-2

I have one application containing some text fields and radio button.now I want to take these values of text views and radio buttons and send it to Google for searching when i click on Search button, and after searching i want to also receive data from Google.Currently am able to switch to google using Intent,but I am not able to send values of text fields to google.

Rup
  • 1
  • 3

1 Answers1

0

I assume you're launching your Intent using a url like

http://www.google.com

Instead, you can use

http://www.google.com/search?q=myParam

where myParam is the thing you're searching for.

You can get this text from an EditText like this

mEdit = (EditText)findViewById(R.id.edittext);
String myParam = mEdit.getText().toString();

Then you can set your url in the Intent you launch to be

String intentURL = "http://www.google.com/search?q=" + myParam;

To search for multiple parameters, separate them using '+'s. E.g.

http://www.google.com/search?q=myParam+myParam2

The following question offers a way to handle the returned results: Chrome extension to parse google search results

Community
  • 1
  • 1
Mike T
  • 4,747
  • 4
  • 32
  • 52