How to make "Google Play Service"-like overlay prompt on android? - android

Sorry for my bad English.
I need to make an native SDK to show an overlay popup window to show a message on the top of the current activity.
The window will show about several seconds and then dismiss.
When the window is showing, the content behind needs to be active.
I try several methods, such as startActivity with not touchable and popupWindow.showAtLocation, but no one can act as the same behavior like Google Play Service-overlay window when you log in using Google account in applications.
I cannot get the current activity context or the current view since I don't have the GET_TASK permission.
Google Play popup overlay window Screenshot:
I need advise, thanks.

I think you need to create a showCase for your app.
This library will help you .
if you want more customization. you have to create a Service. And read this question if you want an overlay.

Related

Show touch/tap for App in Android

I'm developing app which have some Buttons. Now for UX perspective I want to show touch or taps on click of that.
These can be achieved by selectors for buttons that I know Other than is In all android mobiles within developer options showtouch/showtap options is available. These can be set programmatically but once If I set all applications will enable this option.
Can I restrict this option only to my app?
If yes can I customize this for better UI?
Thanks in Advance.
Any links/code related this will be helpful.
You can't do this using something external from your App.
There is nothing to do that.
The only solution could be to create a transparent View as an "Overlay" and show it for few milliseconds on the specific point where the Touch event has occurred.
Obliviously you have to show that Overlay View only when required by your UI and leave the display free-from-overlays when your App is not in foreground/use.
A special Permission is required for Overlay View starting from Marshmallow 6.x and should be prompted to the user that could accept or denied it.

Custom screen for confirm credentials on android

I've been adding support to authenticate user using device lock in my app, using the using createConfirmDeviceCredentialIntent api.
I am able to successfully achieve this and when I launch the intent returned by the above api, it shows the default android lock screen.
The question that I had is, can I modify the UI of the default lock screen that android shows? The api takes a parameter for setting title and description but can I modify other parameters, let's say background color of that screen?
I didn't found anything documented about this anywhere except the api docs, that's why posting here.
Please help.
can I modify the UI of the default lock screen that android shows?
No, sorry.
can I modify other parameters, let's say background color of that screen?
No, sorry.

Displaying Google Map within service using window manager system service

In my app I need to be able to display google map as overlay up on other applications.
For doing so I am using service and window manager to show google map view as TYPE_SYSTEM_ALERT .
I am already able to the display the map twice inside the activity using 2 different google API clients with same valid API key.
I can't figure it out but for some reason when attaching the 'View' which contains 'SupportMapFragment' to 'WindowManager' the map wont display , only google logo at the bottom .
I was thinking maybe it has to do something with pixel format ?
Any suggestions ?
It has to do something with kind of views which window manager supporting , maybe window manager cannot display fragments ?
Is it possible to archive what am I trying to ?
There is no problem in the implementation so I don't past code here .
maybe window manager cannot display fragments ?
Correct. Use MapView directly. It may not work especially well in your case, as not everything is designed to go in an alert window, but it is the only chance that you have.
Also note that your app may have problems starting with Android O, as Google slowly starts to rein in apps that do these sorts of overlays.

Change the message in the Google Location Services dialog

I noticed that Yandex maps application change the title in the Google Location Services dialog (or they completely repeated the design and implemented 'Ok' button tap to turn on setting immediately, if so, please let me know how I can do this). I've made this conclusion, because a default text is a bit different , e.g. screenshot from the Google maps application .
Is there way to customize the mentioned dialog?
I've confused since there is an answer about this, but I wanted to be sure that it's impossible, because I found the app which was able to do it.

How to show a popup window on another actvity

I would like to display a message to the user for some asynchronous event. For example for an alarm expiration. I would like to display a popup or dialog that is displayed over any activity is the foreground at the moment (and this can be some other application activity) leaving the current activity in the backgound.
Is there a way to do so in Android?
First off, you will be told that this is a bad thing to do, that it is against the Android way of doing things. Users do not like this. And that the Notification area is much better way to do this.
That said... there are ways to accomplish this...
A Toast will display no matter which activity is on the screen. So you could set up a background thread (or better a Service) that will display your information in a Toast. This might be good enough for you.
You may find it useful looking at some Toast source code here.
Also here is a nice page on how to create a custom Toast layout by replacing the default View with one of your own. (I have not done this, but it looks quite interesting):
Custom Toast Alert on androidexample.com
The alternative is much more difficult, and is to display a System Overlay window. Unfortunately you have to do quite a lot of work to get these set up properly.
Here are a few related questions that I used to get it working:
Creating a system overlay window (always on top)
System overlay android 4.0
How to create a system overlay in Android which allows interaction with the windows below it?
Each of these has links to many others - there are loads of System Overlay questions on here.
But things to remember:
In the old days, you could put a system overlay on top, and send
touches through to the activity below. This is no longer possible,
and so a lot of the answers are now out of date.
You may need to
play around with the flags in the provided examples to get exactly
the effect you are aiming for. Not all the examples use the same
flags, so there are some subtle differences in how each solution
works.
Then again, I also believe that the Notification area is a much better UI pattern to use, so I do recommend you try that first. It is easier to do, and most of us expect that type of behaviour rather than a pop-up.
The problem with a pop-up, is that it might interrupt a movie I'm watching. Or a game I'm playing.
Yes, i had created two dialog for income event for background and foreground

Categories

Resources