Click here to Skip to main content
15,886,091 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Note : I've searched on Google and this site for an answer but couldn't find one.

Now that I've learnt most of Java (for the logic of an app) and XML (for the user interface of an app), I felt like I should test out my skills develop a simple app with my knowledge. It's then that I realized that I might need a database if I want to store something such as user data and manipulate that data. I was thinking if I could just use XML for storing data but I read online it wouldn't be a good idea. Later I found out I could use SQL for storing data which is a supported language by Android.

So my question is, which language is most popular for the databases of android apps, SQL or XML?
Posted

In the sense you are asking, SQL and XML are more technologies and tools than languages (yes, both have Language in their name). Both are technologies used for data storage, but with different scope. So it depends on what you want to store and how do you want to do with it. Read this first: http://faculty.ksu.edu.sa/mathkour/XML%20DB/XML%20and%20Relational%20Database%20Systems%20-.pdf[^]

As of RDMS, you have SQLite at your hand: http://www.vogella.com/tutorials/AndroidSQLite/article.html[^], but of course, XML tools too: http://www.ibm.com/developerworks/xml/library/x-android/index.html?ca=drs-[^]. But there are other alternatives too, like No-Sql (like this: http://www.oberasoftware.com/jasdb-2/[^]).
 
Share this answer
 
Comments
Tega Natufe 18-Jan-14 16:07pm    
Thanks for the PDF link, I think I will go with SQLite for my databases.
SQL is a method for accessing a database. While it is technically a language, its not completely universal. Certain databases support certain ways of querying the data, with SQL being the most common. Many databases put little twists on SQL so its SQL-like syntax but, for example, not all SQL written for Microsoft Access works with Microsoft SQL Server and vice-versa.

XML is not a language, its a DOM (Document Object Model). Its no more a language than a Word document or a picture. You use XML to create a specification for your user interface, but its not a language that you write code in.

If you want to use a database in Android, you are probably going to have to use SQLite[^]. I don't know of any other databases that Android supports out of the box. I'm sure there are libraries out there to support other kinds.

SQLite is easy to use, I would favor that over storing information in XML (text) files.
 
Share this answer
 
Comments
Tega Natufe 18-Jan-14 16:10pm    
Thanks for the information, could you enlighten me further on how XML specifies the user interface.
Tega Natufe 18-Jan-14 16:43pm    
Thanks
Have a look here:

http://www.vogella.com/tutorials/AndroidSQLite/article.html

ETA - cross-post with sol'n 1.
 
Share this answer
 
v2
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900