Thank you "warwound" the example you have given solved my problem.
I took the HTTP example and change "AStreams_NewData" procedure as follows :
Sub AStreams_NewData (Buffer() As Byte)
Dim Bconv As ByteConverter
Dim msg As String
Dim FN As Filepath
'Log("buffer=" & BytesToString( Buffer, 0, Buffer.Length, "UTF8"))
Dim command() As String
command = Regex.Split(" ",BytesToString( Buffer, 0, Buffer.Length, "UTF8"))
If command(0) = "GET" Then
Select Case command(1).ToLowerCase
Case "/favicon.ico"
msg = HTTP.HandleGetRequest(Bconv.StringToBytes("GET /favicon.ico HTTP/1.1", "UTF8"), AStreams)
Case "/command=1"
msg = HTTP.HandleGetRequest(Bconv.StringToBytes("GET /1.XML HTTP/1.1", "UTF8"), AStreams)
Case "/command=2"
msg = HTTP.HandleGetRequest(Bconv.StringToBytes("GET /2.XML HTTP/1.1", "UTF8"), AStreams)
Case Else
msg = HTTP.HandleGetRequest(Bconv.StringToBytes("GET /ERROR.XML HTTP/1.1", "UTF8"), AStreams)
End Select
Else
msg = HTTP.HandleGetRequest(Bconv.StringToBytes("GET /ERROR.XML HTTP/1.1", "UTF8"), AStreams)
End If
FN = HTTP.MapDirectory(msg)
End Sub
Now when android device runs this little http server code, with any browser with in the same network you can issue a command like "http:<android_server_ip>:<default_port>/command=1" (eg
http://192.168.1.51:8080/command=1). The above code interprets command number returns the data as an XML file.
I think Case "/favicon.ico" is necessary otherwise browser hangs.
Thank you everyone, and hope that this quick sample gives you new ideas.