Tuesday, December 18, 2012

ADF Mobile - Geo Location Synchronization

Here you can read about ADF Mobile application enabled with geo location features - GPS and Google Maps - ADF Mobile - Geo Location and Google Maps App. I would like to post update for this application where geo location is synchronized automatically, directly updating your position on Google Maps screen. Few minor usability updates are included as well - conditional check for 3G/Wi-Fi network and GPS availability.

Download version 2 for ADF Mobile Geo Location and Google Maps application - ADFMobileGoogleMaps_v2.zip. This update contains code to check if 3G/Wi-Fi and GPS functionality is available - displayed on UI:


Show button is enabled only if 3G/Wi-Fi connection is available, otherwise Google Maps are unaccessible. Start button is enabled only if GPS is available - location will be calculated only with active GPS signal.

Initial position is retrieved from GPS, this position is displayed on the map:


You don't need to switch back and request position correction - keep Google Maps window open, when GPS data will be recalculated - position will be refreshed and displayed automatically:


Go back to initial position screen, you can review synchronized location coordinates there:


3G/Wi-Fi network status is retrieved from ADF Mobile API directly - deviceScope.hardware.networkStatus:


Similar for GPS signal status - deviceScope.hardware.hasGeolocation:


GPS position synchronization is quite straightforward - method from pageFlowScope bean updates center coordinates:


Property Change Support listener is responsible to push data changes to the UI:


Point location layer from ADF Mobile maps component is mapped directly with pageFlowScope bean coordinates data - this allows to reload location point, when location coordinares are changing:


5 comments:

  1. Hi Andrejus,
    I have tested your app on Android (Samsung Tablet) and it work fine. Great job!

    Augustin

    ReplyDelete
  2. Hi Andrejus,

    This is really a nice post.
    I am looking if it is possible to to shown a line between my current position and some other place required place. My main aim is to calculate the distance between my current position and destination place ?

    Regards,
    Deepak

    ReplyDelete
  3. When I am clicking "Start" button in Position screen, I am getting following Error

    "Unable to monitor changes in the device's position"

    I am getting same error both in phone and tablet. can you please suggest what is the cause of this error?

    Thanks
    slokam

    ReplyDelete
  4. Hi Andrejus,

    This is really a very nice post. Is there way to update the the location on the google map without going to position view and come back to map view? I couldn't find a way to do that.

    regards,

    Bala

    ReplyDelete
  5. How can I get the coordinates from any point in the map? I need something like tapping anywhere in the map and get the coordinates. Hope you can help me!

    ReplyDelete