Back to project page smsportal-app.
The source code is released under:
MIT License
If you think the Android project smsportal-app listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.sms; /*www . j av a 2 s. com*/ import java.io.IOException; import org.apache.http.HttpResponse; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.methods.HttpPost; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.params.BasicHttpParams; import android.os.AsyncTask; import android.util.Log; class TouchTask extends AsyncTask<String, Void, Void>{ private static final String TAG = "TouchTask"; @Override protected Void doInBackground(String... urls) { // TODO Auto-generated method stub DefaultHttpClient httpclient = new DefaultHttpClient(new BasicHttpParams()); for (String url : urls){ Log.v(TAG, "Touch URL: " + url); HttpPost httppost = new HttpPost(url); httppost.setHeader("Content-type", "application/json"); try { HttpResponse httpResponse = httpclient.execute(httppost); httpResponse.getEntity().consumeContent(); } catch (ClientProtocolException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } return null; } }