Reputation: 21929
I want to display a map using Baidu
API.
Does anyone have an idea on this. If so, can you please provide some sample application code?
Upvotes: 2
Views: 4329
Reputation: 3739
I have recently faced this question too. This answer is 2 years late but maybe someone can still use it later. The answer given by iDev is clearly focused on javascript, which does not answer the question that was about Android.
Baidu offers an official "Hello BaiduMap" tutorial. The explanations are in Chinese only but the code can still be useful if you don't read Chinese.
When adding the API_KEY to your manifest you of course need to use your own key. I have described how to generate that in this answer. The difference is that for a mobile key you need to enter the SHA1 fingerprint of the keystore you use to sign your app, followed by your app's packagename specified in your manifest.
Baidu also provides a sample project demonstrating many functionalities of their maps. When downloading the libraries select the second one (described as 包括类参考、示例代码、开发包[...]) which contains the sample project, ready for import into eclipse.
I have also asked and answered a question about some more advanced baidu maps features if anyone is interested.
Upvotes: 5