update location information
Hi. I connect GPS using jsr179(location based classes) and i update location informations using locationlistener.My problem is that:i want to update informations(coordinates) in a few seconds,but my application update in 40 seconds(average). As i said,i used locationlistener.
1- *lp.setLocationListener(this,5, -1, -1);*
2- *lp.setLocationListener(this,-1, -1, -1);*
I tried the methods above respectively. Are there any settings that i did not. How can i retrieve location updates in a few seconds and update them? Thanks.
(i thougth that maybe my phone's receiver is slow. But ,i found a few gps application on the net. They works like what i want to do..)
Re: update location information
[QUOTE=cenbek03;502204]Hi. I connect GPS using jsr179(location based classes) and i update location informations using locationlistener.My problem is that:i want to update informations(coordinates) in a few seconds,but my application update in 40 seconds(average). As i said,i used locationlistener.
1- *lp.setLocationListener(this,5, -1, -1);*
2- *lp.setLocationListener(this,-1, -1, -1);*
I tried the methods above respectively. Are there any settings that i did not. How can i retrieve location updates in a few seconds and update them? Thanks.
(i thougth that maybe my phone's receiver is slow. But ,i found a few gps application on the net. They works like what i want to do..)[/QUOTE]
You can do it by using the classes like TImer and TimerTask. Just create one class and method which will creat the oibject of Criteria and LocationProvider etc. create object of that class and then call its method continuously from run method of TImerTask class. You can give duration as you like. Let us know if there is any issue.
Re: update location information
i use Thread for receiving location updates. I don't try Timer or Timertask. What does Timer/Tmiertask do? i couldn't understand,because i use Thread.
Re: update location information
[QUOTE=cenbek03;503568]i use Thread for receiving location updates. I don't try Timer or Timertask. What does Timer/Tmiertask do? i couldn't understand,because i use Thread.[/QUOTE]
Using timer and TimerTask the method run of TimerTaks will be automatically invoked so you do not need to call some method continuously. If you are using Thread then you will have to call sleep method and you will have to do some work by yourself which is available inbuilt in these classses
Re: update location information
[QUOTE=cenbek03;502204]Hi. I connect GPS using jsr179(location based classes) and i update location informations using locationlistener.My problem is that:i want to update informations(coordinates) in a few seconds,but my application update in 40 seconds(average). As i said,i used locationlistener.
1- *lp.setLocationListener(this,5, -1, -1);*
2- *lp.setLocationListener(this,-1, -1, -1);*
I tried the methods above respectively. Are there any settings that i did not. How can i retrieve location updates in a few seconds and update them? Thanks.
(i thougth that maybe my phone's receiver is slow. But ,i found a few gps application on the net. They works like what i want to do..)[/QUOTE]
Can you show your Criteria object?