Sub Process_Globals
End Sub
Sub Globals
Dim CookieManager1 As CookieManager
Dim CookieSyncManager1 As CookieSyncManager
Dim WebView1 As WebView
End Sub
Sub Activity_Create(FirstTime As Boolean)
CookieSyncManager1.CreateInstance
WebView1.Initialize("WebView1")
Activity.AddView(WebView1, 0, 0, 100%x, 100%y)
' call SetAcceptCookie after WebView has been initialized
CookieManager1.SetAcceptCookies(True)
' load a webpage that requires a login
Dim Url As String
Url="http://www.geograph.org.uk/profile/6526" ' change this to your login page
WebView1.LoadUrl(Url)
End Sub
Sub Activity_Resume
CookieSyncManager1.StartSync ' not really required for this test example
End Sub
Sub Activity_Pause (UserClosed As Boolean)
CookieSyncManager1.StopSync ' not really required for this test example
End Sub
Sub WebView1_PageFinished (Url As String)
' force the CookieSyncManager to synchronise
CookieSyncManager1.Sync
CookieSyncManager1.ResetSync
Log("WebView1_PageFinished Url = "&Url)
Log("Cookies: "&CookieManager1.GetCookie(Url))
If CookieManager1.HasCookies Then
Log("Cookies: "&CookieManager1.GetCookie(Url))
Else
Log("No cookies found")
End If
End Sub