File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Android and the fly likes Input Data to MySQL Database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Input Data to MySQL Database" Watch "Input Data to MySQL Database" New topic
Author

Input Data to MySQL Database

Fandy Akhmad
Ranch Hand

Joined: Nov 26, 2011
Posts: 32

Dear Javaranch..

I have some problem in my App. I try to connect Android and Mysql database with PHP.
I want to insert some data trough android Textfield. But It can not save to the database.

1. I use XAMPP
2. I use 10.0.2.2 and my Ip address to connect database.
3. I check from Android Emulator browser check connection. and it successfully.

I think the problem in my Main.java file.

Here is my PHP code :

koneksi.php



insert.php




Here is my Android code:

main.xml File




Android Manifest file



Main.java File



Please help me..

Thank you so much..
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3476

Any error or exceptions is thrown?
Fandy Akhmad
Ranch Hand

Joined: Nov 26, 2011
Posts: 32

Nothing errors i found..

I don't know the concept to building Android app with Mysql Database.
May be you can show me simple app,.

Thanks for your responds
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Fandy Akhmad wrote:Nothing errors i found..

You need to look into whatever log file PHP writes to, and in the Android logcat output.
Fandy Akhmad
Ranch Hand

Joined: Nov 26, 2011
Posts: 32

Tim Moores wrote:
Fandy Akhmad wrote:Nothing errors i found..

You need to look into whatever log file PHP writes to, and in the Android logcat output.


Here is logcat 'error'

12-02 09:23:27.497: E/Zygote(33): setreuid() failed. errno: 2
12-02 09:23:38.707: E/Zygote(33): setreuid() failed. errno: 17
12-02 09:23:42.097: E/BatteryService(69): usbOnlinePath not found
12-02 09:23:42.097: E/BatteryService(69): batteryVoltagePath not found
12-02 09:23:42.097: E/BatteryService(69): batteryTemperaturePath not found
12-02 09:23:42.169: E/SurfaceFlinger(69): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake
12-02 09:23:50.036: E/EventHub(69): could not get driver version for /dev/input/mouse0, Not a typewriter
12-02 09:23:50.036: E/EventHub(69): could not get driver version for /dev/input/mice, Not a typewriter
12-02 09:23:50.377: E/System(69): Failure starting core service
12-02 09:23:50.377: E/System(69): java.lang.SecurityException
12-02 09:23:50.377: E/System(69): at android.os.BinderProxy.transact(Native Method)
12-02 09:23:50.377: E/System(69): at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)
12-02 09:23:50.377: E/System(69): at android.os.ServiceManager.addService(ServiceManager.java:72)
12-02 09:23:50.377: E/System(69): at com.android.server.ServerThread.run(SystemServer.java:184)
12-02 09:23:52.717: E/SoundPool(69): error loading /system/media/audio/ui/Effect_Tick.ogg
12-02 09:23:52.736: E/SoundPool(69): error loading /system/media/audio/ui/KeypressStandard.ogg
12-02 09:23:52.746: E/SoundPool(69): error loading /system/media/audio/ui/KeypressSpacebar.ogg
12-02 09:23:52.757: E/SoundPool(69): error loading /system/media/audio/ui/KeypressDelete.ogg
12-02 09:23:52.767: E/SoundPool(69): error loading /system/media/audio/ui/KeypressReturn.ogg
12-02 09:23:55.177: E/ThrottleService(69): Could not open GPS configuration file /etc/gps.conf
12-02 09:23:56.937: E/logwrapper(149): executing /system/bin/tc failed: No such file or directory
12-02 09:23:57.007: E/logwrapper(150): executing /system/bin/tc failed: No such file or directory
12-02 09:23:57.127: E/logwrapper(151): executing /system/bin/tc failed: No such file or directory
12-02 09:24:14.124: E/HierarchicalStateMachine(69): TetherMaster - unhandledMessage: msg.what=3
Chrobione Robinson
Greenhorn

Joined: Dec 06, 2011
Posts: 7
Fandy Akhmad wrote:
Tim Moores wrote:
Fandy Akhmad wrote:Nothing errors i found..

You need to look into whatever log file PHP writes to, and in the Android logcat output.


Here is logcat 'error'

12-02 09:23:27.497: E/Zygote(33): setreuid() failed. errno: 2
12-02 09:23:38.707: E/Zygote(33): setreuid() failed. errno: 17
12-02 09:23:42.097: E/BatteryService(69): usbOnlinePath not found
12-02 09:23:42.097: E/BatteryService(69): batteryVoltagePath not found
12-02 09:23:42.097: E/BatteryService(69): batteryTemperaturePath not found
12-02 09:23:42.169: E/SurfaceFlinger(69): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake
12-02 09:23:50.036: E/EventHub(69): could not get driver version for /dev/input/mouse0, Not a typewriter
12-02 09:23:50.036: E/EventHub(69): could not get driver version for /dev/input/mice, Not a typewriter
12-02 09:23:50.377: E/System(69): Failure starting core service
12-02 09:23:50.377: E/System(69): java.lang.SecurityException
12-02 09:23:50.377: E/System(69): at android.os.BinderProxy.transact(Native Method)
12-02 09:23:50.377: E/System(69): at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)
12-02 09:23:50.377: E/System(69): at android.os.ServiceManager.addService(ServiceManager.java:72)
12-02 09:23:50.377: E/System(69): at com.android.server.ServerThread.run(SystemServer.java:184)
12-02 09:23:52.717: E/SoundPool(69): error loading /system/media/audio/ui/Effect_Tick.ogg
12-02 09:23:52.736: E/SoundPool(69): error loading /system/media/audio/ui/KeypressStandard.ogg
12-02 09:23:52.746: E/SoundPool(69): error loading /system/media/audio/ui/KeypressSpacebar.ogg
12-02 09:23:52.757: E/SoundPool(69): error loading /system/media/audio/ui/KeypressDelete.ogg
12-02 09:23:52.767: E/SoundPool(69): error loading /system/media/audio/ui/KeypressReturn.ogg
12-02 09:23:55.177: E/ThrottleService(69): Could not open GPS configuration file /etc/gps.conf
12-02 09:23:56.937: E/logwrapper(149): executing /system/bin/tc failed: No such file or directory
12-02 09:23:57.007: E/logwrapper(150): executing /system/bin/tc failed: No such file or directory
12-02 09:23:57.127: E/logwrapper(151): executing /system/bin/tc failed: No such file or directory
12-02 09:24:14.124: E/HierarchicalStateMachine(69): TetherMaster - unhandledMessage: msg.what=3


Those logs are showing a different issue that is happening before your code is even ran...

Thins I would confirm:

I would check to make sure that my php code is working by passing the following url code through the browser on the phone and on the dev computer.... ******Please change validuser and valid password to a user and password in the database and see if it gets a response. ******

Also clear the log view on logcat prior to running the application and also use the debug mode on eclipse.

hope this helps

-chrobi

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Input Data to MySQL Database
 
Similar Threads
nullpointer when i try to initiate onclicklistener
android uncaught handler: thread main exiting due to uncaught exception
AdMob ad doesn't show in the emulator
Layouts, bottom position
how to put layout in middle of the screen?