简体   繁体   English

通过下载另一个apk文件并从那里获取资源来更改应用程序中的主题

[英]change theme in app by downloading another apk file and getting resources from there

After scouring the internet for hours, I've posted this on SO. 在搜寻了几个小时的互联网之后,我已经将其发布在SO上。

Requirements: 要求:

My app will have a total of three themes for user to select from. 我的应用程序总共有三个主题供用户选择。 (Free app) User should download an apk from play store to get these three themes. (免费应用程序)用户应从Play商店下载apk以获取这三个主题。 (Paid apps) (付费应用)

After downloading the paid app the free app should allow user to set any of the three themes in the free app. 下载付费应用后,免费应用应允许用户在免费应用中设置三个主题中的任何一个。

How to achieve this please guide me. 如何实现这一目标,请指导我。

I've reached a dead end on this one but I see many apps have achieved this already but there is not guide available anywhere on the web. 我对此一无所知,但我看到许多应用程序已经实现了这一目标,但是网络上没有任何指南可提供。

The accepted answer to How to release application plugin using Android Market? 如何使用Android Market释放应用程序插件公认答案 will help you. 会帮助你。 It's not a complete guide but a fair starting point. 它不是一个完整的指南,而是一个公平的起点。

Basically you use PackageManager.getResourcesForActivity or PackageManager.getResourcesForApplication to retrieve resources from the other packages, and then use them as you would with an own resource. 基本上,您使用PackageManager.getResourcesForActivityPackageManager.getResourcesForApplication从其他程序包中检索资源,然后像对待自己的资源一样使用它们。 This other question may complete the picture for you. 这另一个问题可能会为您完成图片。

获得.apk后,您可以将其阅读为zip文件,并在资源(res)或资产文件夹中手动搜索主题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM