Displaying Google Map within service using window manager system service

294
May 29, 2017, at 04:11 AM

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 .
Answer 1

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.

Rent Charter Buses Company
READ ALSO
Android Instant Apps: Migration of existing multidex app to base/feature module?

Android Instant Apps: Migration of existing multidex app to base/feature module?

I'm migrating my existing multi-dex app into an Instant app and converted my app into the recommended project structure

377
Display math formulas from latex code in Android Studio

Display math formulas from latex code in Android Studio

I'm developing an app with a couple of friends and we want to display math formulas using latex codeEssentially we display text inside buttons and in textviews

531
Geolocation timing out on packager refresh

Geolocation timing out on packager refresh

I am experiencing the following problem: when I open my app, I try to alert the user current coordinates, according to the code belowIn the first open, it happens normally

296
Xamarin Studio - Xamarin.Android missing

Xamarin Studio - Xamarin.Android missing

i just downloaded Xamarin Studio, because Xamarin in visual studio was slow and the designer wasn't workingWhen i try to create new project, the "Next" button is disabled

445