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


© 2005 Research In Motion Limited. All rights reserved. The BlackBerry and RIM families of related marks, images and symbols are the exclusive properties and trademarks of Research In Motion Limited. RIM, Research In Motion, ‘Always On, Always Connected’ and BlackBerry are registered with the U.S. Patent and Trademark Office and may be pending or registered in other countries. All other brands, product names, company names, trademarks and service marks are the properties of their respective owners. The specifications and features contained in this document are subject to change without notice. All other brands, product names, company names, trademarks and service marks are the properties of their respective owners. Prices subject to change without notice. Research In Motion Limited presents information about third party products and services on BlackBerry Connection for your information. However, since Research In Motion Limited relies on information provided by outside sources, it makes no warranty or guarantee concerning the features, reliability or pricing of third party products or services, or their compatibility with any Research In Motion Limited products.

Research In Motion Limited
295 Phillip Street
Waterloo, Ontario
Canada N2L 3W8