I have developed phonegap android app.I have been running the app in background when the button is clicked using android service and show notification and alert.And also i will show the ads(inmobi) using javascript.Both background process and ads is working fine.But suddenly i got error(sometimes) in logcat and my app gets force closed.In the background process i am getting the values from the server using web service
Here is my Logcat error:
java.net.UnknownHostException: Host is unresolved:Mypath
at java.net.Socket.connect(Socket.java:1038)
at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.
<init>(HttpConnection.java:62)
at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.
get(HttpConnectionPool.java:88)
at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.
getHTTPConnection(HttpURLConnectionImpl.java:927)
at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.
connect(HttpURLConnectionImpl.java:909)
at org.ksoap2.transport.ServiceConnectionSE.connect(ServiceConnectionSE.java:75)
at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:136)
at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:90)
at com.app.myactivity.MyService$1.handleMessage(MyService.java:123)
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)
DEBUG/AndroidRuntime(2881): Shutting down VM
WARN/dalvikvm(2881): threadid=1: thread exiting with uncaught
exception(group=0x4001d800)
ERROR/AndroidRuntime(2881): FATAL EXCEPTION: main
ERROR/AndroidRuntime(2881): java.lang.NullPointerException
at com.app.mobilyzer.newly.MyService$1.handleMessage(MyService.java:194)
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)
Please Kindly Guide me.Please tell me where is the problem.Whether it is because of the ads or in the background process.Thanks in Advance.
I believe that the problem is that sometimes you get a null value on either your code, the webside, or maybe the ads side.