私は以下のコードを持っています。私はこのコードをクリックボタンで呼びたいと思っています どうすればいいですか?どのように私はクリックボタンアンドロイドで次の無効を呼び出すことができますか?
public static void main(String[] args) throws Exception {
String google = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=";
String search = "stackoverflow";
String charset = "UTF-8";
URL url = new URL(google + URLEncoder.encode(search, charset));
Reader reader = new InputStreamReader(url.openStream(), charset);
GoogleResults results = new Gson().fromJson(reader, GoogleResults.class);
// Show title and URL of 1st result.
System.out.println(results.getResponseData().getResults().get(0).getTitle());
System.out.println(results.getResponseData().getResults().get(0).getUrl());
}
あなたの質問から明らかなように、Androidの初心者ですから、このチュートリアルを見てみることをお勧めします。http://developer.android.com/resources/tutorials/hello-world.html – slayton