Android Question [Resolved]Get a value of job and make a string

Douglas Farias

Expert
Licensed User
Longtime User
hi i m using a job to see my profile info in my web site
ok it return the values


B4X:
  <p>nome=Douglas Eduardo Farias</p>
    <p>email=doidloko@gmail.com</p>
    <p>link=https://plus.google.com/109691273181171171967</p>
    <p>imagem=https://lh5.googleusercontent.com/-_KZutqDhFHE/AAAAAAAAAAI/A</p>
    <p>sexo=male</p>
    <p>localizacao=pt-BR</p>

how can i get only a values?

dim a1, a2, a3, a4, a5 as string

a1 = doidloko@gmail.com
a2 = https://plus.google.com/109691273181171171967

etc etc
how can i remove the <p>and get values later nome= ?



B4X:
LogCat connected to: B4A-Bridge: motorola XT1033-359321054369100
--------- beginning of /dev/log/main
Connected to B4A-Bridge (Wifi)
sending message to waiting queue (CallSubDelayed - UpdateStatus)
Installing file.
PackageAdded: package:click.fight.vallow
(Intent) Intent { act=android.intent.action.MAIN flg=0x20000000 cmp=click.fight.vallow/.main }
no extras
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Service (httputils2service) Create **
** Service (httputils2service) Start **
    <p>nome=Douglas Eduardo Farias</p>
    <p>email=doidloko@gmail.com</p>
    <p>link=https://plus.google.com/109691273181171171967</p>
    <p>imagem=https://lh5.googleusercontent.com/-_KZutqDhFHE/AAAAAAAAAAI/A</p>
    <p>sexo=male</p>
    <p>localizacao=pt-BR</p>
 

Douglas Farias

Expert
Licensed User
Longtime User
i find a soluction , i dont know it is the best way to this but work fine

if someone could'll let my code used

this code ready my job result and take only what u need

example my job return

B4X:
<p>nome=Douglas Eduardo Farias</p>
    <p>email=doidloko@gmail.com</p>
    <p>link=https://plus.google.com/109691273181171171967</p>
    <p>imagem=https://lh5.googleusercontent.com/-_KZutqDhFHE/AAAAAAAAAAI/A</p>
    <p>sexo=male</p>
    <p>localizacao=pt-BR</p>

and with this code i take only name=
string = Douglas Eduardo Farias


B4X:
Sub Process_Globals
   Dim sf As StringFunctions
      sf.Initialize
End Sub

Sub JobDone (Job As HttpJob) 'Aqui baixa as informações exibidas do site e tras para o app
    If Job.Success = True Then
    ProgressDialogHide
        Select Job.JobName
            Case "Job1"
            Dim cass As String
            Dim ssss As String
            'Log(Job)
        cass = Job.GetString
        ssss =sf.MidExtract(cass,"<p>nome=", "</p>")
            WebView1.StopLoading
            WebView1.Visible = False
            Msgbox(ssss, "teste")
        End Select
    Else
        ToastMessageShow("Error: " & Job.ErrorMessage, True)
    End If
    Job.Release
End Sub
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…