Android Question Time difference based on latitude and longitude

khwarizmi

Active Member
Licensed User
Longtime User
Hi all

How can I use the GNSS library to obtain the time in another country, taking into account the time in my country based on latitude and longitude?
 

udg

Expert
Licensed User
Longtime User
knowing that my application relates to exams for students in different countries and they must sit for the electronic exam at the same time.
I would have suggested to investigate whether a BLE Beacon (or similar) could be a viable solution.
I mean, each classroom has its own beacon with RTC feature.
Students enter the room, scan for the beacon and your app knows exactly where they are and what time is it
 
Upvote 0

khwarizmi

Active Member
Licensed User
Longtime User
DateTime.Now depends on the timing of the device, and the student may manipulate the timing.
In my system, students download the exam file in advance, and are only allowed to enter at the time specified for the start of the exam, and there is a password that they receive at the time of the exam.
At the end of the exam, the application sends the students’ answers. If an Internet failure occurs at the moment of sending, the application keeps a copy of the answers to be sent later.
As much as possible, I tried to limit Internet tasks to specific times.
 
Upvote 0

udg

Expert
Licensed User
Longtime User
Yes, beacons. AFAIK, there are beacons sporting an RTC clock on board.
My idea is that your app let the user select the place where he/she is to attend the exam. The beacon is used to validate the place and read local time. If place and time are correct the exam is allowed.
Basically they will need to download and install your app when and where there is good connection.
Then beacons will be used as traffic lights to allow or deny partecipation to a given exam session.
The app collects data.
When Internet link is available, app transmit data to your server.

So, beacons are used to confirm that a candidate is in the right place at the right time.
 
Upvote 0

QSerg

Member
Time zone map is VERY strange and irregular. Look for example at Singapore. Using longitude and latitude with some "magic" formula will render almost useless result.
 
Upvote 0

mjcoon

Well-Known Member
Licensed User
Yes, it's quite political; the times as actually used by residents rather than solar time. BTW Surely Daylight Savings Time is used in summer, not winter (in UK, for instance). That's because there is then more daylight than a normal working day, so there is some scope for shuffling the clocks around to get a better fit.
 
Upvote 0

rabbitBUSH

Well-Known Member
Licensed User
Hi all

How can I use the GNSS library to obtain the time in another country, taking into account the time in my country based on latitude and longitude?
Timeanddate.com has these and an expensive API set. One of their online calculators does what you describe. They say this as well, see the quote below : (maybe one of these two places will share time calculator methods publicly. Navy people must need to do this. The observatory at Greenwich as well. Ask them.)

For astronomical calculations, we use algorithms developed by the US Naval Observatory and NASA's Jet Propulsion Laboratory.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…