I would like to repeatedly (every second) ask for the message (object or value) to GAE (if android client did not create or change something there) from another android device. I need to check it pretty fast, but I know that it happens aproximately once in hour.
I use restlet and I don't want to create new thread and poll by get from this thread every second, because this is very battery consuming. I also don't want to use C2DM.
Is it somehow possible to do this? I have found something about NIO nonblocking http connectors here:
http://restlet-code.1609877.n2.nabble.com/Push-data-from-server-using-a-live-HTTP-connection-td2906563.html
But here is described only the client side and I also don't know if this solution would even be possible to use on GAE and how. Does anyone know more about this approach?
Thank you very much in advance.
As the author of uniqush, I created an entry in the FAQ page specific to this question.
Can I use uniqush on Google App Engine?
Yes and no.
If you just want to use GCM on Google App Engine, then there are some code in uniqush-push which you can directly use.
However, because Google App Engine does not support socket connection, there is no way to use APNS. In another work, if you want to setup a server on Google App Engine, you cannot push any notification to iOS devices no matter what software/library you are using.
I did considered to port uniqush to Google App Engine. But because of this fact, I think it may be better to port it until Google let us use client-side socket connections, or provide some way to connect to APNS server.
Again, if you are considering to use Google App Engine as a server for your App, please be aware that you will not be able to push notification to any iOS device right now. If this fact does not bother you, then do it.
Personally, I recommend you to run a server with full control. It is not expensive nowadays. Amazon EC2 or similar cloud products may be a good choice to run uniqush.
As I recommended above, using a (virtual) server with full control would be a better choice if you want to support more platforms besides Android.
If there is any other question, please feel free to reply.
For being future proof I would suggest you have a single push notification service for both kind of devices. You can either build on your own, or leverage something like uniqush or this
Also the Urban Airship's SDK would be a good option to look at, more details here
this is similar to Urban Airship but only a fraction of the cost. The API allows you to send a C2DM message to a user via a call. After you implement the broadcast reciever, when a user installs the app they are prompted to accept the message. If they accept a token is sent to the C2DM server identifying the user. This token is then used to send them a message via the C2DM platform. The Zend PHP Framework has built in functions for this but if reliability is a concern go with an external provider like Remote Queries or Urban Airship
Related
How can I make an online server to access API's and handle requests? Then how can I have my android app access this online server to make requests?
I have an android app that I am building for a school project. This app will need to use multiple APIs to gather information to display to the user. However I don't want to allow people to decompile to source code and take my API keys. My plan is to build an online application that will do all of this work on the server side. This way the user only submits a query and the server sends information in response to their request. This will speed things up for the user and keep the keys from being accessed by other individuals.
Steps I think I need to take.
Set up server to access the API's
Make app access online server through HTTP requests
3....
4...
I have a very general concept in my head, but I'm not sure where to begin. If I'm wrong on any part of this question please correct me.
I do plan on moving this to the app store in the future.
edit: Do you know of tutorials that show the building of the API and then loading it to Amazon AWS or another server?
There are many options when building restful services for api consumption. You could start with php, which is the easiest to start with. Here is a nice tutorial that takes you through the initial stage all the way to the end of building login system for android using mysql and php as the server language. It contains the barebone details of setting up the infrastructure and logic. I think from there you manipulate and go further.
https://www.androidhive.info/2012/01/android-login-and-registration-with-php-mysql-and-sqlite/
check out java rest easy, it is a nice tool to use to build web API's. You can host it for cheap at red shift or amazon using their pay what you use billing.
The cheapest way for you to host your REST API is to use Amazon's API Gateway. You pay for what you use and pay nothing if it is not being used. API Gateway plays very nicely with Amazon's Lambda service that allows you to run discrete code units - again, you only pay for what you use. Lambda itself plays nicely with Amazon's pay-as-you go NoSQL datastores (SimpleDB and DynamoDB).
I searched a lot but I found no solution. I'm pretty sure that it is not possible but maybe one of you how you can do this.
I have a Server that can send Push-Notifications to my app. Therefore I use the Google Cloud Messageing Service https://developers.google.com/cloud-messaging/
Unfortunately the rules for when a notification should be sended are not that easy. So I would feel a lot better if I could write JUnit-Testcases that can subscripe to the project and receive these notifications. And it would be very helpful if I could test this against a real system.
Howoever it seems that you can only recive push-notifications in real Android and IPhone -Apps. Additionally there is a Chrome-App thatcan do it https://developers.google.com/cloud-messaging/gcm
Is there any possibility to receive a GCM Push-Notification in a Java desktop application?
Since there seems to be no Solution for this I wrote Something that suits my needs. Feel free if to do anything you want with this:
https://github.com/codemaker219/gcmproxy
I am going to develop uber-like application.Here I have to send latitude and longitude to web and mobile devices continuously with my service,What I have do to get this.
Can anyone please give some idea.
You should start by designing how the application is to be used, seen from all the different users perspectives.
For instance is this a web app, or a native app, or both?
Then from that knowledge, you need to define a communication protocol.
You should be able to determine if the client will be polling for data, or if you need to push it from the server onto the clients.
This also goes for the data that travels the other way.
From here you choose a language for programming, and then start doing some proof of concept tests.
The choice will depend on the chosen underlying technologies
(web / native / os / available libraries)
After some test work you may have something that works, then you need to review or add security to the communication, cause we do not want everyone collecting location data from everyone that has the app installed.
Then run beta trials and eliminate the worst bugs, and then release the app.
You'll want some sort of asynchronous task which can get new data from your server and refresh the mobile and web content to reflect the content of the server. You'll also want to notify the server whenever you make local changes to content and want to reflect those changes. Android provides the SyncAdapter pattern as a way to easily solve this pattern. You'll need to register user accounts, and then Android will perform lots of magic for you, and allow you to automatically sync. Here's a good tutorial: http://www.c99.org/2010/01/23/writing-an-android-sync-provider-part-1/
I want to create a java server application which receives data from an Android client and also transmit notification to client. Actually i did not know much about server apps. I am quite familiar with servlets and mysql, is there any tutorials based on these??
So any suggestion how to build it or any tutorials for it?? please help me!
What you are probably looking for is Google App Engine a SaaS by Google. While there are many alternatives this is probably the best route you can take for implementing a Java based backend. Follow these tutorials* and you'll be good to go. Keep in mind the GAE is a bit complicated and will take some time to get on your feet.
https://cloud.google.com/appengine/docs/java
More tutorials on GAE can be found by a nice google search!
I want to make one desktop application for our college so that it can be use in the way so that when we want to send update about the college fest it can be directly reached to all the person who have the desktop application in java.
For android we have the GCM concept. Is there any method for the desktop application also?
I do not want to use polling here .... So please tell me any suitable method how to do this?
Not without running a server of your own. GCM is a particular service that Google runs free of charge to encourage developers to use the Android platform, and it works by having every Android device make a TCP connection to Google and keep it open all the time waiting for incoming messages. You'd have to have your own similar server.
You could use a JMS publish/subscribe topic, but in this case, it is almost certainly a better idea to let the client poll for updates in JSON or RSS format. Is there a specific reason you don't want to poll?