Android include audio files with app package - java

I need to build a standalone audio/music player that should be able to play different audio files in 2 languages, english and russian as they are selected.
I thought that would be and easy task since I found a lot of examples for a player that read from an SDCARD.
The problem is that in this specific case I want to bring the audio files within the app and read them from a specific folder inside the project (ex. /audio/eng/ or /audio/rus/). Is there a way to collect the audio files from one of these folders that come along with the app and play them?
I have very small experience in android applications but I wish to solve the problem.
Kind regards,
Chris

Related

How to share file between apps without file section interface

I am trying to make an app that can easily keep sending files to different apps(whichever the user is running currently), when those apps make request to my app for files.
I was going through this link Sharing a file in Android , Sharing simple data in android and also Sharecompat Blog.
In these links they use a chooser interface to select target apps which I don't want.
My goal is that those other apps can communicate with my app without any clicks or selection.
And In response I can provide them the necessary files.
But I couldn't find anything which can help me build my desired app.
How Can I do it?
Please, Any suggesstions.

Create a symbolic link from inside the Android app's assets folder to its storage

I'm working on an android app in which the user can play multiple Unity games. However, achieving this simple aspect has proven to be too complicated with Unity, if even possible.
After analyzing how Unity on Android works, I understood that it uses a bunch of libraries (called libmain.so, libunity.so and libmono.so), these three libraries refer to the code of the actual game which is stored inside the apk of the android app, specifically in "assets/bin/Data/" directory. The directory is hard-coded inside the code of the libraries, and everything in the libraries is legally prevented from being changed.
So, in order to allow the users to play multiple games, I thought that I could place the game that the user currently wants to play inside the "assets/bin/Data" directory, and so when the Unity libraries want to start the game, they will find it in "assets/bin/Data" and will start it. And then when the user wants to play another game, I simply replace the files of the old game in "asseets/bin/Data" with the files of the new game, and the Unity libraries will thus play the other game, and so on.
However, this wouldn't work, because an android app is not allowed to modify its own apk.
So, to solve this problem, I thought that I could put the files of the game to be played somewhere in the external or internal storage of the app, and then add a symbolic link (shortcut) to those files inside "assets/bin/Data".
That way, when the libraries of Unity want to play the game, they will go to the "assets/bin/Data" directory, where they will find shortcuts to the actual game in the app's storage, and since I can freely change the content of the app's storage, then I will be able to replace the game on demand.
My question is: Is it possible to create a symbolic link (shortcut) from the app's assets to the app's storage?? If yes, how??
If anything is unclear please ask me to elaborate
Thank you
No, it's not possible to do this. The assets included in the APK are not expanded to be on the device filesystem. They are accessed in-place via the AssetManager APIs.
It would be an enormous security hole to allow an app to replace itself without the user knowing or bypassing the package installation path provided by the framework. If all you need to do is push down asset type updates (graphics, levels, sounds, etc.) then consider using an OBB or other downloadable asset to extend the app.

How to play an .mp3 file reversely in java

I want to develop an android application in which the user can play an .mp3 song file reversely ( playing backwards).
I have searched a lot on the web and the stackoverflow, but I haven't found anything useful and basically I'm short on the main idea behind this scenario.
So I'd like to know if there are any java libraries for manipulating .mp3 files or sample applications. Any insight is appreciated :)
A possible solution is to convert it to WAV (on the fly) and then play it using the following answer:
Play WAV file backward

Extract Audio from Jar file

So, I'm trying to extract the music from a Java Mobile game.
It's Block Breaker Deluxe 2.
Unfortunately there is nothing on the Internet about it, pretty much. At least about the music.
I used to play this game a lot years and years ago.
I want to extract the music for personal use. Just to listen.
When I open the file with the Java Decompiler, I only get the class files and so. Plus some other files which appear to be data.
This is where I got the file from: download link
I know that many of the files are either PNGs or classes. What about the music?

Google Drives SDK and powerpoint

I am currently developing a small android app using the google drive SDK/google doc's embedded player which will play through power point files in a slide-show manner. Since there's no direct way I can tell when one powerpoint ends and another begins using the SDK, I was wondering if there was any way for me to retrieve the number of slides from a power point. With the amount of slides I'll be attempting to use the interval between slide changes to calculate the time taken for each powerpoint to play and then using that I can switch through files. I know .pptx files carry the amount of slides in it's metadata (not so sure about .ppt), but I'm not sure how to go on reading it. I've looked at google drive SDK's part to read metadata, but it seems rather limited to what you can actually read. I've looked at ApachePOI but it doesn't seem it's android compatible. Could anyone point me in the right direction with this?
Thanks :).
Sorry, this is not possible using the Google Drive SDK. You could easily download the pptx, unzip it (it is just zipped XML) and extract the required metadata.

Categories