Android Question start a app from lockscreen

MarkusR

Well-Known Member
Licensed User
Longtime User
hello,
i have android 8.1.0

its possible to start a app from lock screen, just for input data and then the app should disappear?
maybe similar the apps that appear in the edges for voice input or camera.

or just a mini widget for user input would be ok.

or a app that starts every awake if me pressed power on.

or a app start from the drop down menü? (where the user can toggle the flashlight)
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

MarkusR

Well-Known Member
Licensed User
Longtime User
i found
Lock screen widget functionality was discontinued after version android 4.4
 
Upvote 0

MarkusR

Well-Known Member
Licensed User
Longtime User
here is a interesting event i will try
UserPresent - The user has unlocked the keyguard screen.
https://www.b4x.com/android/help/phone.html#phoneevents

after the user unlock the service get an event and a activity get in front.

Starter Service
B4X:
#Region  Service Attributes
    #StartAtBoot: False
    #ExcludeFromLibrary: 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.

    Public PhoneEvent1 As PhoneEvents

End Sub

Sub Service_Create
    'This is the program entry point.
    'This is a good place to load resources that are not specific to a single activity.


    'https://www.b4x.com/android/help/phone.html#phoneevents
    PhoneEvent1.Initialize("PhoneEvent")

End Sub

Sub Service_Start (StartingIntent As Intent)

End Sub

Sub Service_TaskRemoved
    'This event will be raised when the user removes the app from the recent apps list.
End Sub

'Return true to allow the OS default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
    Return True
End Sub

Sub Service_Destroy

End Sub

'https://www.b4x.com/android/help/phone.html#phoneevents
'The user has unlocked the keyguard screen.
Sub PhoneEvent_UserPresent (Intent As Intent)
   
    Log("PhoneEvent_UserPresent")
    Log(Intent.ExtrasToString)
    StartActivity(Main)
           
End Sub
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…