5.3 Common Questions About Push
The concept of true application data push is unique to the BlackBerry platform; it's not a common capability found on mobile devices. When many developers are first exposed to the BlackBerry application data push, some common questions seem to pop up every time:
Where does the push application run?
The push application can run anywhere.
Regardless of whether you're pushing to internal or external users, the only requirements are that the system running the push application has access to the data it needs to send and that it has the ability to communicate over the network (via HTTP) with the server that is processing the push request (the BES or the RIM Push Infrastructure). The application can run on a desktop computer sitting under a developer's desk, or it can run on an application server sitting in a corporate data center. The push application can, although it's not recommended, run on a BlackBerry, Windows Mobile device, or even an iPhone.
For enterprise push applications, the push application also should not be installed on the BES. It sends data to the BES, but it should not be running on the BES or servers hosting any components of the BES or MDS.
What programming languages can I use to write push applications?
Any development language can be used.
Push applications can be written in any computer language, as long as the language supports the technologies required for push. As you'll see later, the only requirement for a push application is that it is able to communicate with a server via HTTP. There are push applications deployed that are written in PHP, ASP.NET, Python, Java, Visual Basic, C#, and even Delphi.
When should the data be sent to target devices?
Anytime that is appropriate for the target audience.
It's up to the developer writing the push application to decide when the pushed data should be sent to target devices. Data is typically sent based on a schedule or trigger defined by the business requirements for the application. The data can be sent on schedule; every morning at 7:00 A.M., for example. The data can be sent on a trigger—data can be sent whenever specific changes are made to the data or a specific event occurs.
All that matters is that the developer is careful about how often the data is pushed. Although push typically reduces the amount of data sent to/from a device by removing the need for the application to periodically check for updates, you can still reduce battery performance or increase data plan usage if data is pushed more often than needed. Send the data only when it's important to send it and try to batch updates to minimize how often data is sent.
If the application is pushing data to a Java application running on the destination device, the push application can just push new or updated data rather than the full data set with every push. The client-side application or application user can be responsible for purging older data.
Can pushed content be customized per destination user or group of users?
Yes. The push application is created based on the needs of the application user. Whether the pushed data is customized for every recipient or the same data is sent to everyone, it is a decision the developer makes when building the push application.
If the information is general and applicable to an entire team (sales promotions, business unit performance against a quota, industry news), send the same data to everyone. If the data being sent is relevant to a single user or group of users, the push application must build a set of data for them and push it before building the data for the next set of users.