I recently got onto Microsoft Launcher for Android. I really want to know how it allows users to lock the screen with a double tap. What API does it use in Android for Screen Lock ? I have not found any such API for Android which exposes the methods for screen lock.
Please note I am referring to screen lock and not a device lock that can only be opened with a password like over here.
Is it part of the accessibility suite ? Asking because I had to provide accessibility permission for the app. I had asked this question before but I got an answer that it was not possible with the recent APIs. So how can Microsoft Launcher do it ? It is not using any tricks, like turning the brightness to 0 and waiting for a timeout.
More information can be found at this answer. And also here. Hope it helps.
Related
I just want to find a plugin that can trigger the native device screen lock button.
So for example if you click a button your device gets locked just it would do if you click your devices native lock button on the side of the phone. For example if your lock button of the device is broken you could do this within an app.
As far as I can tell the only plugin that would work is this one:
https://github.com/kitolog/cordova-plugin-screen-locker . But it seems it only works for android (And might aswell only lock the screen orientation).
window.screenLocker.unlock(successCallback, errorCallback, 10); // 10 seconds unlock timeout (third parameter is optional)
window.screenLocker.lock(successFun, errorFun); // release screen unlock
Is there any solution for iOS aswell? I really cant find anything.
There is a very good reason why the plugin is android-only, as there is no public API to lock the screen on iOS. In general, Apple is more restrictive as to what it allows its developers to do.
For a more in depth explanation, check out this answer.
Is it possible to Display Information on the lock screen from an Android application.
I came across a few Apps which allow you to display Email and Calendar information on the screen but could not find which API to use for achieving the same.
Android 4.2 supports app widgets on the lockscreen.
according to the app you've mentioned (which has very poor description and quite low rating) , i suspect they disable the keyguard (the default lock screen) each time they get the event of power off (or on) .
maybe the activity that they are using has a transparent background and is above the normal lock screen .
there are many similar apps , such as "widget Locker" ,"magic Locker" and "quick Launch" , all do about the same thing to replace the keyguard . most of them also have the ability to replace the launcher (but will still show the launcher of the user, of course) , for smoother experience .
does the screenshot belong to the app you've mentioned , or to something you wish to achieve ?
You can learn how it can be done if you look at the sources of open source project contact owner that adds a message to the lock screen, too.
I want to unlock the andorid screen when a tag is detected - based on the tag ID.
something like how com.biwota.cerbero is done. someone here has any experience or knows how this can be done. ? could you please point to the right directions perhaps ?
thank you
Domnic
This is not possible, unfortunately. NFC polling is turned off when the screen is off or locked, since Android 4.0 ICS. Only with a custom ROM you can modify this behaviour.
I haven't found a definite answer to this yet. Lots of apps let you build/install custom lock screens without root, etc. It's just like installing an app. I found this in the dev guide: http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_SHOW_WHEN_LOCKED
I assume that while this is running it would run just like any other app. But how would I "release" it to let the user get to their home screen? And do I need to handle things like incoming phone calls?
You can't (at least if you follow the rules) replace the secure lock screen. You can have a lock-screen like activity that will show up when the phone is locked. Use FLAG_SHOW_WHEN_LOCKED, but notice that your activity cannot be transparent - i.e. it cannot be a dialog.
Is there a way to replace the phone lock application of an Android phone ?
I would like to customize my screen lock, and perhaps, if the result is nice, publish it on the market. Would that be possible ?
Any tips ?
Is there a way to replace the phone lock application of an Android phone ?
No, sorry, there is no way to create a true replacement lock screen. There has been some discussion of augmenting the OS to support this. However, it is an area that is rather complex, both due to the code itself, and due to security issues.