{"id":2219,"date":"2022-08-30T15:23:02","date_gmt":"2022-08-30T15:23:02","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/01\/05\/my-app-works-fine-on-wifi-but-on-gprs-it-gives-the-following-error-and-crashes-saying-fc-any-idea-why-is-this-happening-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:23:02","modified_gmt":"2022-08-30T15:23:02","slug":"my-app-works-fine-on-wifi-but-on-gprs-it-gives-the-following-error-and-crashes-saying-fc-any-idea-why-is-this-happening-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/my-app-works-fine-on-wifi-but-on-gprs-it-gives-the-following-error-and-crashes-saying-fc-any-idea-why-is-this-happening-collection-of-common-programming-errors\/","title":{"rendered":"My app works fine on Wifi but on GPRS it gives the following error and crashes saying FC any idea why is this happening-Collection of common programming errors"},"content":{"rendered":"<p>this kind of code im using<\/p>\n<pre><code>private static String SOAP_ACTION = \"http:\/\/schemas.xmlsoap.org\/soap\/http\";\n\n    private static String NAMESPACE = \"http:\/\/schemas.xmlsoap.org\/soap\/encoding\/\";\n    private static String METHOD_NAME = \"something\";\n\n    private static String URL = \"http:\/\/server\/file.php?wsdl\";\nparameters.addProperty(\"SubMSISDN\", msisdn);\n                            parameters.addProperty(\"AppID\", 2);\nrequest.addProperty(METHOD_NAME, parameters);\n                            SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);\n                            envelope.setOutputSoapObject(request);\n                            HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);\n                            try{\n                                androidHttpTransport.call(SOAP_ACTION, envelope);\n                            }catch (Exception e) {\n                                \/\/ TODO: handle exception\n                                e.printStackTrace();\n                            }\n                            try{ \n                            result = (SoapObject) envelope.bodyIn;\n                            }catch(NullPointerException e ){\n                                e.printStackTrace();\n                                Toast.makeText(getApplicationContext(), \"Please check your internet connection\", Toast.LENGTH_LONG).show();\n                            }\n                            if(result != null){\ndo rest of work here\n}\n<\/code><\/pre>\n<p>This is error log<\/p>\n<pre><code>12-13 16:24:16.519: E\/AndroidRuntime(14087): FATAL EXCEPTION: main\n12-13 16:24:16.519: E\/AndroidRuntime(14087): java.lang.NullPointerException\n12-13 16:24:16.519: E\/AndroidRuntime(14087):    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1374)\n12-13 16:24:16.519: E\/AndroidRuntime(14087):    at android.app.Activity.startActivityForResult(Activity.java:2827)\n12-13 16:24:16.519: E\/AndroidRuntime(14087):    at android.app.Activity.startActivity(Activity.java:2933)\n12-13 16:24:16.519: E\/AndroidRuntime(14087):    at com.syntecx.selfcare.BalanceHis$1.onPostExecute(BalanceHis.java:195)\n12-13 16:24:16.519: E\/AndroidRuntime(14087):    at com.syntecx.selfcare.BalanceHis$1.onPostExecute(BalanceHis.java:1)\n12-13 16:24:16.519: E\/AndroidRuntime(14087):    at android.os.AsyncTask.finish(AsyncTask.java:417)\n12-13 16:24:16.519: E\/AndroidRuntime(14087):    at android.os.AsyncTask.access$300(AsyncTask.java:127)\n12-13 16:24:16.519: E\/AndroidRuntime(14087):    at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:429)\n12-13 16:24:16.519: E\/AndroidRuntime(14087):    at android.os.Handler.dispatchMessage(Handler.java:99)\n12-13 16:24:16.519: E\/AndroidRuntime(14087):    at android.os.Looper.loop(Looper.java:123)\n12-13 16:24:16.519: E\/AndroidRuntime(14087):    at android.app.ActivityThread.main(ActivityThread.java:3687)\n12-13 16:24:16.519: E\/AndroidRuntime(14087):    at java.lang.reflect.Method.invokeNative(Native Method)\n12-13 16:24:16.519: E\/AndroidRuntime(14087):    at java.lang.reflect.Method.invoke(Method.java:507)\n12-13 16:24:16.519: E\/AndroidRuntime(14087):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)\n12-13 16:24:16.519: E\/AndroidRuntime(14087):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)\n12-13 16:24:16.519: E\/AndroidRuntime(14087):    at dalvik.system.NativeStart.main(Native Method)\n<\/code><\/pre>\n<p>it works fine when im using wifi but in some devices on gprs the application crashes and give a force close when i debuged the app the above mentioned log created showing the problem<\/p>\n<p id=\"rop\"><small>Originally posted 2014-01-05 09:04:15. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>this kind of code im using private static String SOAP_ACTION = &#8220;http:\/\/schemas.xmlsoap.org\/soap\/http&#8221;; private static String NAMESPACE = &#8220;http:\/\/schemas.xmlsoap.org\/soap\/encoding\/&#8221;; private static String METHOD_NAME = &#8220;something&#8221;; private static String URL = &#8220;http:\/\/server\/file.php?wsdl&#8221;; parameters.addProperty(&#8220;SubMSISDN&#8221;, msisdn); parameters.addProperty(&#8220;AppID&#8221;, 2); request.addProperty(METHOD_NAME, parameters); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.setOutputSoapObject(request); HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); try{ androidHttpTransport.call(SOAP_ACTION, envelope); }catch (Exception e) { \/\/ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2219","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2219","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=2219"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2219\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=2219"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=2219"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=2219"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}