Hello,
Can i share one application related data with another. Say I have a music file in resources/raw folder of apk2. Can I use the same file in apk1.
thx...
Hello,
Can i share one application related data with another. Say I have a music file in resources/raw folder of apk2. Can I use the same file in apk1.
thx...
The application which has the music file will need to implement a Content Provider. This will allow the other application to retrieve the content.
If your apps are signed with the same certificate and have the same android:sharedUserId
declared in the manifest, they can share data in that they can read/write to each others' data directories. They can even share a process if you'd like them to (see android:process
).
To share the files between the apks, you need to pass the uri of the files along with the implementation of Content Provider. And while accessing it back, use the content resolver in the second apk.
You can see this in Gallery and Email app integration where an image gets attached to the email from Gallery.