lockscreen

iOS Private API: lock device and power off the screen

房东的猫 提交于 2019-11-27 07:03:30
问题 I'm making an app for jailbreak that lock the device when the user launch the app. I've tried GSEventLockDevice(); from GraphicsServices.framework but this does not work properly because it locks the screen but does not power off the screen. Is there another way to lock the screen without MobileSubstrate ? 回答1: Just as another alternative, check out this answer, which uses SBDimScreen() . You could use that in conjunction with GSEventLockDevice() . It appears that you may now (iOS 5+) need to

How can I interact with the Lockscreen layout to display text into it, like this app:

妖精的绣舞 提交于 2019-11-27 02:51:55
问题 I just discovered this application : https://market.android.com/details?id=de.j4velin.lockscreenCalendar It seem that is now possible to write some text inside the lockscreen in the place where the alarm is usually written. I would like to display custom text on this place, but have totally no idea on how to achieve that. This guy succeed to write calendar events at this place. Thank a lot for any clue//snippet that would help me. 回答1: This is astonishingly easy to achieve and astonishingly

Android Galaxy S4 — Activity that is visible over lock screen

坚强是说给别人听的谎言 提交于 2019-11-27 01:53:55
问题 A few years ago, I wrote an alarm app that worked on Android 2, and I'm now trying to upgrade it to work on Android 4. Specifically, on the Samsung Galaxy S4. On Android 2, if the phone was sleeping, it would wake the phone up and display a "Snooze or Dismiss" screen over the lock screen. On Android 4, it wakes the phone up, but you have to unlock it, then open the notifications area, then click the alarm's notification, before you can hit "Dismiss." I have always been using this code to do

How can i set up screen lock with a password programmatically?

坚强是说给别人听的谎言 提交于 2019-11-27 01:11:00
Is there any one that can help me with a code to set a password to lock the screen ? thx Shaahul Use this code in your App, it works for me: DevicePolicyManager devicePolicyManager = DevicePolicyManager.getSystemService(Context.DEVICE_POLICY_SERVICE); ComponentName demoDeviceAdmin = new ComponentName(this, name of activity); devicePolicyManager.setPasswordQuality( demoDeviceAdmin,DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED); devicePolicyManager.setPasswordMinimumLength(demoDeviceAdmin, 5); boolean result = devicePolicyManager.resetPassword("123456", DevicePolicyManager.RESET_PASSWORD

iOS KeyChain not retrieving values from background

跟風遠走 提交于 2019-11-26 23:22:10
I am currently storing the username (email) and a salted hash of the email and password in the iOS KeyChain. I'm using the ARC'ified version found here . KeychainItemWrapper *wrapper = [[KeychainItemWrapper alloc] initWithIdentifier:@"MyCustomIdentifier" accessGroup:nil]; [wrapper setObject:APP_NAME forKey:(__bridge id)kSecAttrService]; [wrapper setObject:email forKey:(__bridge id)kSecAttrAccount]; [wrapper setObject:token forKey:(__bridge id)kSecValueData]; This all works fine when I need to pull the token out for my network calls while the app is active. It works for logging in from a clean

Android how to show notification on screen

二次信任 提交于 2019-11-26 23:02:03
问题 I've been working on push notifications and I am able to implement it and display it on status bar, the problem I am facing is that I want to display it even if the phone is lock, Under the lock screen where it says ("drag to unlock"), I have seen notifications like that but cant find any example to that. Example: Just like when you received a missed call , it will show it under the lock button on your screen. Code: String ns = Context.NOTIFICATION_SERVICE; NotificationManager

How to programmatically lock screen in Android? [duplicate]

冷暖自知 提交于 2019-11-26 22:34:23
Possible Duplicate: Lock the android device programatically How can I programmatically lock the screen in Android? YoK Check this class : com.android.internal.policy.impl.LockScreen Referenced from here: Can you lock screen from your app? Also check code for enabling and disabling lock Screen in Android. (Referenced from here ) KeyguardManager keyguardManager = (KeyguardManager)getSystemService(Activity.KEYGUARD_SERVICE); KeyguardLock lock = keyguardManager.newKeyguardLock(KEYGUARD_SERVICE); For locking the screen use, lock.reenableKeyguard(); and for disabling the lock use, lock

xcode - MPNowPlayingInfoCenter info is not displayed on iOS 8

≯℡__Kan透↙ 提交于 2019-11-26 20:29:26
问题 I'm developing a music application, which should play music in the background. I use the MPMoviePlayerController to play the music. My code to initiate the MPMoviePlayerController : NSString* resourcePath = [[NSBundle mainBundle] resourcePath]; resourcePath = [resourcePath stringByAppendingString:@"/music.m4a"]; NSError* err; self.player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:resourcePath]]; if (err) { NSLog(@"ERROR: %@", err.localizedDescription); }

A way to get unlock event in android?

廉价感情. 提交于 2019-11-26 18:50:20
Is there a way to receive something like PHONE_UNLOCKED (with a BroadcastReceiver of some kind)? I have a service running that shows a Toast when the screen is turned on. Unfortunately a few phones don't show it until they're unlocked. Most of the times the Toast message is already gone then. There is a Broadcast Receiver Action ACTION_USER_PRESENT here is the implementation of ACTION_USER_PRESENT and ACTION_SHUTDOWN add this to your application Manifests <receiver android:name=".UserPresentBroadcastReceiver"> <intent-filter> <action android:name="android.intent.action.USER_PRESENT" /> <action

Creating custom LockScreen in android

佐手、 提交于 2019-11-26 15:22:19
I am developing custom lockscreen app.its working fine in below 4.0 but above 4.0,when we press home button the app stops.is there any solution for this no apps will stop when pressing home button untill unlocking the screen.(like go locker app) Another way to develop a LockScreen App is by using Views , let me explain it. First of all you can "disable" in some devices the System lock screen by disabling the KEYGUARD : ((KeyguardManager)getSystemService(Activity.KEYGUARD_SERVICE)).newKeyguardLock("IN").disableKeyguard(); You should put this line of code in your Service . After that you can