PDA

View Full Version : Need to Know Mobile is in Motion State


narasinga
05-04-2012, 02:55 AM
Hi Friends,

I Need to know is my blackberry mobile in Motion state or in Stay state.

How could i know this..

Dougsg38p
05-04-2012, 08:06 AM
Define "in motion state" and "in stay state"

What exactly are you trying to detect?

There are two possibilities, depending on what you are trying to accomplish: GPS or Accellerometer.

narasinga
05-04-2012, 11:29 PM
Hi currently i m implementing GPS Application and i need to stop gps for some time which is mobile is not in motion state. If mobile is in motion state then i have to start gps. To accomplish this object i need to know mobile is in motion or not..

My mobile doesn't support Accellerometer concept.. (9300) so i can't implement with this program..

hrbuckley
05-05-2012, 09:21 AM
The GPS will tell you when motion has stopped, within reason. One thing I have used to start the GPS up again is the change in current active cell which can be gotten from GPRSInfo or CDMAInfo on a periodic basis.

narasinga
05-06-2012, 11:31 PM
what is mean my current active cell? I need to implement same (have to start gps when user in motion).

hrbuckley
05-07-2012, 07:03 AM
A cell phone communicates with the network through one cell (a radio tower that interfaces the carriers network to the cellphone frequencies) at a time. A change from one cell to another, or a significant change in signal strength can indicate a change in location. You will need to develop a set of appropriate heuristics to determine when it is appropriate to start the GPS. Starting and stopping the GPS on a cycle shorter than 10 minutes actually takes more power than just letting it run.

If you are not familiar with these concepts I would suggest that you do some research into how mobile devices operate before taking on such a complex project.

narasinga
05-07-2012, 08:38 AM
can i use GPRSInfo.getCellInfo().getCellId() and GPRSInfo.getCellInfo().getLAC() methods to get the vary of different places?

hrbuckley
05-07-2012, 11:20 AM
GPRSInfo.getCellInfo().getCellId() will tell you what the current cell is. When it changes the phone will be talking to the network through a different cell. This may or may not indicate a change in location.

You may also want to look at your LocationProvider Criteria. If your provider supports Cellsite location based service then you could use that. Not all providers support this, and some that do charge extra for it. So like I said you need to do the research into what is available from your carrier(s) and on the phones you are developing for.