Reproductor de radio

hola, quiero hacer una app que reproduzca una radio por internet (eso ya lo se hacer)

Pero lo quie quiero implementar es que si el internet del telefono falla, el reproductor intente conectarse hasta que el telefono tenga nuevamente conexion. o en caso que el stream este fuera de linea, el reproductor cada 15 segundos intente concetarse sin que se genere el error de que el app no responde.

hello, I want to make an app that plays an internet radio (I already know how to do that)

But what I want to implement is that if the phone's internet fails, the player will try to connect until the phone has a connection again. or in case the stream is offline, the player tries to connect every 15 seconds without generating the error that the app is not responding.

  1. If not connected put a Notifier in the Net.OnDisconnect event: "Connection lost ... please wait..." and try to play the audio stream again in the Net.OnConnect event.
    See here: Net : Get some information about network
    grafik

  2. But since Android 6 Google introduced Doze mode. This causes all possible functions to be shut down / throttled (WiFi / LTE etc.) after some time (min / sec). This inevitably leads to disconnections and the audio stream stops. To prevent this, a Foreground servive must be used.
    Search the forum for radio / streaming app.

Gracias, esa parte la entiendo. pero no es lo que intento hacer. Lo que intento hacer es que si yo apago la transmisión de shoutcast en el servidor el app detecte que se perdió la señal del servidor (no la señal del internet en el movil) y que entre en estado de reconexión constante. Y que luego que yo active nuevamente la señal en el servidor, el app se como esta en intentos de reconecar, se conecte automaticamente

Thanks, I understand that part. but that's not what i'm trying to do. What I am trying to do is that if I turn off the shoutcast transmission on the server, the app detects that the server signal has been lost (not the internet signal on the mobile) and that it enters a constant reconnection state. And that after I activate the signal on the server again, the app knows how it is in attempts to reconnect, it connects automatically

  1. Use a Foreground service to keep the WiFi / Internet connection stable.
  2. If the sound then stops (i.e. your server is not sending), use a clock that tries to start the sound again every 15 seconds.

Btw, what is your purpose? Why is the server disconnecting?

lo quiero hacer para cuando la conexión de internet falla en la pc que se usa para enviar el audio al server se desconecte, el stream en el app al detenerse intente reconectarse, para as{i cuando la conexion del punto de emision se restaura, el app se conecte automaticmente sin dar play

I want to do it so that when the internet connection fails on the pc that is used to send the audio to the server, it disconnects, the stream in the app when it stops tries to reconnect, so that when the connection of the emission point is restored, the app connects automatically without giving play

Ok, and what's the problem with doing it like I said?

el problema e que no se como armarlo.