@@ -0,0 +1,2303 @@
+package com.example.smartgrid;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport org.apache.http.HttpEntity;%0Aimport org.apache.http.HttpResponse;%0Aimport org.apache.http.NameValuePair;%0Aimport org.apache.http.client.HttpClient;%0Aimport org.apache.http.client.entity.UrlEncodedFormEntity;%0Aimport org.apache.http.client.methods.HttpPost;%0Aimport org.apache.http.impl.client.DefaultHttpClient;%0Aimport org.apache.http.message.BasicNameValuePair;%0Aimport org.apache.http.util.EntityUtils;%0A%0Aimport android.app.Activity;%0Aimport android.os.AsyncTask;%0Aimport android.os.Bundle;%0Aimport android.util.Log;%0Aimport android.view.Menu;%0Aimport android.view.MenuItem;%0Aimport android.view.View;%0Aimport android.widget.Button;%0Aimport android.widget.EditText;%0A%0Apublic class DeleteActivity extends Activity %7B%0A%09EditText ip = null;%0A%09EditText AppName = null;%0A%09@Override%0A%09protected void onCreate(Bundle savedInstanceState) %7B%0A%09%09super.onCreate(savedInstanceState);%0A%09%09setContentView(R.layout.activity_delete);%0A%09%09%0A%09%09AppName = (EditText)findViewById(R.id.editText2);%0A%09%09%0A%09%09Button delete = (Button)findViewById(R.id.button1);%0A%09%09delete.setOnClickListener(new View.OnClickListener() %7B%0A%09%09%09%0A%09%09%09@Override%0A%09%09%09public void onClick(View v) %7B%0A%09%09%09%09new DeleteTask().execute();%0A%09%09%09%09%0A%09%09%09%7D%0A%09%09%7D);%0A%09%7D%0A%09%0A%09private class DeleteTask extends AsyncTask%3CVoid, Integer, Double%3E %7B%0A%09%09String HadoopoutDelete;%0A%0A%09%09protected Double doInBackground(Void... voids) %7B%0A%09%09%09postData();%0A%0A%09%09%09return null;%0A%09%09%7D%0A%0A%09%09public void postData() %7B%0A%09%09%09EditText ipAddress = (EditText) findViewById(R.id.editText1);%0A%09%09%09%0A%09%09%09HttpClient httpclient = new DefaultHttpClient();%0A%09%09%09HttpPost httppost = new HttpPost(%22http://%22 + ipAddress.getText()%0A%09%09%09%09%09+ %22/deleteAppliance.php%22);%0A%0A%09%09%09try %7B%0A%09%09%09%09List%3CNameValuePair%3E nameValuePairs = new ArrayList%3CNameValuePair%3E(%0A%09%09%09%09%09%091);%0A%09%09%09%09nameValuePairs.add(new BasicNameValuePair(%22Name%22, AppName%0A%09%09%09%09%09%09.getText().toString()));%0A%09%09%09%09%0A%09%09%09%09httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));%0A%09%09%09%09HttpResponse response = httpclient.execute(httppost);%0A%09%09%09%09HttpEntity entity = response.getEntity();%0A%09%09%09%09HadoopoutDelete = EntityUtils.toString(entity);%0A%0A%09%09%09%7D catch (Exception e) %7B%0A%09%09%09%09Log.e(%22log_tag%22, %22Error in http connection %22 + e.toString());%0A%09%09%09%09return;%0A%09%09%09%7D%0A%09%09%7D%0A%0A%09%09protected void onPostExecute(Double result) %7B%0A%09%09%09AppName.setText(%22%22);%0A%09%09%09%0A%0A%09%09%7D%0A%0A%09%7D%0A%7D%0A

Create DeleteActivity.java