Make yourself familiar with regular expressions and try to evaluate the 
input string for matching known URL address patterns. The problem here is, 
that your pattern matching must not be strict. So you also need to allow 
input like

www.domain.com
domain.com

without http(s) protocol prefix which will be the most likely user input. 
Unfortunately that is a malformed URL and you need to auto-complete it so 
it gets valid:

www.domain.com --> http://www.domain.com/

Everything that does *not *match your URL pattern should be treated as 
search query. You could pass on that query to Google or whatever search 
engine of your choice.


On Monday, August 5, 2013 2:10:07 PM UTC-5, SonyPhoneGuy wrote:
>
> Hello,
>
> I would like to make a search interface on android with Eclipse.
>
> I have managed to add a search box on my form by using the menu xml which 
> shows on the form action bar.  I also have an webview on my form that is to 
> load what is entered into the search box. 
>
> I was wondering if there was an easy way to do websearch (if the entered 
> term is not a webresource) or to display the webpage if the search term is 
> correct ... rather like how the native browser does it on android.
>
> Thank you. 
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to