Implementing a Lock Screen widget on the Home Screen - Android? - android

So, a few users have been asking me if I could make a home screen widget that launches my app..
Due to sensitive content, I've made a simple "Enter the password" splash screen. If the pin is correct the user gets access..
I've been getting complaints that it's a little slow and annoying to enter that every single time.
Majority of the requests I'm getting are relating to accessing the app quickly from the home screen itself. Using the simple shortcut icon is literally the same thing, since it will again open up the password screen..so I need something different.
So I need to open the app from the home screen, using a widget. I need the opening process to be say under 3 seconds or so... and I need to confirm the identity of the user.
What I'm thinking is a Lock Screen, or Pin screen widget.
Is there a way to replicate the Android Lock Screen inside a widget ? ... Remember, I need it on the home screen...
I think a 3X3 grid widget should do....
But there's absolutely no mention anywhere on how to do this... Is it possible? If so, how?
I want exact same functionality, the user can say, set a lock screen combination inside the app, disable the pin entering splash screen, put up the widget - and open the app from there.
Again, there's no mention anywhere of anything relating to this.
So, Any ideas on where I can get more help? Or how I might go about accomplishing this ?

Related

How do parental control apps lock the screen?

I am developing an app that locks the screen for some time, just like parental control apps do when the screen time runs out. However, I do not really know how they work. I suppose they don't use lockNow because there is that message that shows up telling you that the time has run out. I also don't think they use overlays, because the phone is supposed to detect the use of overlays. So does anybody know what kind of function is used? Also for my app I want to add a button that ends the screen lock, so I am looking for a suitable way to achieve that.

Keeping an active app always on top except for home screen

I want to know if there's some way to maintain an Android activity always on top regardless of any other apps present in the phone device that might put on top on it, except for home screen via home button, which cannot be helped.
I've checked that if a whatsapp popup displays over my activity, that activity starts showing a strange behavior.
Maybe this can be controlled by some events, but I think it's much easier to avoid anything that might put on top of app, so no strange behavior appears.
Is there any way to do that?
It depends on the level of control that you have over the device. If your app is going to be publicly available you cannot (and should not) do much to prevent other components from coming on top of the stack.
Apart from that, one thing you can do is check for UI changes through this: https://developer.android.com/reference/android/view/View.OnSystemUiVisibilityChangeListener or/and activity lifecycle events (like onPause) and prevent whatever this "strange behaviour" is.
The inverse way to deal with this is to prevent any app from having the "Draw Over Other Apps" permission, but as I said it depends on the environment of your deployment.

Adding Swipe function to customized lock screen

I've been working on making customized lock screen.
I think I succeeded on making view come up when the screen is turned on.
However, I am wondering how I can make my app realize user's swipe activity in order to make screen go to the home screen just like the normal android lock screen does.
Any suggestion will be very helpful thx!
Here are some examples to detect right,left,up and down swipes.You can detect any of the swipes and finish all activities to exit from your app.
Example 1
Example 2
Example 3
You can ask if you have any further queries.Happy coding :)

How to display balloon counter over application launcher icon on android

I would like to make an icon counter for andoid just like the Email and the Samsung Apps applications i have seen such requests from other developers, but you all say it can't be done.
if so how come those 2 apps and other apps can do it?
do i have to make like more than one icon image and swap them or something?
is it really cant be done and why?
thanks.
you all say it can't be done.
That is because it cannot be done, except by the maker of the home screen, or via an app widget (instead of a launcher icon).
if so how come those 2 apps and other apps can do it?
Because Samsung wrote the home screen and can do what it wants with its home screen.
do i have to make like more than one icon image and swap them or something?
That will not work, as you cannot change the launcher icon at runtime.
is it really cant be done and why?
It really can be done by making an app widget, or by making your own home screen.

Can I control the android device screen on in the PowerManagerService.java?

I have a question on the control of android device's screen on.
What I want to implement on android framework is that:
depend on specific application, I can control the screen to be on or not.
That is to say, if I don't want some application, let's say the AngerBirds, to make the
screen from state off to on, can I do it?
From the source code of PowerManagerService.java:
I found there is one line of code:
`policy.screenTurningOn(mScreenOnListener);`
so, is this the code to turn on the screen?
Then if I add some condition here, such as, if the current command of turnning on the screen is from
the application AngryBird, then I just ignore, and make the screen keep state off.
is this possible?
If possible, then can I get the Application context and the reason of turnning on the screen?

Categories

Resources