R rabiuls Member Licensed User Longtime User Dec 31, 2012 #1 Hello, Is it possible to detect whether screen is locked or not? I have seen the "UserPresent" of phone library. Is there any other method? Thanks a lot.
Hello, Is it possible to detect whether screen is locked or not? I have seen the "UserPresent" of phone library. Is there any other method? Thanks a lot.
R rabiuls Member Licensed User Longtime User Dec 31, 2012 #2 Ok, I found a way with the Reflection library. Upvote 0
SoyEli Active Member Licensed User Longtime User Jan 1, 2013 #3 can you explain how its done ? Upvote 0
R rabiuls Member Licensed User Longtime User Jan 11, 2013 #4 SoyEli said: can you explain how its done ? Click to expand... Sorry, I did not notice this, as I have not subscribed to this thread. I shall post it if you still there and want to know. Upvote 0
SoyEli said: can you explain how its done ? Click to expand... Sorry, I did not notice this, as I have not subscribed to this thread. I shall post it if you still there and want to know.
NeoTechni Well-Known Member Licensed User Longtime User Jan 11, 2013 #5 I would like to know Upvote 0
R rabiuls Member Licensed User Longtime User Jan 11, 2013 #6 NeoTechni said: I would like to know Click to expand... Well, OK. Select the Reflection library. The sub bellow will set a variable - 'DeviceLocked' to either 0 or 1: Sub CheckLock Dim r As Reflector Dim isLock As Boolean r.Target = r.GetContext r.Target = r.RunMethod2("getSystemService", "keyguard", "java.lang.String") isLock = r.RunMethod("inKeyguardRestrictedInputMode") If isLock = False Then DeviceLocked = 0 Else DeviceLocked = 1 End If End Sub Upvote 0
NeoTechni said: I would like to know Click to expand... Well, OK. Select the Reflection library. The sub bellow will set a variable - 'DeviceLocked' to either 0 or 1: Sub CheckLock Dim r As Reflector Dim isLock As Boolean r.Target = r.GetContext r.Target = r.RunMethod2("getSystemService", "keyguard", "java.lang.String") isLock = r.RunMethod("inKeyguardRestrictedInputMode") If isLock = False Then DeviceLocked = 0 Else DeviceLocked = 1 End If End Sub
NeoTechni Well-Known Member Licensed User Longtime User Jan 11, 2013 #7 Thank you. Don't take this the wrong way, I am just trying to teach you how to program faster/easier Code: Copy Sub CheckLock as boolean Dim r As Reflector r.Target = r.GetContext r.Target = r.RunMethod2("getSystemService", "keyguard", "java.lang.String") return r.RunMethod("inKeyguardRestrictedInputMode") end sub Upvote 0
Thank you. Don't take this the wrong way, I am just trying to teach you how to program faster/easier Code: Copy Sub CheckLock as boolean Dim r As Reflector r.Target = r.GetContext r.Target = r.RunMethod2("getSystemService", "keyguard", "java.lang.String") return r.RunMethod("inKeyguardRestrictedInputMode") end sub
R rabiuls Member Licensed User Longtime User Jan 11, 2013 #8 NeoTechni said: Thank you. Don't take this the wrong way, I am just trying to teach you how to program faster/easier Code: Copy Sub CheckLock as boolean Dim r As Reflector r.Target = r.GetContext r.Target = r.RunMethod2("getSystemService", "keyguard", "java.lang.String") return r.RunMethod("inKeyguardRestrictedInputMode") end sub Click to expand... Indeed it's better :sign0142:. Thank you very much. Upvote 0
NeoTechni said: Thank you. Don't take this the wrong way, I am just trying to teach you how to program faster/easier Code: Copy Sub CheckLock as boolean Dim r As Reflector r.Target = r.GetContext r.Target = r.RunMethod2("getSystemService", "keyguard", "java.lang.String") return r.RunMethod("inKeyguardRestrictedInputMode") end sub Click to expand... Indeed it's better :sign0142:. Thank you very much.