User Tag List

Results 1 to 6 of 6

Thread: Date and Time chrono doesn't run in background

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    SoftWarewolf's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    922
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Date and Time chrono doesn't run in background

    So with multitasking the obvious choice, and countdown timers on my menu, i really need to know for how long the app is minimized.
    On iOS this works great with the chrono (stop watch) on the date and time object, as the chrono keeps running in the background.

    But on Android it doesn't, i've attached a quick example:
    chronotest.zip

    How to verify: tap "start", minimize app by pressing the home button (not back button), when returning to the app the time is the same as when it went into the background.

    Anyone know a way around this to know how long the app has been paused for, or do i need to make an extension?

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,312
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    You can do this by always setting a value to the system time, and then create another event ABOVE where you compare the value to the system time. If the app has been inactive, the comparison is done before the app gets to update the value, and so you can calculate how long the app has been inactive by subtracting the stored value from the system time.
    This is how I did it in an android app, and it works

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    SoftWarewolf's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    922
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Which object do you get the system time from?

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,312
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    You'll have to make a calculation from what you can retrieve from the Date & time object.

    Always set a counter to:

    ( ( year of( "Date & Time" ) - 2017 ) * 12 * 31 * 86400 ) + ( day of month of( "Date & Time" ) * 31 * 86400 ) + ( day of month of( "Date & Time" ) * 86400 ) + ( hours of( "Date & Time" ) * 3600 ) + ( minutes of( "Date & Time" ) * 60 ) + ( seconds of( "Date & Time" ) )

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    rubes's Avatar
    Join Date
    May 2011
    Posts
    357
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Popcorn, what is the above calculation doing? I am trying to find a way to determine one of the following scenarios, and wondering if the above would be helpful.
    1. How many months have passed since a previously logged date
    2. how many weeks have passed since a previously logged date
    3. how many days have passed since a previously logged date

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    rubes's Avatar
    Join Date
    May 2011
    Posts
    357
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually, i have a formula for months passed, but can't figure out weeks or days.
    If you store the Year and Month of the earliest time as y1 and m1, and the later time as y2 and m2, the formula i use is (y1*12+m1)-(y2*12+m2) gives the difference in months.
    I'm just stuck on how to get the difference in weeks and days

Similar Threads

  1. 'Date And Time Object' how to set date?
    By King_Cool in forum Fusion 2.5
    Replies: 2
    Last Post: 6th December 2015, 12:04 PM
  2. [bug] Date&time object doesn't show date
    By qenio in forum Android Export Module Version 2.0
    Replies: 3
    Last Post: 19th March 2012, 10:49 PM
  3. Chrono Pause on app to the background
    By Keith in forum iOS Export Module Version 2.0
    Replies: 1
    Last Post: 6th December 2011, 11:33 AM
  4. Chrono related actions when the application is in the background
    By Yos in forum iOS Export Module Version 2.0
    Replies: 2
    Last Post: 30th November 2011, 11:13 AM
  5. [Bug Report] Date & Time Object doesn't display
    By PixelatedPict in forum Android Export Module Version 2.0
    Replies: 1
    Last Post: 17th April 2011, 09:22 PM

Posting Permissions

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