Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

install app programmatically android

I have an app in which i use zxing barcode scanner to scan qr codes. This works only if the user installs barcode scanner app in his mobile. So, can i install that app automatically with the installation of my app? Like installing apk file programmatically or integrating that apk with mine etc. so that user need to again install that app manually.

like image 276
Seshu Vinay Avatar asked May 06 '26 23:05

Seshu Vinay


1 Answers

Yes, I think you can, Put that apk in your internal storage and then using intent You can install it with programatically, First check with Android Package Manager if Barcode Scanner is available in device or not if not then install it,

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(path+"/Bscanner.apk")), "application/vnd.android.package-archive");
startActivity(intent);

But If possible you have to integrate the Zxing library into your android application and use it, So you have to no need to install Bar-code Scanner apk on device..

like image 84
user370305 Avatar answered May 08 '26 13:05

user370305



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!