Sub WriteSetting(Setting As String, Value As Int)
Dim r1 As Reflector
Dim args(3) As Object
Dim types(3) As String
r1.Target = r1.GetContext
args(0) = r1.RunMethod("getContentResolver")
types(0) = "android.content.ContentResolver"
args(1) = Setting
types(1) = "java.lang.String"
args(2) = Value
types(2) = "java.lang.int"
r1.RunStaticMethod("android.provider.Settings$System", "putInt", args, types)
End Sub
Sub GetBrightness() As Int
Dim r As Reflector
r.Target = r.RunStaticMethod("java.util.Locale", "getDefault", Null, Null)
Return r.RunMethod("getScreenBrightness")
End Sub
Dim r1 As Reflector
Dim args(3) As Object
Dim types(3) As String
r1.Target = r1.GetContext
args(0) = r1.RunMethod("getContentResolver")
types(0) = "android.content.ContentResolver"
args(1) = "SCREEN_BRIGHTNESS"
types(1) = "java.lang.String"
args(2) = -1
types(2) = "java.lang.int"
Dim BrightInt As Int
BrightInt = r1.RunStaticMethod("android.provider.Settings$System", "getInt", args, types)
Msgbox(BrightInt,"bright")
int UserBrightness = Settings.System.getInt(getContentResolver(), Settings.System.SCREEN_BRIGHTNESS,-1);
Int oldBrightness = Settings.System.getInt(getContext().getContentResolver(),Settings.System.SCREEN_BRIGHTNESS);