#Region Project Attributes
#ApplicationLabel: b4aRichPath
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait
#CanInstallToExternalStorage: False
#End Region
#AdditionalRes: ..\DemoRes
#AdditionalRes: ..\LibRes
#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.
Dim t As Timer
Dim nativeMe As JavaObject
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 rp1 As RichPath
Private rp2 As RichPath
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("main")
nativeMe.InitializeContext
t.Initialize("t", 7000)
rp1.VectorDrawable = "ic_notifications"
rp2.VectorDrawable = "ic_android"
End Sub
Sub Activity_Resume
t.Enabled = True
End Sub
Sub Activity_Pause (UserClosed As Boolean)
t.Enabled = False
End Sub
Sub t_tick
rp1.animateNotification
nativeMe.RunMethod("Ring", Null)
rp2.animateAndroid
End Sub
#if Java
import android.net.Uri;
import android.media.RingtoneManager;
import android.media.Ringtone;
public void Ring() {
Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
Ringtone r = RingtoneManager.getRingtone(BA.applicationContext, notification);
r.play();
}
#End If