Android Question InitializePost2 amd MP3 files

gehrlekrona

Member
Licensed User
Longtime User
I have a mySQL database and I want to query the database and get the name of an MP3 file that is i there and play it.
I think I have some it right so when I send my query to the php page it returns the path to the MP3 file. From there I am not sure since it doesn't play anything.

MC is my HTTPClient

step1:
GetMP3("SELECT mp3 from table where id='" & ID.Text.SubString2(0,6) & "' and plats='" & plats.Text.SubString2(0,7) & "'", mp3)
Step2:
Sub GetMP3(Query As String, TaskId As Int)

Dim reqs As HttpRequest

reqs.InitializePost2("http://www.mysite.com/getmp3.php?id=" & ID.Text.SubString2(0,6) & "&plats=" & plats.Text.SubString2(0,9), Query.GetBytes("UTF8"))
MC.Execute(reqs, TaskId)

End Sub
Step3:
Sub MC_ResponseSuccess (Response As HttpResponse, TaskId As Int)

Dim ress As String
Dim urls As String
ress = Response.GetString("UTF8")
urls=ress

If ress.EndsWith("mp3") Then
mp.LoadLoad(urls)
mp.Play
End If

End Sub

Any suggestions?
 

gehrlekrona

Member
Licensed User
Longtime User
I only have version 1.8 so I can't use Httputils2 and I am not sure how to use it at all in the code I have :( Sorry for being such a moron. I have tried to find some examples but not how to query the database, get the name on the MP3 file and stream it in my player.
If there is an example that I haven't found yet, please place a link so I can try to understand how to use it.
 
Upvote 0
Top