Android Tutorial Embed an Http Server in your Android Application

Status
Not open for further replies.

Douglas Farias

Expert
Licensed User
Longtime User
@Erel how to upload multiple files on this example?
on the html is only add <multiple> at form, you can select multiple files, later u see 3 files selected, but when you go to upload, press a button to upload, this upload only one. how to make a multiple upload to device?
 

omidaghakhani1368

Well-Known Member
Licensed User
Longtime User
Hi Erel.
my note 3 device get force close error when i enter ip in addressbar why?
 

IslamQabel

Active Member
Licensed User
Longtime User
If i want to display a text of a label found in the activity module(e.g. LabelA) such that i want to display it in the web page when i access the server from any PC web browser.
can i use the following code:
B4X:
Sub Server_HandleRequest (Request As ServletRequest, Response As ServletResponse)
   Response.SendString(LabelA.text)
End Sub

noting that ... i built html page using general html editor not by B4J
thanks
 

IslamQabel

Active Member
Licensed User
Longtime User
i know that the server code should be in service module....I am asking how to display the text of LabelA which found activity module to be displayed in the web page
 

IslamQabel

Active Member
Licensed User
Longtime User
i want to build more than one web page .....for example three web pages so the user can move from one to the others how to do that?
Thanks
 

IslamQabel

Active Member
Licensed User
Longtime User
In the first example, i see "list" page.....so if i want to add for example "page2.html" should i add the same subroutines like the "main page" in the service module?
 

IslamQabel

Active Member
Licensed User
Longtime User
Hi Erel....
in the service module.....if i add the following in sub Server-HandleRequest
B4X:
Case Request.RequestURI,StartWith("/page2/")
         HandlePage2(Request,Response)
and adding this new sub-routine:
B4X:
Sub HandlePage2(Response As ServletResponse)
      Dim Page2 As String=GetTemplate("Page2.html")
     '******displaying the time in the second page***
     Page2=Page2.Replace("$TIME$",DateTime.Time(DateTime.Now))
Response.SetContentType("text/html")
Response.SendString(Second)
End Sub
are these additional codes are correct?
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…