B4J Question Question About non-ui apps

tufanv

Expert
Licensed User
Longtime User
Hello,

I have looked into Erel's topic about non-ui applications ( curl project) . In that project, the html code of a website is taken. With an ui app project , i can take the code into a textview and extract some values with text1.substring2. But with non-ui i think i cant use or create a textview because it is just a console app. What can i use to extract some values like with substring2.

Thanks
 

Mark Read

Well-Known Member
Licensed User
Longtime User
You can download the whole URL into a string variable using httputils or the newer versions. Depending on what you want to extract, there may be other ways too.

What data do you want from the site?
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
You can download the whole URL into a string variable using httputils or the newer versions. Depending on what you want to extract, there may be other ways too.

What data do you want from the site?

I want to extract some exchange rates from the website. Normally for my b4i and b4a app i get the whole code in to a textview than i use text1.substring2(point1,point2)
to get the portion i want from the code.
 
Upvote 0

billzhan

Active Member
Licensed User
Longtime User
B4X:
'use httputils2 module (source code version  which support non-ui, not *.jar lib
    Dim linkstr As String = "http://yourtarget.com"
    Dim j As HttpJob
    j.Initialize("j", Me)
    j.Download(linkstr)

Sub JobDone(j As HttpJob)
    If j.Success Then
         html_STR = j.GetString
         html_STR.substring2(point1,point2)
    Else
         html_STR=""
    End If
End Sub
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
Thank you very much. I will try now
B4X:
'use httputils2 module (source code version  which support non-ui, not *.jar lib
    Dim linkstr As String = "http://yourtarget.com"
    Dim j As HttpJob
    j.Initialize("j", Me)
    j.Download(linkstr)

Sub JobDone(j As HttpJob)
    If j.Success Then
         html_STR = j.GetString
         html_STR.substring2(point1,point2)
    Else
         html_STR=""
    End If
End Sub
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
So i can use it without the view. After so many years stil i dont know some important basic things.

THis is the first time i will use b4j so thank you !
 
Upvote 0
Top