lachica426
New Member
Hey guys. I'd like to ask how to retrieve data from MYSQL using httputils2. I've been working for this app using HttpClient and usually test it using the emulator and it's working fine. The problem is when I run it on my actual device with a higher SDK (Jelly Bean), it throws an error that says: "Network on main thread exception" and the 2nd line of this part of my code gets highlighted:
I've tried reading on this forum and learned that I must instead us HttpUtils2 / Response.GetAsynchronously method but the problem is, I don't know how to start and how to convert my code.. If you could give me a sample code or anything that would be very much appreciated. I badly need your help and suggestions. Thank you!
B4X:
Case getSched
Dim res As String
res = Response.GetString("UTF8")
Dim parser As JSONParser
parser.Initialize(res)
Dim sched As List
sched.Initialize
sched = parser.NextArray