How to switch the app in sleep mode ?

Put your problem here if it does not fit any of the other categories.

How to switch the app in sleep mode ?

Postby mork » Tue Jan 05, 2010 7:30 pm

Hy Guys,

i try to learn "Android-Java" - and i have the following problem:

my program get some gps-values,
and send it to a server - after it,
the programm must sleep for 30minutes.
In this time, the GPS turned off.

My code

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. while (true){
  3.  
  4.  
  5.  
  6.  
  7.  
  8. //do ....
  9.  
  10.  
  11.  
  12. Thread.Sleep(time in ms);
  13.  
  14. }
  15.  
  16.  
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


Will not work -.-

Can anyone try to explain:
- a solution for "Sleep"
- goes the App into a "halt" status, so the battery will not be drily ?

cu,
mont
mork
Freshman
Freshman
 
Posts: 2
Joined: Tue Jan 05, 2010 7:21 pm

Top

Postby mork » Wed Jan 06, 2010 9:41 pm

damn... okay.. it was easy...

but... when it goes to sleep,
the app cannot do any events,
so the system says "[...] [force close] [wait]"

in VB.NET i can write Application.DoEvents() - ...and in Java ?

Thanks,
mork
mork
Freshman
Freshman
 
Posts: 2
Joined: Tue Jan 05, 2010 7:21 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 22 guests