Yep, I'm a noob. Got an app working though but can't test the web services component without being able to muster an internet connection (3g or WiFi) through the emulator. I would appreciate any suggestion on where to find documentation on how to get the emulator to connect to the internet, or a pointer to an example?
Thanks, Erel, for your help and for the really fast reply! I must have something wrong with the way I'm using httputils. I'm getting nothing back from a call to HttpUtils.GetString(b4a). I'm trying to stick pretty close to the simple example you provided. All I'm trying to do is dump the contents of the GetString to an EditText view by clicking a button so that I can verify that I'm getting something back... but the length of s ends up equal to zero.
B4X:
Sub Process_Globals
End Sub
Sub Globals
Dim butTest As Button
Dim sms_result As EditText
Dim b4a As String
Dim s As String
b4a = "http://www.google.com"
End Sub
Sub Activity_Create(FirstTime As Boolean)
activity.LoadLayout("xaffle_login")
HttpUtils.CallbackActivity = "Main" 'Current activity name.
HttpUtils.CallbackJobDoneSub = "JobDone"
HttpUtils.Download("Job1", b4a)
End Sub
Sub JobDone (Job As String)
If HttpUtils.IsSuccess(b4a) Then
s = HttpUtils.GetString(b4a)
End If
End Sub
Sub butTest_Click
sms_result.text = s
Dim y As Int
y = s.Length
Msgbox ("length=" & y, "string test")
End Sub
I recommend you to use a real device for development. The Android emulator is very slow.
The emulator is good for working with the WYSIWYG designer and for specific tests that require a different version of Android.
Thanks, Erel. That sounds like good advice. I'll try to figure out how to get synced with a real device. What's the best resource on the site for understanding that?