2

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

frndforall
  • 115
  • 2
  • 6

3 Answers3

6

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
  • 29,665
  • 7
  • 84
  • 82
0

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

David Webb
  • 190,537
  • 57
  • 313
  • 299
  • 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 Apr 21 '10 at 10:29
  • @dave webb can The other application change the file if I use a content provider? – P basak Feb 13 '14 at 02:49
0

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
  • 1,012
  • 8
  • 9