which kind of database to use with android app? - android

I am developing an android program for my university. I am confused about which database to use.
What I want is that when the user is connected to the internet the program will check for any updates in the backend database. If there is any, the program will sync it with Android device.
Let's assume that after while the user opens the program in place with no internet, the program will work just fine because the file is already in his mobile.
I chose Access and created .xml file and by the help of this site: XML resources in android. I learnt how to read it.
Actually this program is my senior project. I dont want the judges to ask me why didn't I use MySQL or SQLite.
Which database system should I use? Is Access the right database system to choose?
I want to do a program that looks just like Univ of Kent program.

Parsing XML could take time, also in XML you have no choice but to load the whole file.
SQLite is fast, simple to use and very dynamic.
Android offers a very simple SQLite API. Androoid SQLite API
If you are interested in reading more about all the data storage types in Android visit this link

It depends upon your requirement. lets say you want to build something which handles and stores the data on your device locally then SQLite is a good option (you can use firebase as well).if you want to do some sort of calculation on you data on a remote server then firebase is a best choice .
by using firebase you can store your data generated by your users and then if you want you can carry out some analytics as well.
i would prefer Firebase .

Related

When I use a sqlite database as an asset can the database still be used/viewed by another program?

I am working on my capstone and I need to create two programs using two different languages that use a single local database. I am making a chore manager that will be a windows program and an android app. I figure out how to use sqlite for the windows app, but I cannot wrap my head around using an existing database with android studio. I need the app to be able to read existing data and display it and then based on some conditions edit the data.
If I add the database as an asset will the data a user changes using the app be usable by another windows program?
Here's my opinion: "Don't use SQLite for this." Use a regular shared database that you can (securely ...) access from both environments.
SQLite databases are files, accessed through the file-system. They are most commonly used where the data won't be shared, because, like any "shared file" database of aeons past, they are always subject to corruption if someone (or the operating system, or the network ...) does anything wrong. Whereas a conventional client/server database doesn't have these problems because it controls the data while it talks to you.
SQLite is a marvelous tool for storing structured information on a device. I've deployed many dozens of "boutique" websites which store their page-information that way. But, I think, it's not the right tool for this job.

share database between desktop and android app

I´m creating a simple database, let´s say something like NBA players with statistics and pictures. I want to be able to edit the database in my desktop C# application and then consult it on my phone .. When there is no internet!
it is Ok to transfer files from desktop to phone manually. It is Ok to download in the app and then get to the place where there is no internet.
The question is .. what´s my best option here? one big xml? or json? a one-file database like sqllite?
I have expertise on C# but I´m new to android and the whole internet connectivity thing. So I´m specially interested on something that´s easily accesible from android phone.
What would you do ?
In my opinion, it is better that you use a single database for the 2 application using mySQL, a local network is necessary, but an internet will be optional. Android will Send & Retrieve Data in the database. Here are some links you can use( documentation, sample codes ).

Android Sql Lite download from sql server using webservice

I have a website which display quotes grouped by author.
The front end is in asp.net and the database is in sql server 2012.
The table is simple with four fields.
Id numeric and primary key
Author nvarchar
Quote nvarchar
Insertdate datetime.
Now, I want to create a mobile app on both Android and ios platform.
First I started with Android using android studio.
I have the basic design ready with layout.
Now, I am stuck with the main requirements which is I want to give user the options of downloading the quotes when online and the quotes already downloaded should be available offline.
I have been trying multiple tutorial but can't find the one with the exact requirements.
So, is this the below right way of going forward?
I created a webservice and transferring the data using retrofit library. Now I'm able to display the data but not storing it locally. As this part is complete just want to be sure if I have done it the correct way as don't want to rollback once I start working on the part two that is storing the data in sqlite.
Also, can I reuse some of the functionality on ios.
Seems reasonable.
What you probably want to do now is introduce local storage for the data so they don't have to be online and accessing the API all the time. For Android SQLite is the normal way of storing data, and iOS uses Core Data (although SQLite is available).
Everything up to the API is reusable, you'll need to develop the download and storage for each ecosystem separately.
NB - that being said, I believe that Google's Firebase cloud database has an offline mode, so you could potentially work around the need to develop the syncs separately and use Firebase's SDK to get the data into an auto synced local store. Haven't used it myself, but it;s out there.

Is there a way to change the default SQLITE database location on an android phone, to a folder on an HPH website?

I have an app that stores a sqlite database in the usual place. ie: data/data/com.blah.blah/databases. I wish to remotely locate the SQLITE database and read from and write to it. I wonder if there is a way to do it without using the Oracle Mysql option. Is there a way to just change the default location to a folder on a website. Thanks in advance. If so how do I do it. I cant find any tuts or books that explain how its done.
SQLite isn't a remote database implementation. That is kind-of part-of white it is called SQ*Lite*. :) It is for doing SQL databases based on local files, without taking the big additional overhead of having some remoteable service protocol sitting between you and the database.
There are all kinds of options for interacting with remote data stores, not just MySQL - PostgreSQL, etc. You can use whatever of those you want. You can then have on the device just the client code you need to communicate with the remote data store. It doesn't make sense for Android to supply any complicated/sophisticated here built-in, though, since exactly what you want is going to depend mostly on what you are using on your back-end server.

Storage of Static data within android app

I am currently developing a simple info app on various university campuses. I want the app to operate predominantly in an offline state thus I want to store all my information locally. The data within the app will not be subject to any change thus I was wondering what the best (practice) method was to store such data? Basically should I be storing the info in a SQLite db, java file or xml?
The answer depends on your requirements, but because of the built-in integration with SQLite, the easiest will probably be to just use SQLite, plus you get the benefits of a relational database. You can refer to the Notepad tutorial for a start.
It depends on the data you have. If it is largely text I would store it in an android string resource file. If it is somehow structured and has IDs and relations store it in a database.
We had a University project requiring a local database on an android phone. What whe did was to use SQLite to write on a database stored on the memory stick. (We couldn't find the right permissions to write directly on the file system)
Check the API website for the android.database.sqlite package first.
And here for a nice tutorial :
http://www.devx.com/wireless/Article/40842

Categories

Resources