Reputation: 39564
My application can be easily repackaged for blackberry devices using their web portal. http://developer.blackberry.com/android/documentation/using_the_bb_packager_1873331_11.html
So I can turn my .apk file into a .bar file that users can install on their BB10 devices.
My concern now would be to slighty change the UI or disable some features (in-app billing, Google Maps, some intents) regarding the OS.
I would like for instance to display a Map button on legit Android devices and remove this button on the Blackberry port. I also have some preferences related to the widget that have no reason to appear on a BB10 device
Do you know a perfect way to detect if the app is the repackaged one or the original apk?
My guess would be to use the Build information, but I am pretty sure there is a better way to achieve this.
Upvotes: 3
Views: 695
Reputation: 45
This question is a little old but since it was a top hit on Google when I was looking for an answer I thought I should post this here:
You can query the os name using System.getProperty("os.name") which will return qnx when running on a BlackBerry.
Upvotes: 1
Reputation: 1155
You can change your Android project to be a library project, and add two different App projects that refer to that library.
Add a string resource to ./res/values (I called it static_values.xml) and place a string in it (platform="Android" for Android and platform="BB10").
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="platform">BB10</string>
</resources>
You can refer to that using getResources().getString(R.string.platform), and decide in code what to do.
Upvotes: 0
Reputation: 837
Talking about maps, specifically Google maps com.google.android.maps
, you cant have refrences to the library in your java code or your manifest file, the .bar will not be created till all the refrences to the library are removed.
Also, the Q10 has ratio 1:1 on its screen, something that will have to be looked into as far as your layout is conferenced.
For the same reasons, creating a different codebase was the only way forward for me.
Upvotes: 0