API 28 URGENTE

1,175 views
Skip to first unread message

Pedro Souza

unread,
Dec 5, 2019, 6:18:03 AM12/5/19
to mitappinv...@googlegroups.com
Hello, can anyone help me, my APP made in Mid Inverntor of my web Radio W3Brasil, After the API28 update has stopped, how can I fix it? Download the App at
Thank you all for your attention, Peace.


Olá, alguém pode me ajudar, meu APP feito no Mid Inverntor da minha web Rádio W3Brasil,
depois que a atualização para o API28 ficou parando, como fazer para corrigir? Baixem o App em
Agradeço a atenção de todos, Paz.

SteveJG

unread,
Dec 6, 2019, 4:04:33 PM12/6/19
to MIT App Inventor Forum
Have you tried  re-compiing your app using Companion 2.55 and nb180 .  This should make your appe compatible with API28 .   After you recompile, reload your Project to GooglePlay

Pedro Souza

unread,
Dec 10, 2019, 5:41:52 AM12/10/19
to MIT App Inventor Forum
Already recompiled, but I do not know where do this Companion 2.55 and nb180, can help me, I wait, Peace.

Já recompilei, mas Não sei onde faço esta Companion 2.55 e o nb180, pode me ajudar, aguardo, Paz.

TimAI2

unread,
Dec 10, 2019, 6:09:48 AM12/10/19
to MIT App Inventor Forum
If you have recompiled, using the AI2 site, then your app should now be API28 compliant

try uploading your latest apk to Google Play ?

Pedro Souza

unread,
Dec 10, 2019, 6:20:08 AM12/10/19
to MIT App Inventor Forum
Fiz  a recompilação, usando o site AI2, depois deste procedimento o aplicativo ficou compatível com API28, mas ele ficou parando na hora da execução, baixe ai e faça um teste.
I made the recompilation, using the AI2 site, after this procedure the application was compatible with API28, but it was stopping at the time of execution, download there and do a test.

TimAI2

unread,
Dec 10, 2019, 6:46:08 AM12/10/19
to MIT App Inventor Forum
There is nothing we can do with your apk on Google Play.

If you say it stops working when opened, then you will need to look at your code to see what is causing this.

Look at the release notes to understand what changes were made since you first built your app.

Chris Ward

unread,
Dec 10, 2019, 7:09:15 AM12/10/19
to MIT App Inventor Forum
Pedro

Did you change something other than recompile and rebuild the APK?  A new start icon, image, an extra Screen?

Pedro Souza

unread,
Dec 10, 2019, 7:26:43 AM12/10/19
to MIT App Inventor Forum
Bom vou ver se esplico tudo, recebi a informação que deveria atualizar para o API28 ou ele parraria de funcionar, então entrei no App inventor e apenas mudei a versão para que ele mudasse para o API28
e postei na play store, e logo que atualizou notei que a web rádio toca por um periodo e para, não estava assim. 

Well I'll see if I explain everything, I received the information that should upgrade to API28 or it would stop working, so I entered the App inventor and just changed the version so that it changed to API28 and posted in the play store, and as soon as it updated noticed that web radio plays for a period and stops, it wasn't like that.

codigo da web rádio w3brasil dez 2019.png


Chris Ward

unread,
Dec 10, 2019, 7:43:43 AM12/10/19
to MIT App Inventor Forum
Hi Pedro

I just tried your App - the linked website got blocked by my broadband provider......

The radio broadcast has been running for 20+ minutes without issue. Samsung Galaxy S8, Android v9 (latest version).

You might want to ensure the devices that have the "stopped" issue have the most recent Android Version possible.

Pedro Souza

unread,
Dec 10, 2019, 8:31:46 AM12/10/19
to MIT App Inventor Forum
O meu é um moto g5 atualizado e em média de 15 a 20 minutos ele para e só ao apertar o play para voltar não era assim na API anterior,
tocava sem parar até o usuário mesmo parar, vou tentar fazer outra atualização pra ver se resolve e posto aqui.

Mine is an updated moto g5 and on average 15 to 20 minutes it stops and just pressing play to return was not like this in the previous API,
played without stopping until the user even stops, I will try to make another update to see if it resolves and post here.

BodyMindPower

unread,
Dec 11, 2019, 5:10:09 AM12/11/19
to MIT App Inventor Forum

Pedro Souza

unread,
Dec 11, 2019, 6:03:37 AM12/11/19
to MIT App Inventor Forum
Fiz a atualização, o aplicativo não passa 30 minutos funcionando e para, antes da atualização do API 28 ele tocava sem interrupções, e sobre o amigo BodyMindPower que falou em não AAC e sim MP3 lembro que o aplicativo é um STRIAMING de Rádio, que na verdade eu coloco apenas o ID da Rádio, http://199.233.234.34:8350 fiz a mudança para http://199.233.234.34:8350/;stream.aac pra testar se normalizava e nada, alguem da http://ai2.appinventor.mit.edu/ poderia me ajudar, será que tem a ver com a atualização API 28, usem o ID acima no média play e irão ver que toca sem parar, então não é problema de transmissão, Aguardo a ajuda de todos e Obrigado a todos, Paz.

 made the update, the application does not spend 30 minutes working and so, before the API 28 update it played without interruption, and about the friend BodyMindPower who spoke not AAC but MP3 remember that the application is a STRIAMING Radio, which in the true I just put the radio ID, http://199.233.234.34:8350 made the change to http://199.233.234.34:8350/;stream.aac to test if normalized and nothing, someone from http: // ai2 .appinventor.mit.edu / could help me, does it have to do with the API 28 update, use the above id in the average play and you will see that it plays nonstop, so no broadcast issue, I look forward to helping everyone and Thank you all, Peace.

Pedro Souza

unread,
Dec 11, 2019, 8:11:07 AM12/11/19
to MIT App Inventor Forum
Olhem o que achei, uma empresa com o mesmo problema em seu aplicativo, veja na imagem.


APLICATIVO PARANDO KSHOST DEZ 2019.png

Look what I found, a company with the same problem in your application, see the image.

Pedro Souza

unread,
Dec 12, 2019, 8:30:35 PM12/12/19
to MIT App Inventor Forum
Alguém pode me ajudar neste assunto, meu aplicativo web rádio Após determinado tempo tocando em segundo plano o aplicativo para de executar,
isso acontece depois da atualização do API 28, como posso resolver isso?

Can anyone help me on this, my web radio app After a while playing in the background the app stops running,
This happens after the API 28 update, how can I fix it?
WEB_RADIO_SERVINDO_A_CRISTO.aia

TimAI2

unread,
Dec 13, 2019, 3:53:05 AM12/13/19
to MIT App Inventor Forum
Your issue won't get answered any more quickly if you spam the forum on different posts with the same message, just one will be sufficient.

If there was a definite answer/solution available you would have found it / it would have been given.

Chris Ward

unread,
Dec 13, 2019, 5:06:18 AM12/13/19
to MIT App Inventor Forum
We have been thinking about your problem Pedro.

It may be the case that Android cuts-off the App because it is running but is "not in use". That is to say, when the device goes into sleep mode or battery saving mode, you will observe the screen is dimmed to black, but your app still plays. The User does not need to touch anything, he/she is is just listening - however,Android might see this as inactivity by the User and so to save energy, closes the App. 

I'm wondering if Log Cat could tell us what happens. Google: "how to set up and use Log Cat".


Pedro Souza

unread,
Dec 13, 2019, 5:28:40 AM12/13/19
to MIT App Inventor Forum
Chris Ward - Até entendo, mas antes da atualização da Playstore do API 28 ele tocava sem parar mesmo em suspensão, tem algum código que podemos usar na criação do App
pra que ele toque mesmo em suspensão, notei que outros aplicativos de outras pessoas feito em outras plataformas também estão passando por este caso, veja este anuncio
que recebi via e-mail. 


Chris Ward - As I understand it, but before the API 28 Playstore update it played nonstop even on hold, there is some code we can use to create the App
so that it even plays in suspension, I noticed that other people's apps made on other platforms are also going through this case, see this ad
I received via email.

APLICATIVO PARANDO KSHOST DEZ 2019.png

The ad says


Radios Application Fix

 

Hello, how are you? Many of our customers have reported a problem with the radio app:


After a certain amount of time tapping in the background, the application would stop running.


We have great news :) After much work we have been able to fix this problem.


So if you are already a KSHOST customer you can rest assured that your app will be automatically updated with this fix soon.


TimAI2

unread,
Dec 13, 2019, 5:43:07 AM12/13/19
to MIT App Inventor Forum
Did you ask them how they fixed the problem ?

Chris Ward

unread,
Dec 13, 2019, 5:48:37 AM12/13/19
to MIT App Inventor Forum
Hi Pedro

The best way would be to run the App as an Android Background Service. However, App Inventor and other Block-based programming systems do not support this, so your App would have to be rewritten in Java/Kotlin in Android Studio or some other text-based programming language.

A work-around is to force the App to always be in the foreground. This is generally not recommend because the App can use-up the battery power quickly.

Pedro Souza

unread,
Dec 13, 2019, 6:05:45 AM12/13/19
to MIT App Inventor Forum
TimAI2, Sim já mantive contato e eles não falam, é segredo de mercado, :-(

Chris Ward -  pois é também pensei nisso, em que apenas app feitos no eclipse ou Android Studio, mas como tenho este já a bastante tempo e desconheço
completamente o uso de outro editor me sinto como refém de resolver, pensei também em criar um player em HTML5 e colocar apenas o link, pode ser que solucione
este problema, fica meio que montagem (Gambiarra) como falamos aqui no Brasil, mas desde já agradeço a todos que tentaram me ajudar, mas acho que o pessoal
do APP Inventor vão ver este problema e vão sim solucionar, até Outubro funcionava perfeito, sem parar, isso só aconteceu depois da atualização do API 28.
Como neste forum eu não consigo relatar o caso pra ninguém direto responsável pelo site MID, o jeito é aguardar ou tentar resolver via Gambiarra. 


TimAI2, Yes I already kept in touch and they don't talk, it's a market secret, :-(

Chris Ward - because it's also thought of that, where only app made in eclipse or Android Studio, but as I have this for a long time and I don't know
completely using another editor I feel hostage to solve, I also thought of creating a player in HTML5 and put only the link, it may solve
this problem, is kind of mounting (Gambiarra) as we speak here in Brazil, but I thank everyone who tried to help me, but I think the people
from APP Inventor will see this problem and will solve it, until October it worked perfect, without stopping, it only happened after the API 28 update.
As in this forum I can not report the case to anyone directly responsible for the MID site, the way is to wait or try to solve via Gambiarra.

Chris Ward

unread,
Dec 13, 2019, 6:26:00 AM12/13/19
to MIT App Inventor Forum
Pedro

It certainly looks like a change in API 28. That's most likely Google trying to improve Android security. 

A "solution" via Gambiarra would not solve the problem if API 28 is now designed to keep a look out for Apps that run a long time unattended.

First, we need to see what exactly happens, hence my suggestion to use Log Cat. The Log Cat log file should show exactly what the system did at the time your App stopped working.


Pedro Souza

unread,
Dec 13, 2019, 6:44:07 AM12/13/19
to MIT App Inventor Forum
Chris Ward - Glória a DEUS, você poderia me ajudar a identificar este problema, não conheço este the log cat, lhe agradeço muito. 


Chris Ward - Glory to God, could you help me identify this problem, I don't know this the log cat, thank you very much.

BodyMindPower

unread,
Dec 13, 2019, 7:01:15 AM12/13/19
to MIT App Inventor Forum
@Pedro 
I tested you app and I have no issues with it on an Android 9 device.
So what is / are your testing device/s?
But you should also try to import your app into Kodular and use the ExoPlayer there, which is especially suitable for streaming.

BodyMindPower

unread,
Dec 13, 2019, 7:30:47 AM12/13/19
to MIT App Inventor Forum
I tested your app with Kodular and the ExoPlayer. It works fine and the big advantage is that the music starts immediately.
(without delay, buffering / the Player component needs ~ 30 sec to start the music)


TimAI2

unread,
Dec 13, 2019, 8:38:47 AM12/13/19
to MIT App Inventor Forum
I also ran some tests with the Player component using a very simple start stop app with an "is playing" check (on a button, no clock):

  1. Genymotion emulator (Android 9) with Companion App - no issues after an hour
  2. Lenovo A2 Tablet (Android 6) with Companion App - no issues after an hour
  3. HTC10 Phone (Android 7) compiled apk, sound stopped after 28 minutes, but the Player was "still playing", then the app crashed. So no simple clock - check - restart option, unless you just restart things every 20 minutes ? My guess is there is something going on under the hood with the buffer / cache / memory that goes into overload. Is it an Android thing or an AI2 thing ?  I do not know.
Will test compiled app on the Lenovo next, to see if it is a version thing....

TimAI2

unread,
Dec 13, 2019, 8:48:23 AM12/13/19
to MIT App Inventor Forum
On the Lenovo Tablet (Android 6) with the compiled app, the player kept stopping after a minute or so (not playing). Was able to start the player again.

Next up will have a look at an HTML5 player in a webview - see what happens

Chris Ward

unread,
Dec 13, 2019, 9:01:33 AM12/13/19
to MIT App Inventor Forum
I'm sorry Pedro, I can't do that for you - but the links from the Google search include step-by-step video. It's not rocket science :)

TimAI2

unread,
Dec 13, 2019, 9:30:39 AM12/13/19
to MIT App Inventor Forum
Using html5



<!DOCTYPE html>
<html>
<meta name=“viewport” content=“width=device-width, initial-scale=1.0”>

<head>
<title>Web Radio Brasil</title>
</head>

<body>
<p>Web Radio Brasil</p>
<audio controls>
        <source src="http://199.233.234.34:8350/stream" type="audio/mp3">
        <source src="http://199.233.234.34:8350/stream" type="audio/aac">
    </audio>
</body>

</html> 

works but doesn't continue to play when the device goes to sleep, so KeepScreenOn (Taifun Tools extension) and mains/usb power required

BodyMindPower

unread,
Dec 13, 2019, 3:25:23 PM12/13/19
to MIT App Inventor Forum

Pedro Souza

unread,
Dec 15, 2019, 7:02:18 AM12/15/19
to MIT App Inventor Forum
     Olá, alguém tem aplicativo de web rádio na play store criado na versão do API 28 que está funcionando sem interrupção, pode me passar o link pra eu testar.
coloquei um player em HTML 5 no aplicativo, mas mesmo assim ficou parando quando em segundo plano e depois de um determinado tempo tocando, também estou
tentando manter contato com a google para uma resposta.


     Hello, does anyone have a web radio application in the play store created in the API 28 version that is working without interruption, can you pass me the link for me to test.
I put an HTML 5 player in the app, but it still stopped when in the background and after a while playing, I'm also
trying to contact google for an answer

TimAI2

unread,
Dec 15, 2019, 7:26:15 AM12/15/19
to MIT App Inventor Forum
We are working with MIT on possible solutions, still bug testing to find the issue

Chris Ward

unread,
Dec 15, 2019, 8:13:08 AM12/15/19
to mitappinv...@googlegroups.com
I put an HTML 5 player in the app, but it still stopped when in the background and after a while playing,

Hi Pedro, I did say that would not be a solution. 

We think the issue is that the App is "unattended". The User starts the Radio Broadcast and then does nothing else with the App, just listens to the broadcast. We think Google Android stops the App, making the assumption that it is not being used by the User and is eating-up battery power. It's an unproven theory, but had you tried recording what happens via Log Cat, we would potentially know more by now.

If the theory turns out to be fact, I'm not sure that MIT can do anything about it. The only solution is usually not a good solution - force the App to stay in the foreground. We normally do not recommend this action because of course it depletes battery power quickly. However, your App is already doing that.........

Chris Ward

unread,
Dec 15, 2019, 8:21:07 AM12/15/19
to mitappinv...@googlegroups.com
@Anke: ...it states "Instead of so many features, before using ExoPlayer, you must think of the features that your app requires i.e. if you are making a simple music player app then go with the MediaPlayer."

However, perhaps it is possible to loop a generic video clip in ExoPlayer while streaming the Radio Station broadcast. If that's true, it might be a posh way to keep the App in the foreground? That's basically what we need to do. At the moment, Taifun's Notification method is the front runner.

Pedro Souza

unread,
Dec 15, 2019, 2:06:46 PM12/15/19
to MIT App Inventor Forum
TimAI2 - Agradeço que agora chegou a noticia que gostaria de ouvir e estou anscioso para ver a solução deste problema o mais rápido possível, se precisar de maiores detalhes é só chamar
que estou pronto a informar para que possamos ter a solução o mais breve possível, no aguardo, e Paz a todos.


TimAI2 - Thank you now that the news I would like to hear and I am looking forward to see the solution of this problem as soon as possible, if you need more details just call that I am ready
to inform so we can have the solution as soon as possible, waiting , and Peace to all.

BodyMindPower

unread,
Dec 16, 2019, 4:50:16 AM12/16/19
to MIT App Inventor Forum
I am afraid there will be no solution in the short term. I have performed many tests that confirm that the WiFi connection will be deactivated / interrupted in standby / sleep mode. Unfortunately (e.g. on a Galaxy Note8, AIP 28), no setting in the energy-saving or WiFi or app settings can fix this. If the device is connected to a charger or wakes up, there are no problems. But of course that is not a solution to the problem.

Correction: There are also problems with Kodular: the sound stutters when the app switches to standby mode (so there seems to be a limited WiFi signal). However, as soon as the charging cable is plugged in, everything runs ok. So it actually seems to have something to do with Google's (tightened) energy saving options (Doze).

The forums are full of such inquiries and complaints. Just these ones as examples:
https://forum.xda-developers.com/galaxy-tab-s4/help/wi-fi-sleep-settings-gone-t3838101/page2
https://eu.community.samsung.com/t5/Andere-Smartphones/WLAN-schaltet-sich-bei-Android-9-scheinbar-ab-wenn-der/td-p/980516/page/2

This is also strange, which I also noticed on some devices:
https://stackoverflow.com/questions/59280438/delay-in-mediaplayer-audio-streaming-with-non-https-urls-in-android-9

At this point, there seem to be only two options:
- Leave the screen on (KeepScreenOn mode / Taifun Tools ext.)
- allow switching to 3/4G LTE

Pedro Souza

unread,
Dec 16, 2019, 6:55:44 AM12/16/19
to MIT App Inventor Forum
BodyMindPower - Show é exatamente isso, testei aqui com o celular na tomada e estou a 1 hora usando sem problemas, agora vem a pergunta,
como faço pro aplicativo funcionar em segundo plano sem parar, alguém pode me ajudar?


BodyMindPower - Show is exactly that, I tested it here with the phone in the socket and I'm 1 hour using without problems, now comes the question,
how do i make the app run in the background nonstop, can anyone help me?

BodyMindPower

unread,
Dec 16, 2019, 7:20:14 AM12/16/19
to mitappinv...@googlegroups.com
As already said, the app runs in the background / after timeout (sleep mode) without any problems and uses WiFi as long as the device is connected to the power supply. Otherwise the WiFi connection is throttled or cut and you have to wake up the device or you have to allow the switch to 3 / 4G LTE beforehand.

There currently seems to be no other solution (worldwide).

PS:
Como já foi dito, o aplicativo é executado em segundo plano sem problemas e usa WiFi desde que o dispositivo esteja conectado à fonte de alimentação. Caso contrário, a conexão Wi-Fi é acelerada ou cortada e você precisa ativar o dispositivo ou permitir que a chave seja 3 / 4G LTE antecipadamente.

Atualmente, parece não haver outra solução (em todo o mundo).

BodyMindPower

unread,
Dec 16, 2019, 2:40:49 PM12/16/19
to MIT App Inventor Forum
I forgot the third option:
- exclude all devices from the Play Store, which are affected (specially Samsung devices, Android > 7)

Chris Ward

unread,
Dec 18, 2019, 11:30:37 AM12/18/19
to MIT App Inventor Forum
Related: There is a permission that can be requested for the App: REQUEST_IGNORE_BATTERY_OPTIMIZATIONS




Pedro Souza

unread,
Dec 18, 2019, 11:51:25 AM12/18/19
to MIT App Inventor Forum
Chris Ward - olá, onde e coo faço pra colocar este comando no Aplicativo, pode me ajudar?

Chris Ward - Hello, where and how do I put this command in the application, can you help me?

Chris Ward

unread,
Dec 18, 2019, 2:49:54 PM12/18/19
to MIT App Inventor Forum
In your Screen Initialisation Block.

Permission.png


Pedro Souza

unread,
Dec 23, 2019, 8:28:40 PM12/23/19
to MIT App Inventor Forum
Chris Ward - Fiz o que você indicou, apareceu o erro 908 e continuou parando a execução do aplicativo do mesmo jeito, segue blocos.

BLOCOS_WEB_RÁDIO_W3BRASIL_DEZ_2019.png

Chris Ward - I did as you indicated, error 908 appeared and continued stopping the application execution the same way, follows blocks.

Chris Ward

unread,
Dec 23, 2019, 8:58:19 PM12/23/19
to MIT App Inventor Forum
Hi Pedro

Yeah - it simply does not work, worth a try but no joy.

There has been a huge discussion amongst the Power Users and the MIT team but no concrete solution.


Reply all
Reply to author
Forward
0 new messages