lockscreen

Detecting lock screen on Mac through Python3

北城以北 提交于 2019-12-11 18:39:20
问题 Trying to find a way to detect if the screen is locked on a Mac system, using Python3 I've tried the following, and it gives a KeyError: import Quartz gui_dict = Quartz.CGSessionCopyCurrentDictionary() print(gui_dict['CGSSessionScreenIsLocked']) edit: import Quartz all_windows = Quartz.CGWindowListCopyWindowInfo(Quartz.kCGWindowListOptionOnScreenOnly, Quartz.kCGNullWindowID) for x in all_windows: if x["kCGWindowOwnerName"] == "loginwindow" print("Locked!") This code works on Python2, but not

How to know if users entered a wrong passcode (lock screen) in android app

烈酒焚心 提交于 2019-12-11 01:33:49
问题 I am working on an Android App in which one of the activity has to be completed if user enter a wrong passcode in android lock screen. For example an email sent if user entered a wrong passcode.. I will appreciate any help. Thanks in advance. Kshitij 回答1: The lock screen are running in a total sandbox environment which makes it makes it inaccessible.You can create a different Application acting as the lock screen and disabling the default android version. 回答2: You can do this by registering

Add Android Widget on App Install

风流意气都作罢 提交于 2019-12-10 19:35:20
问题 I'm trying to find a way to automatically add a widget without making the user add it manually via the launcher to the home page or lock screen (preferably both, but at minimum to the lock screen). Here's what I have to add the widget to the home screen. What am I missing? public class MyWidgetProvider extends AppWidgetProvider { private static final String ACTION_CLICK = "ACTION_CLICK"; @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {

How to bypass 'swipe to unlock' screen

懵懂的女人 提交于 2019-12-10 16:10:06
问题 I am implementing a custom 'swipe to unlock' screen. If the 'Screen lock' in settings is 'Swipe', my app work properly. In my custom 'swipe to unlock' screen -> User swipe to unlock -> it unlocks phone and go to home screen directly by adding the code below in my activity: activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD); activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED); The problem arises when the 'Screen lock' in settings is 'PIN

Android Lock Screen and Keyboard Controls

亡梦爱人 提交于 2019-12-09 23:37:31
问题 I am part way through writing a media player app for Android. It's all going really well so far, however I am now reaching the difficult stage! I have two questions. Do i need to implement a service activity? As I understand it, this is required to allow the app to continue working in the background. However, mine is working fine while I move to other programs on the tablet, and returns to the app without problems. Can someone please explain what the advantages are of services? Secondly, I

Android lock screen multiple activities (a.k.a basic kiosk mode)

故事扮演 提交于 2019-12-08 11:54:20
问题 I try to implement a kiosk mode application. I was able to lock down most of the possibilities to close the app or access system functions. Now, I was wondering, if it is possible have multiple activities in a lock screen. If I switch between multiple activities of my app, the default lock screen is shown for a short moment and then the app re-appears. If I just replace fragments, the app works like a charm. I have the following code: @Override public void onAttachedToWindow() { getWindow()

How to launch an activity when lock screen is enabled?

大城市里の小女人 提交于 2019-12-08 09:10:44
问题 How do you launch an activity when the lock screen is enabled? I want to be able to launch an activity as a result of the screen being locked. I already no I can make an activity work on top of the lock screen using WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED but it is a little unclear to me how to start the activity when the screen is locked. Do I need a service to be running that listens for the screen to lock and then launches the activity? 回答1: When the lock screen is enabled, you

show web site on Android lock screen

别来无恙 提交于 2019-12-08 04:48:14
问题 I'm looking for a reliable way to let the Android user show a web site on the lock screen. This could be done in principle in 3 ways: Showing it on the native Android lock screen, but then they should be able to remove the native clock because my site is a world clock (you can see it at intelnav.50webs.com/world_time.html if you're interested). For all I know this can't be done. Using a 3rd party custom lock screen that allows this. Unfortunately I couldn't find a good one, and I did some

Activity in front of Lockscreen

梦想的初衷 提交于 2019-12-08 02:20:07
问题 I want to create an activity in front of the lockscreen. I don't want to skip the keyguard completely. I tryed it with the TYPE_SYSTEM_OVERLAY flag but there I can't handel any events. It works with FLAG_SHOW_WHEN_LOCKED but then there is a black background and i want it like on this picture: An Activity without black background and event handling http://s1.directupload.net/images/130306/sctc586t.jpg It would be nice if it is like TYPE_SYSTEM_OVERLAY but with event handling. Is that possible?

How to lock the Screen customly? Just like WaveSecure in Android

扶醉桌前 提交于 2019-12-08 01:10:38
问题 I want to do a demo just like WaveSecure, which win Android Develop Challenge 2 with a third place. Now I have a problem in locking the screen customly, so I want to know how WaveSecure achieve its locking function, as the following picture show: When the mobile is locked, WaveSecure can require customer to input their own password. So I think WaveSecure must replace Android's original locking function. And I also google it, but I didn't find anything helpful. I only find two packages may be