#Region Module Attributes
#FullScreen: False
#IncludeTitle: True
#ApplicationLabel: Generic Sample
#VersionCode: 1
#VersionName: 0.0
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim mp As MediaPlayerStream
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.
Dim StartButton As Button
Dim StopButton As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
If FirstTime Then
mp.Initialize("mp")
End If
mp.Load("http://transom.org/sounds/2004/tools/200403_mp3/mono_40kbps.mp3")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause(UserClosed As Boolean)
mp.Stop
End Sub
'##########################
'######## Controls ########
'##########################
Sub StartButton_Click
StartButton.Enabled = False
StopButton.Enabled = True
mp.Play
End Sub
Sub StopButton_Click
StartButton.Enabled = True
StopButton.Enabled = False
mp.Pause
End Sub
'##########################
'######## Routines ########
'##########################
Sub mp_StreamReady
ProgressDialogShow("Loading...")
StartButton.Enabled = True
End Sub
Sub mp_StreamError(ErrorCode As String, ExtraData As Int)
ToastMessageShow("Error: " & ErrorCode & ", " & ExtraData, True)
End Sub