'Activity module
Sub Process_Globals
End Sub
Sub Globals
Dim WebView1 As WebView
End Sub
Sub Activity_Create(FirstTime As Boolean)
WebView1.Initialize("WebView1")
' use WebViewExtras to add the JavascriptInterface to the WebView
' the javascript can now call B4A Subs
Dim WebViewExtras1 As WebViewExtras
WebViewExtras1.addJavascriptInterface(WebView1, "B4A")
Activity.AddView(WebView1, 0, 0, 100%x, 100%y)
WebView1.LoadUrl("file:///android_asset/draggable-markers.html")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
' this Sub is called by the map javascript when the Marker "dragend" event occurs
Sub Marker_DragEnd(NewLatitude As String, NewLongitude As String)
' only String types can be passed from the javascript to B4A so we need to convert the String types to Double
Dim Latitude As Double=NewLatitude
Dim Longititude As Double=NewLongitude
Log("The user has dragged the Marker to ("&Latitude&", "&Longititude&")")
End Sub