I would like to set my phone’s system time based on the current location position. I’m planing on usine one of the B4A GPS libraries. Is it possible to do this programically? Is there a B4A library that will allow me to do it?
Just before you (and others) put too much effort in on this, perhaps check your phone's settings, because it should already be setting the time according to your network service provider anyway:
which will usually be the same time as "based on the current location position". Or are you doing some celestial calculations or similar?
My experience with GSM has been that, upon arrival at an airport and turning off airplane/flight mode, the phone then spots the various networks, chooses one that it likes (strongest signal? affiliated with SIM service provider?) and updates the time accordingly. You do not need a SIM or account with the overseas cell carriers.
I have not done/tried this with NO SIM installed. I've read that emergency calls are still possible, so it is entirely possible that the time update will still work too.
if the mobile network don't work within the country then i think its a no, but if you connect to a wifi with gps on then google map will pinpoint your location
gmaps knows your location but not the time lol
If the phone is in airplane mode, I would expect not. Mind you, GPS isn't going to work so well inside a big metal tube anyway. There's usually an onboard tv channel showing the plane on a global map, so you could always (shock, horror) manually update the phone's time zone as you cross the various lines.
GPS signal includes time (always has, always will) that is more accurate than anything you're ever going to get outside of a standards laboratory, but you've got me wondering now: does Android use that info? Only problem I can see is that the time zone boundaries wiggle about a bit, so it would need a decent database to match geographic location to time zone correctly (cf defaulting to 15-degrees-wide hourly zones).
Nice app, but it does require root. I already made an app that requires the current time to match the time zone to give alerts to the user is in and would love to include this functionality as part of the app only if it didn't require the user to root their phone.
Really? Spewin :-/ I did see something about using the alarm clock service to set the time, but didn't read the detail. Let me check my browser history... never know your luck in the big city