Adding Swipe function to customized lock screen - android

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 :)

Related

Viewpager like Home screen with drag rearrange and swipe down to delete

I have started working on making a simple launcher app. I have already gone through many posts and source code of various launchers but I am really stuck at the home screen thing. I just want to create a simple view pager and on long click of it I want it to behave like android stock launcher where user can drag and drop screens to rearrange it and may delete it by swiping down to the cross button.
I am really confused as there is no proper documentation of how things happening in android stock launcher
Please tell me how to achieve this properly. If anyone has extracted that code and give it to me it will be a great help. Links are appreciated.
Thanks!
The standard home screen is implemented as a single large view, with each screen being a child view. Each of those individual screens then lays out icons and app widgets according the grid appropriate for the device.
The way the swiping behavior works is by overriding onInterceptTouchEvent and onTouchEvent. It's tricky because there are so many things that a touch could be doing: the user could be tapping on an icon, swiping to the next screen, or starting a long-press. When you implement one of these behaviors, you have to make sure you don't get in the way of another one.
Once the user is doing a long-press, your launcher app enters a different mode, and the event processing behaves differently in this mode. That is, it implements the standard drag-and-drop behavior. This is tricky too.
I spent two years of my life working on the home screen app for a major device manufacturer. It's complicated, and I'd recommend that you have a good reason for diving into the project.

android application that is visible on lock screen same as emergency calls button

How to create an android app that will appear on the lock screen and can be started even if the phone is lock?
Such that the application icon is visible on the lock screen instead of menu. Similar to emergency calls button on the lock screen.
Can anyone please help me out in this?
I read many things but was not able to find such thing please help me out.
Starting with Android 4.2, you can create lockscreen widgets. If the user places it on the lockscreen, it works mostly like any other widget.

Implementing a Lock Screen widget on the Home Screen - 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 ?

Activate Android with touch instead of power button

We've got a tablet application for which we want to screen to timeout after a certain period, but would like the user to re-enable it by touching the screen instead of the 'power'-button on the side of the device.
What's the best approach (battery performance) to this?
Using a Partial Wake Lock (will the screen react?)
Disable the screen in some way, but keep everything (including touch response) working?
Other?
Any suggestions on this?
Gabriel,
Since this isn't possible by completely turning the screen off, you may want to just want to use a wake lock and dim the screen to its lowest setting as your 'timeout'. This way you can still accept screen touch events and 'wake' it from this state and bring it back to its previous brightness.
We've got a tablet application for which we want to screen to timeout after a certain period, but would like the user to re-enable it by touching the screen instead of the 'power'-button on the side of the device.
This is impossible except perhaps via custom firmware. If the screen is off, it will not respond to touch events.
Another thing you could do is use an app to turn screen off like ScreenStandby since it works in the background and can start on boot as well.
Out of curiosity, how can we go about contacting someone to help in creating a custom firmware like you did Gabriel?

Android wakelock question

Could someone please show me a sample code snippet where you use two buttons; one to turn off and one to turn on the screen. I cant get it to work. Thanks!
I don't understand your question properly. A wake lock is set in your application so that the device screen does not turn off after a particular span of time. how ever you are advised to use this FLAG_KEEP_SCREEN_ON flag and is the best way
Force Screen On
Erm, when the screen is off, how are you hoping to display a button? Unless you mean hardware buttons, in which case I think only the power button can turn the screen back on.

Categories

Resources