• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Input Data to MySQL Database  RSS feed

 
Ranch Hand
Posts: 32
Java Linux MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..
 
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any error or exceptions is thrown?
 
Fandy Akhmad
Ranch Hand
Posts: 32
Java Linux MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Saloon Keeper
Posts: 4743
117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 32
Java Linux MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!