Displaying Google Map within service using window manager system service - android

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.

Related

is it possible to implement Turn by Turn navigation sdk from mapbox on Android Google Maps?

i have create a tracking project using maps from Google on android kotlin, and i want to create more that user can go to somewhere with navigation (so there's two point, a current location point and destination point). i want to implement turn by turn navigation sdk from mapbox? is it possible to do that? have you build it before?
ya turn by turn navigation is tricky.Map box should make it easier though u just have to implement there sdk in your project and they also have docs on how to use the Map box sdk. only downfall is you have to pay for it.
i would advise if you are creating a personal project try creating a location listener and update current position of the device on a google maps intent. you can then just create your own navigation app ( its abit of a longer way around it but you would have more control over the navigation and plus its free)

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 open Google Maps (or alternative) navigation with multiple destinations?

I'm working on a cross platform (iOS & Android) app that requires the user to follow a (possibly closed) path made of several destinations.
So far it seems that my best option is to find a way to open Google Maps with a URL like this: https://www.google.com/maps/dir/San+Jose,+CA/GooglePlex/San+Francisco,+CA
Besides the fact that such url opens the browser first and not the app directly, Google Maps doesn't enter the "navigation" mode.
I analyzed the SDK and there doesn't seem to be a way to instantiate a path with multiple destinations.
Is there a way to achieve navigation on multiple destinations in Google Maps? If not, any alternative with "navigation" mode?
Yes you can achieve navigation in multiple direction
1) in navigation map first it has been showing one direction , there your calling one api, check that api you will get multiple direction data, just you have to parse the all data by using loop and need to do custom implementation.

Removing others WindowManager TYPE_SYSTEM_OVERLAY

I was wondering if it was possible to remove a floating View using TYPE_SYSTEM_OVERLAY used by another App (I'm thinking about Facebook Messenger among others).
I firstly tried to display my own overlay with transluscent background, thinking that it would probably take the other app's place... but sadly the 2 are coexisting (it's interesting to see that many apps can bring their view to the "top most" level).
So at the end: is there any way to get rid of those views ? (I'm working on an app that will allow users to enable a kind of no-distraction mode) - or do we have to live with it ?

How to make "Google Play Service"-like overlay prompt on 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.

Categories

Resources