BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 05-04-2011, 11:44 PM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Nov 2009
Model: 8300
PIN: N/A
Carrier: developer
Posts: 37
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default how to do local caching in blackberry

Please Login to Remove!

HI,
In my blackberry native application i am getting the response as XML.I don't want to call the request each and every page navigation.I want to store the data in local caching once and fetch it from there.
How do i use local caching in blackberry
I am using SDK 4.2.
please advise

Thanks in advance
Offline  
Old 05-11-2011, 10:37 AM   #2 (permalink)
Knows Where the Search Button Is
 
Join Date: Nov 2009
Model: 8300
PIN: N/A
Carrier: developer
Posts: 37
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: how to do local caching in blackberry

guys,
is it possible to do local caching ??
Offline  
Old 05-11-2011, 11:11 AM   #3 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default Re: how to do local caching in blackberry

It's not clear from your post if you are using a BrowserField, or calling the native browser. In either case, caching is already done for you.

If you are using HTTPConnection and a GET, over a BIS or BES connection, there is a certain amount of caching that occurs over the infrastructure. Usually, the goal is to defeat this caching

If you are using a direct TCP connection and HTTPConnection, then you'll have to invent caching.

You might just store the response content and the URL in a hash table. The URL would be the key, the text from the response would be the data object. Youwould then consult the cache (your hash table) prior to calling the URL over the conneciton. If the URL is already in the cache, you'll load the data from the table instead of over the connection.

I've done this strategy for downloading images: no point in downloading the same image over and over. Once in the cache, we get it from there.

Last edited by Dougsg38p : 05-11-2011 at 11:12 AM.
Offline  
Old 05-12-2011, 08:11 AM   #4 (permalink)
Knows Where the Search Button Is
 
Join Date: Nov 2009
Model: 8300
PIN: N/A
Carrier: developer
Posts: 37
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: how to do local caching in blackberry

Thanks for your valuable information.
yes i am using HTTPConnection.Response is in plain XML format.

is it possible to store the me XML in hash table. ie with xml tags ?
Offline  
Old 05-12-2011, 08:39 AM   #5 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default Re: how to do local caching in blackberry

Sure - you can store any object in the hastable, including byte[], string, etc.
Offline  
Old 05-16-2011, 10:46 AM   #6 (permalink)
Knows Where the Search Button Is
 
Join Date: Nov 2009
Model: 8300
PIN: N/A
Carrier: developer
Posts: 37
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: how to do local caching in blackberry

I am storing my own object in PersistentStore.
There is no issue in first time . While i am trying load my applicatoin again, i am getting "Bad PersistentStore Object" Exception and forcefully asked me to reset my simulator.

Is it not good practice to store our own object in PersistentStore.
if so is there any other way to store my own object in local?

Please help me out.
Offline  
Old 05-17-2011, 05:09 AM   #7 (permalink)
Knows Where the Search Button Is
 
Join Date: Nov 2009
Model: 8300
PIN: N/A
Carrier: developer
Posts: 37
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: how to do local caching in blackberry

And also i am getting "Bad Persistent Object" Exception while trying to load the other application too.
Please help me out .
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads for: how to do local caching in blackberry
Thread Thread Starter Forum Replies Last Post
Bes 4.1.7 Mr2 Mikey_AGBoston BES Admin Corner 5 04-29-2010 02:37 PM
BES 5.0 Exchange/Domino final documentation posted illy BES Admin Corner 9 05-12-2009 11:16 AM
Perform a cutover to another BlackBerry Enterprise Server in IBM Lotus Domino hdawg BES Admin Corner 3 04-25-2008 09:47 AM
New to BES admin , need help with messages. bigwig BES Admin Corner 5 10-17-2007 10:59 AM
BES 4.1 SP2 for Microsoft Exchange - Now Available jibi BES Admin Corner 51 01-10-2007 09:30 AM





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.