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
coder_slay
Posts: 15
Registered: ‎04-18-2012
My Device: 9800

How to detect BB10 app already installed using a ported android app?

I have an Android Application which will detect whether a third party application(com.mypackage.myactivity) is installed or not, after that it launches that application. So the Android Code is

 

PackageManager pm = ctx.getPackageManager();
boolean app_installed =false;
try{ pm.getPackageInfo("com.mypackage.myactivity",PackageManager.GET_ACTIVITIES); app_installed =true;
} catch(PackageManager.NameNotFoundException e){ app_installed =false;
}

if(app_installed){

IntentLaunchIntent= getPackageManager().getLaunchIntentForPackage("com.mypackage.myactivity"); startActivity(LaunchIntent);}

This works fine for Android. But when I convert my apk to bar file and then install it on a BB10 device then it doesn't recognises whether the application is installed or not.

Do i need to change the package name?

Please advice on this.

 

Developer
madmaskd
Posts: 137
Registered: ‎07-24-2012
My Device: Blackberry Z10 LE, Q10 And PlayBook

Re: How to detect BB10 app already installed using a ported android app?

Hai that features is not allowed to android port apps.. you have to check the permission for android in documentations. Majority of system permission system level are not permitted in BlackBerry for android port apps.. you have to go for cascade app for such features... even I have similar problem so I have to build app as fresh app in cascade..
Hit Like if you find my post Use Full Thank You...