Hi Friends,
My requirement:-
I am looking for a solution to retrieve the device's latitude and longitude and write it to a remote database SILENTLY.
I don't want the device to write the Lat and Long to the remote database in a scheduled manner, for eg every 15 minutes or 30 minutes, INSTEAD, whenever a DESKTOP APP user demands the location of the device, my B4A app should write the Lat and Long to the remote database. My total solution is a mix of desktop app and B4A app.
Whenever the DESKTOP application requests for the Android device's location, the B4A app should write the lat and long to the remote database without any notification on the B4A app ie the B4A user should be totally unaware that a location request has come from the Desktop app and the B4A provided those information.
Hope I made my requirements clear.
After giving some thoughts, I have come up with an idea but not sure whether this is the right solution or not, OR is there any other better solutions to achieve the above said requirement.
The B4A app after receiving this GCM message should not show any notification on the B4A app, it will silently update the remote database with the device's latitude and longitude. Once the remote database is updated with the device's current latitude and longitude, I can show the device's location on the DESKTOP application.
If the above said GCM Service can serve the pupose, then I don't know
Any help will be appreciated.
Regards
Anser
My requirement:-
I am looking for a solution to retrieve the device's latitude and longitude and write it to a remote database SILENTLY.
I don't want the device to write the Lat and Long to the remote database in a scheduled manner, for eg every 15 minutes or 30 minutes, INSTEAD, whenever a DESKTOP APP user demands the location of the device, my B4A app should write the Lat and Long to the remote database. My total solution is a mix of desktop app and B4A app.
Whenever the DESKTOP application requests for the Android device's location, the B4A app should write the lat and long to the remote database without any notification on the B4A app ie the B4A user should be totally unaware that a location request has come from the Desktop app and the B4A provided those information.
Hope I made my requirements clear.
After giving some thoughts, I have come up with an idea but not sure whether this is the right solution or not, OR is there any other better solutions to achieve the above said requirement.
- I already use Google Cloud Mesaging (GCM) in B4A
- I am able to send GCM messages from the DESKTOP application to B4A app
- I already use FusedLocationProvider in many activities in the B4A app.
The B4A app after receiving this GCM message should not show any notification on the B4A app, it will silently update the remote database with the device's latitude and longitude. Once the remote database is updated with the device's current latitude and longitude, I can show the device's location on the DESKTOP application.
If the above said GCM Service can serve the pupose, then I don't know
- How to get the Lat/Long from FusedLocationProvider without showing/using any activity screen to the user.
- How to process the GCM message (demanding the location details) without showing any notification to the user.
Any help will be appreciated.
Regards
Anser
Last edited: