Android Question Use Google Timezone API

Discussion in 'Android Questions' started by Cebuvi, Jul 28, 2015.

  1. Cebuvi

    Cebuvi Member Licensed User


    Is it possible to use the Google TimeZone API to determine timezone from latitude/longitude?

    In what other way could be determined? (Without using the Google API)

  2. Erel

    Erel Administrator Staff Member Licensed User

  3. Cebuvi

    Cebuvi Member Licensed User

    Thank you,

    It works perfectly.
  4. DonManfred

    DonManfred Expert Licensed User

    can you share your solution for the other people who will search for such solution in future?
  5. Cebuvi

    Cebuvi Member Licensed User


    The first is to create or select a project in the Google Developers Console and enable the API for the TimeZone
    ( see the Erel link: )

    And this is the example of my code

    Sub Process_Globals
    'These global variables will be declared once when the application starts.
        'These variables can be accessed from all modules.

    End Sub

    Sub Globals
    'These global variables will be redeclared each time the activity is created.
        'These variables can only be accessed from this module.

    Private lblTexto As Label
    End Sub

    Sub Activity_Create(FirstTime As Boolean)

    Dim Fecha As Long
    Dim url, Lat, Lon, keyAPI As String
    Dim TZjob As HttpJob
    ' timestamp
    ' location
    ' Key API
        keyAPI=your code API
    "TZjob", Me)
    "" & Lat & "," & Lon & "&timestamp=" & Fecha & "&key=" & keyAPI

    End Sub
    Sub JobDone (Job As HttpJob)
    Dim map1 As Map
    Dim JSON As JSONParser
    If Job.Success = True Then
            map1 = JSON.NextObject
    "timeZoneId") & CRLF & map1.Get("dstOffset") & CRLF & map1.Get("rawOffset") & CRLF & map1.Get("timeZoneName")
    Log("Error: " & Job.ErrorMessage)
    ToastMessageShow("Error: " & Job.ErrorMessage, True)
    End If
    End Sub
    I hope it's helpful

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice