Android imitates wechat to call third-party map application navigation (Gaode, Baidu, Tencent)

Achieve goals

Let's take a screenshot of wechat function to see what to do

In fact, there is a destination. When you click the destination, a selectable application pops up for navigation.

When the brain moves, to realize this function, it should be roughly divided into two steps:

The bottom menu here is done with popupwindow.

realization

1. Menu display

Popupwindow supports the incoming view for pop-up display, so we directly write a menu layout, and Gaode, Baidu and Tencent add a cancel.

map_ navagation_ sheet.xml

In order to show the effect, I have written a subclass of popupwindow. Generally, you can use popupwindow directly.

Then display popupwindow where it needs to be called

2. Click each menu to call the navigation API for the map

The official website of each map will be introduced. You just need to pass the destination name, longitude and latitude information. There's nothing to say. Just post the code directly.

design sketch

Paste the renderings

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>