Do proper activity transitions. Send controller input to the streaming PC.

This commit is contained in:
Cameron Gutman
2013-09-21 20:40:38 -04:00
parent f9785b9dec
commit aa4376f3d7
8 changed files with 135 additions and 140 deletions
+7 -19
View File
@@ -1,17 +1,12 @@
package com.limelight;
import java.io.IOException;
import org.xmlpull.v1.XmlPullParserException;
import com.limelight.nvstream.NvConnection;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
public class Connection extends Activity {
@@ -20,7 +15,7 @@ public class Connection extends Activity {
private SharedPreferences prefs;
private static final String DEFAULT_HOST = "141.213.191.238";
public static final String HOST_KEY = "hostText";
public static final String HOST_KEY = "hostKey";
@Override
@@ -32,7 +27,7 @@ public class Connection extends Activity {
public void onPause() {
SharedPreferences.Editor editor = prefs.edit();
editor.putString(this.HOST_KEY, this.hostText.toString());
editor.putString(Connection.HOST_KEY, this.hostText.toString());
editor.apply();
super.onPause();
@@ -53,22 +48,15 @@ public class Connection extends Activity {
this.hostText = (TextView) findViewById(R.id.hostTextView);
prefs = getPreferences(0);
this.hostText.setText(prefs.getString(this.HOST_KEY, this.DEFAULT_HOST));
this.hostText.setText(prefs.getString(Connection.HOST_KEY, Connection.DEFAULT_HOST));
this.statusButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
try {
new NvConnection(Connection.this.statusButton.getText().toString()).doShit();
} catch (XmlPullParserException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Intent intent = new Intent(Connection.this, Game.class);
intent.putExtra("host", Connection.this.hostText.getText().toString());
Connection.this.startActivity(intent);
}
});
}