|
I am ready to help you. Please contact me at irudayambics@gmail.com.
|
|
|
|
|
|
..
modified 14-Jan-15 19:49pm.
|
|
|
|
|
Please do not use these forums for advertising, they are strictly for technical questions.
|
|
|
|
|
Hi,
Is it possible to recognize emotions(Happy,Sad etc) of user through capturing image of user on android mobile. Please help me out if any suggestion or have any source code of recognition of user mood in android. Thanks
|
|
|
|
|
I am really new into the whole android thing.I have always loved programming and its been a hobby. So, i started learning android couple of months back from the New Boston website. I just love the tutorials and now i have a dream to make my first app and see it in the hands of millions of people.Now, getting back to reality. I am also a fulltime college student which means balancing between my coursework and hobby. Now, i bet most of the experts may have gone through this management issues and can suggest me on my problem. My problem is that i get so carried away with developing my app that i forget to do my coursework and focus on my other programming languages(which i equally love). So, how do i actually not get carried away with my hobby and still make a fine balance between my coursework and my android app dream? Can you guys suggest some ideas which can help beginners like me to manage this sort of situation?
|
|
|
|
|
Self discipline! Make yourself a time-table to include both coursework and hobby - and keep to it!
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
Please go through tutorials point for learning Android and go through the official Android web site for complete understanding of the concepts.
Take up a problem and try to provide solution using Android you will see yourself improving a lot in Android technology
|
|
|
|
|
The same way you manage anything in life: set priorities and timetables, and stick to them.
|
|
|
|
|
1.I want to write code for MP3 cutter, Please help me any one
i know java how can i apply the code that also know little bit please help me any one.
2.How to combine the splash screen and sliding bar and list view and etc please tell me.
|
|
|
|
|
|
He
I am new to android programming. I tried to execute a app from one of the tutorials and it is showing runtime error. If it runs highscores menu. Application closed. Below are the error messages from logcat and the activity file. Appreciate your help. Thanks in advance.
Error
12-15 03:49:51.124: I/HighScores(1115): getScores() called
12-15 03:49:51.154: I/HighScores(1115): getScores() no scores found
12-15 03:49:51.354: I/Reversi, RevHSCustAd getView called(1115): position = 0
12-15 03:49:51.444: I/Reversi, RevHSCustAd getView called(1115): position = 0
12-15 03:49:51.454: D/AndroidRuntime(1115): Shutting down VM
12-15 03:49:51.454: W/dalvikvm(1115): threadid=1: thread exiting with uncaught exception (group=0xb2a40ba8)
12-15 03:49:51.594: D/dalvikvm(1115): GC_FOR_ALLOC freed 447K, 11% free 4353K/4880K, paused 89ms, total 100ms
12-15 03:49:51.714: E/AndroidRuntime(1115): FATAL EXCEPTION: main
12-15 03:49:51.714: E/AndroidRuntime(1115): Process: uk.co.flumeland.reversi, PID: 1115
12-15 03:49:51.714: E/AndroidRuntime(1115): java.lang.NullPointerException
12-15 03:49:51.714: E/AndroidRuntime(1115): at uk.co.flumeland.reversi.RevHighScoreAdapter.getView(RevHighScoreAdapter.java:68)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.widget.AbsListView.obtainView(AbsListView.java:2263)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.widget.ListView.measureHeightOfChildren(ListView.java:1263)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.widget.ListView.onMeasure(ListView.java:1175)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.View.measure(View.java:16497)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1404)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.widget.LinearLayout.measureVertical(LinearLayout.java:695)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.View.measure(View.java:16497)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.View.measure(View.java:16497)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
12-15 03:49:51.714: E/AndroidRuntime(1115): at com.android.internal.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:327)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.View.measure(View.java:16497)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
12-15 03:49:51.714: E/AndroidRuntime(1115): at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2291)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.View.measure(View.java:16497)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1916)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1113)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1295)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5670)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.Choreographer.doCallbacks(Choreographer.java:574)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.Choreographer.doFrame(Choreographer.java:544)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.os.Handler.handleCallback(Handler.java:733)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.os.Handler.dispatchMessage(Handler.java:95)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.os.Looper.loop(Looper.java:136)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.app.ActivityThread.main(ActivityThread.java:5017)
12-15 03:49:51.714: E/AndroidRuntime(1115): at java.lang.reflect.Method.invokeNative(Native Method)
12-15 03:49:51.714: E/AndroidRuntime(1115): at java.lang.reflect.Method.invoke(Method.java:515)
12-15 03:49:51.714: E/AndroidRuntime(1115): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
12-15 03:49:51.714: E/AndroidRuntime(1115): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
12-15 03:49:51.714: E/AndroidRuntime(1115): at dalvik.system.NativeStart.main(Native Method)
12-15 03:49:51.864: W/CursorWrapperInner(1115): Cursor finalized without prior close()
12-15 03:49:54.184: I/Process(1115): Sending signal. PID: 1115 SIG: 9
RevHighScoreAdapter.java
package uk.co.flumeland.reversi;
import java.util.ArrayList;
import java.lang.String;
import android.app.Activity;
import android.content.Context;
import android.net.Uri;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
public class RevHighScoreAdapter extends ArrayAdapter {
private Score[] scores;
private Context context;
public RevHighScoreAdapter(Context context, Score[] score){
super(context, 0);
scores = score;
this.context = context;
}
@Override
public int getCount() {
return scores.length;
}
@Override
public Object getItem(int position) {
return position;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View row = convertView;
Log.i("Reversi, RevHSCustAd getView called", "position = " + position );
if (row == null) {
LayoutInflater inflater = ((Activity) context).getLayoutInflater();
row = inflater.inflate(R.layout.high_scores_listview_row, parent, false);
}
TextView nameTV = (TextView) row.findViewById(R.id.hs_player_name_lv);
ImageView photoIV = (ImageView) row.findViewById(R.id.hs_player_image_lv);
TextView scoreTV = (TextView) row.findViewById(R.id.hs_score_lv);
Log.i("Reversi, RevHSCustAd getView called", "position = " + position );
nameTV.setText(scores[position].getName());
Log.i("Reversi, RevHSCustAd getView called", "position = " + position );
scoreTV.setText(String.valueOf(scores[position].getScore()));
return row;
}
}
HighScores.java
package uk.co.flumeland.reversi;
import java.util.ArrayList;
import android.app.Activity;
import android.content.ContentResolver;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Typeface;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
public class HighScores extends Activity {
private Score[] score = new Score[10];
private ListView scoreList;
private ContentResolver cr;
private RevHighScoreAdapter rHSad;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_high_scores_screen);
TextView title = (TextView) findViewById(R.id.title_textview);
scoreList = (ListView) findViewById(R.id.high_score_list);
Typeface tf = Typeface.createFromAsset(getAssets(),
"fonts/tattoowoo_naughty-nights/Naughty Nights.ttf");
title.setTypeface(tf);
getScores();
loadScores();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu, menu);
return true;
}
public void getScores() {
Log.i("HighScores", "getScores() called");
cr = getContentResolver();
Cursor c = cr.query(HighScoresData.CONTENT_URI, null, null, null,
HighScoresData.KEY_SCORE + " DESC");
int numScores = c.getCount();
int i = 0;
if (c != null && c.getCount() > 0) {
c.moveToFirst();
do {
Log.i("HighScores", "getScores() = "
+ c.getString(HighScoresData.NAME_COLUMN) + " "
+ c.getString(HighScoresData.PHOTO_COLUMN) + " "
+ c.getInt(HighScoresData.SCORE_COLUMN) + " " + i);
score[i] = new Score(c.getString(HighScoresData.NAME_COLUMN),
c.getString(HighScoresData.PHOTO_COLUMN),
c.getInt(HighScoresData.SCORE_COLUMN));
i++;
} while (c.moveToNext() && i < 10);
} else {
Log.i("HighScores", "getScores() no scores found");
}
}
private void loadScores() {
rHSad = new RevHighScoreAdapter(this, score);
scoreList.setAdapter(rHSad);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.action_settings:
startActivity(new Intent(this, Settings.class));
return true;
case R.id.action_how_to:
startActivity(new Intent(this, HowTo.class));
return true;
case R.id.action_high_scores:
startActivity(new Intent(this, HighScores.class));
return true;
}
return false;
}
@Override
protected void onPause() {
super.onPause();
finish();
}
}
|
|
|
|
|
The error log is telling you what the problem is, and where it occurs:
12-15 03:49:51.714: E/AndroidRuntime(1115): java.lang.NullPointerException
12-15 03:49:51.714: E/AndroidRuntime(1115): at uk.co.flumeland.reversi.RevHighScoreAdapter.getView(RevHighScoreAdapter.java:68)
Step through with your debugger and you should see what is null and why.
|
|
|
|
|
RevHighScoreAdapter.java
package uk.co.flumeland.reversi;
import java.util.ArrayList;
import java.lang.String;
import android.app.Activity;
import android.content.Context;
import android.net.Uri;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
public class RevHighScoreAdapter extends ArrayAdapter {
private Score[] scores;
private Context context;
public RevHighScoreAdapter(Context context, Score[] score){
super(context, 0);
scores = score;
this.context = context;
}
@Override
public int getCount() {
return scores.length;
}
@Override
public Object getItem(int position) {
return position;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View row = convertView;
Log.i("Reversi, RevHSCustAd getView called", "position = " + position );
if (row == null) {
LayoutInflater inflater = ((Activity) context).getLayoutInflater();
row = inflater.inflate(R.layout.high_scores_listview_row, parent, false);
}
TextView nameTV = (TextView) row.findViewById(R.id.hs_player_name_lv);
ImageView photoIV = (ImageView) row.findViewById(R.id.hs_player_image_lv);
TextView scoreTV = (TextView) row.findViewById(R.id.hs_score_lv);
Log.i("Reversi, RevHSCustAd getView called", "position = " + position );
nameTV.setText(scores[position].getName());
Log.i("Reversi, RevHSCustAd getView called", "position = " + position );
scoreTV.setText(String.valueOf(scores[position].getScore()));
return row;
}
}
Error code? How do I fix it ?
nameTV.setText(scores[position].getName());
Log.i("Reversi, RevHSCustAd getView called", "position = " + position );
scoreTV.setText(String.valueOf(scores[position].getScore()));
|
|
|
|
|
Member 11360501 wrote: How do I fix it ? Fix what? You still have not explained what the error is.
|
|
|
|
|
it is showing runtime error. If it runs highscores menu. Application closed.
Error Log
12-15 03:49:51.124: I/HighScores(1115): getScores() called
12-15 03:49:51.154: I/HighScores(1115): getScores() no scores found
12-15 03:49:51.354: I/Reversi, RevHSCustAd getView called(1115): position = 0
12-15 03:49:51.444: I/Reversi, RevHSCustAd getView called(1115): position = 0
12-15 03:49:51.454: D/AndroidRuntime(1115): Shutting down VM
12-15 03:49:51.454: W/dalvikvm(1115): threadid=1: thread exiting with uncaught exception (group=0xb2a40ba8)
12-15 03:49:51.594: D/dalvikvm(1115): GC_FOR_ALLOC freed 447K, 11% free 4353K/4880K, paused 89ms, total 100ms
12-15 03:49:51.714: E/AndroidRuntime(1115): FATAL EXCEPTION: main
12-15 03:49:51.714: E/AndroidRuntime(1115): Process: uk.co.flumeland.reversi, PID: 1115
12-15 03:49:51.714: E/AndroidRuntime(1115): java.lang.NullPointerException
12-15 03:49:51.714: E/AndroidRuntime(1115): at uk.co.flumeland.reversi.RevHighScoreAdapter.getView(RevHighScoreAdapter.java:68)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.widget.AbsListView.obtainView(AbsListView.java:2263)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.widget.ListView.measureHeightOfChildren(ListView.java:1263)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.widget.ListView.onMeasure(ListView.java:1175)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.View.measure(View.java:16497)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1404)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.widget.LinearLayout.measureVertical(LinearLayout.java:695)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.View.measure(View.java:16497)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.View.measure(View.java:16497)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
12-15 03:49:51.714: E/AndroidRuntime(1115): at com.android.internal.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:327)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.View.measure(View.java:16497)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
12-15 03:49:51.714: E/AndroidRuntime(1115): at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2291)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.View.measure(View.java:16497)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1916)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1113)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1295)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5670)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.Choreographer.doCallbacks(Choreographer.java:574)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.Choreographer.doFrame(Choreographer.java:544)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.os.Handler.handleCallback(Handler.java:733)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.os.Handler.dispatchMessage(Handler.java:95)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.os.Looper.loop(Looper.java:136)
12-15 03:49:51.714: E/AndroidRuntime(1115): at android.app.ActivityThread.main(ActivityThread.java:5017)
12-15 03:49:51.714: E/AndroidRuntime(1115): at java.lang.reflect.Method.invokeNative(Native Method)
12-15 03:49:51.714: E/AndroidRuntime(1115): at java.lang.reflect.Method.invoke(Method.java:515)
12-15 03:49:51.714: E/AndroidRuntime(1115): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
12-15 03:49:51.714: E/AndroidRuntime(1115): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
12-15 03:49:51.714: E/AndroidRuntime(1115): at dalvik.system.NativeStart.main(Native Method)
12-15 03:49:51.864: W/CursorWrapperInner(1115): Cursor finalized without prior close()
12-15 03:49:54.184: I/Process(1115): Sending signal. PID: 1115 SIG: 9
|
|
|
|
|
It is no use repeatedly posting the same data. I already explained that you need to use your debugger to trap where the error occurs and establish which variable is the null pointer, and what it is supposed to refer to.
|
|
|
|
|
thanks I will use debugger I sent information you
|
|
|
|
|
This is your error
12-15 03:49:51.124: I/HighScores(1115): getScores() called
12-15 03:49:51.154: I/HighScores(1115): getScores() no scores found
So because is not finding any scores, it is returning a null value that is not handled
12-15 03:49:51.714: E/AndroidRuntime(1115): at uk.co.flumeland.reversi.RevHighScoreAdapter.getView(RevHighScoreAdapter.java:68)
so just adding some error handling will fix your problem, easy
I want to die like my grandfather- asleep, not like the passengers in his car, screaming!
|
|
|
|
|
Look at line 68 of RevHighScoreAdapter.java.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
How to make android device to detect the HID (keyboard,mouse)Devices?
I read Lot of artical saying that "HID devices doesnot kick off USB_ATTACHED intent".
I need to detect the mouse.
Could you tell me please how could I detect the HID devices?
|
|
|
|
|
Hi and Happy New Year!
I'm using ksoap2 to call webservice's method and get exception when bilding envelope:
org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope (position:START_TAG <definitions name="WebService" targetnamespace="http://93.174.51.130:7000/WebService">@10:58 in java.io.InputStreamReader@b3e83c10)
Name space in WSDL is "http://93.174.51.130:7000/WebService"
and namespace in code too, what problem, help me please!
I used search but can't find exactly answer
WSDL and code below, Thanks
WSDL: http://93.174.51.130:7000/db1c_rt-lt/ws/WebService.1cws?wsdl
private static final String SOAP_ACTION="http://93.174.51.130:7000/WebService#WebService:Authentication";
private static final String SOAP_METHOD_NAME="Authentication";
private static final String URL = "http://93.174.51.130:7000/db1c_rt-lt/ws/WebService.1cws?wsdl";
private static final String NAMESPACE="http://93.174.51.130:7000/WebService";
public void ExecuteRequest(){
SoapObject Request = new SoapObject(NAMESPACE, SOAP_METHOD_NAME);
Request.addProperty("Login", "Test_User");
Request.addProperty("Password", "ddI334_H23");
Request.addProperty("appGUID", UUID.randomUUID().toString());
SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER12);
soapEnvelope.dotNet = false;
soapEnvelope.setAddAdornments(false);
soapEnvelope.encodingStyle = SoapSerializationEnvelope.ENC;
soapEnvelope.env=SoapSerializationEnvelope.ENV;
soapEnvelope.implicitTypes = true;
HttpTransportSE aht = new HttpTransportSE(URL);
aht.debug = true;
try
{
aht.call(SOAP_ACTION, soapEnvelope);
SoapPrimitive resultString = ( SoapPrimitive)soapEnvelope.getResponse();
Log.i("Check_Soap_Service", "resultString - " + resultString);
}
catch (Exception e)
{
Log.i("Check_Soap_Service","Exception : "+e.toString());
}
finally
{
Log.i(getClass().getSimpleName(),"requestDump : "+aht.requestDump);
Log.i(getClass().getSimpleName(),"responseDump : "+aht.responseDump);
}
}
|
|
|
|
|
I have following code for detection of attached USB.
{
UsbManager manager;
@Override
public void onReceive(Context context, Intent intent) {
Toast.makeText(context, "Broadcast Receiver", Toast.LENGTH_SHORT)
.show();
onNewIntent(intent,context);
}
private void onNewIntent(Intent intent, Context context) {
String intentAction = intent.getAction();
Toast.makeText(context,"Action :" + intentAction, Toast.LENGTH_SHORT).show();
if(intentAction.equalsIgnoreCase("android.hardware.usb.action.USB_DEVICE_ATTACHED"))
{
Toast.makeText(context,"Dveice Attached", Toast.LENGTH_SHORT).show();
handleDevice(intent,context);
}
else if(intentAction.equalsIgnoreCase("android.hardware.usb.action.USB_DEVICE_ATTACHED"))
{
Toast.makeText(context,"Dveice Detached", Toast.LENGTH_SHORT).show();
}
else
{
}
}
private void handleDevice(Intent intent,Context context) {
manager = (UsbManager) context.getSystemService(UsbManager.EXTRA_DEVICE);
HashMap<string,usbdevice> list = manager.getDeviceList();
Iterator<usbdevice> it = list.values().iterator();
while(it.hasNext())
{
UsbDevice device = it.next();
openDevice(device);
}
}
private void openDevice(UsbDevice device) {
UsbDeviceConnection connection = manager.openDevice(device);
int fd = connection.getFileDescriptor();
Log.d("Fd :"+fd,"Text");
}
not firing the USB_DEVICE_ATTACHED event.
|
|
|
|
|
|
You need to handle device attached event itself in launcher activity.On the other hand If you want to handle detached event you need to have a broadcast receiver.
|
|
|
|
|