Programming a Clock + Schedule App from System Time

This is a discussion on Programming a Clock + Schedule App from System Time within the Beginning Developers forums, part of the Android Development category; Hi, I was wondering what android method I should use to import the system time into like a variable that I can test. For example, ...

Results 1 to 2 of 2

Thread: Programming a Clock + Schedule App from System Time

  1. #1
    Android Lurker kerblaster's Avatar
    Join Date
    Aug 2012
    Posts
    1

    Programming a Clock + Schedule App from System Time

    Hi, I was wondering what android method I should use to import the system time into like a variable that I can test.
    For example, I want to make an app where when the app reads the system time to be 12:00-12:30, it will say "Lunch time" If its 12:30-1, it will say "Gym" or something a long those lines. Any suggestions?

  2. Android.net is the premier Android Forum. Registered users do not see these ads. .

  3. #2
    Android Lurker Tramontana's Avatar
    Join Date
    Aug 2012
    Location
    Ventimiglia, Italy
    Posts
    5

    Use standard Java calendar classes

    Use new GregorianCalendar() to create a Calendar for the current time. This has a get(field) method where field is one of a large number of constants for the hour, minute, day, month etc. Then use some logic to decide which name you want to give for that part of the day. All the documentation is online at Calendar and GregorianCalendar. I can't be more specific as your question is a little imprecise.
    Last edited by Tramontana; 08-07-2012 at 03:06 PM. Reason: Typo

Remove Ads

http://www.scramblerducati.org/

Sponsored Links

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Similar Threads

  1. Help me! Time/Clock issues Not Alarm Clock! D:
    By misstvirus in forum Samsung Captivate
    Replies: 0
    Last Post: 11-18-2011, 12:53 AM

Search tags for this page

android clock programming

,

android programming import systemclock

,

android system time variable

,

galaxy s3 system time

,

programming a clock app

Click on a term to search our sites for related topics.
Android Forum