Issues while consuming webservice - android

Installing Apache Tomcat, Apache Axis2, Create web project, Convert to service, Deploy it in Tomcat, Create client project then, Create client with stub of our services and finally, access the service.
I think these are all the steps to consume web service on Android Eclipse.
Here I have completed up to the step deploying the web project on tomcat server, it shown about the services successfully, but server option shown up as SYNCHRONIZED. It's given below
server
Tomcat v6.0 server at localhost[Started,Synchronized]
AndBack[Synchronized].
Meanwhile after creating client project it shown up during run time as:
Sorry! The application has stopped unexpectedly. Please try again. Force close
Please refer my logcat given below.
LOGCAT
04-25 16:46:51.153: E/dalvikvm(273): Could not find class 'org.ksoap2.serialization.SoapObject', referenced from method org.test.Frontend.AndFrontActivity.onCreate
04-25 16:46:51.153: W/dalvikvm(273): VFY: unable to resolve new-instance 25 (Lorg/ksoap2/serialization/SoapObject;) in Lorg/test/Frontend/AndFrontActivity;
04-25 16:46:51.153: D/dalvikvm(273): VFY: replacing opcode 0x22 at 0x0010
04-25 16:46:51.164: D/dalvikvm(273): VFY: dead code 0x0012-0081 in Lorg/test/Frontend/AndFrontActivity;.onCreate (Landroid/os/Bundle;)V
04-25 16:46:51.243: D/AndroidRuntime(273): Shutting down VM
04-25 16:46:51.243: W/dalvikvm(273): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
04-25 16:46:51.273: E/AndroidRuntime(273): FATAL EXCEPTION: main
04-25 16:46:51.273: E/AndroidRuntime(273): java.lang.NoClassDefFoundError: org.ksoap2.serialization.SoapObject
04-25 16:46:51.273: E/AndroidRuntime(273): at org.test.Frontend.AndFrontActivity.onCreate(AndFrontActivity.java:28)
04-25 16:46:51.273: E/AndroidRuntime(273): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-25 16:46:51.273: E/AndroidRuntime(273): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
04-25 16:46:51.273: E/AndroidRuntime(273): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
04-25 16:46:51.273: E/AndroidRuntime(273): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
04-25 16:46:51.273: E/AndroidRuntime(273): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
04-25 16:46:51.273: E/AndroidRuntime(273): at android.os.Handler.dispatchMessage(Handler.java:99)
04-25 16:46:51.273: E/AndroidRuntime(273): at android.os.Looper.loop(Looper.java:123)
04-25 16:46:51.273: E/AndroidRuntime(273): at android.app.ActivityThread.main(ActivityThread.java:4627)
04-25 16:46:51.273: E/AndroidRuntime(273): at java.lang.reflect.Method.invokeNative(Native Method)
04-25 16:46:51.273: E/AndroidRuntime(273): at java.lang.reflect.Method.invoke(Method.java:521)
04-25 16:46:51.273: E/AndroidRuntime(273): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
04-25 16:46:51.273: E/AndroidRuntime(273): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
04-25 16:46:51.273: E/AndroidRuntime(273): at dalvik.system.NativeStart.main(Native Method)

Turns out external jars such as
ksoap2-android-assembly-2.6.2-jar-with-dependencies.jar
to be put under /libs folder so Eclipse ADT automatically adds your jars to the buildpath of your application. It was a buildpath missing defined class error after all.. I hope this will help you, too!
here or there

Related

android VerifyError

i'm getting this message when i run my application i don't know why i'm getting it could any one help me. here is the logcat.
java.lang.VerifyError: com.kosh.me.Smaller
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1429)
at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
at android.app.ActivityThread.access$2300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:876)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:634)
at dalvik.system.NativeStart.main(Native Method)
This happens when the build library classes conflict with those at run-time. Try performing a Clean of your project followed by a build.

Runtime Crash on constructing Gson object with NoClassDefFoundError

I am developing one android application and in that app I am trying to use Gson Library for Json serialization and de-serialization. I downloaded the library from the following link:-
http://code.google.com/p/google-gson/downloads/list
I included the gson-2.2.2.jar in Java Build Path, but the application crashes at run time when constructing Gson object:-
Gson gson = new Gson();
in logcat I get
07-24 14:53:21.648: E/dalvikvm(488): Could not find class 'com.google.gson.Gson', referenced from method com.google.gson.examples.android.GsonProguardExampleActivity.onCreate
07-24 14:53:21.648: W/dalvikvm(488): VFY: unable to resolve new-instance 10 (Lcom/google/gson/Gson;) in Lcom/google/gson/examples/android/GsonProguardExampleActivity;
07-24 14:53:21.668: D/dalvikvm(488): VFY: replacing opcode 0x22 at 0x0010
07-24 14:53:21.668: D/dalvikvm(488): VFY: dead code 0x0012-007a in Lcom/google/gson/examples/android/GsonProguardExampleActivity;.onCreate (Landroid/os/Bundle;)V
07-24 14:53:21.788: D/AndroidRuntime(488): Shutting down VM
07-24 14:53:21.788: W/dalvikvm(488): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
07-24 14:53:21.814: E/AndroidRuntime(488): FATAL EXCEPTION: main
07-24 14:53:21.814: E/AndroidRuntime(488): java.lang.NoClassDefFoundError: com.google.gson.Gson
07-24 14:53:21.814: E/AndroidRuntime(488): at com.google.gson.examples.android.GsonProguardExampleActivity.onCreate(GsonProguardExampleActivity.java:40)
07-24 14:53:21.814: E/AndroidRuntime(488): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-24 14:53:21.814: E/AndroidRuntime(488): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
07-24 14:53:21.814: E/AndroidRuntime(488): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
07-24 14:53:21.814: E/AndroidRuntime(488): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
07-24 14:53:21.814: E/AndroidRuntime(488): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
07-24 14:53:21.814: E/AndroidRuntime(488): at android.os.Handler.dispatchMessage(Handler.java:99)
07-24 14:53:21.814: E/AndroidRuntime(488): at android.os.Looper.loop(Looper.java:123)
07-24 14:53:21.814: E/AndroidRuntime(488): at android.app.ActivityThread.main(ActivityThread.java:4627)
07-24 14:53:21.814: E/AndroidRuntime(488): at java.lang.reflect.Method.invokeNative(Native Method)
07-24 14:53:21.814: E/AndroidRuntime(488): at java.lang.reflect.Method.invoke(Method.java:521)
07-24 14:53:21.814: E/AndroidRuntime(488): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-24 14:53:21.814: E/AndroidRuntime(488): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-24 14:53:21.814: E/AndroidRuntime(488): at dalvik.system.NativeStart.main(Native Method)
Error is:-
07-24 14:53:21.814: E/AndroidRuntime(488): java.lang.NoClassDefFoundError: com.google.gson.Gson
Also, If I include full source of Gson library as another package in my project it all works well.
What am I doing wrong, is this the correct jar??
Seems you have kept the jar file inside lib folder, rather the name should be changed to libs. This was updated newer revisions of ADT (revision 17 onwards).

Facebook client crashes facebook SSO login dialog after changing facebook password

I have encountered a crash using SSO to login to facebook. I could not find any reports in any of the forums of anything similar.
When we change user password on facebook site, within about 15 seconds android facebook client will notify user via notification bar that facebook authentication failed. If user reacts and logs in, our application SSO will pick up new token with no problem.
If user changes the password, launches our app facebook request (like download of list of friends) before user reacted to facebook application notification and logged in with new password, we get the SSO crash, which erroneously notifies our application that user cancelled login.
Somehow facebook application login dialog (blue dialog) and SSO login dialog (white dialog) can't live together. If they are opened at the same time, SSO initiated instance of Facebook client crashes with following exception:
04-25 10:40:39.790: E/AndroidRuntime(5991): FATAL EXCEPTION: main
04-25 10:40:39.790: E/AndroidRuntime(5991): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.facebook.katana/com.facebook.katana.ProxyAuth}: java.lang.NullPointerException
04-25 10:40:39.790: E/AndroidRuntime(5991): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
04-25 10:40:39.790: E/AndroidRuntime(5991): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
04-25 10:40:39.790: E/AndroidRuntime(5991): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
04-25 10:40:39.790: E/AndroidRuntime(5991): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
04-25 10:40:39.790: E/AndroidRuntime(5991): at android.os.Handler.dispatchMessage(Handler.java:99)
04-25 10:40:39.790: E/AndroidRuntime(5991): at android.os.Looper.loop(Looper.java:130)
04-25 10:40:39.790: E/AndroidRuntime(5991): at android.app.ActivityThread.main(ActivityThread.java:3691)
04-25 10:40:39.790: E/AndroidRuntime(5991): at java.lang.reflect.Method.invokeNative(Native Method)
04-25 10:40:39.790: E/AndroidRuntime(5991): at java.lang.reflect.Method.invoke(Method.java:507)
04-25 10:40:39.790: E/AndroidRuntime(5991): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)
04-25 10:40:39.790: E/AndroidRuntime(5991): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
04-25 10:40:39.790: E/AndroidRuntime(5991): at dalvik.system.NativeStart.main(Native Method)
04-25 10:40:39.790: E/AndroidRuntime(5991): Caused by: java.lang.NullPointerException
04-25 10:40:39.790: E/AndroidRuntime(5991): at com.facebook.orca.common.util.Base64.c(Base64.java:497)
04-25 10:40:39.790: E/AndroidRuntime(5991): at com.facebook.orca.common.util.Base64.b(Base64.java:459)
04-25 10:40:39.790: E/AndroidRuntime(5991): at com.facebook.katana.ProxyAuth.b(ProxyAuth.java:36)
04-25 10:40:39.790: E/AndroidRuntime(5991): at com.facebook.katana.activity.PlatformDialogActivity.a(PlatformDialogActivity.java:127)
04-25 10:40:39.790: E/AndroidRuntime(5991): at com.facebook.orca.activity.FbFragmentActivity.onCreate(FbFragmentActivity.java:48)
04-25 10:40:39.790: E/AndroidRuntime(5991): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-25 10:40:39.790: E/AndroidRuntime(5991): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
04-25 10:40:39.790: E/AndroidRuntime(5991): ... 11 more
Another hint is that little bit above that there is a window leaked non fatal exception within facebook application:
Activity com.facebook.katana.ProxyAuth has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView#406eecf0 that was originally added here
Did anyone encounter similar crashes? I am really puzzled that nobody refers to those crashes, as far as google can find. I followed hackbook example when implementing this. I really don't have a clue what could be causing it.
Might not have to do with password changing but removing:
android:launchMode="singleInstance" from the AndroidManifest.xml
solved a similar bug for me (also java.lang.NullPointerException in com.facebook.katana/com.facebook.katana.ProxyAuth)

Increasing minSdkVersion causes Out Of Memory errors

I developed my app with minSdkVersion set to 3, targetSdkVersion set to 8.
My app is published, and runs on everything from Android 1.5 to 3.0 Though devices it will run on with anything older than 2.0 is always spotty, some it will and some it won't
It works perfect on my Incredible, Android 2.2. It uses 5-8mb memory when running.
However I decided I wanted to split it into two different apps, one for Android 1.5 and 1.6 compatibility and another with higher quality images optimized for tablets.
The only line I changed was setting minSdkVersion from 3 to 5, and all of a sudden it won't run on any phone or emulator?
Now on my Incredible, it uses 7mb just to show the menu background, and gives me an out of memory error every time when loading another image.
Any ideas? Thanks
04-25 17:19:45.476: ERROR/dalvikvm-heap(20145): 7094850-byte external allocation too large for this process.
04-25 17:19:45.476: ERROR/dalvikvm(20145): Out of memory: Heap Size=4871KB, Allocated=2517KB, Bitmap Size=19170KB
04-25 17:19:45.476: ERROR/GraphicsJNI(20145): VM won't let us allocate 7094850 bytes
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): FATAL EXCEPTION: main
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): java.lang.RuntimeException: Unable to resume activity {com.ht/com.ht.Garage}: android.view.InflateException: Binary XML file line #10: Error inflating class com.ht.Panel
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3347)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3362)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2808)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.app.ActivityThread.access$2300(ActivityThread.java:135)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2136)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.os.Handler.dispatchMessage(Handler.java:99)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.os.Looper.loop(Looper.java:144)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.app.ActivityThread.main(ActivityThread.java:4937)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at java.lang.reflect.Method.invokeNative(Native Method)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at java.lang.reflect.Method.invoke(Method.java:521)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at dalvik.system.NativeStart.main(Native Method)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): Caused by: android.view.InflateException: Binary XML file line #10: Error inflating class com.ht.Panel
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.view.LayoutInflater.createView(LayoutInflater.java:513)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.app.Activity.setContentView(Activity.java:1654)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at com.ht.Garage.onResume(Garage.java:165)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1255)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.app.Activity.performResume(Activity.java:3864)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3337)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): ... 12 more
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): Caused by: java.lang.reflect.InvocationTargetException
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at com.ht.Panel.<init>(Panel.java:107)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at java.lang.reflect.Constructor.constructNative(Native Method)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.view.LayoutInflater.createView(LayoutInflater.java:500)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): ... 23 more
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.graphics.Bitmap.nativeCreate(Native Method)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): at android.graphics.Bitmap.createBitmap(Bitmap.java:574)
04-25 17:19:45.506: ERROR/AndroidRuntime(20145): ... 27 more
04-25 17:19:48.066: ERROR/ActivityManager(97): fail to set top app changed!
Set your minSdkVersion to API level 7, API level 5 and 6 are no longer available as 2.0 has been completely phased out. The Android SDK manager does not offer those API's any longer as an available package because they have been marked as obsolete. I just did a new install on a new system and found the API's unavailable.
I found how to fix it, setting anyDensity to false works. I don't understand why it works though.
With API 3, anyDensity has a default value of false, but I was setting it to true!
With an API of 4 (or is it 5) or higher, anyDensity has a default value of true.
How is it any different between it defaulting to true with API 7, and me setting it to true with API 3?
That should not affect memory usage at all, it ends up being the same value no matter what!
Oh well, my app hasn't needed anyDensity set to true since I put in code to dynamically scale the images based on screen size and density anyway.

NetworkConnectivityListener class not found on UPC300-2.2 Viewsonic G-Tablet

I am getting this error in my application, and this happens only on UPC300-2.2 Viewsonic G-Tablet. All answers I've found so far (including this one) adviced on putting
<uses-permission android:name="android.permission.INTERNET"/>
to the manifest file, but it doesn't help.
Here is the complete stacktrace:
java.lang.NoClassDefFoundError: android.net.NetworkConnectivityListener
at
com.google.android.maps.MapActivity.onCreate(MapActivity.java:199)
at
myapp.Activity.ActivityMapSearch.onCreate(ActivityMapSearch.java:99)
at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
at
android.app.ActivityThread.access$2300(ActivityThread.java:125)
at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
at
android.os.Handler.dispatchMessage(Handler.java:99)
at
android.os.Looper.loop(Looper.java:123)
at
android.app.ActivityThread.main(ActivityThread.java:4627)
at
java.lang.reflect.Method.invokeNative(Native
Method) at
java.lang.reflect.Method.invoke(Method.java:521)
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at
dalvik.system.NativeStart.main(Native
Method)
If that is TRUE, you can grab the source code of the class from the Android Source and add it yourself

Categories

Resources