Re: [android-developers] Timer in Android

2012-05-04 Thread Mady Zaid
انتى ممكن تستخدمى كونتر اللى على اساسه بتطكبطى الكونتر وهو دات نفسه جواه
داله لما ينتهى بيعمل حاجه معينه انا ممكن ابعتلك الكود لو تحبى
أسلام محمود
مهندس برمجيات
انفورميكس مصر
On May 3, 2012 2:35 AM, Mai Al-Ammar mai.alam...@gmail.com wrote:

 yes, I set a flag before calling a function which calls the timer, and
 after calling cancel, I modify the flag value,
 after calling the function, I checked the flag but this did not work
 correctly.

 thanks for your reply

 On Tue, May 1, 2012 at 5:01 PM, Kristopher Micinski 
 krismicin...@gmail.com wrote:

 what did you try?

 How did it not work?

 Did you set a flag somewhere before calling cancel?

 Or what?

 kris

 On Tue, May 1, 2012 at 7:49 AM, Mai Al-Ammar mai.alam...@gmail.com
 wrote:
  I tried to track it by myself but I could not :(
  could you please help me with an idea of tracking.
 
  On Tue, May 1, 2012 at 2:22 PM, Mark Murphy mmur...@commonsware.com
 wrote:
 
  This has nothing to do with Android. There is no method on TimerTask
  to tell you it is canceled, so you will need to track that yourself by
  some other means.
 
  On Mon, Apr 30, 2012 at 8:16 PM, Mai Al-Ammar mai.alam...@gmail.com
  wrote:
   Hello every one,
  
   I have a simple question about timer in Android, How can I know if
 the
   timer
   is stopped or not?
   I have an if statement which see if some condition is satisfied,
 then it
   will stop the timer by :
   if(timerTask != null)
   timerTask.cancel();
   I want to check after calling the timer if the timer is stopped or
 not?
  
   Please help me
  
   thanks in advance
  
   --
   Mai A. Al-Ammar
   Teacher Assistant
   Imam Mohammad bin Saud Islamic University
   College of Computer Science
  
   --
   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
 
 
 
  --
  Mark Murphy (a Commons Guy)
  http://commonsware.com | http://github.com/commonsguy
  http://commonsware.com/blog | http://twitter.com/commonsguy
 
  Android App Developer Books: http://commonsware.com/books
 
  --
  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
 
 
 
 
  --
  Mai A. Al-Ammar
  Teacher Assistant
  Imam Mohammad bin Saud Islamic University
  College of Computer Science
 
  --
  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 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




 --
 Mai A. Al-Ammar
 Teacher Assistant
 Imam Mohammad bin Saud Islamic University
 College of Computer Science

 --
 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 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

Re: [android-developers] Timer in Android

2012-05-02 Thread Mai Al-Ammar
yes, I set a flag before calling a function which calls the timer, and
after calling cancel, I modify the flag value,
after calling the function, I checked the flag but this did not work
correctly.

thanks for your reply

On Tue, May 1, 2012 at 5:01 PM, Kristopher Micinski
krismicin...@gmail.comwrote:

 what did you try?

 How did it not work?

 Did you set a flag somewhere before calling cancel?

 Or what?

 kris

 On Tue, May 1, 2012 at 7:49 AM, Mai Al-Ammar mai.alam...@gmail.com
 wrote:
  I tried to track it by myself but I could not :(
  could you please help me with an idea of tracking.
 
  On Tue, May 1, 2012 at 2:22 PM, Mark Murphy mmur...@commonsware.com
 wrote:
 
  This has nothing to do with Android. There is no method on TimerTask
  to tell you it is canceled, so you will need to track that yourself by
  some other means.
 
  On Mon, Apr 30, 2012 at 8:16 PM, Mai Al-Ammar mai.alam...@gmail.com
  wrote:
   Hello every one,
  
   I have a simple question about timer in Android, How can I know if the
   timer
   is stopped or not?
   I have an if statement which see if some condition is satisfied, then
 it
   will stop the timer by :
   if(timerTask != null)
   timerTask.cancel();
   I want to check after calling the timer if the timer is stopped or
 not?
  
   Please help me
  
   thanks in advance
  
   --
   Mai A. Al-Ammar
   Teacher Assistant
   Imam Mohammad bin Saud Islamic University
   College of Computer Science
  
   --
   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
 
 
 
  --
  Mark Murphy (a Commons Guy)
  http://commonsware.com | http://github.com/commonsguy
  http://commonsware.com/blog | http://twitter.com/commonsguy
 
  Android App Developer Books: http://commonsware.com/books
 
  --
  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
 
 
 
 
  --
  Mai A. Al-Ammar
  Teacher Assistant
  Imam Mohammad bin Saud Islamic University
  College of Computer Science
 
  --
  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 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




-- 
Mai A. Al-Ammar
Teacher Assistant
Imam Mohammad bin Saud Islamic University
College of Computer Science

-- 
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

Re: [android-developers] Timer in Android

2012-05-01 Thread Mark Murphy
This has nothing to do with Android. There is no method on TimerTask
to tell you it is canceled, so you will need to track that yourself by
some other means.

On Mon, Apr 30, 2012 at 8:16 PM, Mai Al-Ammar mai.alam...@gmail.com wrote:
 Hello every one,

 I have a simple question about timer in Android, How can I know if the timer
 is stopped or not?
 I have an if statement which see if some condition is satisfied, then it
 will stop the timer by :
 if(timerTask != null)
 timerTask.cancel();
 I want to check after calling the timer if the timer is stopped or not?

 Please help me

 thanks in advance

 --
 Mai A. Al-Ammar
 Teacher Assistant
 Imam Mohammad bin Saud Islamic University
 College of Computer Science

 --
 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



-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android App Developer Books: http://commonsware.com/books

-- 
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


Re: [android-developers] Timer in Android

2012-05-01 Thread Mai Al-Ammar
I tried to track it by myself but I could not :(
could you please help me with an idea of tracking.

On Tue, May 1, 2012 at 2:22 PM, Mark Murphy mmur...@commonsware.com wrote:

 This has nothing to do with Android. There is no method on TimerTask
 to tell you it is canceled, so you will need to track that yourself by
 some other means.

 On Mon, Apr 30, 2012 at 8:16 PM, Mai Al-Ammar mai.alam...@gmail.com
 wrote:
  Hello every one,
 
  I have a simple question about timer in Android, How can I know if the
 timer
  is stopped or not?
  I have an if statement which see if some condition is satisfied, then it
  will stop the timer by :
  if(timerTask != null)
  timerTask.cancel();
  I want to check after calling the timer if the timer is stopped or not?
 
  Please help me
 
  thanks in advance
 
  --
  Mai A. Al-Ammar
  Teacher Assistant
  Imam Mohammad bin Saud Islamic University
  College of Computer Science
 
  --
  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



 --
 Mark Murphy (a Commons Guy)
 http://commonsware.com | http://github.com/commonsguy
 http://commonsware.com/blog | http://twitter.com/commonsguy

 Android App Developer Books: http://commonsware.com/books

 --
 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




-- 
Mai A. Al-Ammar
Teacher Assistant
Imam Mohammad bin Saud Islamic University
College of Computer Science

-- 
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

Re: [android-developers] Timer in Android

2012-05-01 Thread Kristopher Micinski
what did you try?

How did it not work?

Did you set a flag somewhere before calling cancel?

Or what?

kris

On Tue, May 1, 2012 at 7:49 AM, Mai Al-Ammar mai.alam...@gmail.com wrote:
 I tried to track it by myself but I could not :(
 could you please help me with an idea of tracking.

 On Tue, May 1, 2012 at 2:22 PM, Mark Murphy mmur...@commonsware.com wrote:

 This has nothing to do with Android. There is no method on TimerTask
 to tell you it is canceled, so you will need to track that yourself by
 some other means.

 On Mon, Apr 30, 2012 at 8:16 PM, Mai Al-Ammar mai.alam...@gmail.com
 wrote:
  Hello every one,
 
  I have a simple question about timer in Android, How can I know if the
  timer
  is stopped or not?
  I have an if statement which see if some condition is satisfied, then it
  will stop the timer by :
  if(timerTask != null)
  timerTask.cancel();
  I want to check after calling the timer if the timer is stopped or not?
 
  Please help me
 
  thanks in advance
 
  --
  Mai A. Al-Ammar
  Teacher Assistant
  Imam Mohammad bin Saud Islamic University
  College of Computer Science
 
  --
  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



 --
 Mark Murphy (a Commons Guy)
 http://commonsware.com | http://github.com/commonsguy
 http://commonsware.com/blog | http://twitter.com/commonsguy

 Android App Developer Books: http://commonsware.com/books

 --
 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




 --
 Mai A. Al-Ammar
 Teacher Assistant
 Imam Mohammad bin Saud Islamic University
 College of Computer Science

 --
 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 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


[android-developers] Timer in Android

2012-04-30 Thread Mai Al-Ammar
Hello every one,

I have a simple question about timer in Android, How can I know if the
timer is stopped or not?
I have an if statement which see if some condition is satisfied, then it
will stop the timer by :
if(timerTask != null)
timerTask.cancel();
I want to check after calling the timer if the timer is stopped or not?

Please help me

thanks in advance

-- 
Mai A. Al-Ammar
Teacher Assistant
Imam Mohammad bin Saud Islamic University
College of Computer Science

-- 
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

Re: [android-developers] Timer in Android

2012-04-30 Thread James Black
I would create a remote service for the timer, and query it, since it would
run independently from the activity.
On Apr 30, 2012 8:16 PM, Mai Al-Ammar mai.alam...@gmail.com wrote:

 Hello every one,

 I have a simple question about timer in Android, How can I know if the
 timer is stopped or not?
 I have an if statement which see if some condition is satisfied, then it
 will stop the timer by :
 if(timerTask != null)
 timerTask.cancel();
 I want to check after calling the timer if the timer is stopped or not?

 Please help me

 thanks in advance

 --
 Mai A. Al-Ammar
 Teacher Assistant
 Imam Mohammad bin Saud Islamic University
 College of Computer Science

 --
 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 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

Re: [android-developers] Timer in Android

2012-04-30 Thread Mai Al-Ammar
Thank you but I don't understand what did you mean :(


On Tue, May 1, 2012 at 3:57 AM, James Black planiturth...@gmail.com wrote:

 I would create a remote service for the timer, and query it, since it
 would run independently from the activity.
 On Apr 30, 2012 8:16 PM, Mai Al-Ammar mai.alam...@gmail.com wrote:

 Hello every one,

 I have a simple question about timer in Android, How can I know if the
 timer is stopped or not?
 I have an if statement which see if some condition is satisfied, then it
 will stop the timer by :
 if(timerTask != null)
 timerTask.cancel();
 I want to check after calling the timer if the timer is stopped or not?

 Please help me

 thanks in advance

 --
 Mai A. Al-Ammar
 Teacher Assistant
 Imam Mohammad bin Saud Islamic University
 College of Computer Science

 --
 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 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




-- 
Mai A. Al-Ammar
Teacher Assistant
Imam Mohammad bin Saud Islamic University
College of Computer Science

-- 
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

[android-developers] timer on sip calling

2012-02-24 Thread Jagruti Sangani
hello,
I want to start the timer when the call will establish and the timer
will stop when the call will end by other party.Can anybody know how
to do this.same as when the call is come in our mobile and the second
is display continuesly till the call will end.

-- 
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


Re: [android-developers] timer on sip calling

2012-02-24 Thread Uberall, Android

Dear Jagruti madam,

You can do it by using the PhoneStateListener call and start timer when 
call receives and call end.


Now u can use it by overriding the onCallStateChanged() method for your 
purpose.


I hope it will be sufficient for you.


Thanks  Regards
Prashant B Lal.

On 24-02-2012 14:39, Jagruti Sangani wrote:

hello,
I want to start the timer when the call will establish and the timer
will stop when the call will end by other party.Can anybody know how
to do this.same as when the call is come in our mobile and the second
is display continuesly till the call will end.



--
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


Re: [android-developers] timer,thread,imageview in android

2012-02-04 Thread Farhan Tariq
explain your requirements please...

from what i can get from your subject, what you could do is have an async
task download images and update an imageView. Call that imageView from a
thread that sleeps for 5 seconds in a while loop... something rughly like
this (it has a Lot of errors, wrote it just to give you an idea, hope it
helps)

public class ImageSetter extends Activity{


public void onCreate(){
   imageView = (ImageView) findViewById(R.id.myImageView);
   while(true){
  new MyAsyncDownloader(url).execute();
  Thread.sleep(5000);

   }
}


private class MyAsyncDownloader extends ASyncTaskVoid,Void,Void{
private Bitmap bitmap;
private String url;
  public MyASyncDownloader(String url){
this.url = url;
  }
  doInBackground(){
bitmap = downloadImage(url);
  }

  onPostExecute(){
// set bitmap as background of imageView
  }
}

}

2012/2/4 Salih Selametoglu barbooni...@gmail.com

 hello my friends,

 i wanna create image every five secends and destroy it after 3 seconds.

 How can i do it? can you help me?

 --
 Salih SELAMETOĞLU
 Teknopalas RFID Yazılım Çözümleri / Yazılım Uzman Yardımcısı
 İstanbul Üni. Bil. Müh. 4. Sınıf
 http://www.linkgizle.com
 http://selametoglu.blogspot.com/
 http://slideme.org/application/light-show (first application)

 --
 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 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

[android-developers] timer,thread,imageview in android

2012-02-03 Thread Salih Selametoglu
hello my friends,

i wanna create image every five secends and destroy it after 3 seconds.

How can i do it? can you help me?

-- 
Salih SELAMETOĞLU
Teknopalas RFID Yazılım Çözümleri / Yazılım Uzman Yardımcısı
İstanbul Üni. Bil. Müh. 4. Sınıf
http://www.linkgizle.com
http://selametoglu.blogspot.com/
http://slideme.org/application/light-show (first application)

-- 
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


[android-developers] timer popup sound sometime delayed when phone enters locked state

2011-10-18 Thread John Goche
Hello,

I am using a timer to popup a window on an android smartphone (LG Nexus
One).
However I come across the following problem from time to time: sometimes
when
the phone is locked and is in standby mode because I haven't touched it for
a while
the popup's ringtone does not start until I unblock the phone. Essentially
the alarm
fires as soon as I unlock the phone by pushing the lockup screen upwards
with the
finger so it ends up firing up late sometimes. Strangely this does not
happen all the time.

Anyone come across this problem?

John Goche

-- 
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

Re: [android-developers] timer for implementing projectile motion

2011-10-17 Thread Justin Anderson
* Can anyone please suggest me the type of android's predefined  timer
 to be used for implementing projectile motion or do I need to write a
 custom timer.*

java.util.Timer
java.util.TimerTask
android.os.CountDownTimer

*Note: I found these by going to developer.android.com and typing Timer in
the search box...*

* Also please let me know  the range of initial velocity V
 which can be used for assumption.*

Seriously?

I would also highly recommend this link:
http://www.catb.org/~esr/faqs/smart-questions.html

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Sun, Oct 16, 2011 at 10:13 PM, ruchira ruchira...@gmail.com wrote:

 Can anyone please suggest me the type of android's predefined  timer
 to be used for implementing projectile motion or do I need to write a
 custom timer.Also please let me know  the range of initial velocity V
 which can be used for assumption.

 --
 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 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

[android-developers] timer for implementing projectile motion

2011-10-16 Thread ruchira
Can anyone please suggest me the type of android's predefined  timer
to be used for implementing projectile motion or do I need to write a
custom timer.Also please let me know  the range of initial velocity V
which can be used for assumption.

-- 
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


[android-developers] Timer problem

2011-07-19 Thread Salih Selametoglu
Hello every android :) i have got a problem that is about timer. I
wanna change image every 10 seconds but i have not done yet. I can try
to use Timer but i couldnt. Is there any body  to help me?


Salih SELAMETOĞLU
İstanbul University
Computer Engineering - #4

-- 
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


Re: [android-developers] Timer problem

2011-07-19 Thread TreKing
On Tue, Jul 19, 2011 at 8:59 AM, Salih Selametoglu barbooni...@gmail.comwrote:

  I wanna change image every 10 seconds but i have not done yet. I can
 try to use Timer but i couldnt.


Why couldn't you?

-
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

Re: [android-developers] Timer problem

2011-07-19 Thread Salih Selametoglu
i think i am writing wrong code

-- 
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


Re: [android-developers] Timer problem

2011-07-19 Thread Salih Selametoglu
i write code but not re-run.  Only it once runs


 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



-- 
Salih SELAMETOĞLU
Teknopalas RFID Yazılım Çözümleri / Yazılım Uzman Yardımcısı
İstanbul Üni. Bil. Müh. 4. Sınıf
+90 537 279 6412

-- 
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


Re: [android-developers] Timer problem

2011-07-19 Thread Salih Selametoglu
ok. It have been solved. I used Runnable and Handler class.

-- 
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


Re: [android-developers] Timer problem

2011-07-19 Thread TreKing
You're welcome.

-
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

[android-developers] Timer

2011-05-30 Thread khanh_qhi™
Hi there,
I need a counter time in my application. Is there any time Counter?

-- 
Regards,
Khanh.

-- 
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

Re: [android-developers] Timer

2011-05-30 Thread Tiago Maluta
Did you checked?
http://developer.android.com/reference/java/util/Timer.html
http://developer.android.com/reference/java/util/TimerTask.html

import java.util.Timer;
import java.util.TimerTask;

// ...

Timer timer1 = new Timer(); 
timer1.schedule(new Task(), 0, 3*1000); /* 3 seconds */

// ...

class Task extends TimerTask {
Task() {}
public void run() { /* your code */ }
}

--tm




On Mon, May 30, 2011 at 12:16 PM, khanh_qhi™ khanhqh20...@gmail.com wrote:
 Hi there,
 I need a counter time in my application. Is there any time Counter?

 --
 Regards,
 Khanh.

 --
 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 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


[android-developers] Timer

2011-05-24 Thread shanmu nathan
Hi guys,
i need to show the stop watch when i clicks the button.. can
anybody help me..

-- 
With Regards,

SHANMUGANATHAN. A
Software Engineer Trainee,
Citrisys Solution,
Phone: +91.44.22311173
Mail To: sayyadu...@citrisys.com

-- 
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

Re: [android-developers] Timer

2011-05-24 Thread Mohammed Hossain Doula
http://developer.android.com/resources/articles/timed-ui-updates.html

http://developer.android.com/resources/articles/timed-ui-updates.html
http://steve.odyfamily.com/?p=12

On Tue, May 24, 2011 at 1:16 PM, shanmu nathan win.sha...@gmail.com wrote:

 Hi guys,
 i need to show the stop watch when i clicks the button.. can
 anybody help me..

 --
 With Regards,

 SHANMUGANATHAN. A
 Software Engineer Trainee,
 Citrisys Solution,
 Phone: +91.44.22311173
 Mail To: sayyadu...@citrisys.com


  --
 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




-- 
*--
Mohammed Hossain Doula
Software Engineer
desme INC.*
*www: http://www.hossaindoula.com
@: ron...@desme.com*
*facebook: http://www.facebook.com/ROnyWorld*
*twitter: http://www.twitter.com/hossaindoula*
*blogspot: hossaindoula.blogspot.com
GSM: 00880-167-4347101*

-- 
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

[android-developers] Timer task not being performed accurately

2011-02-11 Thread Parashar
I am trying to perform basic task of rotating a canvas 20 times a
second using timer but it doesn't seem to be working properly and its
lagging. for example, if I rotate rectangle 0.3 degrees per 50 ms it
should rotate 6 degree in on second, but that is not the case. It
really slow in rotation. Here is my sample code:

//Code for update task
class UpdateTimeTask extends TimerTask {
   public void run() {
   hndView.post(new Runnable() {
public void run() {
hndView.invalidate(); //this code invalidates 
custom
view that calls onDraw to draw rotated hand
}
  });
   }
}

//Code for onDraw method of custom view that needs to be update
@Override protected void onDraw(Canvas canvas) {
super.onDraw(canvas);

ang = ang + inc; //ang is angle to rotate and inc is float 
value of
0.3 degree to be incremented
if (ang = 360) ang = ang - 360;
canvas.rotate(ang, canvas.getWidth()/2, canvas.getHeight()/2);
canvas.drawRect((canvas.getWidth()/2 - 2), 
(canvas.getHeight()/2 -
125), (canvas.getWidth()/2 + 2), (canvas.getHeight()/2 + 10),
mTextPaint);
canvas.restore();

}

//code to schedule task
Timer timer = new Timer();
UpdateTimeTask tt = new UpdateTimeTask();
timer.schedule(tt, 0, 50);


Can anyone please tell me what am I doing wrong here? Should I used
different approach to perform this task? Because its hard to believe
that you cannot have simple smooth rotation of rectangle 20 times in
one second.

-- 
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


[android-developers] Timer Question

2011-01-25 Thread bklik
I have lots of issues with my egg timer application.

I started by just writing the application all in an action. That of
course didn't work because once the user left the application, it
would get garbage collected after a while and longer timers would
fail.

So, I tried a Service. My main Activity handles all the UI stuff and
binds to a Service. The user enters in the amount of time they want
the egg timer to fun for, and that time gets handed off to the
service.

The Service has a timer that deducts time every second until it
reaches zero, then plays a sound. Only, somehow it randomly never gets
there. Sometimes it'll work for a three hour countdown, other times
it'll stop working after only 30 minutes. I've put Log.d() all over
the place where things get stopped or destroyed but they never show
up.

Does a timer get stopped and garbage collected independed of an
Activity or Service? Is there a simple example of a persistent
countdown timer out there?

Thanks,

Brenton

-- 
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


Re: [android-developers] Timer Question

2011-01-25 Thread Kostya Vasilyev
Using a Java Timer in an Android application has some drawbacks: one, it 
invokes the callback on a worker thread, two, it stops if the process is 
killed.


Take a look at AlarmManager - it's reliable even if the application is 
killed, and uses an Android-specific notification mechanism when it fires.


http://developer.android.com/reference/android/app/AlarmManager.html

-- Kostya

25.01.2011 19:44, bklik пишет:

I have lots of issues with my egg timer application.

I started by just writing the application all in an action. That of
course didn't work because once the user left the application, it
would get garbage collected after a while and longer timers would
fail.

So, I tried a Service. My main Activity handles all the UI stuff and
binds to a Service. The user enters in the amount of time they want
the egg timer to fun for, and that time gets handed off to the
service.

The Service has a timer that deducts time every second until it
reaches zero, then plays a sound. Only, somehow it randomly never gets
there. Sometimes it'll work for a three hour countdown, other times
it'll stop working after only 30 minutes. I've put Log.d() all over
the place where things get stopped or destroyed but they never show
up.

Does a timer get stopped and garbage collected independed of an
Activity or Service? Is there a simple example of a persistent
countdown timer out there?

Thanks,

Brenton




--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

--
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


Re: [android-developers] Timer Question

2011-01-25 Thread Marcin Orlowski
On 25 January 2011 17:44, bklik brenton.k...@gmail.com wrote:

 So, I tried a Service. My main Activity handles all the UI stuff and
 binds to a Service. The user enters in the amount of time they want
 the egg timer to fun for, and that time gets handed off to the
 service.

You definitely are looking for this:
http://developer.android.com/reference/android/app/AlarmManager.html

-- 
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


[android-developers] Timer + App updated

2010-09-27 Thread Will
Hi,

I would like to know how to intercept the event that the apk has been
updated in order to launch again my Timer.

Indeed, I have a Timer wich is scheduledAtFixedRate, but when my App
is updated through the market, the timer is killed ; and if the user
doesn't launch the App, the timer is not started (so my app becomes
useless...).

How could I do to avoid it ? Is there an event to catch the App
updated ? I searched, tried, but nothing.

Thanks a lot for your help.

Regards,
--
Will

-- 
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


Re: [android-developers] Timer + App updated

2010-09-27 Thread TreKing
On Mon, Sep 27, 2010 at 3:07 PM, Will w.rou...@gmail.com wrote:

 Is there an event to catch the App updated ? I searched, tried, but
 nothing.


http://developer.android.com/reference/android/content/Intent.html#ACTION_PACKAGE_REPLACED

Though I somehow doubt the app being installed will itself receive the
broadcast.

-
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

[android-developers] Timer in an App

2010-08-31 Thread chetan
Hi All,
   I am creating an App in which i need to add a timer for
postpone the one event for 1 hr and start same event after 1 hr , so i
want to know how i can implement the same. Are there any Timer api's
and handling of them in android.

Thanks
Chetan Chauhan

-- 
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


Re: [android-developers] Timer in an App

2010-08-31 Thread Mark Murphy
Use AlarmManager.

On Tue, Aug 31, 2010 at 2:02 AM, chetan chetanchauha...@gmail.com wrote:
 Hi All,
           I am creating an App in which i need to add a timer for
 postpone the one event for 1 hr and start same event after 1 hr , so i
 want to know how i can implement the same. Are there any Timer api's
 and handling of them in android.

 Thanks
 Chetan Chauhan

 --
 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




-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Development Wiki: http://wiki.andmob.org

-- 
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


[android-developers] Timer / threads / reliability

2010-03-04 Thread Neilz
Hi all. I have an activity that uses a Timer (java.util.Timer) to
control the display. I set it off to repeat its run() method every
second or so. When it runs, it updates some View elements.

As Timer runs in its own thread, I assumed this would be reliable. But
I notice that sometimes there is a stutter, or delay, in the views
updating. It's like they occasionally get stacked up, and all happen
together. Studying the output from logcat, I notice that this happens
when the device is doing something else - some system functions, or
sometimes a garbage collection.

How can I avoid this? I'm not aware I can run the main activity in a
thread of its own, can I? If the timer has its own thread, why is it
affected?

Any help appreciated!

-- 
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


Re: [android-developers] Timer / threads / reliability

2010-03-04 Thread Mark Murphy
Neilz wrote:
 Hi all. I have an activity that uses a Timer (java.util.Timer) to
 control the display. I set it off to repeat its run() method every
 second or so. When it runs, it updates some View elements.
 
 As Timer runs in its own thread, I assumed this would be reliable. But
 I notice that sometimes there is a stutter, or delay, in the views
 updating. It's like they occasionally get stacked up, and all happen
 together. Studying the output from logcat, I notice that this happens
 when the device is doing something else - some system functions, or
 sometimes a garbage collection.
 
 How can I avoid this? 

You can't.

 I'm not aware I can run the main activity in a
 thread of its own, can I? If the timer has its own thread, why is it
 affected?

Because the UI is drawn on the main application thread.

Whenever you make a change to the UI -- such as calling setText() on a
TextView -- think of it as putting a message on a message queue that is
processed in a message loop by the main application thread.

All your Timer is doing is triggering some messages to go into that
queue on a periodic basis. How quickly those messages will be popped off
the queue and processed depends on what else is in the queue, how much
time those other things in the queue take (including time in your
activity and listener callback methods), what else is being done in
threads in your application, and what else is being done in other
processes on the device.

You can simplify your current implementation by dumping the Timer and
using postDelayed() to trigger your updates, for what that's worth.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android App Developer Training: http://commonsware.com/training

-- 
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


[android-developers] Timer cause memory leak

2010-02-26 Thread James Wang
I have three activities:MyFirstActivity(click)-MyActivity(timer)-
MyNextActivity.
And I noticed Timer cause MyActivity memory leak when digging through
hprof in Eclipse.
Below is my codes:
public class MyActivity extends Activity {

private Timer timer = new Timer();

protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TimerTask task = new TimerTask() {
public void run() {
Intent intent = new Intent();

intent.setClassName(getPackageName(),
MyNextActivity.class.getName());
startActivity(intent);
finish();
}
};
timer.schedule(task, INTERVAL_TIME);
}

public void onDestroy() {
super.onDestroy();
//memory leaking happens if there is not below.
//timer = null;
}
}

If I did set timer to null in onDestroy, MyActivity will always exist
in heap. I did the flow four times and found four timers and four
MyActivity instances in heap.

Who can tell me why?

-- 
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


[android-developers] Timer problem

2010-02-09 Thread satish bhoyar
Hi all,

I am trying to work with Timer. My use case is
I am dynamically updating the Layout  after some delay i will be loading
the new updated layout. I put the Timer but it is not working correctly

this is the timer code

  timer.schedule(new TimerTask() {
public void run() {
//fourcellview();
fourcellview(A,B,C,D);
}
}, 1000);
.
Right now it stays in the same for long time. As per explanation of the
method schedule the second param is in milisec. But it stays in same state
for long time.

thanks
satish

-- 
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

[android-developers] Timer and Timer Task

2010-01-22 Thread nikhil
I am using a timer in my app. I wish to vary the interval or period
with which the timer task runs. Like when my app is being used the
timer task is scheduled at say 1 sec while the moment user exits the
app the service changes the timer to 5 seconds.

Currently, I am cancelling the previous timer and create a new timer
instance with new period. I dont know if this is efficient way to do
it because for some reason the timer messes up and it sometimes hits
more than twice per second..when its suppose to hit every 5 seconds.

Is there a better way to vary the interval or period by using the same
timer variable through out?

My Timer is in the service which I have created to run in the
background.

-- 
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


[android-developers] Timer

2009-12-03 Thread Sasikumar.S
Hi,

How to get whether timer is runnning or not?...

That means How to get whether timer is scheduled or not?...

-- 
Thanks  Regards
Sasikumar.S

-- 
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

[android-developers] Timer not available

2009-08-14 Thread Honest

Hello,

I came to know about Timer in android. I read
http://android-developers.blogspot.com/2007/11/stitch-in-time.html
that Timer is not available at Runtime.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[android-developers] Timer TimerTask latency

2009-07-17 Thread Jason Proctor

seems like i'm running into some latency issues with the regular Java 
Timer and TimerTask classes. does Android have preferred classes for 
doing the same kind of thing?

tx
-- 
jason.software.particle

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[android-developers] Timer doesn't work

2009-05-04 Thread kaloer

Hi,
I am using a Timer in my android application, but i can't get it to
work. When I start my application the Timer simply does not start. The
application continues but does not update.

The long toStart finds the number of seconds left of the current
minute, and thereafter the period is set to 60 seconds. The TimerTask
simply calls a method.

This is the first part of the class containing the Timer:

public class infoUpdate extends Activity {

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final Calendar cal = Calendar.getInstance();
updateTime();
long toStart = ( 60 - cal.get(Calendar.SECOND) ) * 1000;
Timer firstTimer = new Timer(false);
firstTimer.schedule(new TimerTask() {
@Override
public void run() {
updateTime();
}
}, toStart, 6);
}




-
Thank you very much,
//Kaloer

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[android-developers] Timer Help (Time Stamp my code)

2009-04-24 Thread mcmc

Hi, I'm trying to put a timer in my code to determine the amount of
time it takes to execute a block of code.

I've tried googling up some ideas, but they are all related to
scheduling tasks, which is not what I want.

I want to, perhaps, place a time stamp in different parts of my code.
How can I do this?

Any help is greatly appreciated. :)
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---