Android Login and Registration with PHP, MySQL and SQLite forced to close -
source of app code : http://www.androidhive.info/2012/01/android-login-and-registration-with-php-mysql-and-sqlite/
i run apps on samsung s2 , android 2.2 emulator, both forced close after login random username , password. forcefulness close after tried register.
logcat(verbose):
02-21 03:09:15.800: w/keycharactermap(563): no keyboard id 0 02-21 03:09:15.800: w/keycharactermap(563): using default keymap: /system/usr/keychars/qwerty.kcm.bin 02-21 03:09:23.480: d/button(563): login 02-21 03:09:23.829: e/json(563): <!doctype html public "-//ietf//dtd html 2.0//en"> 02-21 03:09:23.829: e/json(563): <html><head> 02-21 03:09:23.829: e/json(563): <title>404 not found</title> 02-21 03:09:23.829: e/json(563): </head><body> 02-21 03:09:23.829: e/json(563): <h1>not found</h1> 02-21 03:09:23.829: e/json(563): <p>the requested url /android_login_api/ not found on server.</p> 02-21 03:09:23.829: e/json(563): </body></html> 02-21 03:09:23.829: e/json parser(563): error parsing info org.json.jsonexception: value <!doctype of type java.lang.string cannot converted jsonobject 02-21 03:09:23.829: d/androidruntime(563): shutting downwards vm 02-21 03:09:23.829: w/dalvikvm(563): threadid=1: thread exiting uncaught exception (group=0x4001d800) 02-21 03:09:23.849: e/androidruntime(563): fatal exception: main 02-21 03:09:23.849: e/androidruntime(563): java.lang.nullpointerexception 02-21 03:09:23.849: e/androidruntime(563): @ com.example.androidhive.loginactivity$1.onclick(loginactivity.java:65) 02-21 03:09:23.849: e/androidruntime(563): @ android.view.view.performclick(view.java:2408) 02-21 03:09:23.849: e/androidruntime(563): @ android.view.view$performclick.run(view.java:8816) 02-21 03:09:23.849: e/androidruntime(563): @ android.os.handler.handlecallback(handler.java:587) 02-21 03:09:23.849: e/androidruntime(563): @ android.os.handler.dispatchmessage(handler.java:92) 02-21 03:09:23.849: e/androidruntime(563): @ android.os.looper.loop(looper.java:123) 02-21 03:09:23.849: e/androidruntime(563): @ android.app.activitythread.main(activitythread.java:4627) 02-21 03:09:23.849: e/androidruntime(563): @ java.lang.reflect.method.invokenative(native method) 02-21 03:09:23.849: e/androidruntime(563): @ java.lang.reflect.method.invoke(method.java:521) 02-21 03:09:23.849: e/androidruntime(563): @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:868) 02-21 03:09:23.849: e/androidruntime(563): @ com.android.internal.os.zygoteinit.main(zygoteinit.java:626) 02-21 03:09:23.849: e/androidruntime(563): @ dalvik.system.nativestart.main(native method) 02-21 03:14:23.920: i/process(563): sending signal. pid: 563 sig: 9 02-21 03:49:40.550: w/keycharactermap(600): no keyboard id 0 02-21 03:49:40.550: w/keycharactermap(600): using default keymap: /system/usr/keychars/qwerty.kcm.bin 02-21 03:49:45.180: d/button(600): login 02-21 03:49:46.750: e/json(600): <!doctype html public "-//ietf//dtd html 2.0//en"> 02-21 03:49:46.750: e/json(600): <html><head> 02-21 03:49:46.750: e/json(600): <title>404 not found</title> 02-21 03:49:46.750: e/json(600): </head><body> 02-21 03:49:46.750: e/json(600): <h1>not found</h1> 02-21 03:49:46.750: e/json(600): <p>the requested url /android_login_api/ not found on server.</p> 02-21 03:49:46.750: e/json(600): </body></html> 02-21 03:49:46.750: e/json parser(600): error parsing info org.json.jsonexception: value <!doctype of type java.lang.string cannot converted jsonobject 02-21 03:49:46.750: d/androidruntime(600): shutting downwards vm 02-21 03:49:46.760: w/dalvikvm(600): threadid=1: thread exiting uncaught exception (group=0x4001d800) 02-21 03:49:46.760: e/androidruntime(600): fatal exception: main 02-21 03:49:46.760: e/androidruntime(600): java.lang.nullpointerexception 02-21 03:49:46.760: e/androidruntime(600): @ com.example.androidhive.loginactivity$1.onclick(loginactivity.java:65) 02-21 03:49:46.760: e/androidruntime(600): @ android.view.view.performclick(view.java:2408) 02-21 03:49:46.760: e/androidruntime(600): @ android.view.view$performclick.run(view.java:8816) 02-21 03:49:46.760: e/androidruntime(600): @ android.os.handler.handlecallback(handler.java:587) 02-21 03:49:46.760: e/androidruntime(600): @ android.os.handler.dispatchmessage(handler.java:92) 02-21 03:49:46.760: e/androidruntime(600): @ android.os.looper.loop(looper.java:123) 02-21 03:49:46.760: e/androidruntime(600): @ android.app.activitythread.main(activitythread.java:4627) 02-21 03:49:46.760: e/androidruntime(600): @ java.lang.reflect.method.invokenative(native method) 02-21 03:49:46.760: e/androidruntime(600): @ java.lang.reflect.method.invoke(method.java:521) 02-21 03:49:46.760: e/androidruntime(600): @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:868) 02-21 03:49:46.760: e/androidruntime(600): @ com.android.internal.os.zygoteinit.main(zygoteinit.java:626) 02-21 03:49:46.760: e/androidruntime(600): @ dalvik.system.nativestart.main(native method) 02-21 03:49:46.840: d/dalvikvm(600): gc_for_malloc freed 3724 objects / 212248 bytes in 76ms 02-21 03:49:52.790: i/process(600): sending signal. pid: 600 sig: 9 02-21 03:51:55.399: w/keycharactermap(748): no keyboard id 0 02-21 03:51:55.399: w/keycharactermap(748): using default keymap: /system/usr/keychars/qwerty.kcm.bin 02-21 03:52:03.429: d/button(748): login 02-21 03:52:03.759: e/json(748): <!doctype html public "-//ietf//dtd html 2.0//en"> 02-21 03:52:03.759: e/json(748): <html><head> 02-21 03:52:03.759: e/json(748): <title>404 not found</title> 02-21 03:52:03.759: e/json(748): </head><body> 02-21 03:52:03.759: e/json(748): <h1>not found</h1> 02-21 03:52:03.759: e/json(748): <p>the requested url /android_login_api/ not found on server.</p> 02-21 03:52:03.759: e/json(748): </body></html> 02-21 03:52:03.770: e/json parser(748): error parsing info org.json.jsonexception: value <!doctype of type java.lang.string cannot converted jsonobject 02-21 03:52:03.770: d/androidruntime(748): shutting downwards vm 02-21 03:52:03.770: w/dalvikvm(748): threadid=1: thread exiting uncaught exception (group=0x4001d800) 02-21 03:52:03.779: e/androidruntime(748): fatal exception: main 02-21 03:52:03.779: e/androidruntime(748): java.lang.nullpointerexception 02-21 03:52:03.779: e/androidruntime(748): @ com.example.androidhive.loginactivity$1.onclick(loginactivity.java:65) 02-21 03:52:03.779: e/androidruntime(748): @ android.view.view.performclick(view.java:2408) 02-21 03:52:03.779: e/androidruntime(748): @ android.view.view$performclick.run(view.java:8816) 02-21 03:52:03.779: e/androidruntime(748): @ android.os.handler.handlecallback(handler.java:587) 02-21 03:52:03.779: e/androidruntime(748): @ android.os.handler.dispatchmessage(handler.java:92) 02-21 03:52:03.779: e/androidruntime(748): @ android.os.looper.loop(looper.java:123) 02-21 03:52:03.779: e/androidruntime(748): @ android.app.activitythread.main(activitythread.java:4627) 02-21 03:52:03.779: e/androidruntime(748): @ java.lang.reflect.method.invokenative(native method) 02-21 03:52:03.779: e/androidruntime(748): @ java.lang.reflect.method.invoke(method.java:521) 02-21 03:52:03.779: e/androidruntime(748): @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:868) 02-21 03:52:03.779: e/androidruntime(748): @ com.android.internal.os.zygoteinit.main(zygoteinit.java:626) 02-21 03:52:03.779: e/androidruntime(748): @ dalvik.system.nativestart.main(native method) 02-21 03:52:03.869: d/dalvikvm(748): gc_for_malloc freed 3885 objects / 218072 bytes in 88ms 02-21 03:57:03.939: i/process(748): sending signal. pid: 748 sig: 9
my database name android_api, im using wamp server androidhive did. androidhive utilize below code :
private static string loginurl = "http://10.0.2.2/ah_login_api/"; private static string registerurl = "http://10.0.2.2/ah_login_api/";
but utilize this:
private static string loginurl = "http://10.0.2.2/android_login_api/"; private static string registerurl = "http://10.0.2.2/android_login_api/";
and seek this:
private static string loginurl = "http://10.0.2.2/android_api/"; private static string registerurl = "http://10.0.2.2/android_api/";
i tried 3 url above doesnt work.
i curious config.php:
<?php define("db_host", "localhost"); define("db_user", "root"); define("db_password", ""); define("db_database", "android_api"); ?>
should leave db_password that? because dont know / dont have password.
i succesfully run app http://www.androidhive.info/2012/05/how-to-connect-android-with-php-mysql/ on android 2.2 emulator.
but getting problem login , registration app.
this first time on developing android project, hope there expertise help me solve problem. tried hard solve whole 2 days nothing.
i checked every single code many times, don't know causes of forcefulness close.
please guide , show me true. *thanks*
thank kishu27! create me focus on url , @ lastly found solution.
the right url "http://10.0.2.2/android_api/index.php"
because within folder of android_api have folder named "include" , index.php. must connect index.php first login , register
im super happy !!
php android mysql
No comments:
Post a Comment