Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you share resources across APK's?

Tags:

android

Is it possible to share resources across APK's? For example, can application A (in APK A) load an icon or layout view from application B (in APK B)?

like image 974
jsmith Avatar asked Nov 22 '10 13:11

jsmith


2 Answers

You can make use of getResourcesForApplication

That way you can load whatever you want from other app package as long as you know at least the package name and the id or name of the resource to load.

As a side note, layouts cannot be loaded without further processing them with an XMLResourceParser because of possible id mismatches between your app package and the "guest" package.

like image 77
Ander Webbs Avatar answered Oct 13 '22 22:10

Ander Webbs


Two different apps can share resources - images/ files,etc. if they are signed with same certificate. Please check android doc here

like image 31
Andy1625 Avatar answered Oct 13 '22 21:10

Andy1625