How to run external, downloaded yet not installed apps on Android?

前端 未结 5 992
失恋的感觉
失恋的感觉 2020-12-24 03:39

I am just curious :

Some apps , usually for developers, allow to download other sample apps and execute the sample apps without installing them.

An example

5条回答
  •  抹茶落季
    2020-12-24 04:19

    You can use Android's class loaders (in this particular case probably the PathClassLoader) to dynamically load classes at runtime without installing them.

    Take a look at e.g. https://github.com/Rookery/AndroidDynamicLoader to see how this can be implemented.

    Plugin apk's might not even need something that complicated but can just communicate via Intents sent to exported activities and posted back results. You can use PackageManager (http://developer.android.com/reference/android/content/pm/PackageManager.html) to query for which intents activities are registered.

提交回复
热议问题