Database for Mobile applications - android

I would like build a mobile application in order to learn the technology.
I have chosen Ionic framework for the same, as it takes care of majority of settings for building the application. But, when coming to database for the app which I am trying to build, I am bit confused.
Some links as a result of googling suggest me to use SQLite and some pull me towards Firebase. My doubt is, are they related for comparison? I guess, SQLite and Firebase cannot be compared with. Please clarify.
Thanks
Manikandan J

SQLite is your phone's database and Firebase is an online database.
Using SQLite, you can create apps which do not support sharing with others. An example, pac man. Say you got a highscore of "20". But you cannot share this highscore with other people's phones because it is local (inside your phone).
Using Firebase, you can store data online, for example, registration details etc. Once people have registered they can login with their info using multiple platforms (depending on your target). You can make them share things with eachother and so on.

SQLite is more suitable fro developing offline android application. Firebase always required a server but SQLite did'nt require any server so for Firebase you should have internet required but in SQLite you can achieve your goal offline. So depending upon the conditions you can use one of this.

Related

Can you use android Room library to host a database online

Please I am working on a project for a "travel ticket booking android app". I've already learned how to develop android apps but the problem is that my project will need have an updatable online database from which travelling agencies could be added and users also use it to inspect and choose the different travelling options.
My question is: Can you use android Room library to store information in on an external online server instead of the phone local storage?
thanks
Let's remember Room is abstraction layer over SQL Lite. Thus in theory you should be able to backup your database into file, publish it somewhere online, download it from other places and restore it somewhere else - but that's very very limiting in case you deal with more then one user.
So practical answer to your question is no, you cannot use Room to store info externally online.
As long as you are in Google ecosystem already, you should probably consider Firebase options they are offering: https://firebase.google.com/docs/database/rtdb-vs-firestore. As long as you are using Room, you'll probably have to build some adapter for your data.

sharing SQLite database information

I have a question regarding my app. While I was doing search for sqlite database concepts and advantages, I found that SQLite is serverless or you don't have to deal with server when you using it.
My question is, if SQLite is serverless, how two or more devices can share information in my app between them without server?
By wanting to share anything between devices you are creating a server/client scenario. i.e. Something is served from one device to a client, the other device.
SQLite is probably not the ideal solution as there is no client-server aspect included, so you'd have to write you own server and client code, which would very likely not be at all simple.
Firebase could be the simplest solution as it's a single SDK and is hosted/served by Google. This link - Add Firebase to Your Android Project - may be of interest

What is the proper structure for accessing a database on mobile apps?

I'm a complete beginner with mobile development. A friend of mine approached me with a project idea, asking me if it was possible to do it. The way I see it, it is a mobile app that needs to read and write data on a database in order to write inspection reports on the job of various staff members.
I told that friend that I would check how mobile development works first and would try to create a prototype to present. I've asked and Android is the main platform that is desired, so I've tried working with Android Studio and it is pretty straight forward up to now.
So, now I'm wondering what is the proper way to sync mobile apps with the database. Last time I worked with a database in a project we had multiple clients connecting to a server to play some small game together and the server would access the database and send the data back to the client through the network connection. So, I was wondering if a mobile app was supposed to use this communication structure or would simply talk directly to the database instead of a server.
The structure I have in mind:
Is this an acceptable structure? Or am I thinking of this the wrong way?

Android local SQLite sync with Firebase

I have an app where the default option is to store user data as a local SQLite database, however, I want to add the option if the user wants to sign in and transfer the local database to an online database so it can be accessed on multiple devices.
I don't have much experience with cloud storage solution so any advice would be really appreciated. Is for my application the Firebase Real-time Database the best online solution or is there another approach I should look into?
Firebase's real-time database is indeed one of the best solutions for your problem. It has a generous free plan and is well integrated into Android Studio.
And if your data structure is simple enough, you can drop SQLite altogether and use Firebase's offline storage. This will allow Firebase to automatically handle syncing of offline data for you(syncing is usually painful to implement by yourself).
Alternatively, you could build your own web app and expose a REST API to your android application. This gives you the advantage of having control over everything. I would however not recommend this because of the amount of knowledge and time required.

MYSQL and SQLite

I know this might seem like a basic question but can an android app which i know uses SQLite work with a web site like http://www.freemysql.net/client/. I have developed a desktop program in netbeans that functions with this website using MYSQL and I want my android app to upload information to this site as well. Or can i use MYSQL with android. I just need to be pointed in the right direction. Any help will be greatly appreciated
If you only expect your app to work if "online" you may be able to make it work. I would expect that the cloud db API already qualifies as a web service interface like Kevin mentioned you would need. If you want a desktop and Android app to use this same database, it seems vaguely reasonable.
I didn't see any API documentation for the site you mentioned. I would focus your attention on how to write an Android app that communicates with a web service. Since you've already written a Java desktop client, you probably already have some idea about this.
If you decide at some point you need access to a database "offline" you should just look at a tutorial for database access on Android. It's not that painful. You may want this so you can store data locally and push to the cloud when you're connected.
http://developer.android.com/guide/topics/data/data-storage.html#db

Categories

Resources