0

Is there a way to access the raws of a different app through manifest settings or anything of that sort? I am trying to access raw mp3 of an app to play on a different app.

1 Answers1

0

If by "raw" you mean the contents of another app's /res/raw/ folder then you can't. At least not without SuperUser/Root access.

You could theoretically manually pull apart the app in question on your PC and use their resources as you wish where you wish but that may very well be at best a breach of their TOS and at worst copyright infringement.

However, if you have control over the app in question that contains the resource you want access to you could define a ContentProvider to allow public access. Perhaps the app even already has one?


Edit: You have now clarified that you have access to both apps so then you can of course share whatever you like with yourself.

As I mentioned above you can use a ContentProvider to share resources or information between apps. In this particular case you are looking to share an audio *.mp3 file I would suggest a FileProvider which inherits from ContentProvider.

I'll leave the implementation details to the official Android docs linked as they do a much better job of explaining it than I ever could.

In a nutshell though:

  • App A which holds the audio file defines a FileProvider.
  • App B makes an Intent request to App A for a/the file (with optional authentication)
  • App A can either return the file now or offer a choice of files to App B.
  • App B either consumes the received provider and gets its file or tells App A which file it wants.
  • App A can now pass the chosen file to App B which consumes it.

P.S. As some bedtime reading you could have a look at this alternative implementation that links to a github repo and explains the usage of a project from SO's very own CommonsWare: https://stackoverflow.com/a/14734310/1590950

Community
  • 1
  • 1
indivisible
  • 4,892
  • 4
  • 31
  • 50