Sync data between Android App, Web and Desktop application - android

Currently, I have an App that sends data to web server.
But, if website sends data to the server, my App does not receive any data from the server.
I want to create an app like Evernote where I don't have to refresh the app to receive data from the server.
So when I sends data from mobile, it has to sync with all other devices.
How do I implement it?? Which method is best for android?
Is GCM the only way to do it?

We need more information regarding what you have tried implementing for us to provide a better solution since your issue is about code implementation.
You may check Firebase Realtime Database as this seems perfect for your situation because with Firebase, "data are synced across all clients in realtime, and remains available when your app goes offline". Since you are using Android, you can check this document: Set up Firebase Realtime Database for Android.

Related

Android, API Server, and Firebase Database relation

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.

android send data to device?

we have an application under xamarin where a user connected and on a login the user DOWNLOAD the work he make it.
Device call our web service and device downloaded the datas in json format.
The data downloaded are saved into the database sql lite on client.
All work fine.
Now imagine this sample :
user has connected on the device, downloaded work.
But afer some hours, the work has changed for some reason.
We need to send new data (new work) again the particular device.
I've read some article about the google push notification but i wonder if i search on the right place.
How i can send data to a particular device under android ?
Could you share your experience, article , sample..
Thanks for your knowledge
I've read some article about the google push notification but i wonder if i search on the right place.
There is a realtime database on Firebase that will fit your requirement. But it is a cloud based service, using it probably means you have to move all your data from your server to Firebase server. So it is not a good fit, if you want to use your own webservice.
Other option is to use an AlarmManager to set a repeating task to sync your data periodically.

can i setup a wamp server with a db on my pc, to continuously update my android app's database?

Hey guys i have a basic question,
I want to know if i can setup a wamp server on my pc with a database, for that when i update something on the database on my pc, it automatically updates the database on my android app via internet, and if it is possible
im planning to put the app on the googlePlayStore, and i want to know if the users who download the app will be able to update the database of the app also thru my server.
im making an app with a db of contacts, mostly taxi services and i want to be able to update the contacts of the db thru an online server, in wich if i change a contact the user will click on the UPDATE_CONTACTS button, and i want the app to automattically check if the server is online, and if it is, UPDATE the db's on the app.
but i want the server to be on my pc, can i do it thru a Wamp_Server app, or do i need to install Windows_Server?
Thanks in Advance for all Answers!
Regards.
Yes you could use a WAMP server, along with Google Cloud Messaging to accomplish this. Create an account and add the API to your server side logic. Once that is complete, implement GCM in your app.
Check out how to implement a GCM client in Android for information on how to do this.
You'll be able to use push notifications from the cloud to send data (retrieved from your server application) to your app via GCM.
Hope this helps.
I think that there's a better solution:
Create a JSON file;
Store this JSON on the cloud;
Read this JSON every time your app starts.
So, your app's users always will get those contacts up to date, without any efforts.

websockets and sync adapter in android

I'm designing an application for getting some data from a web service, like a REST API and showing it to the user:
I was thinking about using the Sync Adapter with Content Provider API:
the Sync Adapter handles the data flow between the local DB and remote DB.
the content provider API loads the data into the UI.
My question is that the remote application, if, has a server push support (using Socket.IO or so), how should I design the app to exploit this feature? because as far as I understand, when the SyncAdapter will run is determined by SyncManager. So I can't ensure that the sync is done only when the server pushes. I wanted to know if this is possible, even without running the application in the foreground or background. i.e., only with the sync adapter running.
thanks in advance for any replies.
PS: I'm just starting to design android apps, so forgive me/correct me if I'm wrong.
Follow up:
I'm not interested in the Cloud messaging APIs (like GCM). I wanted to keep the data private if the user wishes to.
If your application will be running for a while you don't really want to keep a constant connection open to a server since that will eat a lot of batteries.
It sounds like you're looking for this:
http://developer.android.com/google/gcm/index.html
Using gcm your app can get a notification when there's an update on your server.

Updating data Android

I want to develop an application that will need its data to be updated regularly, to do that I will add an administrator. I was thinking to make a website for the admin only who will go and update the data over there and then a notification will be sent from the server to the android application using GCM when there is an update, the app will sync and the data will be updated.
Now since I will need to use a server that means my database will be MySQL right?
Or is there another way to do the same thing but without having a headache of using MySQL and json?
I don't have a server of my own, I was going to use a local server like xamp or wamp and I am more used to working sqlite, if there is a solution to get around this problem with sqlite it would be a pleasure to know it.
The application you are talking about can be achieved by using JSON. For that you need to make api with the related data.

Categories

Resources