When developing a projectCodeIt needs to be reused, and many resources are often reused, such:
- Icon on the button
- Interaction sound
- Activity layout required by a function
- Widget Style
- Common text and corresponding language versions
For example, the layout of such a software sharing:
The layout, labels, and button text are reusable. If you share a link to the author's Software List, QR code images can also be reused, you only need to pass in different sharing information strings for each call.
Now the problem is that I cannot find a way to share these general resources among multiple projects. Currently, I can only copy and paste these resources among projects in a very straightforward way. I always feel like this ......
I tried to use a project as a public project, store resources, package them as jar files, reference other projects, and use the resource ID in the public project namespace to access resources, but in this way, the access is still the same as that ID in the project (because ID is actually an int value). This problem must be because the context still usesProgram, So I found it directly from the resources of the program.
Then I try again through this. createpackagecontext ("com. skyd. common ", 0) to obtain the context of a public project, but this operation fails. The exception prompt name is not found, and this method is effective across app calls.
Is there any way to achieve this?