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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Android™ Runtime Development

Reply
New Member
ishaer2k2
Posts: 1
Registered: ‎02-05-2013
My Carrier: Orange

java Code in android to check if app is running on blackberry or any other non-android device?

Hi there,

 

I have developed an android app using gingerbread.

I want to repackage and deploy it on blackberry. I did so and my app has some issues in blackberry.

So I want to remove some of the functionalities from my code if it is blackberry.

 

I can modify my code and recreate .apk and .bar respectively

 

 

I want some code  like:

 

if(APP_IS_RUNNING_ON_BLACKBERRY)

{

// do this

}else{

//do that

}

 

How do I know if APP_IS_RUNNING_ON_BLACKBERRY??

Is there any way using android sdk to know if app is not running on android device but on blackberry?

 

Thanks in advance.

 

Please use plain text.
Contributor
jonathan2708
Posts: 18
Registered: ‎02-02-2013
My Carrier: O2

Re: java Code in android to check if app is running on blackberry or any other non-android device?

You can use the "os.name" system property which will return 'qnx' if the app is running on BlackBerry :

 

Boolean APP_IS_RUNNING_ON_BLACKBERRY;

APP_IS_RUNNING_ON_BLACKBERRY = System.getProperty("os.name").equals("qnx");

 

Jonathan

Please use plain text.