On a second device I want to connect to the first via a WiFi network using it’s IP address (http://192.168.2.105:5555) and get the $DEVICENAME$ var from the html. Question is how do I connect and how do I retrieve the data?
You should connect to the http server with HttpUtils2. While you can parse the html, a simpler option will be to change the string returned from the server (JSON for example).
Hi Erel,
I try this..........data is a string containing the html code from #1 device
B4X:
Dim p As JSONParser
ToastMessageShow(data, False)
p.Initialize(data) '(File.ReadString(File.DirAssets, "1.txt"))
Dim list1 As List
list1.Initialize
list1 = p.NextArray <<<<<<<<<<<<<<<<<<<< error here
Dim map1 As Map
map1 = list1.Get(0)
Log(map1)
'Dim data As String
data = map1.Get("$DEVICENAME$")
ToastMessageShow(data, False)