Android Question [Solved] Read online radio stream icy-metaint


Active Member
Licensed User
Is it possible to read the data from a radio stream contained in icy-metaint?
I have implemented this class in java and it works fine, but wanted to know if it can be done with OkHttpClient.

Mi code:
    hc.Initialize("hc")' OkHttpClient
    Dim req As OkHttpRequest
    req.SetHeader("Icy-MetaData", "1")
    req.SetHeader("Connection", "close")
    req.SetHeader("Accept", Null)
    Private Sub hc_ResponseSuccess (Response As OkHttpResponse, TaskId As Int)
        Log(Response.ContentType)'<---- return audio/mpeg
        Log(Response.GetHeaders)'<---- return map headers
    End If

(MyMap) {accept-ranges=[none], access-control-allow-origin=[*], cache-control=[no-cache,no-store,must-revalidate,max-age=0], connection=[close], content-type=[audio/mpeg], icy-br=[128], icy-genre=[folk latina latin], icy-metaint=[32768], icy-name=[RADIO CHANQUETE MALAGA ( ANDALUCIA ESPANA SPAIN ESPANOL], icy-notice1=[<BR>This stream requires <a href="">Winamp</a><BR>], icy-notice2=[SHOUTcast DNAS/posix(linux x86) v2.5.5.733<BR>], icy-pub=[1], icy-sr=[44100], icy-url=[], x-clacks-overhead=[GNU Terry Pratchett]}

Java class code :

URLConnection con = streamUrl.openConnection();
con.setRequestProperty("Icy-MetaData", "1");
con.setRequestProperty("Connection", "close");
con.setRequestProperty("Accept", null);
int metaDataOffset = 0;
Map<String, List<String>> headers = con.getHeaderFields();
InputStream stream = con.getInputStream(); <----- ???
Last edited:


Well-Known Member
Licensed User
Longtime User
Hi, you can show the full code. Take a look at this thread:
Upvote 0