Display an alert in Android while screen is locked - android

I am looking for a way to show the user a message on an Android device even when the screen is locked. What I've found is that most of the popup examples, such as SMS popups, appear only once - but won't display again the second time the user presses the power-button to turn the screen on (but leaves it locked).
I'd love any advice the community can provide on how to display a persistent message on the lock-screen.

Tyr to use LayoutInflater and PopUpWindow class for this purpose

Related

Screen Dim Event / User Inactivity

first of all, I would like to tell you, what I want to do: I want to get some behavior of iOS on my Android device. Of course, it's just a little detail.
The behavior I talk about is on iOS like that:
The user doesn't use the device
After a short time, the device dims its screen.
Now the user has to tap somewhere on the display to reactivate the device.
THIS IS THE BEHAVIOR I WANT If the user taps on the screen, the screen
will just become active again. The tap itself will NOT cause any other action.
On Android, it's almost the same behavior. Except for step 4: If the user taps on the screen to prevent standby, the tap will already cause actions in the app or home screen or wherever you are.
I decided to develop a small Accessibility Service. This service will show an overlay when the device is inactive and dims its display. Clicking on the overlay will just close it. The overlay itself is no problem and it's already working.
My problem is: I don't know how to find out when the display is dimmed because of inactivity.
My ideas are:
Listen to the Intent.ACTION_SCREEN_OFF event (https://developer.android.com/reference/android/content/Intent).
--> It's working. But it's too late :-( The screen is already completely off when the event has been fired.
Check, if the device is inactive/idle.
--> Is there any possibility to get the status of the whole device? I haven't found anything about that.
Or maybe somebody has completely other ideas?
Thanks for your help.
Greetings
Patrick
You can keep the window screen on & using a TimerTask, dim the brightness of the window manually by some % every, say 5 seconds...
Then when the taps on overlay, Increase the brightness

Android activity popup on lockscreen

Ok, first time asking, I couldn't find a solution anywhere..
I'm trying to create an activity that pops up on the lockscreen, kinda like Handcent does (or even Viber, maybe? Can't remember), but I can't for the life of me find a solution that actually works, be it flags, system alert and such
So far I only managed to achieve a workaround by having a dialog themed app and unlocking the phone before showing it but that's not what I'd like to have in the final product, plus it doesn't unlock all kinds of lockscreen (based on user feedbacks, I've had reports of Handcent successfully displaying a dialog while my app can't unlock it)
Is there any tutorial or code snippet for this?
For Unlocking the Phone programatically this should help.
And as you are already using the Dialog Theme, your application's "pop-up" requirements are completed.

How to hide the pop up for my application?

Have a look on the below pic
The foreground pop up is handsent sms app.The back ground is my app. My problem is whenever an sms received popup window opens.The bad thing is even my app runs .Their pop up box may disturb my app users.How can block their pop up on my screens. The dafault sms app is opened then handsent sms app wont show popup on the window.Like that I also want to block other popup on my app screens.
Their pop up box may disturb my app users..How can block their pop up on my screens
You don't know that. This is not something you should try to control, if the user has an app that pops up, that is probably their preference. Your app should however be prepared for interruptions, i.e handle your app's lifecycle properly

Android Notification - Popup dialog box

i am trying to create a dialog box to appear in the middle of the screen when my main program is not in focus and running in background. The purpose of the dialog box is to force the user to take an immediate action. I am already using the notification manager to notify the user but i would still like a old school popup dialog box.
Thanks :D
Popping up a dialog from an application running in the background is thought of as bad practice because it may confuse the user, and may annoy the user because you are disrupting the current task s/he is engaged in.
It is advised by the Android developers to use the Android notification system for tasks like these. A guide to create notifications is here: http://developer.android.com/guide/topics/ui/notifiers/notifications.html
Dialogs are created with the Intent of the current activity. Since your app will not be in focus at the time, you cannot create a dialog.

What does "toast" mean?

Curious what "Toast" means?
Saw this and am curious...
Similar Posts
How to add toast style popup to my application?
Program to show a "toast" notification popup from the Windows command line?
Why does my text keep highlighting?
Thread-safe Form.Show
https://stackoverflow.com/questions/686886/c-remoting-with-forms
Using Jabber to send network messages
Android: determining the current context to display an alert
.NET AnimateWindow
Android toast blur
Can an Android Toast be longer than Toast.LENGTH_LONG?
Why does my text keep highlighting?
A small informational message that pops up like toast.
http://en.wikipedia.org/wiki/Toast_(computing)
It's a type of Window that "pops up" like toast:
http://msdn.microsoft.com/en-us/library/ms632289%28VS.85%29.aspx
An example of a Messenger toast is the message that appears on a user's desktop when one of the user's contacts signs in. Another example of Messenger toasts is the messages displayed when a user receives an alert from the .NET Alerts service. The following are examples of typical toasts:
"Toast" refers to a UI feature where an event causes a small text box to appear at the bottom of the screen. The behavior seems like a piece of bread emerging from a toaster.
It is a popup alert that generally appears on the right hand side of the screen, and is usually for notifications with great importance. There is generally a cool effect with it, such as fading or stretching.
In my question, the toast pops up and fades in.
Toast is just another name for a pop-up notification, a small message that appears temporarily to communicate some information. Pop-ups referred to as “toast” are usually displayed at the bottom of the screen, and in some cases actually pop up like toast:
Photo above from Android Developers: Toasts
Its a kind of notification that is poped up.

Categories

Resources