简体   繁体   中英

How can i connect to MySql database to create a mobile application?

I have a script in java that works like a crawler and saves data in MySql DB. What i want to do is build a Mobile App(Andriod/ios) which will connect to mysql database retrieve results and just show it to the user.

What is the best approach to this ? I tried to use Flex UI with PHP as my server client but was hoping to know if there is a better solution ?

The fastest would be to make android fetch a page in XML, typically on the server and display its contents(If displaying contets is your desired result).

else

You need to implement a script on your server, your POST interacts with that script and inturn that script works with your database.

A typical scenario will be:

Java HTTP POST ~~~> PHP ~~~~> MySql.

PHP will as well help you encode the result in JSON and post it back to your client.

Try using jdbc or jtds library to connect android app with mysql

I used jdts library for connecting mssql db using android app. http://jtds.sourceforge.net

For mysql jdbc might work

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM