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.
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.
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.
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.
I'm new to Android and I'm thinking of uploading my app to the playstore but I haven't tried uploading a single app.
I already know the steps in uploading however there is something that I need to know first.
I want the app to update everyday that doesn't need to notify the user for update. Say for example, in a bible app there is a "Verse of the Day" which is updated daily without downloading an update, just stay connected to the internet and the verse will be updated. I have no idea on how to do that. Is it just uploading a newer apk daily? If so, do I have to notify the user? How do I do that?
Any help would be appreciated.
Method 1:
Basically, what you are planning to do that can be achieve using API.
If you update database on the server then the API will automatically update the new data in the user phone's when it starts.
You can also implement logic that when any new data is added you can fire a local notification from the app and the user will be notified!
Reference: http://code.tutsplus.com/tutorials/android-sdk-making-remote-api-calls--mobile-17568
Method 2
You can create service or background activity that keep on running and calling your API after some interval of time. Whenever new data is received it will fire local notification. (This is not an efficient way because it consumes memory and internet data both)
E.g.: Alarm Manager
Reference: http://www.vogella.com/tutorials/AndroidTaskScheduling/article.html
Method 3
You can implement "push notification service", so that you can push notification on the user's device without updating your APK.
Reference: http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/
P.S. All these method can be done without releasing the new APK on the Google Play Store.
I don't really know what your problem is. You have to host your "Verse of the Day" somewhere online and in the app fetch this data from the server. Why do you want to upload a new version of your app for this?
For the latest content that you want your app users to have, can use the Couchbase Mobile feature called Live Query that abstracts out having the user explicitly ask the server for any updates.
When the app is connected to the internet again, content will be updated accordingly if the user's Android app does not have the latest content locally.
Currently I am working on android e-commerce project, I am using sqlite database to store data.
I need to update my database each and every time. My question is if i upload my app in android market, how can i update my database every day.I know about android versioning concept if i update version of the my apk , how people who are using my app will know that my app is updated.
Please give me a clear idea on this . Thanks in advance.
I have a better solution for this problem. It will be better if you host a web service that will serve the update information. You can do it for free. GoogleAppEngine provides this feature. Serve JSON file from web, parse it in you application. Each time your app launches, write code to check for update information. OR check once in week or some other strategy. This might be tougher way of doing but you can provide more efficient and flexibility through this.
if i upload my app in android market, how can i update my database
every day
You can do this stuff using Web services call to your data server .
now you might have a question in your mind about users devices battery ,
if you continually call those web services your device battery gonna loose lot.
or
if you call this web service in some specific interval then app user might miss the actuate time when data has loaded already .
so i suggest to use GCM for could push notification .
How its works in your project :
When you data will update on server , then there should be one script on server side which send message to GCM server with some required field of identification of that application package
when you device receive that message using your GCM receiver you may need to update your database as you did so far .