Sorry if this is so simple but I have no idea what a bundle is. I am trying to get info from the battery using the code below.
This is a service which runs and triggers the changed event immediaely. I see the info in the intent and can split the values badly into BatteryProperties. I would like just the values and not the text. Thanks for any help.
B4X:
#Region Service Attributes
#StartAtBoot: False
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Private pe As PhoneEvents
End Sub
Sub Service_Create
pe.Initialize("pe")
End Sub
Sub pe_BatteryChanged (Level As Int, Scale As Int, Plugged As Boolean, Intent As Intent)
Main.BatteryCharging=Plugged
Main.BatteryLevel=Level
Main.BatteryScale=Scale
'Log(Intent.ExtrasToString)
Dim BatteryProperties(), tString As String
Dim tValue As Double
BatteryProperties=Regex.Split(",",Intent.ExtrasToString)
Main.BatteryVoltageString=BatteryProperties(12)
Main.BatteryTemperatureString=BatteryProperties(6)
Main.BatteryCharging=Plugged 'delete when finished
End Sub
Sub Service_Start (StartingIntent As Intent)
End Sub
Sub Service_Destroy
End Sub
This is a service which runs and triggers the changed event immediaely. I see the info in the intent and can split the values badly into BatteryProperties. I would like just the values and not the text. Thanks for any help.