how to access android app database centerally - android

In a normal android app ,we can code and create a sqlite database for an android app,But when we are putting this app on play store and multiple users are using that app, then how can we provide same kind of data to all users as database(sqlite) we made is only to that user in his phone.
I am new to android programming so not sure how to maintain a centralized database.

If you want centralized data for all users of your app, regardless of the device, then you'll need to use a cloud type API (e.g. web app backend accessed via REST API). Anything you put in a SQLite database on the device will only be accessible by that app on that specific device and for that specific person. On Android devices with multiple people, such as a tablet with multiple profiles, each person gets a separate instance of your app and data.

Related

Android Firebase separate data by device

I have an Android app connected to Firebase and I was wondering if it is possible to have the data saved separated by device, so that saving data on one device will not appear on another device with the same app. Is this possible without the implementation of authentication and different accounts?

Use android phone as a server

First of all i am new to Android programming with no previous experience in server side programming. I am developing an app that works as a cashier for restaurants. The restaurant may have one device working as a cashier for take-away customers and one or more devices in every hall he has for indoor customers. Instead of having one local database for every device in the restaurant i need to have only one centralized database which every device can use.
Can i share only one copy of local databases to all other devices via api or so to achieve this??
If not what alternative options do i have since as i stated earlier i have no previous experience in setting up a server myself??
Recommended method: Setup a server and create APIs to share and store data in your server's database.
An other way to get around the problem: You can use the Firebase to store your data on cloud. In this way all of your devices can share a cloud database without having to setup a server.

If I install the app in another device, is it still possible to log in with the pre-made ID?

For my best knowledge so far, the biggest difference between SQLite and MySQL is that it does not require a server to run, as SQLite stores data in a database file in each device.
The question rising from this part is..
Let's say I created an Android app which simply contains login and signup features. By installing this app in one device I create an ID with a password (let's say the ID is ricoangeloni and the password is 1234).
If I install the app in another device, is it still possible to log in with the pre-made ID? This is still very confusing, as I am probably not sure if the clients are sharing the centre database.
The answer to this question depends on where the database is located (regardless of whether you're using SQLite or MySQL to access the database). If you're storing the database on the Android device, then that database is specific to that device.
If the database however is stored on some internet-facing computer (doesn't have to be a "server" per say) and your app interacts with that hosted database, then an account created in that database is accessible from anywhere, not just your app. A website for example could also use the accounts in that database for login purposes.
The approach of housing the database on the device does have its advantages, namely you don't need to have a dedicated machine to host the database. But, if you wanted to have one database with all of the accounts and use that for authentication purposes, you're going to need to put that database on the internet.

Delphi mobile app - store data across new mobile phones

Is there any standardized way in Delphi mobile apps for storing/syncing app data across mobile phones for Android + iOS?
Here is my siuation:
Currently I ship some data with my apps and new data is downloaded to cache. This works well, also when users download new versions.
However, now I need to store data inputted by the user... Thus data needs to be persistent... And ideally it should survive mobile changes, e.g. from ios to android or at east when upgrading from e.g. iphone5 to iphone6. I rather not host user data myself on my own servers. It it also important that it is cost free.
So I am looking at what is necessary for:
App/user data survives upgrading Android phone keeping Google Play account.
App/user data survives upgrading iphone keeping Apple iTunes account.
App/user data when user changes mobile platform.
I guess a combination of these solutions will be necessary:
Using a cloud service tied to each separate plaform (i.e. iCloud for iPhone users)
Make an import/export function to a data folder the user manually can backup when switching from e.g. Android o iPhone or the other way
The minimal but fully acceptable solution would be an easy way to export/import a data file. That data file could then e.g. be stored in any service where it could be retrievd from later?
The amount of data will not be a whole lot. Each user has his/hers own data. If the user uses multiple devices it will be up to the user to export/import/sync data in a way that makes senses.

How to sync android database with web database?

Hi I want to sync android database with web database, my scenario is:
I want to make an android app dictionary. The dictionary words are added by web forms and the user android consume those words. In the Android application I have the historical of words that the user displayed and data of their studies, that should be synchronized online in case of change user phone or him have multiple devices.
My question is how to do that:
I need authentication or can get the User's google account to identify him?
How should I synchronize these two databases?
If I use Backup API i can get the same data in diferents devices?
I need authentication or can get the User's google account to identify him? That's your decision. You could even provide both methods. Some people don't want to share everything with Google, others don't care. If you want to create your own authenticator read the Udinic blog post about it.
How should I synchronize these two databases? You need a sync adapter in Android and a receiving service in your web application. In the Udinic blog there is also a tutorial about sync adapters. On server side you could create a REST service for example.
If I use Backup API i can get the same data in differents devices? The Backup API doesn't seem to be the right choice as it only restores data during the initial setup and I assume you want to synchronize the data all the time.

Categories

Resources