• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Connect MySql to Android

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to synchronize the internal Sqlite Database to an external MySQL Database (I work with Eclipse).

I imported mysql-connector-java-5.1.13-bin.jar into the project, but the conversion to another Format (davlink) does not succeed.



Somebody have an idea?
 
author
Posts: 51
Android Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I'm correctly understanding what you're trying to do, the problem is with "localhost". You're trying to connect to the external database from within your Android environment. Android is running Linux underneath, so you've got an operating system there, and localhost to that OS means the Android device. What your code says to do is open port 3306 on the Android device. You'll need to give the IP address of your external host to connect to it from Android.

- dave
 
Terence Gronowski
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dave thanks

I run It with the Emulator on the one same machine. I indeed have to specify the IP of my PC there as for Android the Emulator is "localhost". But that is not the main problem. There is an error message "Conversion to Davlink format failed with error1". I supose this is the error which is caused because the compilation fails when i should rework "mysql-connector-java-5.1.13-bin.jar" into the Davlink format.
 
author
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Terence,

One can certainly include externally build jar files by other java compilers in to android.

Here is a research link for this topic

Externally built jar files and Android

However you must see what other java jar files those may further depend on. Also the android java sdk is a smaller subset of the full java sdk. So if the external jar is using some classes that don't exist in android jar then they will fail.

Hope this is of some help

Satya

 
reply
    Bookmark Topic Watch Topic
  • New Topic