Porting Android app to run on BlackBerry 10 Android runtime - Google Maps

后端 未结 3 408
旧巷少年郎
旧巷少年郎 2021-01-25 07:30

I have an Android app that I want to make available to BlackBerry 10 users by porting for the BB Android Runtime. The only stumbling block is my Android app uses Google Maps AP

相关标签:
3条回答
  • 2021-01-25 07:42

    Turns out what I want to do is not possible - any references to Google Maps API has to be removed completely from the app. See response from the BlackBerry forums :

    "No, it's not going to work. Save yourself time trying to find a fix, and just copy your project to a new one and make the needed changes for blackberry. If you are using source control, then you can try branching off for that probject.

    By the way. If you want Google maps in your app, it can be done using a webview and Google's javascript API."

    0 讨论(0)
  • 2021-01-25 07:46

    You have to remove all references to MapView or MapActivity in the Android code for you to be able to port over to BlackBerry. I'd recommend going one step further: replace MapView with WebView and load the Google Maps mobile site with Javascript. More info can be found here:

    http://developer.blackberry.com/android/apisupport/apisupport_mapping_support.html

    Yes, that will result in maintaining two versions of your app, but it will provide a better experience for BlackBerry users.

    Hope this helps.

    0 讨论(0)
  • 2021-01-25 07:55

    The map screen is only a small feature of the app and I'm happy to disable it for BlackBerry users, but is this possible?

    You can add android:required="false" to your <uses-library> element, and detect at runtime whether you have the MapActivity class before trying to link to your map. Here is a sample app demonstrating this.

    In theory, BB's packager should allow this. Whether it does or not, I cannot say.

    0 讨论(0)
提交回复
热议问题