#Region Project Attributes
#ApplicationLabel: TAKSİ'M
#VersionCode: 2
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
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 WebView1 As WebView
Dim pdfv As PDFViewer
Dim pc As Int=0
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("Layout1")
Dim WebViewSettings1 As WebViewSettings
WebViewSettings1.setDefaultZoom(WebView1, "FAR")
WebViewSettings1.setLoadWithOverviewMode(WebView1, True)
WebViewSettings1.setUseWideViewPort(WebView1, True)
WebViewSettings1.setDisplayZoomControls(WebView1, False)
WebView1.LoadUrl("http://www.taksi-m.com.tr/track")
End Sub
Sub WebView1_OverrideUrl (Url As String) As Boolean
If Url.EndsWith(".pdf") Then
Dim j As HttpJob
j.Initialize("pdf", Me)
j.Download(Url)
Return True
Else If Url.IndexOf("mailto:") > -1 Then
Dim Intent1 As Intent
Intent1.Initialize(Intent1.ACTION_VIEW, Url)
StartActivity(Intent1)
Return True
Else
Return False
End If
End Sub
Sub j_progress(count As Long,total As Long )
End Sub
Sub JobDone (Job As HttpJob)
Log("Job completed: " & Job.Success)
Dim o As OutputStream
o = File.OpenOutput(File.DirDefaultExternal, "l.bal", False)
File.Copy2(Job.GetInputStream, o)
o.Close
Job.Release
If Job.Success = True Then
Activity.LoadLayout("Layout2")
Dim pdfView As PDFViewer
pdfView.init
Activity.AddView(pdfView,0,0,-1,-1)
pdfView.getpdf(File.DirRootExternal&"/l.bal")
End If
End Sub
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event
End Sub
Sub CanGoBack (wv As WebView) As Boolean
Dim r As Reflector
r.Target = wv
Return r.RunMethod("CanGoBack")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub