1.00
com.rootsoft.togglelibrary.ToggleLibrary
Toggle
process
android.permission.WRITE_SECURE_SETTINGS
android.permission.REBOOT
android.permission.WRITE_SETTINGS
android.permission.BLUETOOTH
android.permission.BLUETOOTH_ADMIN
android.permission.CHANGE_WIFI_STATE
android.permission.ACCESS_WIFI_STATE
android.permission.UPDATE_DEVICE_STATS
android.permission.MODIFY_PHONE_STATE
userActivity
User activity happened.
Turns the device from whatever state it's in to full on, and resets the auto-off timer.
when: is used to order this correctly with the wake lock calls. This time should be in the SystemClock.uptimeMillis() time base.
noChangeLights: should be true if you don't want the lights to turn on because of this event. This is set when the power key goes down. We want the device to stay on while the button is down, but we're about to turn off. Otherwise the lights flash on and then off and it looks weird.
void
when
long
noChangeLights
boolean
TurnGPSOn
Turns the GPS on. Note that this method actually activate the GPS immediately (unlike most other methods that
goes to the Settings Screen.).
void
TurnAirplaneModeOn
Turns the airplane modus on.
status:
void
TurnRingerOff
Sets the RingerMode off.
RingerMode:
void
TurnAirplaneModeOff
Turns the airplane modus off
status:
void
TurnGPSOff
Turns the GPS off. Note that this method actually disables the GPS immediately (unlike most other methods that
goes to the Settings Screen.).
void
TurnDataConnectionOff
Turns the Mobile Data Connection off.
void
TurnRingerOn
Sets the RingerMode on.
RingerMode:
void
TurnStreamVolumeOn
Sets the Media Volume to the maximum
value:
void
Reboot
Reboots the device
void
ToggleDataConnection
Toggles the Mobile Data Connection.
There are notifications that it doesn't work on some devices and the emulator
void
TurnDataConnectionOn
Turns the Mobile Data Connection on.
void
TurnBluetoothOn
Turns Bluetooth on.
void
Initialize
Initializes the ToggleLibrary.
ba:
void
ba
anywheresoftware.b4a.BA
isScreenOn
Returns whether the screen is currently on. The screen could be bright or dim.
boolean
ToggleAudio
Toggles the RingerMode automatically in the following order:
Silent -> Vibrate
Vibrate -> Normal
Normal -> Silent
void
goToSleep
Force the device to go to sleep. Overrides all the wake locks that are held.
time: is used to order this correctly with the wake lock calls. The time should be in the SystemClock.uptimeMillis() time base.
void
time
long
TurnRingerMode
Sets the RingerMode to:
NORMAL, VIBRRATE or SILENT
RingerMode:
void
RingerMode
int
TurnBrightnessOn
Turns the brightness on
void
ToggleWiFi
Toggles the Wifi. If it's enabled, it sets it disabled and vice-versa.
void
ToggleGPS
Toggles the GPS. Note that this method actually activate the GPS immediately (unlike most other methods that
goes to the Settings Screen.).
void
ToggleAirplaneMode
Toggles the AirplaneMode.
void
TurnStreamVolumeOff
Turns the Media Volume off.
value:
void
ToggleBluetooth
Toggles the bluetooth. If it's enabled, it sets it disabled and vice-versa.
void
TurnBrightness
Turns the brightness.
0 to 255
void
value
int
TurnWiFiOff
Turns WiFi off.
void
TurnWiFiOn
Turns WiFi on.
void
TurnBluetoothOff
Turns Bluetooth off.
void
TurnBrightnessOff
Turns the brightness off
void
TurnStreamVolume
Sets the Media Volume
value:
void
value
int
WiFi
boolean
Checks if Wifi is enabled or disabled
RingerMode
int
Gets the ringer mode.
Bluetooth
boolean
Checks if bluetooth is enabled or disabled
DataConnection
boolean
Checks if the Mobile Data Connection is enabled or disabled.
GPS
boolean
Checks if the GPS is enabled or disabled.
AirplaneMode
boolean
Checks if the airplane mode is enabled or disabled.
RINGER_MODE_SILENT
Ringer mode that will be silent and will not vibrate.
int
RINGER_MODE_NORMAL
Ringer mode that may be audible and may vibrate.
int
RINGER_MODE_VIBRATE
Ringer mode that will be silent and will vibrate.
int
1.0
XverhelstX