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.
Related
So I have a project that I'm making which is An Android Application, which takes provides information taken from API Server (Laravel 5.x) and also provides live-chat feature
What I'm not sure of doing is how to handle the live-chat feature. Currently here's how the chat system works (keep in mind, there is also a Web App which provides the same feature, that I'm willing to change) :
User type chat and sends it. The client (Android app or Web App) sends it to the API Server. which then saves it to the database.
Then the API Server (which is connected to mysql database server) sends in email / notification which based on the other user's configuration.
When the other User opens the chat, it will call the API Server (which is connected to mysql database server) asking if there's an update every 3 seconds.
if there is, then (Android App or Web App) will show the new chat.
Now first of all I know that this is not efficient, bad on performance, etc.
Now I want to try and use firebase database for realtime chat.
Now, I really want to use the API Server for logging and storing Chat info inside my own database because of some legacy Android App which takes a long time to work on.
which is the better scenario :
The Android App directly sends new chat information to Firebase Database
The Android App sends new chat information to API Server. Then the API Server sends it to Firebase Database
Is there a better way to do this
so which is the better way to do this?
I would highly recommend using the firebase firestore. It sounds like it would solve the best of both worlds. Nosql json storage format is great for a chat app. Also the data is "live" so it will loosen for a change and update the user sides data. Saving you the 3 sec call resources. Last I checked it was still in beta but I used it top make an app that lets you create plus and live pools and it wad pretty smooth. It does take a bit to wrap your head around though.
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.
I am developing an android app with Google Maps.
Basically what a I want to do is to store the location where the user clicks in a database, but I want to store this information for all users that have the app.
I already read about SQLite in Android and his stuff but seems like I only can create a local file where I can store information. I want this information to be sync everytime the app is opened. I don't know how neither where store this information online.
Do I need something like Google Cloud SQL or any other database server to achieve this?
Thanks for all.
UPDATE 09/10:54
I recently discover that MongoLab gives you a simple database to use. In every sample I see for Content Providers in Android or Sync Adapters, I never saw a single database call nor declaration anywhere.
How you can link a content provider or sync adapter to a database?
UPDATE 09/11:24
In the Xamarin docs you can learn how to create a custom Content Provider, but again ... no database is included or mentioned.
Take a look at Sync Adapters:
Synchronizing data between an Android device and web servers can make your application significantly more useful and compelling for your users. For example, transferring data to a web server makes a useful backup, and transferring data from a server makes it available to the user even when the device is offline. In some cases, users may find it easier to enter and edit their data in a web interface and then have that data available on their device, or they may want to collect data over time and then upload it to a central storage area.
I am planing to implement an app and I have come to a point where I don't know what is the best approach.
Scenario:
I have an app where I am making a todo list and I am adding 3 items. I use my phone for this.
Then I take my tablet and want to continue adding another task. Then after a while I take my wife's phone and want to add 2 new tasks.
Basically I want to have a very simple way of storing the tasks online and be able to sync it with the app.
I am seeing two possible ways:
have a web server with a database + web service calls. This has the disadvantage of having a host paid, learn some extra mysql + web service techniques.
store somehow the data on cloud and allow the app by login to access an account which stores the file. I am thinking here at something like Google Drive / Dropbox. But I don't know how I would be able to sync only the updated values, not the whole file. Because I am thinking, if I store all the tasks into one file, each time I update the file, I'll need to upload it fully, which is not the best approach.
I am open to any advices. What approach would you recommend ?
There's also Google Drive's "Application Data" folder.
https://developers.google.com/drive/android/appfolder
This has the advantage of using the user's storage space.
I would look into either Google App Engine or Amazon Web Services. They both give you free allotment of usage per month and if you go over then you start paying, chances are you wont get past the free tier for a while.
AWS is a bit more mature than GAE currently and seemed to be a bit easier to implement that GAE was when I was researching them
Take a look at the new training class for sync adapters:
http://developer.android.com/training/sync-adapters/index.html for the basics of sending data from your device to a server.
On the Android device, I suggest you store your tasks in a content provider. This helps you keep track of updates since the last time you synced. You can then query the provider during your sync, send only the data that's been updated, and store the data on the server.
You should probably store the last update time on the device, so you can tell if the server contains data that isn't yet on the device. Remember that you'll have to download tasks as well if you want all devices to be in sync.
You can try Google's Firebase. Firebase provides SDK for Android and iOS devices. And also, firebase supports offline and syncing. Firebase also provides object storage service. It easier to create firebase app than you think. Have look at this firebase's firestore service.
You can take a look at our Rethync framework (freeware with source) . Using it you can simplify the task of detecting modifications and sync only updated data. Next, Rethync provides both client- and server-side API so you can create your own service (and host it on the web side) or you can write your own transport for the cloud service of your choice (we will provide some transports in future, they are under development now).
I want users to send textual feedback to myself(the developer) directly(without involving Google Play).
Hence, I can get the suggestions to improve my app directly to myself, instead of users writing negative reviews on Google Play.
I do not own a website nor have access to any server.
I do not want to use ACTION_SEND, as that opens an email app.
I'm an android beginner and this is my first app.
Maybe that data can be stored in a database(on cloud, common to all users) that I can access at any time I want?
After researching, I think GCM is supposed to be used, but I no idea how to go about it.
Please tell me the easiest way to implement this.
Thank You.
That is not what exactly what GCM is for. GCM is primarily for sending data from the cloud to the the devices.
You are correct in thinking that one option is to store the data in a database in the cloud. You could use http://pythonanywhere.com free account and build a web app that provides you endpoints which will save and retrieve data to a SQLite db pretty easily (if you have knowledge of python and server side web concepts).
Another perhaps simpler option is to use a pre-existing cloud database solution http://www.parse.com is a cloud backend that also has a free-to-use option that you can use to store arbitrary data. It is pretty easy to get up and running if you follow their many nice Android tutorials.
One last option I will present is to use a Google Spreadsheet with a Form associated to it. Once you create a form if you know the right url and parameters you can send a post request to insert arbitrary data into your spreadsheet. I've created a library that simplifies the process of uploading. GoogleFormUploader. If you need help getting your form set up you can watch the relevant portion of my video tutorial covering this topic