A timer thread and url fetch thread in same activity.

by Droid » Fri, 20 May 2011 04:57:45 GMT


Sponsored Links
 I am having problems with a timer that should fetch http results from
the web every 5 minutes.
I having problems with two threads - often I cannot even turn them off
or keep the timer going without upsetting the apple cart.

Should I start using wait() and notify(), a separate service or
continue trying to get them to be friends with each other in the same
activity. At present its all very badly behaved and I feel as though I
am juggling with marbles.

-- 



Re: A timer thread and url fetch thread in same activity.

by TreKing » Fri, 20 May 2011 05:06:37 GMT


 



Just saying you're using two threads is a red flag. What apple cart?



Use a handler to schedule a message to go off in 5 minutes. When that
message is delivered, use an AsyncTask to do the fetch and handle the
results when it completes.

No raw threads necessary.

-------------------------------------------------------------------------------------------------
TreKing < http://sites.google.com/site/rezmobileapps/treking> ; - Chicago
transit tracking app for Android-powered devices

-- 


Sponsored Links


Other Threads

1. (Maaf salah ke Jalum) WTB: nyari aksesoris htc wildfire macem2 case apa ajaboleh yang penting warna hitam dan teansparan(clear)

Om Admins,
Sorry banget sebelumnya.. Saya khilaf kepencet send blm ganti address.
Siap menerima sanksi nya :(

Best Regards,
David Haryanto
YM    : d4vid_ehue
Gtalk: david.haryanto

-- 
===============
"

2. Best strategy for launch app in Pilot mode.

Hi - I am looking for best strategy to launch app in Pilot mode. We want to 
launch an application in Pilot mode with 100 users with-in a company. When I 
google it and look into android SDK i did not get any good strategy.

What will is the best option for:
1. Make application available only to small group of user.
2. User get automatic application update without any problem.
3. If possible application is not visible in market to all user.


Any suggest is highly appreciated.

-- 

3. Widgets size

4. Why OpenGLES can open fb0?

5. Android Sync Adapter and ContentObserver , how to get contact info from content provider when raw_contacts db changes

6. How Sync Adapter works

7. Big problems with bitmaps, memory management, Log.d