1

In my app, I have location related notifications being received through a Broadcast Receiver.

I would like to display a map inside the notification bigview layout. It would be similar to what is displayed for screenshots, but with a map instead.

Is it possible to initialize a GoogleMap outside of an activity, so I can call the GoogleMap.snapshot method, and place the snapshot in the notification? I am dispatching the notifications from a Broadcast Receiver, so I have no access to UI elements, such as the fragmentManager.

brWHigino
  • 260
  • 1
  • 2
  • 10
  • 1
    [Google Maps Lite Mode](https://developers.google.com/maps/documentation/android-api/lite) is what comes closest, but unfortunately still requires a custom view (which you cannot put in your notification). You may still be able to get it to work using off-screen rendering and such, but that'll take some trial and error. An alternative that will definitely work is [Google Static Maps API](https://developers.google.com/maps/documentation/static-maps/), which just serves images based on your request. That image can then easily be added into a notification. Just be aware there are usage limits. – MH. Dec 17 '15 at 08:28
  • @MH. I ended up using google static maps. – brWHigino Dec 17 '15 at 13:40
  • Probably the best option. Glad to hear it worked out. – MH. Dec 17 '15 at 20:18

0 Answers0