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 1066389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:00:22+00:00 2026-05-16T20:00:22+00:00

I am a new to developing for Android and have been reading up and

  • 0

I am a new to developing for Android and have been reading up and researching in order to become more familiar with the platform. My programming knowledge is moderate I have experience with C++ and a fairly proficient with Actionscript 3.0. I picked up programming primary to work on game development but come from a more artistic/design background.

I have a relatively simple idea for an app that I want to approach from the most practical way possible seeing how it’s my first attempt. Essentially the core functionality of the app will be drawing information I will be getting from an ephemeris chart. At a certain time in the day which is based on the data from the chart I want to change an image/display information based on that day. I am trying to wrap my head around the best possible way to do this. Also I would like to give the user an option of having a notification of some kind when the change occurs, but that is something I have come across in terms of basic implementation.

So my question is if you were to approach setting something like this up how would you? What I am not sure about is setting up a time element so the application knows when to change the image/data to display.
If you took the time to even read this I really appreciate it.
Wade.

  • 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-16T20:00:22+00:00Added an answer on May 16, 2026 at 8:00 pm

    It really depends on where/when/how this image is displayed. I will assume that the image is shown in a normal Activity:

    Look into using the AlarmManager to set alarms. These alarms could start a Service that changes the image source (perhaps updating a db entry of the image resource or filename). Once the work is complete in the Service, send a Broadcast (or StickyBroadcast) with the results in a Bundle using Intent.putExtra(). You could also set the status bar notification at this point using the NotificationManager. The PendingIntent of the Notification should be the Activity that shows the image.

    Check out the “Alarm” and “Notification” sections of the APIDemos (/samples/android-8/ApiDemos/src/com/example/android/apis/app)

    UPDATE: A more robust Alarm system is Mark Murphy’s WakefulIntentService found here.

    Then, register a BroadcastReceiver in that Activity, listening for the Broadcast Intent that you set in the Service. This will listen for when the service completes. If you use a StickyBroadcast in your Service, the data will be cached, making it available when the Activity comes to the front of the stack. Otherwise, you will need to persist the data (in an SQLite db or SharedPrefernces) and use a timestamp.

    UPDATE – Demonstrate persistent data storage:

    A great place to start with learning SQLite is the Android Note Pad demo. This will teach you many of the key aspects of Android including life-cycles, ContentProviders (db wrappers), and using Android Views (widgets).

    The alternative I mentioned is using the Application’s default SharedPreferences. A simple example of usage is this:

    String imageUri = null;
    long timestamp = 0;
    final String currentImage = "current_image";
    final String lastTimestamp = "last_timestamp"
    
    // Access the default SharedPreferences
    SharedPreferences preferences = 
        PreferenceManager.getDefaultSharedPreferences(this);
    // The SharedPreferences editor - must use commit() to submit changes
    SharedPreferences.Editor editor = preferences.edit();
    
    // Get the current image URI
    if (preferences.contains(currentImage) {
        imageUri = preferences.getString(currentImage, null);
    }
    // Get the last timestamp
    if (preferences.contains(lastTimestamp) {
        timestamp = preferences.getLong(lastTimestamp, 0);
    } 
    
    // To set the SharedPreferences
    editor.putString(currentImage, imageUri);
    editor.putLong(lastTimestamp, timestamp);
    editor.commit();
    

    Hope I understand you correctly, and that this helps.

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

Sidebar

Related Questions

No related questions found

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.