Need help with simple search function.

FDisk

Member
Totally :sign0104: question guys.

I have a [search text box] and a [search button]
A URL hxxp://mysitehere.com/find.php?text=

What I'm trying to do is this:
The text that I type in the [search text box] to be added to the end of the URL and go to that webview when [search button] is pressed.

For example if I type "chicago"
I would like it to go to hxxp://mysitehere.com/find.php?text=chicago

Thanks for helping. :)
 
Hi FDisk,

You need the Phone library, which gives acces to your device's browser.

If your URL and search text are in variables or views (e.g. Url and Search) you can call :
Code: Copy
StartActivity (PhoneIntents.OpenBrowser(Url.Text & Search.Text))
and your browser will be opened with the requested page.

You can have at look at Basic4android - Phone
 
Upvote 0
Hi FDisk,

You need the Phone library, which gives acces to your device's browser.

If your URL and search text are in variables or views (e.g. Url and Search) you can call :
Code: Copy
StartActivity (PhoneIntents.OpenBrowser(Url.Text & Search.Text))
and your browser will be opened with the requested page.

You can have at look at hxxp://www.b4x.com/android/help/phone.html#phoneintents_openbrowser]Basic4android - Phone

Awesome! Thanks BasicBert :sign0188:
I actually played with it for a while and found the solution myself.
Did it like this. Workes just like I wanted. :icon_clap:

Code: Copy
Sub Globals
   Dim WebView1 As WebView
   Dim EditText1 As EditText
End Sub

Sub Activity_Create(FirstTime As Boolean)
   Activity.LoadLayout("project1")
   WebView1.LoadUrl("hxxp://mysitehere.com")
End Sub

Sub Button5_Click
   WebView1.LoadUrl("hxxp://mysitehere.com/find.php?text="&EditText1.Text)
End Sub
 
Upvote 0
Hi FDisk,

:sign0142:
If just 1 word from me, a :sign0104:, was helpfull to you, I'm happy.
Just because it's my first response to someone else's question in stead of my own.

I have not (yet) used a webview myself, so I'm learning from you too. I might have to use it later.

Reading other posts, even ones that you think may not apply to yourself, is a great source of examples and help and brings you idea's.
 
Upvote 0
Back
Top