One thing you haven't indicated is if you need this remote access when the app starts, or if you actually need to periodically "wake up" and poll the remote service? If you only need to have a user start your app.. and at that point it requests to the remote service once.. or while the app is running, then using AsyncTask is the way to go. If you need your app to periodically poll the remote service, than a service may be the way to go. A service would not require a separate thread that I know of because it is not tied to a UI. It's a background task, with no UI.
On Tue, Jan 19, 2010 at 1:14 PM, jotobjects <[email protected]> wrote: > I don't think it will accomplish anything to start a service in a > thread. That doesn't make the service run in the thread where it is > started. So you are down to one of the options you are considering. > Ti si also possible to start a service in a separate process but it > still should not block on its main thread. > > Possibly android.os.AsyncTask will be useful for you. > > On Jan 18, 5:17 pm, Flapjack <[email protected]> wrote: > > Please forgive my ignorance, I am new to Java and Android. > > > > I would like to retrieve remote data and display it within my > > activity. To prevent tying up to UI, I understand that I can do this > > in another thread. (I thought I could just-as-well fetch this remote > > data from within a service, but that appears to tie up the UI thread > > also). So now I'm beginning to think I need to either run the logic > > from a new thread within a service, or run a service within a new > > thread. But which? I have found many examples online of running new > > threads or services, but I have yet to find an example of both at the > > same time. > > > > Thanks! > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected]<android-developers%[email protected]> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en >
-- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

