Tuesday, April 9, 2013

XML, KML database for android

While working on an android application development, I researched about the possibilities of database for an android application to store geolocation of various points. During the research, first I started with keeping an XML (not KML) file with all values and use JAXB for reading and writing the XML. Following links are wonderful resources for learning XML access using JAXB: http://www.vogella.com/articles/JAXB/article.html

However later I realized that you should not use JAXB for android app. It will increase the size of application by 9MB.

Then a work around of using XML in android app using SIMPLE. http://simple.sourceforge.net/ and it is a wonderful way to use XML for android.

Meanwhile following tutorial will help you to learn about KML in android. KML is the best way for storing geolocation in an android app but there are not major dummy application to get an understand of how to use it. Here is a link for simple usage of KML : http://labs.micromata.de/display/jak/HelloKML+%28Quickstart%29.

As JAXB is an api for accessing and modifying an XML file in java similarly we have a JAK (Java Api for KML) to access and update KML. Here is the code and more details about the JAK project (open-sourced) https://code.google.com/p/javaapiforkml/

I am not done with the application database and would update the post once I got go ahead with the best strategy.

 Update: Finally we decided on to use SQLite itself. Also got to know from some people that KML is not a database :O

No comments:

Post a Comment