APK size is too big because of audio files - java

I'm working on my own Ebook application. My book has a total of 15 chapters, so I have a list with 15 elements - each one is a string with all the chapter's text.
I also have 15 .ogg files that I paid a voice over talent to record. The size of my final APK is almost 97MB, where about 90MB of them are a result of my audio files.
What can I do in order to reduce the APK to 25MB or less and yet give my users the option to listen to the narration?

You should look into Google Play Dynamic Delivery with the Android App Bundle.
This allows to split your Android app in modules, some of which you could download on-demand at runtime.
Effectively, this would allow you to download the .ogg only when the user needs them, or pre-load them if you can predict which ones are going to be listened to next (e.g. if they have an order).

Related

Flutter app size increased due to too many audios

I am working on a Flutter application and I have more than 100 sounds that users can play for educational purposes.
I am not using any server or Firebase. Every audio is almost 1 MB. With that assets folder size will be more than 100 and app size will increase too.
Can I store all the audio in the SQLite Database? Is there any other way?
You can compress your audio files using the flutter_sound package, it'll help you to decrease the size of your audio files, and don't forget to run flutter clean before compiling your app, unless your app size will be more than that size that you expect to be.

Is there a way for Android apk to download executable java module and run it?

I've got an app in Google Play, as well as on Amazon Appstore, Huawei Marketplace, Samsung Apps and one more e-shop in China.
It's a puzzle game. Regularly, I implement new types of puzzles. Each time, I then have to make them available to the users by creating new version of the app and publishing it to those 5 shops.
Implementation of a single puzzle consists of 2 Java classes, a binary file and a few pngs (icons).
I am thinking that maybe it would be possible to write my app in a way so that it could instead download such 'puzzle modules' from my server? The apk would then need to be able to download executable Java code from Internet and somehow 'adjoin' it as a module to itself. Is that possible?
it is possibile, but it is also restricted in some stores, in Google Play for shure. (also possible on iOS, also restricted in App Store)
this is just very unsafe letting developers adding some executable code without store reviews and informing users, so policies are forbidding it

FFMPEG Android Library Reduce Android App Size

I am using audio/video manipulation library mentioned below.
MobileFFmpeg --- implementation 'com.arthenica:mobile-ffmpeg-min:4.4'
After implementation and applying ProGuard rules app download size is 26.8 Mb.
I want to reduce the app size.
How to reduce the app size?
When you use this kind of library, you don't have much of a choice on app size. One thing you can do is release aab instead of apk on google play.
For example, if you analyze the apk you might see, you have different .so file for different architectures.
With aab file, google can choose the right architecture to build apk for right device.
I would not worry too much about size for this kind of app, because it needs those .so files to work properly.
Another bold approach you can take is to make your own version of ffmpeg lite by removing anything that you don't need.
But that requires a deep understanding of the ffmpeg library.

Android include audio files with app package

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

Most suitable file format for playing audio files in smart phones

I have a web app(jsp/servlets) which allows users to download audio files and play in mobile phones.For targeting a large audience, I wish to develop a j2me app for normal smart phones. My audio files are voice recordings and may run for around 50 minutes. Therefore a very light weight audio files should be available for users to download and play in my mobile app.J2ME app may reach audio files through http(as most phones support http than rtsp).My questions are
1.What is the most suitable audio file format which will run in more smart mobile phones(Nokia,SonyErricsson,Motoroal etc) and most light weight for downloading? (As I know mp3 is good,but are more phones support for mp3?)
2. How I can encode big audio files in servlets(Open source Codecs and those encoded audio files must be play in j2me app:- Manager.createPlayer(url) easily, any sample code or sources please)
My aim is to allow users to download around 5mb files which may run around 50 minutes.I don't whether it is possible or not. if any one knows,please let me know answers for my problems.
The Manager class allows you to test if mp3 is supported in the device. Most recent JavaME devices do, but you should check anyway as the only audio format guaranteed to be supported is wav.
As for the best, in your case the best is the fastest to transfer, I guess. You should create the file with the minimum acceptable quality possible (e.g.: mono instead of stereo, low bitrate instead of high, etc). Since you are working with voice instead of music, you don't really need 44.1 kHz stereo CD quality.
EDIT:
However, I don't think you can stream audio in JavaME over HTTP. The Player.prefetch method will try to download the entire file before playing, and 50 MB is just too much for memory constrained devices like JavaME ones. You have to use RSTP if your device supports it; or use the DataSource version of the createPlayer method, and implement a DataSource to return a regular InputStream from an HTTP connection to your file.

Categories