Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4239740
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T03:04:30+00:00 2026-05-21T03:04:30+00:00

I am currently developing a application which is capable of locating nearby bus and

  • 0

I am currently developing a application which is capable of locating nearby bus and train stops and display departure boards for the users.
I have a Activity, let us call it Activity1 that displays the 20 nearest stops.
When one of these are clicked, Activity2 is opened and the departure-board is loaded and shown.

In both cases, I am using AsyncTasks for data retrieval and parsing in background.
What I however would like to do is to load some of the departure boards in the background while showing the nearest stops. These would then be available as soon as the user decides to see one.

So I would like some kind of mechanism (Thread or Service) that runs parallel with the UI Thread and loads these data. The problem is that this mechanism should be accessibly from both the activities. What is the best approach to achieve this?

I thought about creating a static class SideLoader with a Runnable object and maybe a public list of loaded departure boards that is updated contentiously when this Runnable object are executed. Is this seam like a good practice or what?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T03:04:31+00:00Added an answer on May 21, 2026 at 3:04 am

    You might also look at the following video from the Google I/O conference on doing REST queries asynchronously and storing the data locally for use. Excellent description of best practices that you may learn a lot from. Talks about services, asynctask, contentproviders, and more:

    http://www.youtube.com/watch?v=xHXn3Kg2IQE

    And to expound on that thought – You might use a ContentProvider to access the information stored in a SQLLite database on the device. Use a service to fetch the data online and store it in the database through the contentprovider. Your activities access the contentprovider to retrieve the data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing an application which currently have hundreds of objects created. Is it possible
I am currently developing an application in which I want to display a UserControl
I am currently developing an application in Delphi, in which I have to hide
I'm currently developing a camera application for Android on which some problems have occurred.
I am currently developing an application which will require multiple different development languages. I
I am currently developing an application, which gets the input from a text file
I'm currently involved with developing a C# CMS-like web application which will be used
I'm currently developing a cross-platform C application. Is there any compiler macro which is
I'm developing non-interactive cpu-bound application which does only computations, almost no IO. Currently it
I'm currently developing an application which needs a lot of system and process information,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.