I am currently using Windows Azure with Android and need to sync data between sets of users using PUSH notifications.
For example: User A uploads data to Azure which is stored in the SQL DB. That then needs to be pushed down to a specific set of devices and stored locally in SQLite.
What is the best design pattern for this? Should I be pushing the data with the PUSH notification or be using PUSH as a prompt for the app to then connect with azure and download the data.
Thanks for any help.
I'd think you would want to send a notification to the device that prompts the user to launch the app, and then the app fetches the data. I don't know how Android push services work, but I'd assume there is a fairly limited amount of data you can send in a single notification.
The best way to accomplish this is to use Windows Azure Mobile Services and the unoffical Android SDK.
The unofficial Android SDK can be found at: https://github.com/goldshtn/wams-android
The benefit of using Mobile Services in this case is that it's super easy to writer server-side scripts on INSERT. After you connect your project to a Mobile Service, you'd then head to the 'Data' tab, select the appropriate table, and then head to 'Script.' Pick INSERT from the dropdown, then write a function that sends a push notification to the designated subset of users. You'll need to write this in JavaScript.
There's some code you can work from included with the unofficial SDK, but if you check out https://www.windowsazure.com/en-us/develop/mobile/tutorials/get-started-with-push-dotnet/#update-scripts you can get a sense for the steps you'd follow for an app on any platform (though the tutorials will only walk through Windows Phone 8, Windows Store, and iOS at the moment).
Related
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.
I want to develop a system in which data is being shared between DESKTOP app and Android app.
After searching I have found that I need a server in between them. But I can't figure out what the server is? How do I create it? And how will it help me connect my two platform devices?
Desktop App will receive data from android app. And manage data. It will also be used to send notifications/messages to android apps.
Android App will be used to input data and send it to desktop app. It will receive updates/notifications from desktop app.
Now how do I connect these two? I basically need a common database for real-time data sharing and notifications.
Edit: I am building the desktop app using C# and android app using Java.
Edit2: Maybe I can host the database on CPANEL or 000webhost using PHP. And then connect it with both android and C#. Is this the correct way to do it? Is it possible to connect it with C#? I know it can be connected with Android, not sure about C#.
You don't necessarily need a database. You need a common network protocol between two applications.
All network communication is done via sockets. You need a library that allows you send data over sockets. For example, here's an Android guide that is about sockets.
A socket binds to a specific port of a computer, essentially making it a "server". Much like how web servers all expose port 80, and communicate over a protocol called HTTP. Which is important because it is up to you to decide what protocol your applications communicate between each other, because the socket just sends bytes - it doesn't care what you send or how, as long as it travels to a port on a particular server. It also won't parse the data for you, that's up to your application to handle. For example, how would your desktop app know the Android device sent it a text message, or some image to be displayed, or an address to show a map?
All in all, your reason for wanting a desktop application rather than a web application is not entirely clear. Parsing only the body of HTTP payloads from different HTTP paths that are mapped to different methods (which is typically referred to as a REST API) is much simpler than building your own protocol. You might as well build a desktop GUI over top of a web server.
Making the desktop app send updates back to your mobile application is basically impossible using a bi-directional socket architecture. Your Android should not be running an open server socket continuously just for your application, mostly because battery drain, but because its network address is subject to change frequently, and you therefore additionally need a registration server from which your device would reconnect to. Such a service exists as Firebase Cloud Messaging, which is a rebranding of the GCM technology made by Google, and it can be used to send push notifications to devices, but only with small data payloads.
See here about what activities occur on an Android device for notifications. How does push notification technology work on Android?
Back to the question about databases. Suggesting one to use is too broad. And you only need one of those if you want to store and/or query or join datasets. The same computer running the desktop app can install and run whatever flavor of database you prefer, whether it's a relational database or noSQL database, entirely up to you. The only realtime databases I know of are RethinkDB and Firebase.
You could also just hold a SQLite file which is as good as a small scale database (even the SQLite documentation recommends it for low traffic web sites).
Firebase supports web interface, so you can develop html code and integrate in desktop app, something like web integration in windows form application
I have a android and IOS shopping app to which I need to send push notifications whenever a new promotion is stored in the db. We have mongodb as our database and we setup uniqush as our push notification server. Now, I need advise on building a robust integration system that polls the offers document collection in the db and sends it to Uniqush over http. What technologies/frameworks should I use and is there any open-source ready-made system?
I have tried simple implementation of Meteor Livequery but it is not suitable to handle more than 100K users that use this app.
We are running on CentOS distribution
Any suggestions are welcome.
Thanks
There isn't a system ready for that, but there's a variety of languages out there with libs for mongodb and some with clients for uniqush. I worked on a simple ruby wrapper for uniqush. Mongoid is the most popular MongoDB client for ruby.
You can build a system that relies on chronjobs pulling the newest documents from mongo every few minutes, or you can use Resque to enqueue a job to run on the background to generate and request push notifications to the uniqush-push server every time a offer is created.
Resque would be a my preferred option as it's pretty standard and straightforward.
Now, you may find ruby being too slow for your user base, then you can try to use golang, which is the same language as uniqush-push--though this is completely irrelevant, which is a really fast language and have all required libs to connect to mongo and you can create a client for uniqush-push fairly simply with the net/http standard lib.
You can try to integrate 3rd party libraries like MixPanel, Parse
They all support push notifications and also Android\iOS easy integrates with them.
They can handle that amount of notifications, and always you can send not
all at once, but maybe few as a batch.
So I have an Android application that visualizes points of interest with relevant information. I also plan to have a Ruby on Rails application, that allows users to upload new points of interests with the appropriate attributes (i.e. information). What would be the best way to update my Android application's SQLite database to reflect the new information?
When you updating your RoR application, you want to reflect the changes on your android application as well?? hmm, if in case, you can use GCM which will give u real time push msg http://developer.android.com/guide/google/gcm/index.html
here is a post about it also.
Gem for push notifications for Android and iOS
correct me if im missunderstanding your question
I want to build a app with sharing option. I mean that users can pass simple data between their contacts, that use the app. And I don't want to use servers of mine.
Is it possible to use existing platforms such as Facebook, Google, or even with android APi only?
If it can be done, how can I do it?
You can try with gcm - Google Cloud Messaging for Android
Nevertheless, for this you will have to use some kind of server to send push messages.
I created the free and Open Source web service cross copy to do file and message transfer between devices via simple RESTful commands:
waiting for messages to appear "on the given codeword" (long polling):
GET http://cross-copy.net/api/any_codeword_you_like
sening a message in body to all waiting clients:
PUT http://cross-copy.net/api/any_codeword_you_like
Both devices must use the same codeword and hence it must be agreed upon (displayed on screen, QR-Code, prediefined, computed by geo location or what ever fits for your application. More infos are available in the readme at GitHub.