diff options
author | AndrewMurrell <amurrel@purdue.edu> | 2014-05-07 15:11:59 -0400 |
---|---|---|
committer | AndrewMurrell <amurrel@purdue.edu> | 2014-05-07 15:11:59 -0400 |
commit | d28e031e2f4c35c0568837a087e629317464d19b (patch) | |
tree | ba6bea5e901f44c47d0d292dd5ceb9f3f850b3bb /src/us | |
parent | 3f676d37ad2a110eff5696791478c873be7b24ff (diff) |
updated uploadGestures
Diffstat (limited to 'src/us')
-rw-r--r-- | src/us/minak/SettingsActivity.java | 40 |
1 files changed, 8 insertions, 32 deletions
diff --git a/src/us/minak/SettingsActivity.java b/src/us/minak/SettingsActivity.java index 72274b6..93629ea 100644 --- a/src/us/minak/SettingsActivity.java +++ b/src/us/minak/SettingsActivity.java @@ -16,19 +16,11 @@ package us.minak; -import java.io.IOException; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.Map; -import org.apache.http.HttpResponse; -import org.apache.http.client.ClientProtocolException; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.FileEntity; -import org.apache.http.impl.client.DefaultHttpClient; - import android.app.ListActivity; import android.content.Context; import android.content.Intent; @@ -90,23 +82,15 @@ public class SettingsActivity extends ListActivity { mTask = (GesturesLoadTask) new GesturesLoadTask().execute(); } - public void uploadGesture() { + public void uploadGestures() { // Create a new HttpClient and Post Header - HttpClient httpclient = new DefaultHttpClient(); - HttpPost httppost = new HttpPost("https://lukeshu.com/minak-server"); - - try { - //FileInputStream stream = new FileInputStream(SettingsUtil.getGestureFile(this)); - httppost.setEntity(new FileEntity(SettingsUtil.getGestureFile(this), "application/octet-stream")); - HttpResponse response = httpclient.execute(httppost); - - Toast toast = Toast.makeText(this, response.toString(), Toast.LENGTH_LONG); - toast.show(); - } catch (ClientProtocolException e) { - // TODO Auto-generated catch block - } catch (IOException e) { - // TODO Auto-generated catch block - } + PostTask task = new PostTask(); + task.setActivity(this); + task.execute("https://lukeshu.com/minak-server"); + } + + public void uploadGestures(View view) { + uploadGestures(); } private void checkForEmpty() { @@ -116,14 +100,6 @@ public class SettingsActivity extends ListActivity { } // Basic life-cycle /////////////////////////////////////////////////////// - - - public void postGesture(){ - - - } - - /////////////////////////////// @Override protected void onCreate(Bundle savedInstanceState) { |