views:

146

answers:

3

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...

A: 

The application which has the music file will need to implement a Content Provider. This will allow the other application to retrieve the content.

Dave Webb
To be precise, My intention was to share the library files (.so) in libs folder between two apk's.And can I load library file from any other location apart from the libs folder of the application data.
frndforall
A: 

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).

Roman Nurik
A: 

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.

Vishwanath