views:

448

answers:

2

Sheesh talk about limited information! I'm trying to get my Android application to connect to an online database to access information. There's quite a bit of info including geotags and these are going to be mapped on my app. The developer site has the very informative piece of information:

You can use the network (when it's available) to store and retrieve data on your own web-based services. To do network operations, use classes in the following packages:

java.net.*
android.net.*

Like I said in my previous question, I'm still very much an android newbie, and trying to remember my java oop from college is slow. Does anyone have an example of how this might work, or how I could implement it? I wouldn't mind even connecting to a local xml file, if I could find a good example of how to do that!? Am I just looking in all the wrong places?!

Help. Please!

T

+1  A: 

How do you plan to connect to the database?

Android allows you do to plain socket communication which you can refresh your knowledge of here:

http://java.sun.com/developer/onlineTraining/Programming/BasicJava2/socket.html

Another method would be to put up a REST type service and respond with XML. SAX is commonly used for XML parsing in Android:

http://www.saxproject.org/

Brad Gardner
Hmm, thanks Brad, hadn't really thought about how I was going to connect. I'm coming from a web background so I thought I might be able to do an AJAX-like call to a page which would return the data I need to the application. I'll take a look at those links though. Thanks a million. T
tadywankenobi
A: 

You can use SAXParser to parse XML from the net. Here's a tutorial on how to use the same.

primalpop
PrimalPop, not only do you have a superb moustache, but this is exactly what I've been looking for!!! Thanks for all your help guys!T
tadywankenobi