user662237
user662237

Reputation: 121

Integrating an apk with another source code for Android Development

I am developing an application which needs to click a picture of barcode and then decode it. I need to call the barcode scanner app which i have already downloaded and for which i have the barcode scanner apk. I need to call this apk in the source code of my application. Is it possible? How can i do this?

Upvotes: 0

Views: 521

Answers (1)

Eby
Eby

Reputation: 2789

You can call a third party application's activity in the following way.

final Intent intent = new Intent(BarcodeSanner package name);

intent.setComponent(new ComponentName("BarcodeSanner package name","BarcodeSanner activity name"));

startActivity(intent );

you can catch exception if the application is not there in you phone

Upvotes: 1

Related Questions