Push Notifications on Android: FAQ
Published on 8 Sep 2010
Within the past few weeks, we announced the availability of our popular AirMail Push service on the Android platform. Since then, response has been overwhelming. Check it out for yourself. Sign up for an account and give it a try if you like – integration involves dropping two snippets of code into your app and takes about 20 minutes. The docs are right here.
Here, we share with you some of the most common questions about integration, deployment and push in general. Remember, our support team is always here to help. If you want to file a support request, feature request, or suggestion, our support site is for you. We also frequent an IRC channel. It’s #urbanairship on irc.freenode.net. And of course, you can email us at firstname.lastname@example.org.
Some common questions about AirMail Push for Android from developers
Aren’t push notifications already available on the Android?
As covered in TechCrunch, AirMail Push for Android works with 99.8% of all Android devices (anything running 1.5 or newer). Rather than relying on C2DM in Froyo (which only reaches 4.5% of devices) for push notifications on Android, you can integrate AirMail Push to target nearly every phone on the platform. Plus, you’ll be able to send the same notification to apps on iOS and BlackBerry—from one call to our API.
When Apple announced it was going to be offering push notification services, it was a boon to app developers. Without Multitasking on iPhone 3.0 OS, there was no way for a developer to communicate directly with the app. Now, with Push baked in to iOS, Apple has provided an open socket for developers to communicate directly with the app – plus, it is the only way to communicate with an app that is not running. Apple didn’t provide a whole lot other than the open socket connection, and that’s how our company was formed, by providing the server- and client- side infrastructure for developers to leverage the service. As of today, we have powered nearly 1 billion messages to the iOS platform.
Blackberry wasn’t far behind. They built a similar type of service, and bundled it with their devices, and we again provide the infrastructure to make it work.
The Android platform lacks this type of built-in service. There is nothing baked into the OS that developers can leverage to send push notifications. Many apps appear to have push notifications, but the apps are constantly polling a server, and when a user has all this polling going on with multiple apps, there’s a big drain on battery life. Another drawback is that the notification is nothing close to real time- it just depends on how often the app wakes up to check for new information.
The AirMail Control Panel (also called the helper app) is the missing piece of the puzzle. When a user has it installed, the device is ready to receive notifications as they occur, and our service sends them to the device in milliseconds. Whereas with iOS we forward the message to Apple and with Blackberry we forward to RIM, with Android, we handle the messaging from end to end.
Why do we need to download a helper app to make push notifications work?
We thoroughly investigated many different service models, and we feel the stand-alone application approach is best for both the application developer and the end user. Our main motivation, in terms of the interface and design, was to make things logical to the end user. We wanted a way for end users to control the experience of receiving notifications, so they can choose which apps send them push notification, set the method by which the notifications reach them (alert via sound for example) or disable them altogether. This functionality, enabled by the control panel in Android AirMail Push, is similar to how it works in iOS (and as opposed to BlackBerry and C2DM, which offer no such controls). Plus, we’ll be able to easily expand functionality — for example, quiet time will be added in a version coming soon.
Second, due to the sandbox system in Android, sharing a connection across apps would create a security hole—when you have the first app open the connection, every app on the device would be trusting the first app not to do anything untoward.
For more details on the technical reasons why we chose to launch AirMail as a help app on the Android platform, please read this, from our CTO.
Why do I want to add push notifications to my app in the first place?
Push notifications help you communicate with users. Using AirMail Push mobile messaging, you can interact with the users who have installed your apps on their mobile devices, be they Apple iOS, Android or BlackBerry devices. You can contact them in real-time, instantly, with breaking news updates, messages from their friends, sports scores or stock moves – the uses are endless. Plus, whether the phone is carried in a pocket, handbag or briefcase, your message reaches users where they are. This direct-to-pocket experience provides enormous potential for your content.
How does AirMail Push impact the battery life of an Android device?
AirMail Push lowers your app’s battery profile relative to polling and enables instant delivery. You can push a message plus a payload triggering about anything you want. It’s pretty cool. We haven’t noticed any drop in battery usage during our (very long) testing phase. That was one of our primary concerns.
How many connections can your servers handle?
Each instance of the layer of our infrastructure that manages the connections can handle several hundred thousand connections.
Can you describe the integration with your Android libraries?
You can see the integration story around the push library here. We provide a drop-in library for you that communicates with AirMail Control panel via intents. The library is up on GitHub.
Does your app handle the notification or does it just broadcast an Intent?
Our app handles notifications by default, but if you don’t want it to handle the alerting and want to do it yourself (this was a requirement by some of our larger customers) you can by specifying only an “extra” value. We’ll pass that data along and your app can parse it.
Are the messages secure?
Yes, all notifications are encrypted.
Can UrbanAirship use the Google push architecture for 2.2 devices?
We can, and may, shift our libraries to do so as C2DM matures and is available on more devices, but for now our goal is to offer a singular solution that works well across all devices.