Skip to content

mengzhidaren/apk_install

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

apk_install

apk install tools

Getting Started

install_plugin

license

We use the apk_install plugin to install apk for android;

Usage

To use this plugin, add apk_install as a dependency in your pubspec.yaml file. For example:

dependencies:
  apk_install: '^1.0.1'

Android

You need to request permission for READ_EXTERNAL_STORAGE to read the apk file. You can handle the storage permission using flutter_permission_handler.

 <!-- read permissions for external storage -->
 <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

In Android version >= 8.0 , You need to request permission for REQUEST_INSTALL_PACKAGES to install the apk file

<!-- installation package permissions -->
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />

In Android version <= 6.0 , You need to request permission for WRITE_EXTERNAL_STORAGE to copy the apk from the app private location to the download directory

<!-- write permissions for external storage -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Example

install apk from the internet

 installApk() async {
  final check = await ApkInstall().onCheckInstallApkPermission();
  final state = await ApkInstall().onInstallApk(apkPath);
 }

About

flutter android apk install

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors