Have you run the App in Companion on your Smartphone? It may be a Google Drive thing, it hasn't necessarily been designed for streaming files. Try putting the files in the Media Tray and running them from there - if your files are .wav, convert them to .mp3 first, to reduce the size.
How it works:
- User taps button playBTN and the first music file is started
- When the first music file has finished, the Player Completed event is triggered
- The Player Completed event iterates the index number, used to select the next file from the list List_MusicFiles
- The selected music file is started
- Loops until all music files in the list have been played.
Search for "radio app" and "streaming" regarding Doze mode issues on Android 6+ devices.
I ran it on my mobile after scanning the output code
the files are some bigger than 4MB and won't upload, they are all mp3
That possibly explains the Google Drive thing too - takes time to buffer the file for streaming. However, you can store the music files in the App's ASD (App Specific Directory) or in a shared external directory, either /Download or /Documents - how that is done is Android Version specific:
It probably has something to do with google drive.
It starts playing the first one, if I keep the screen on it will continue to play the second one, if the screen goes off, it plays until the first track ends. It does not continue to play another track if the screen turns off.
If I press next, it will replay the first one, it won't go to next.
The pause and stop buttons work fine.
The next button does not.
... you could try stopping the screen from slipping into sleep mode:
Have not seen your code for the next button but it should use the List Index method I have already given an example of.
Sorry, I had it in the design but I didn't put it in the code because I can't find anything I can use for the next one. While for start, pause and stop I found
As I already said:
You should read my answers too.
You must use a Foreground service to prevent Doze mode.
We've discussed this issue countless times here & in the old AI2 forum and in all AI2-related forums. It's the only way.
Upload to what? Uploading them to the assets is of course possible as long as they don't exceed 30MB (or 50MB for the code... server).
... even with the MIT team.
Thanks a lot for your answers, being a complete newbie I have some jargons that I don't understand.
Tracks connected to google drive not all are playing, only 2 are playing.
I need to look into finding some that are smaller than 4MB to upload to the app.
I need to look into finding some that are smaller than 4MB to upload to the app.
No (the limt is 5MB), but as I said, no problem to add MP3s to the assets by using 7-Zip /WinRAR.
You can do it by using 7-Zip / WinRAR:
How to add / delete multiple files (images) to the assets (EDIT: AIA max 30MB) with 7-Zip or winRAR:
Ooohhh this is great information, many thanks for it
Now that I went to upload music files, apart from the fact that it limits files larger than 5 MB, it does not allow to create barcode if it exceeds 30 MB and if the MB is 29, it is stuck in the creation of barcode.
I think through google drive is better
Uploading the files to the app plays fine, except I had to reduce the number of tracks for it to create the bar code otherwise it would crash.
While via google drive while you can connect multiple music tracks, it only plays only one and rarely even 1-2 play and when the screen closes after the track that is playing does not continue with another one.
While the files are uploaded to the app, playback continues even with the screen off.
Now that I went to upload music files, apart from the fact that it limits files larger than 5 MB, it does not allow to create barcode if it exceeds 30 MB and if the MB is 29, it is stuck in the creation of barcode.
How to build a big app → APK max. 100 MB or → AAB 150 MB
Steps to build a big app for APK → max. 100 MB or AAB → max. 150 MB (new, added on Aug 31, 2021) 1. APK (Note: apps that were released before Aug 1, 2021 can still use APKs !) You can use e.g. APK Editor Studio for that. First download the keystore "android.keystore" from your AI2 account and rename it to: "android.ks" remove some big files (png, jpg, mp3,…) from the assets (AIA < 10 MB, better < 5 MB) build APK decompile APK (re)insert the missing files to the assets recompile your …
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.