Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Android™ Runtime Development

Reply
Contributor
gr8pathik
Posts: 10
Registered: ‎05-20-2013
My Device: Blackberry q10
Accepted Solution

How to detect if the Android app is the Blackberry repackaged version?

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.

Please use plain text.
Developer
mstawick
Posts: 48
Registered: ‎06-24-2010
My Device: Storm 2

Re: How to detect if the Android app is the Blackberry repackaged version?

Try:

 

    public static boolean isBlackBerry() {
        return java.lang.System.getProperty("os.name").equals("qnx");
    }

 

Please use plain text.