1

I would like to know if there is any way to retrieve or load database from MySql to the Android app? So far most of them includes JSON etc. Is it a must to involve JSON? Is there any alternative way?

I am able to post data to the database. I would like to know if I can view the table of the database or any info from the database from the Android app directly.

My aim is to view all directory and files available in the web server. User can enter the directory or file while browsing. It would be good if it is listed in ListView etc?

TheBoyan
  • 6,802
  • 3
  • 45
  • 61
peacefreezer
  • 133
  • 1
  • 2
  • 10
  • 1
    Did you do any research? "Android mysql" google search turned http://www.basic4ppc.com/forum/basic4android-getting-started-tutorials/8339-connect-android-mysql-database-tutorial.html up as the second result. Please read [ask]. – Jack Nov 25 '11 at 21:03
  • ya I did, but isit a must to use JSON? The result is written in JSON... I'm asking if there is any alternative – peacefreezer Nov 25 '11 at 21:12

2 Answers2

0

I have seen forum posts of undocumented MySQL JDBC drivers created for test and academic purposes. Just a quick search on google for "Android JDBC MySQL" will get you to some of these. However, you would not typically want to connect directly to a database over the web on your mobile device, bad idea (for a host of reasons). Instead you might look at creating an interface for whatever data it is you want to access and exposing it as a service (SOAP, REST, anything else). Then you can use a variety of plain Java APIs to get/ put/update/delete/whatever your data. What you want is more like the Google Data APIs, for your own stuff, rather than trying to include all sorts of JDBC overhead on a phone (keep all of that on the server, and use it like you normally would).

vgardner
  • 507
  • 5
  • 20
0

Yes it is possible. I searched around Google for a bit and I think I got some references for you to look at.

What you're talking about is called Java DataBase Connectivity, commonly referred to as JDBC, is an API for the Java programming language that defines how a client may access a database. It provides methods for querying and updating data in a database.

More Info: http://dev.mysql.com/doc/refman/5.0/en/connector-j-usagenotes-basic.html

This basic info is focused on straight Java, rather than Android.

And as requested this method is a direct connection to a remote MySQL DB. I took it a step further and a google search "android JDBC" yielded the following results...

JDBC connection in Android

Setting up a linux MySql backend for your Android Application

Gotta love stackoverflow...all the answers are here.

Community
  • 1
  • 1
Rawr
  • 2,206
  • 3
  • 25
  • 53