Note that there are some explanatory texts on larger screens.

plurals
  1. POandroid application unfortunately stopped when running from real device
    primarykey
    data
    text
    <p>hi I have made my first android application and it got a webservices to connect to mysql DB in my local PC using XAMPP I can run it perfectly from the Android emulator with no hassle but I need to run from my real device but I got the issue of the connection to the DB </p> <p>so far I have changed the IP address in the file that contains the connection details for the web service and also the userfunction.java in eclipse (this one for the user reg. and login functions)</p> <p>in the phone side , my PC uses LAN and my phone connects to the same connection using connectify wireless </p> <p>but when I click on login button from my real device I got this in my logcat</p> <pre><code>05-18 12:19:40.600: E/SensorManager(13663): thread start 05-18 12:19:40.725: E/SpannableStringBuilder(13663): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length 05-18 12:19:40.725: E/SpannableStringBuilder(13663): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length 05-18 12:19:47.695: E/JSON Parser(13663): Error parsing data org.json.JSONException: End of input at character 0 of 05-18 12:19:47.700: E/AndroidRuntime(13663): FATAL EXCEPTION: main 05-18 12:19:47.700: E/AndroidRuntime(13663): java.lang.NullPointerException 05-18 12:19:47.700: E/AndroidRuntime(13663): at com.mohammed.watzIslam.LoginActivity$1.onClick(LoginActivity.java:62) 05-18 12:19:47.700: E/AndroidRuntime(13663): at android.view.View.performClick(View.java:4211) 05-18 12:19:47.700: E/AndroidRuntime(13663): at android.view.View$PerformClick.run(View.java:17267) 05-18 12:19:47.700: E/AndroidRuntime(13663): at android.os.Handler.handleCallback(Handler.java:615) 05-18 12:19:47.700: E/AndroidRuntime(13663): at android.os.Handler.dispatchMessage(Handler.java:92) 05-18 12:19:47.700: E/AndroidRuntime(13663): at android.os.Looper.loop(Looper.java:137) 05-18 12:19:47.700: E/AndroidRuntime(13663): at android.app.ActivityThread.main(ActivityThread.java:4898) 05-18 12:19:47.700: E/AndroidRuntime(13663): at java.lang.reflect.Method.invokeNative(Native Method) 05-18 12:19:47.700: E/AndroidRuntime(13663): at java.lang.reflect.Method.invoke(Method.java:511) 05-18 12:19:47.700: E/AndroidRuntime(13663): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006) 05-18 12:19:47.700: E/AndroidRuntime(13663): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773) 05-18 12:19:47.700: E/AndroidRuntime(13663): at dalvik.system.NativeStart.main(Native Method) </code></pre> <p>this is the userfunction.java that keeps the location address of user reg. and login webserives </p> <pre><code>\ public class UserFunctions { private JSONParser jsonParser; private static String loginURL = "http://xxxx:port#/android_login_api/"; private static String registerURL = "http://xxxx:port#/android_login_api/"; private static String login_tag = "login"; private static String register_tag = "register"; // constructor public UserFunctions(){ jsonParser = new JSONParser(); } /** * function make Login Request * @param email * @param password * */ public JSONObject loginUser(String email, String password){ // Building Parameters List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;(); params.add(new BasicNameValuePair("tag", login_tag)); params.add(new BasicNameValuePair("email", email)); params.add(new BasicNameValuePair("password", password)); JSONObject json = jsonParser.getJSONFromUrl(loginURL, params); // return json // Log.e("JSON", json.toString()); return json; } /** * function make reg. Request * @param name * @param email * @param password * */ public JSONObject registerUser(String name, String password, String email){ // Building Parameters List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;(); params.add(new BasicNameValuePair("tag", register_tag)); params.add(new BasicNameValuePair("name", name)); params.add(new BasicNameValuePair("email", email)); params.add(new BasicNameValuePair("password", password)); // getting JSON Object JSONObject json = jsonParser.getJSONFromUrl(registerURL, params); // return json return json; } /** * Function get Login status * */ public boolean isUserLoggedIn(Context context){ DatabaseHandler db = new DatabaseHandler(context); int count = db.getRowCount(); if(count &gt; 0){ // user logged in return true; } return false; } /** * Function to logout user * Reset Database * */ public boolean logoutUser(Context context){ DatabaseHandler db = new DatabaseHandler(context); db.resetTables(); return true; } } </code></pre> <p>can someone points out for any mistake or suggest me a solution </p> <p>thanks </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload