|
Ask the Guru
Who is the Guru, you ask? Guru is our in-house technical expert ready to answer your development questions in each newsletter issue. If you have a question for Guru, please email guru@blackberry.net. Selected questions and Guru's replies will be featured in each newsletter, so stay tuned.
getMore Storage asks:
I noticed that on the simulator I could "load" a vector using [PersistentObject].getContents() that was much larger than the amount of available RAM.
What does getContents() do? Where does the persistent object live?
Guru Persists:
Peruse and pursue an understanding of Storing Data Persistently, a document that will help you untangle your questions on data storage on the BlackBerry device.
Need more of a push? Here's an example of how to use getContents();
Retrieve
Use PersistentObject.getContents() within a synchronized block to retrieve data.
private MenuItem getItem = new MenuItem("GetItem", 110, 11) {
public void run() {
synchronized(store) {
if(store.getContents() == null)
System.out.println("Error");
else
String[] currentinfo =
(String[])store.getContents();
}
}
};
Prompting for a Push ponders:
I've read that MDS has the option for a push message to expire. To avoid message duplication on the MDS queue and unwanted load on the BlackBerry Enterprise Server™ or potential overload and unresponsive BlackBerry Enterprise Server, is there a way to specify push messages to expire on MDS queue after a certain amount of time (for example 10 min as the push interval)? Is there such a way to do it when you are posting to BlackBerry Enterprise Server for push?
Guru Shares:
You can set the "X-RIM-Push-Deliver-Before" attribute to expire the push if it is not delivered by a particular date or time. Attributes are encoded as HTTP headers.
Find out more from the BlackBerry Browser Content Developer Guide, page 61.
Back to top
|