solrudev / Ackpine

Android package installer library
https://solrudev.github.io/Ackpine/
Apache License 2.0
54 stars 7 forks source link

How can we install apks from assets folder #73

Closed antranvn closed 4 days ago

antranvn commented 1 month ago

How can we install apks from assets folder? Can you give an example code?

solrudev commented 1 month ago

@antranvn First, get an Uri for an asset:

val uri = AssetFileProvider.getUriForAsset("path/to.apk")

AssetFileProvider comes from ackpine-assets artifact.

Then just create a session with this Uri and launch it as usual (see docs page):

val session = packageInstaller.createSession(uri)
// Now do whatever you want, e.g.
val result = session.await()
solrudev commented 2 weeks ago

@antranvn Do you have any other questions?

solrudev commented 4 days ago

Closing due to inactivity.