Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Developer
vishalkheterpal
Posts: 134
Registered: ‎01-11-2011
My Device: curve

Persisting data in background

Hi all,

 

I am storing some data in persistence.this data is large and this process is taking time nearly one minute on phone.

i just want to store data in background thread.When i create a seprate thread for this.It hangs the ui until data is not stored.What should i do.

Please use plain text.
Developer
obone
Posts: 162
Registered: ‎01-11-2012
My Device: BlackBerry 9790, BlackBerry PlayBook 64Gb, BlackBerry 10 Dev Alpha
My Carrier: MTS

Re: Persisting data in background

[ Edited ]

Hi vishalkheterpal,

Try to decrease priority for your background thread.

 

It's also useful to be know how you create the thread.

Respectfully,
Oleg

Developer, QNX RTOS, BlackBerry 10 and PlayBook
Follow me on Twitter (in Russian)
St.Petersburg BlackBerry Dev. Group
Please use plain text.
Developer
rishikeshsinghpbh
Posts: 121
Registered: ‎05-31-2012
My Device: 9900
My Carrier: Airtel

Re: Persisting data in background

Hi,

Use the following---

 

new Thread(new Runnable() { public void run() {

 

//do ur work here

 

} }).start();

 

Also make sure that u r not synchronizing for a long process,i mean u r not using synchronized (UiApplication.getEventLock())  in the worker thread.

 

thanks,

 

 

Rishikesh Singh
Please use plain text.
New Developer
vishalkheterpal
Posts: 134
Registered: ‎01-11-2011
My Device: curve

Re: Persisting data in background

rishikeshsinghpbh i am doing the same the ui stills hangs.

Please use plain text.
Developer
rishikeshsinghpbh
Posts: 121
Registered: ‎05-31-2012
My Device: 9900
My Carrier: Airtel

Re: Persisting data in background

Hi,

 

Also make sure that u r not synchronizing for a long process,i mean u r not using synchronized (UiApplication.getEventLock())  in the worker thread.

 

Thanks

 

Rishikesh Singh
Please use plain text.