I would very explicitly NOT develop a MySQL App on the Android.

While you could perhaps get the JDBC driver to run on Android, this is
the wrong approach from a architectural standpoint. You won't get the
performance, scalability, maintainability, reliability, nor security
characteristics you'd like.

Instead, expose your client-side functionality in a web service. For
most purposes, I'd suggest a RESTfull web service, but SOAP is also an
option. JSON is often a good alternative to XML -- especially if you
will be interacting with this service via a browser.

If you put SQL in your client, you are basically screwed. You will
NEVER be able to alter your schema, or introduce some non-DB
processing, or split the data between databases, or make any of a host
of other changes, because some people may never upgrade their apps.
Well, OK, you can say "screw them", and change it anyway, but they'll
ding you in the marketplace ratings.

Especially in a mobile app, you want a looser coupling. With a web
service, you can simultaneously provide multiple versions of the same
service (perhaps distinguished only by a revision indicator). You can
do server-side caching to take a load off your database. You could
even move to a different database entirely.

Also, connection failures will be frequent. With MySQL, you'd have to
pay considerable attention to recovering from connection failures.
With a web service, a single call may fail, but because the
communication itself is stateless (if designed well), you can just
retry that one failing call.

You do have to think carefully about transaction boundaries, and try
to accomplish more with a single call, rather than beginning a
transaction, doing a bunch of stuff, and the committing. That's a good
thing -- you'll get much better performance, because the round-trip
time through the mobile network will be poor. You'll also be rewarded
with much superior reliability -- a single MAKE-ALL-THESE-CHANGES call
happens in a shorter period of time, and is much less likely to fail
due to the network than a series of BEGIN-EDIT-EDIT-EDIT-EDIT-COMMIT
operations.

All in all, there's very good reason why nobody uses MySQL on Android,
and it has nothing to do with limitations on Android. The same
arguments actually apply to ANY client-side use of MySQL, it's just
that they get even stronger on a mobile platform.

On Mar 8, 1:45 pm, Si458 <[email protected]> wrote:
> Hiya,
>
> Im currently trying to develop a mysql app on the android, ive got the
> basics working and ive also managed to get the JDBC working with java
> but not android :(
>
> im running my application threw the debig in eclipse and it appears to
> be these lines it comming up with errors
>
> Class.forName("com.mysql.jdbc.Driver");
> Connection conn = DriverManager.getConnection(url
> +dbName,userName,password);
>
> what do u think im doing wrong?
>
> as im moving forward and forward in eclipse threw the lines (F5) it
> keeps going into
> Class.class and saying Source Not Found ???
> and also
> ClassLoader.class and saying source not found aswell
>
> what do u think im doing wrong or what should i do???
>
> thank you :)
>
> SASmith
> Simon Smith

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to