如何在 Android 上运行外部的、已下载但尚未安装的应用程序? [英] How to run external, downloaded yet not installed apps on Android?

查看:50
本文介绍了如何在 Android 上运行外部的、已下载但尚未安装的应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是好奇:

某些应用程序(通常供开发人员使用)允许下载其他示例应用程序并在不安装它们的情况下执行示例应用程序.

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

这种应用的一个例子是很酷的DevAppsDirect" 应用程序(BTW 强烈推荐它).

An example for such an app is the cool "DevAppsDirect" app (highly recommend it BTW) .

我的问题是:

这些应用是如何工作的?

How do such apps work?

我的意思是,他们会下载 APK 吗?他们如何跳过安装阶段并以某种方式运行下载的应用程序?它们是否以某种方式与下载的内容合并?像插件吗?

I mean , do they download the APK ? How do they skip the installation phase and somehow run the downloaded apps ? Do they somehow merge with the downloaded content? Is it like a plugin?

这样的东西对于需要插件和扩展程序的应用程序可能很有用,也许还有我想不到的其他想法.

Such a thing could be useful for apps that require plugins and extensions, and maybe other ideas that I can't think about.

我也想知道其他应用程序如何使用插件机制.许多应用程序允许通过 Play 商店下载其他插件应用程序.他们是否以某种方式在其他 apk 文件中运行了一些代码?他们甚至可以访问其他 apk 文件吗?有没有办法告诉 android 哪些应用程序可以访问我的 apk 文件?

i also wonder how do other apps use a plugins mechanism. many apps allow to download other plugins-apps via the play store. do they somehow run some code in the other apk files? can they even reach the other apk files ? is there a way to tell android which apps can access my apk file ?

推荐答案

您可以使用 Android 的类加载器(在这种特殊情况下可能是 PathClassLoader)在运行时动态加载类,而无需安装它们.

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

看看例如https://github.com/Rookery/AndroidDynamicLoader 了解如何实现.

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

插件 apk 甚至可能不需要复杂的东西,但可以通过发送到导出活动和回发结果的 Intent 进行通信.您可以使用 PackageManager (http://developer.android.com/reference/android/content/pm/PackageManager.html) 来查询注册了哪些意图活动.

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.

这篇关于如何在 Android 上运行外部的、已下载但尚未安装的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆