Package net_62v.external
Class MetaApplicationInstaller
java.lang.Object
net_62v.external.MetaApplicationInstaller
A class for package management, you can clone a specific app by calling the
You can install an app that not being installed on the host system by calling the
cloneApp(String)
method.You can install an app that not being installed on the host system by calling the
installAppByPath(String)
method.- Version:
- 1.0
- Author:
- [email protected]
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
Install an existing app which already been installed.
Must be installed before, so this method also known as clone application.
Usage:static String
convertResultToString
(int installResult) Convert the install result to a readable string, mostly greater than 0 is success, otherwise you can
use this api for debug purpose, and can be shown to users for comprehensive.static int
installAppByPath
(String path) Install apk from explorer etc.static int
Same asinstallAppByPath(String)
, but will move the file at path.
The file at such path will be moved or deleted,
and you have to confirm if the file will be deleted after the installation progress.static int
installAppsByPath
(String path) Install apks (split apk) from explorer etc.static int
Same asinstallAppsByPath(String)
, but will move the folder at path.
The content in such folder will be moved or deleted,
and you have to confirm if the files will be deleted after the installation progress.
-
Constructor Details
-
MetaApplicationInstaller
public MetaApplicationInstaller()
-
-
Method Details
-
cloneApp
Install an existing app which already been installed.
Must be installed before, so this method also known as clone application.
Usage:
MetaApplicationInstaller.cloneApp("com.whatsapp")
- Parameters:
packageName
- package name like"com.whatsapp"
- Returns:
- install result, greater than 0 then success, otherwise you should convert it to see.
- Throws:
RemoteException
-
installAppByPath
Install apk from explorer etc. And you must give a direct path to install inside.
Only support the standard apk file, please verify the file before you use this method.
MetaApplicationInstaller.installAppByPath("/sdcard/sample.apk")
- Parameters:
path
- a direct apk path- Returns:
- install result
- Throws:
RemoteException
-
installAppByPathAndMove
Same asinstallAppByPath(String)
, but will move the file at path.
The file at such path will be moved or deleted,
and you have to confirm if the file will be deleted after the installation progress.- Parameters:
path
- a direct apk path- Returns:
- install result
- Throws:
RemoteException
-
installAppsByPath
Install apks (split apk) from explorer etc. And you must give a direct path to install inside.
Support dir or apks / apkm / xapk format file
MetaApplicationInstaller.installAppsByPath("/sdcard/pure.xapk")
- Parameters:
path
- a direct xapk (also the apkm and apks) path- Returns:
- install result
- Throws:
RemoteException
-
installAppsByPathAndMove
Same asinstallAppsByPath(String)
, but will move the folder at path.
The content in such folder will be moved or deleted,
and you have to confirm if the files will be deleted after the installation progress.- Parameters:
path
- a direct xapk (also the apkm and apks) path- Returns:
- install result
- Throws:
RemoteException
-
convertResultToString
Convert the install result to a readable string, mostly greater than 0 is success, otherwise you can
use this api for debug purpose, and can be shown to users for comprehensive.- Parameters:
installResult
- install result integer- Returns:
- readable string
-