?[package:][type:]na
public static final int ic_launcher=0x7f020000;
}
public static final class id {
- public static final int videoView=0x7f080000;
+ public static final int editText1=0x7f080002;
+ public static final int hostTextView=0x7f080000;
+ public static final int statusButton=0x7f080001;
+ public static final int videoView=0x7f080003;
}
public static final class layout {
public static final int activity_connection=0x7f030000;
@@ -110,7 +113,7 @@ or to a theme attribute in the form "?[package:][type:]na
Must be a reference to another resource, in the form "@[+][package:]type:name"
or to a theme attribute in the form "?[package:][type:]name".
- @attr name android:buttonBarButtonStyle
+ @attr name com.limelight:buttonBarButtonStyle
*/
public static final int ButtonBarContainerTheme_buttonBarButtonStyle = 1;
/**
@@ -120,7 +123,7 @@ or to a theme attribute in the form "?[package:][type:]na
Must be a reference to another resource, in the form "@[+][package:]type:name"
or to a theme attribute in the form "?[package:][type:]name".
- @attr name android:buttonBarStyle
+ @attr name com.limelight:buttonBarStyle
*/
public static final int ButtonBarContainerTheme_buttonBarStyle = 0;
};
diff --git a/libs/dnsjava-2.1.5.jar b/libs/dnsjava-2.1.5.jar
new file mode 100644
index 00000000..e928fad9
Binary files /dev/null and b/libs/dnsjava-2.1.5.jar differ
diff --git a/res/layout/activity_connection.xml b/res/layout/activity_connection.xml
index a8fff5e7..a291bb75 100644
--- a/res/layout/activity_connection.xml
+++ b/res/layout/activity_connection.xml
@@ -8,4 +8,28 @@
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".Connection" >
+
+
+
+
+
+
+
diff --git a/src/com/limelight/Connection.java b/src/com/limelight/Connection.java
index bdc715b5..66f91ac0 100644
--- a/src/com/limelight/Connection.java
+++ b/src/com/limelight/Connection.java
@@ -7,21 +7,59 @@ 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.SharedPreferences;
public class Connection extends Activity {
+ private Button statusButton;
+ private TextView hostText;
+ private SharedPreferences prefs;
+
+ private static final String DEFAULT_HOST = "141.213.191.238";
+ public static final String HOST_KEY = "hostText";
+
+ @Override
+ public void onResume() {
+ super.onResume();
+ }
+
+ @Override
+ public void onPause() {
+ SharedPreferences.Editor editor = prefs.edit();
+
+ editor.putString(this.HOST_KEY, this.hostText.toString());
+ editor.apply();
+
+ super.onPause();
+ }
+
+ @Override
+ protected void onDestroy() {
+ super.onDestroy();
+ }
+
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_connection);
- new Thread(new Runnable() {
-
+
+ this.statusButton = (Button) findViewById(R.id.statusButton);
+ this.hostText = (TextView) findViewById(R.id.hostTextView);
+
+ prefs = getPreferences(0);
+ this.hostText.setText(prefs.getString(this.HOST_KEY, this.DEFAULT_HOST));
+
+ this.statusButton.setOnClickListener(new OnClickListener() {
@Override
- public void run() {
+ public void onClick(View arg0) {
try {
- new NvConnection("141.213.191.238").doShit();
+ new NvConnection(Connection.this.statusButton.getText().toString()).doShit();
} catch (XmlPullParserException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -31,7 +69,7 @@ public class Connection extends Activity {
}
}
- }).start();
+ });
}
}
diff --git a/src/com/limelight/nvstream/NvMDNS.java b/src/com/limelight/nvstream/NvMDNS.java
new file mode 100644
index 00000000..9099daea
--- /dev/null
+++ b/src/com/limelight/nvstream/NvMDNS.java
@@ -0,0 +1,27 @@
+package com.limelight.nvstream;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
+public class NvMDNS {
+
+
+
+ public static String NVSTREAM_MDNS_QUERY = "_nvstream._tcp.local.";
+ public static final short MDNS_PORT = 5353;
+ public static final int REPLY_TIMEOUT = 3000;
+ public static final int REPLY_TRIES = 10;
+ public static InetAddress MDNS_ADDRESS;
+
+ static {
+ try {
+ // 224.0.0.251 is the mDNS multicast address
+ MDNS_ADDRESS = InetAddress.getByName("224.0.0.251");
+ } catch (UnknownHostException e) {
+ MDNS_ADDRESS = null;
+ }
+ }
+
+ // TODO: Implement this shit
+
+}