Related
The power button on my N1 has been giving me fits, and given the number of people I've read about with "dead" power buttons, I think mine is going out so I'm trying to preserve it as long as possible.
I enabled trackball wake (using CM6) which takes care of 1/2 the equation, but I need a good lockscreen app (just something to make the phone go to sleep). I found one in the market called Lock Screen Enabler, but it's not a "true" lockscreen app and it's very buggy, causing all sorts of problems for me.
I've been a web developer for 8 years and recently got into Android development (which I hope to be doing full-time soon), so I thought I'd just code a quick app for personal use in 5 minutes.
The problem, however, is that the DEVICE_POWER permission is needed in order to call goToSleep() and from what I've read so far from other online posts, this permission is only granted to native system applications.
Since my phone is rooted, I even tried granting my application SU privileges, but that doesnt seem to work either.
So, my question boils down to how do I grant my application DEVICE_POWER permission? I figure if anyone out there knows the answer, it's going to be someone on XDA as this place is full of geniuses. Thanks in advance!!
UPDATE: I've attached the finished app. Made this for personal use but if anyone wants to use it they are welcome to. My only gripe about it right now is the "screen flicker" that happens when you launch it because it's trying to launch an app that immediately locks the screen and finishes itself. If I can figure out how to get the app to launch in a smaller window maybe I can minimize the size to reduce the screen flicker. But for now, this works and I can set it to launch when I click the clock on Fancy Widget, so I'm happy. Thanks again to everyone who offered answers to my questions. Just another reason why I love the Android development community!!
-teleknEsis
Search for Lock screen widget. I have the same problem and I use it. It immediately locks your phone once pressed
nDrg said:
Search for Lock screen widget. I have the same problem and I use it. It immediately locks your phone once pressed
Click to expand...
Click to collapse
Awesome, thx! Still would like to know how they got that prompt to show that basically made the application an Administrator app. Seems like the missing piece I need to complete my own
teleknEsis said:
Awesome, thx! Still would like to know how they got that prompt to show that basically made the application an Administrator app. Seems like the missing piece I need to complete my own
Click to expand...
Click to collapse
It seems that you'll need to add the application as a device administrator. There seems to be some decent information half way down this page under Device policy manager: Link.
I'd be interested in using this application as I can't change the icon of my previously mentioned widget.
Edit: More information here as well: Link.
nDrg said:
It seems that you'll need to add the application as a device administrator. There seems to be some decent information half way down this page under Device policy manager: Link.
I'd be interested in using this application as I can't change the icon of my previously mentioned widget.
Edit: More information here as well: Link.
Click to expand...
Click to collapse
I will probably still go ahead and create one. I like how with FancyWidget you can set it so clicking the clock will launch an app. Unfortunately it doesn't work with widgets, so I need an extra icon on my home screen just to lock it. If you have an icon you'd like me to use, feel free to share and I'll put it in
And thx for the info!!
I would be happy with any icon to be honest, I just don't like the lock screen widget one Good luck bud
teleknEsis said:
..If you have an icon you'd like me to use, feel free to share and I'll put it in
And thx for the info!!
Click to expand...
Click to collapse
Yeah, put my themed one in from LockScreenWidget (smoked)
http://forum.xda-developers.com/showthread.php?t=731625
rori~ said:
Yeah, put my themed one in from LockScreenWidget (smoked)
http://forum.xda-developers.com/showthread.php?t=731625
Click to expand...
Click to collapse
Alright, I got it working, but there's one problem. It can't be uninstalled because it's currently a device admin. Same goes for that Lock Screen Widget I installed earlier.
Looking into a way to be able to uninstall, if one even exists....
You disabled: device administrator ?
Looking into a way to be able to uninstall, if one even exists....
Click to expand...
Click to collapse
Try using "root explorer" to find the files and just delete them.
teleknEsis said:
Alright, I got it working, but there's one problem. It can't be uninstalled because it's currently a device admin. Same goes for that Lock Screen Widget I installed earlier.
Looking into a way to be able to uninstall, if one even exists....
Click to expand...
Click to collapse
You need to go to Security & Location - Device Administrators and disable both there.
Hollow.Droid said:
You need to go to Security & Location - Device Administrators and disable both there.
Click to expand...
Click to collapse
Good call. Thx. However, I also came up with a work-around for ppl who are just as lazy as myself. There are 2 icons in the launcher. The first will lock the screen (once you enable the app as a device admin). The second will disable the app as a device admin, allowing you to uninstall at your will.
I really intended for this app to be for personal use, but if anyone wants it I'll put it up here for you to download. If you'd rather I remove the second launcher icon and just let you to disable it through Security settings, I will also do this (as really, I don't plan on uninstalling any time soon so this is fine for myself).
Thanks to everyone who helped out!!!
teleknEsis said:
Good call. Thx. However, I also came up with a work-around for ppl who are just as lazy as myself. There are 2 icons in the launcher. The first will lock the screen (once you enable the app as a device admin). The second will disable the app as a device admin, allowing you to uninstall at your will.
I really intended for this app to be for personal use, but if anyone wants it I'll put it up here for you to download. If you'd rather I remove the second launcher icon and just let you to disable it through Security settings, I will also do this (as really, I don't plan on uninstalling any time soon so this is fine for myself).
Thanks to everyone who helped out!!!
Click to expand...
Click to collapse
Yeah I'd appreciate the single launcher version please if possible
Hollow.Droid said:
Yeah I'd appreciate the single launcher version please if possible
Click to expand...
Click to collapse
OK - I'll update and upload when I get into work
Application is in the OP. Have at it
Great, works perfect on MIUI 0.9.30
Does the job perfectly! I especially like how it runs as an app so I can change the icon
You're a lifesaver, or should I say power button saver
Thanks so much.
I tried to develop something similar before but got stuck. Saved me some time!
Thanks for creating such useful app for my N1. My power bt is fine, but I would like to preserve it to powering up/down the phone.
BTW, I also downloaded Lock Screen Widget to test it out. Is it possible that you can make your app to shut off the screen smoother, like LSW? I like it you set it up as an app, which is super useful for me set up as a gesture swipe on my LauncherPro dock icons.
Thanks again and keep up your good work!
Thanks again, your app is really great. But could you add a option to map it to the search button (long press) please?
Thank you!
Hi everybody.
Today I present here a Samsung s3 like lockscreen replacement which will actually replace your default lockscreen and you'll never need to launch that app after a reboot to activate it (I know its too annoying :-\ )
HERE I WANT TO MENTION THAT I HAVEN'T CREATED THIS APP. I'M ONLY SHARING IT HERE
This, let me tell u, is the BEST lockscreen out there to get you rid of that default one. Also this doesn't consume your ram as go locker and others do so you won't sacrifice performance for beauty. What else could you want !!!!
Here's how to go about it :-
1. Download the apk file from the attachments.
2. Install the apk as a system app (IF U DONT KNOW HOW TO then first install it as user app and then use titanium backurp to convert it to a system app )
3. After the installation long touch on ur desktop.
4. Choose the following - Shortcuts>Activities>Touch the name "unlock screen">Choose the second activity.
5. Touch the icon that just appeared and first enable the lockscreen.
6. Now choose the Set sceen lock option and choose swipe.
7. Now u can change wallpapers and shortcuts to be shown on the lockscreen as u wish.
Although there aren't many features here but this lockscreen is permanent and will not affect performance at all.
Congrats !!!! You've just set up your phone's lockscreen to be completely like Samsung GS3.
Whenever you want to disable the lockscreen or uninstall the app all u need to for is disable the screen from the settings of the app and then uninstall.
If u have any queries, post them here and I'll answer u as soon as possible.
I have also attached some screenshots for u to see if you're unable to understand anything. Also if you like the app then post it here and rate the thread well. (I can't force you to thank me but if you liked the app then why not )
ENJOY THE BEAUTY.........
DON'T FORGET TO HIT THE THANKS BUTTON IF THIS HELPED YOU
I've installed it as system app but when I long-press my desktop there is no "Activities" option under "shortcuts". :crying:
Edit: I've managed to get it working by downloading a shortcut creator app from the playstore. It's nice but I stick to my default lockscreen because of two things:
1. The app still shows under my running applications consuming around 2-6mb of RAM acceptable but;
2. It does not have notifications for unread sms and missed calls?
Thanks still.
17viper17 said:
I've installed it as system app but when I long-press my desktop there is no "Activities" option under "shortcuts". :crying:
Edit: I've managed to get it working by downloading a shortcut creator app from the playstore. It's nice but I stick to my default lockscreen because of two things:
1. The app still shows under my running applications consuming around 2-6mb of RAM acceptable but;
2. It does not have notifications for unread sms and missed calls?
Thanks still.
Click to expand...
Click to collapse
Thanks for trying the app. The problem is that I didn't write the code so I can't really help that shortcut issue. Anyway I'm trying to find a workaround so maybe this'll be fixed soon.
17viper17 said:
I've installed it as system app but when I long-press my desktop there is no "Activities" option under "shortcuts". :crying:
Edit: I've managed to get it working by downloading a shortcut creator app from the playstore. It's nice but I stick to my default lockscreen because of two things:
1. The app still shows under my running applications consuming around 2-6mb of RAM acceptable but;
2. It does not have notifications for unread sms and missed calls?
Thanks still.
Click to expand...
Click to collapse
Hi, I just tried giving a missed call to my phone and found that it does show a notification which is a semi-transparent round icon at the centre of the screen. Also u can add a shortcut to the call log app for direct access to missed calls and a message icon for messages.
Hi can you help me again? I uninstalled this app without deactivating it as device administrator, it went well except for a few expected forced closes which was easily resolved by rebooting my device. A few days after I wanted to give this app another shot, installed it as system app but when I try to create a shortcut I only have one activity to choose from that is "settings". It still activates as my locker but I wanted it to be a device administrator again. By not being a device admin my default locker shows up for while during boot-up until the app loads and takes over the lock. When it as installed as a device admin it was instant upon boot. Hope you can help solve my problem which is primarily why doesn't it show up among the device administrator choices anymore?
17viper17 said:
Hi can you help me again? I uninstalled this app without deactivating it as device administrator, it went well except for a few expected forced closes which was easily resolved by rebooting my device. A few days after I wanted to give this app another shot, installed it as system app but when I try to create a shortcut I only have one activity to choose from that is "settings". It still activates as my locker but I wanted it to be a device administrator again. By not being a device admin my default locker shows up for while during boot-up until the app loads and takes over the lock. When it as installed as a device admin it was instant upon boot. Hope you can help solve my problem which is primarily why doesn't it show up among the device administrator choices anymore?
Click to expand...
Click to collapse
Hello. This app (being installed as a system app) doesnt need to be a system administrator. Also you can't install an app that has the status of system administrator without disabling it. Therefore I assume that you've missed something in the description. As or the problem of the other locker app taking over, the simplest solution would be to uninstall that app. Post again here if this didn't solve the issue.
Hello, thanks for the reply. After days of having this app as my default lockscreen, my "complaints" are probably not worth it (especially the device administrator thingy ^^). It's working flawlessly, default lock is not showing up anymore. So it stays as my default lockscreen. And by the way there is a missed SMS notification after all. Again thank you! :good:
17viper17 said:
Hello, thanks for the reply. After days of having this app as my default lockscreen, my "complaints" are probably not worth it (especially the device administrator thingy ^^). It's working flawlessly, default lock is not showing up anymore. So it stays as my default lockscreen. And by the way there is a missed SMS notification after all. Again thank you! :good:
Click to expand...
Click to collapse
Glad that I could be of help. Hope you have a nice experience with this locker. As for those "complaints", well they were just some doubts that anybody would've got
Enjoy .....
Introducing LivePics:
With LivePics you can watch the latest pictures as they are posted to Instagram in real time. You can watch a specific tag or the area around you. There's no need to refresh, just sit back and enjoy!
Single tap the picture to pause or resume.
Double tap the picture to like it.
An Instagram account is required to sign in.
Download:
------------ reserved for changelogs ---------------------
Can you guys provide some feedback?
Planned additions:
-Ability to view user's galleries (clickable users)
-Ability to follow users (add them to your Instagram account)
-Clickable locations (see on a map)
-Pick a location to watch
-Adjust the radius to watch
-View your liked photos
Hi @Flyview cool concept. You asked for feedback. I think you should allow the transitions to be slower 2 seconds is to fast.
I don't really understand the seconds of the transition is it random ?
You might want to show a small overlay as a tutorial on first start I found the one tap to pause which is nice and the two tap to like, but I liked a picture without knowing what the 2 tap would do and I don't know which one it was
I'd like a go back feature too, if you see a picture and right when it disappears you notice something but you can't go back, so just a see previous like a swipe right.
Living in Paris I learned with your app that most pictures on instagram are of the Eiffel tower
Getting a blank screen many times.
damage98 said:
Hi @Flyview cool concept. You asked for feedback. I think you should allow the transitions to be slower 2 seconds is to fast.
Click to expand...
Click to collapse
Thanks! Yes, this will certainly be a setting.
exadeci said:
I don't really understand the seconds of the transition is it random ?
You might want to show a small overlay as a tutorial on first start I found the one tap to pause which is nice and the two tap to like, but I liked a picture without knowing what the 2 tap would do and I don't know which one it was
I'd like a go back feature too, if you see a picture and right when it disappears you notice something but you can't go back, so just a see previous like a swipe right.
Living in Paris I learned with your app that most pictures on instagram are of the Eiffel tower
Click to expand...
Click to collapse
It will show a new picture whenever there is a new one available (up to minimum of every second), this will be configurable. I have to think of a good way to show previous pictures. I was thinking the old ones would become scrollable below but if someone new comes to the app they may think it's like Instagram where the point is to scroll down. And yes, intro overlay should be added as well. That's awesome about Paris haha!
Zaiaku said:
Getting a blank screen many times.
Click to expand...
Click to collapse
What mode are you in? Are you watching a tag or area?
Sent from my Nexus 5
good idea, but this is what I get right after connecting. no access to anything!
btw does it work with gps only or can it localise based on network?
Cool idea but I think the suggestions above are a must. Keep it up man
orenxda said:
good idea, but this is what I get right after connecting. no access to anything!
btw does it work with gps only or can it localise based on network?
Click to expand...
Click to collapse
Hmmm that's not good. Do you have Google apps installed? What's your Android OS and ROM? It'll work with whatever location provider is available, GPS is not necessary.
Do you mean "Google apps device policy"? no
I run 4.4.2 on Asus A86 device
@Flyview nice app i have few suggestions
1. Ability to select the distance range for nearby pictures
2. Ability to click the user of the pic uploader, which takes directly to their profile so that we can follow them.
3. Custom picture refresh time.
4. Add an overlay which has buttons to Pause/Play Previous/Next buttons.
tried uninstall, reinstall and login.
there is an error warning warning telling me i have to enable cookies in my browser, or disable private mode? then this blank screen all the time. only way to reach login page is uninstall/reinstall
orenxda said:
tried uninstall, reinstall and login.
there is an error warning warning telling me i have to enable cookies in my browser, or disable private mode? then this blank screen all the time. only way to reach login page is uninstall/reinstall
Click to expand...
Click to collapse
Oh ok that makes sense then. You need to enable cookies in Chrome (or whatever browser the Instagram login page is using). Otherwise LivePics can't log you in to your Instagram account.
Sent from my Nexus 5
unsure how but eveything started working now lol
Flyview said:
Oh ok that makes sense then. You need to enable cookies in Chrome (or whatever browser the Instagram login page is using). Otherwise LivePics can't log you in to your Instagram account.
Click to expand...
Click to collapse
well i checked and cookies are enabled in every browser installed: default, chrome, firefox, opera. not sure witch one instagram is using. will dig deeper in settings.
Same problem, I only get a white screen. Running KiKat on a stock TMobile Note 3. Tried clearing data. Hangs on login screen usually, then it will give the login/cookies error message. If I get past that, back to white screen. Tried uninstalling, then reinstalling - same results.
04/14 - update installed this week - fixed the problem - working fine now.
Zaiaku said:
unsure how but eveything started working now lol
Click to expand...
Click to collapse
Were you also seeing a blank screen after logging in or in between pictures?
orenxda said:
well i checked and cookies are enabled in every browser installed: default, chrome, firefox, opera. not sure witch one instagram is using. will dig deeper in settings.
Click to expand...
Click to collapse
I will see if it's anything that could be off in the code, a few people seem to be experiencing this. Any more info is appreciated.
rbsummers said:
Same problem, I only get a white screen. Running KiKat on a stock TMobile Note 3. Tried clearing data. Hangs on login screen usually, then it will give the login/cookies error message. If I get past that, back to white screen. Tried uninstalling, then reinstalling - same results.
Click to expand...
Click to collapse
So do you ever see the screen where you enter username/password for instagram or does the message come before that? A screenshot would be great!
error message appear after login. then blank screen.
Any chance to turn down it's killing of background apps? It's insane, I don't even get sms messages until I open the app (Signal, Facebook Messenger and others)
Basically no notifications at all arrive if screen has been off for longer
I have root
Thats the problem of emui. It has too many hidden features that cause the deep sleep problem.
1) Go to settings>battery, go to icon on top right, make sure everything off in there, except keep the mobile data always on.
2) Go to settings>notification&statusbar>notification management, choose the apps that u would like to use, on the priority display.
3) Go to settings>apps, click on the settings icon, go to special access, ignore optimisation, change to all apps, choose your desired apps, change to allowed.
Lastly make sure your desired apps off in the lock screen cleanup.
Sent from my Honor 8 Pro using XDA Labs
grizzlyspid86 said:
Thats the problem of emui. It has too many hidden features that cause the deep sleep problem.
1) Go to settings>battery, go to icon on top right, make sure everything off in there, except keep the mobile data always on.
2) Go to settings>notification&statusbar>notification management, choose the apps that u would like to use, on the priority display.
3) Go to settings>apps, click on the settings icon, go to special access, ignore optimisation, change to all apps, choose your desired apps, change to allowed.
Lastly make sure your desired apps off in the lock screen cleanup.
Sent from my Honor 8 Pro using XDA Labs
Click to expand...
Click to collapse
Thanks, this is useful advice, but in step (2) I get a list of all applications. The ones I'm interested in (Facebook, Messaging) are already set up for priority display.
Also in step (3) - wouldn't that increase battery consumption ? I'm on B183
andrewsc said:
Thanks, this is useful advice, but in step (2) I get a list of all applications. The ones I'm interested in (Facebook, Messaging) are already set up for priority display.
Also in step (3) - wouldn't that increase battery consumption ? I'm on B183
Click to expand...
Click to collapse
Step 3 ignore all huawei's optimisation on the selected apps. Actually on every other brand phone its always allowed. Just in this emui they hibernate the apps. So when u make it allowed, it will be working normal again just like other brand phones.
Sent from my Honor 8 Pro using XDA Labs
3) Go to settings>apps, click on the settings icon, go to special access, ignore optimisation, change to all apps, choose your desired apps, change to allowed
So when u make it allowed, it will be working normal again just like other brand phones.
Click to expand...
Click to collapse
The list of All Apps does not include GMail . But it does include Facebook. BTW I started to get notifications even after applying steps 1 and 2. Now I applied step 3 to Facebook, but it's a mystery why GMail is not on that list. On some other page which lists applications, there is a menu to show "system processes". But not on this one, so I can't "allow" optimisations to be turned off for GMail. It's a mystery.
Hi. I have an issue with Whatsapp. It has all the permission s available, so does google contacts. Ut for some reason the chats in what's app shows just numbers, not contact says..anybody came across the fix?
It's permissions do make sure you've set EVERYTHING there's stuff like Modify And Create Contacts and other similar ones this depends on
To fix manually in the meantime just go to the main screen, go to send a new message, then the three dots & Refresh
Go to settings - Accounts & Sync - Whatsapp - More - Sync now
That seems to work
ToneLa said:
It's permissions do make sure you've set EVERYTHING there's stuff like Modify And Create Contacts and other similar ones this depends on
To fix manually in the meantime just go to the main screen, go to send a new message, then the three dots & Refresh
Click to expand...
Click to collapse
That was done. Refreshing it did 5he trick. Thanks guys.
Cool!
If it persists after a reboot check permissions again (this gets very boring on the Chinese rom) but refreshing always brought it back for me.
Enjoy
The easiest way to fix this is go to privacy setting and look at behaviour of the apps, specially the permissions that WhatsApp tried to get and was restricted, or returned blank. Then set that permission to allow always.
Seifer1975 said:
The easiest way to fix this is go to privacy setting and look at behaviour of the apps, specially the permissions that WhatsApp tried to get and was restricted, or returned blank. Then set that permission to allow always.
Click to expand...
Click to collapse
That is a very good hint, thanks.
Do a quick search, this has been reported and fixed by many who had this.
Sathelp said:
Do a quick search, this has been reported and fixed by many who had this.
Click to expand...
Click to collapse
Thing is, the fix is not permanent, I need to do it every few minutes. That's ridiculous
Why, I fixed mine once and it has never gone back. Have you checked all permissions, network restrictions, notification and battery settings and then go to compose a message, press on the 3 dots and refresh. You must be missing one of these things. Get yourself on to the EU ROM, you don't get this trouble. Good luck, you will crack it.
Sathelp said:
Why, I fixed mine once and it has never gone back. Have you checked all permissions, network restrictions, notification and battery settings and then go to compose a message, press on the 3 dots and refresh. You must be missing one of these things. Get yourself on to the EU ROM, you don't get this trouble. Good luck, you will crack it.
Click to expand...
Click to collapse
Are there any other battery settings apart form these on the app settings page (no restrictions)?
I am also on the Chinese rom and just fixed the permissions, marked autostart and excluded from battery saver. Everything works permanently.
Here are some screenshots to check against yours
Sathelp said:
Here are some screenshots to check against yours
Click to expand...
Click to collapse
Look at this. It's strange. Allow permanently is checked and still it's been denied
Sathelp said:
Here are some screenshots to check against yours
Click to expand...
Click to collapse
My settings look exacltly the same
boober78 said:
Are there any other battery settings apart form these on the app settings page (no restrictions)?
Click to expand...
Click to collapse
The best way to do all this is not to look individually but search "battery" or "permissions" in settings. The layout isn't always great so I'd recommend searching for words instead of just scrolling through
ToneLa said:
The best way to do all this is not to look individually but search "battery" or "permissions" in settings. The layout isn't always great so I'd recommend searching for words instead of just scrolling through
Click to expand...
Click to collapse
Yes, you are right. What I find stunning in this phone is the fact 5hat the launcher after deep sleep reverts to a system one and lawnchair's settings for some reason are restored
ToneLa said:
The best way to do all this is not to look individually but search "battery" or "permissions" in settings. The layout isn't always great so I'd recommend searching for words instead of just scrolling through
Click to expand...
Click to collapse
Yes, you are right. What I find stunning in this phone is the fact 5hat the launcher after deep sleep reverts to a system one and lawnchair's settings for some reason are restored
Whatsapp working at chinese rom
The way that work for me was :
- give all permissions at manage the app whatsapp
- in "apps, manage apps, whatsapp, turn on autostart, battery saver no restrictions, restrict data usage checked wlan, mobile data
Sathelp said:
Here are some screenshots to check against yours
Click to expand...
Click to collapse
Many thanks for this. I picked up a transparent Mi 10 Ultra a week or so ago and had this issue after flashing the Xiaomi.eu stable ROM. I could refresh the contacts within the app, but it would only stick for ten minutes or so. So far these settings have stuck.....