I'm Feeling Lucky

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

I'm Feeling Lucky

Postby Secant » Sun Nov 21, 2010 2:13 am

Hi I'm new to the Android platform but I've been able to learn quite a bit already. There is one thing bugging me at the moment and I cannot seem to find an obvious answer without searching deeply through all of Google's code and I was wondering if somebody could help. I do apologize if this is the wrong place for this post, please move it if it is, but I figured it could be a good Novice tutorial.

Essentially what I have right now is an app with an edit box and a button that takes the string and uses an Intent and the SearchManager to launch the browser and search Google for the string. This is easy enough I found the code on some other forum. However, what I would like to do is to perform a search and only receive the first url Google's search shows. I tried just parsing the page source but Google's page is not that simple. I think what needs to be done is to some how get the search manager to start the search without launching the browser and many instead have a Cursor collect all the URLs or even just the first. Maybe a Cursor isn't what I need I just THINK.. it is, limited knowledge and all. Essentially I would like to make a button that mirrors the "I'm Feeling Lucky" button on Google. Hopefully there is just some function that does that. Even better would be in I could get the function to just return the URL and then later allow me to launch the page in my own custom WebView, for learnings sake.
Posts: 2
Joined: Sun Nov 21, 2010 1:50 am


Return to Novice Tutorials

Who is online

Users browsing this forum: YaCy [Bot] and 3 guests