是否有可能访问另一个APK资源,而无需使用内容提供商? [英] Is it possible to access resources in another APK without using content providers?

查看:98
本文介绍了是否有可能访问另一个APK资源,而无需使用内容提供商?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为,这是不可能,包含在其他APK接入资源,除非内容提供商的使用。不过,我偶然发现所谓的更好的键盘的应用程序。它采用的外观,所以我决定要下载外观的例子。

I thought that it is impossible to access resources contained in other APK unless content providers are used. However, I stumbled upon an app called Better Keyboard. It uses skins, so I decided to download an example of a skin.

一个例子皮肤真是出乎我的意料。它几乎不含有code,只声明了一个活动,没有内容提供商。 Nontheless它包含了资源,他们显然从某种程度上更好的键盘应用程序访问,如果被安装APK皮肤。那么它是如何做的?

An example skin really surprised me. It contains almost no code, declares only an activity and no content providers. Nontheless it contains resources and they are apparently somehow accessed from Better Keyboard app if the APK with the skin gets installed. So how is it done?

推荐答案

我相信你正在寻找

资源资源= mPackageManager.getResourcesForApplication(org.example.foo);

<一个href="http://developer.android.com/reference/android/content/pm/PackageManager.html#getResourcesForApplication%28java.lang.String%29">http://developer.android.com/reference/android/content/pm/PackageManager.html#getResourcesForApplication%28java.lang.String%29

这篇关于是否有可能访问另一个APK资源,而无需使用内容提供商?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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