[android-developers] Re: Stop watch functionality in Android

2013-10-09 Thread Abhilash baddam
Hi,
Thanks for the reply.

Otherwise shall I use the service so that android system doesn't kill the
service..?

Is there any other better approach for this...??




On Thursday, October 10, 2013, TreKing treking...@gmail.com wrote:

 On Wed, Oct 9, 2013 at 12:57 PM, Abhilash baddam 
abhilash.androiddevelo...@gmail.com wrote:

 Is the reason when the app goes to background, the android system is
killing the Timer.. ?

 Yes. Review the app life cycle and the documentation on saving and
restoring state.


-
 TreKing - Chicago transit tracking app for Android-powered devices

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 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 unsubscribe from this group and stop receiving emails from it, send an
email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [android-developers] Re: Stop watch functionality in Android

2013-10-09 Thread TreKing
On Wed, Oct 9, 2013 at 9:41 PM, Abhilash baddam 
abhilash.androiddevelo...@gmail.com wrote:

 Otherwise shall I use the service so that android system doesn't kill the
 service..?


Android will kill your Service if need be. This is not a solution.


 Is there any other better approach for this...??


Yes. Read the documentation. Review the app lifecycle. Pay particular
attention to the documentation on saving and restoring state.

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[android-developers] Re: Stop watch functionality in Android

2013-10-09 Thread Abhilash baddam
Hi Trekking,

If I use onrestoreinstance state then if I started timer say at 00:00:00 it
started n its running, and presses on home then I will store the timer
value. after some time, for ex  I go back to app at 00:56:45 sec if the
timer gets killed then I don't get the latest or upated value from restore
instance state,if I am not wrong..?

On Thursday, October 10, 2013, TreKing treking...@gmail.com wrote:

 On Wed, Oct 9, 2013 at 9:41 PM, Abhilash baddam 
abhilash.androiddevelo...@gmail.com wrote:

 Otherwise shall I use the service so that android system doesn't kill
the service..?

 Android will kill your Service if need be. This is not a solution.


 Is there any other better approach for this...??

 Yes. Read the documentation. Review the app lifecycle. Pay particular
attention to the documentation on saving and restoring state.


-
 TreKing - Chicago transit tracking app for Android-powered devices

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 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 unsubscribe from this group and stop receiving emails from it, send an
email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [android-developers] Re: Stop watch functionality in Android

2013-10-09 Thread TreKing
On Wed, Oct 9, 2013 at 10:26 PM, Abhilash baddam 
abhilash.androiddevelo...@gmail.com wrote:

 If I use onrestoreinstance state then if I started timer say at 00:00:00
 it started n its running, and presses on home then I will store the timer
 value.


Don't store timer value - store the start time. Then figure out the current
value from that.


 after some time, for ex  I go back to app at 00:56:45 sec if the timer
 gets killed then I don't get the latest or upated value from restore
 instance state,if I am not wrong..?


Yes, you should get the value back that you saved, and from that you can
figure out what the elapsed time is.

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.