From aa336c4cdb224a010c8aa95c95c791dcceaf0195 Mon Sep 17 00:00:00 2001 From: brarcher Date: Fri, 1 Jan 2016 14:00:05 -0500 Subject: [PATCH 1/6] Create AUTHORS file --- AUTHORS | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 AUTHORS diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..9796fc8 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,6 @@ +Branden Archer: + Initial concept and implementation + + +Anybody who has contributed code to Protect Baby Monitor is considered +an author. Send pull requests to this project for additions to this file. From 800439457bfdc3ed7e9c1299535e9f19852235da Mon Sep 17 00:00:00 2001 From: brarcher Date: Fri, 1 Jan 2016 14:05:28 -0500 Subject: [PATCH 2/6] Update NEWS --- NEWS | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NEWS b/NEWS index ef96752..4b2064c 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,9 @@ +In development: + + * Improve and simplify audio playback to reduce dropped + audio samples + + Mon Dec 28, 2015: Release 0.1 * Initial release From fddb8ceedeef1e6a60b174e1e8e9d3c4a298a14c Mon Sep 17 00:00:00 2001 From: Branden Archer Date: Fri, 1 Jan 2016 02:27:49 -0500 Subject: [PATCH 3/6] Use camel case for variable name --- src/protect/babymonitor/MonitorActivity.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/protect/babymonitor/MonitorActivity.java b/src/protect/babymonitor/MonitorActivity.java index 7d3774c..82d854f 100644 --- a/src/protect/babymonitor/MonitorActivity.java +++ b/src/protect/babymonitor/MonitorActivity.java @@ -212,11 +212,11 @@ public class MonitorActivity extends Activity _registrationListener = new NsdManager.RegistrationListener() { @Override - public void onServiceRegistered(NsdServiceInfo NsdServiceInfo) { + public void onServiceRegistered(NsdServiceInfo nsdServiceInfo) { // Save the service name. Android may have changed it in order to // resolve a conflict, so update the name you initially requested // with the name Android actually used. - final String serviceName = NsdServiceInfo.getServiceName(); + final String serviceName = nsdServiceInfo.getServiceName(); Log.i(TAG, "Service name: " + serviceName); From 7cb2138d13312c37347773602eb5856eea8b513b Mon Sep 17 00:00:00 2001 From: Branden Archer Date: Fri, 1 Jan 2016 02:29:02 -0500 Subject: [PATCH 4/6] Display IP Address and port of child device Later, the parent will be able to use this information to pair with the child device, as an alternative to using mDNS --- AndroidManifest.xml | 1 + res/layout/activity_monitor.xml | 38 ++++++++++++++++++++ res/values/strings.xml | 5 ++- src/protect/babymonitor/MonitorActivity.java | 29 +++++++++++++++ 4 files changed, 72 insertions(+), 1 deletion(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 5fd218a..7fe6b8c 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -9,6 +9,7 @@ android:targetSdkVersion="17" /> + + + + + + + + + + + + + Connected To: Disconnected Listening... - + Address: + Port: + Address and port that parent must pair to + Not connected to a Wi-Fi network diff --git a/src/protect/babymonitor/MonitorActivity.java b/src/protect/babymonitor/MonitorActivity.java index 82d854f..4d5a3ac 100644 --- a/src/protect/babymonitor/MonitorActivity.java +++ b/src/protect/babymonitor/MonitorActivity.java @@ -28,7 +28,10 @@ import android.media.AudioRecord; import android.media.MediaRecorder; import android.net.nsd.NsdManager; import android.net.nsd.NsdServiceInfo; +import android.net.wifi.WifiInfo; +import android.net.wifi.WifiManager; import android.os.Bundle; +import android.text.format.Formatter; import android.util.Log; import android.view.Menu; import android.view.MenuItem; @@ -163,6 +166,29 @@ public class MonitorActivity extends Activity } }); _serviceThread.start(); + + MonitorActivity.this.runOnUiThread(new Runnable() + { + @Override + public void run() + { + final TextView addressText = (TextView) findViewById(R.id.address); + + final WifiManager wifiManager = (WifiManager) getSystemService(WIFI_SERVICE); + final WifiInfo info = wifiManager.getConnectionInfo(); + final int address = info.getIpAddress(); + if(address != 0) + { + @SuppressWarnings("deprecation") + final String ipAddress = Formatter.formatIpAddress(address); + addressText.setText(ipAddress); + } + else + { + addressText.setText(R.string.wifiNotConnected); + } + } + }); } @Override @@ -229,6 +255,9 @@ public class MonitorActivity extends Activity final TextView serviceText = (TextView) findViewById(R.id.textService); serviceText.setText(serviceName); + + final TextView portText = (TextView) findViewById(R.id.port); + portText.setText(Integer.toString(port)); } }); } From 562a2bb164ca69c54fe328493f1bdac2af383d44 Mon Sep 17 00:00:00 2001 From: Branden Archer Date: Fri, 1 Jan 2016 14:03:56 -0500 Subject: [PATCH 5/6] Initial attempt at pairing with child device with address/port On some networks or some mDNS implementations child discovery may not work well. As an alternative, allow a parent to connect to a device directly with an IP Address and port. --- AndroidManifest.xml | 1 + res/layout/activity_discover.xml | 58 +++++++++++++++++++ res/values/strings.xml | 5 ++ src/protect/babymonitor/DiscoverActivity.java | 55 +++++++++++++++--- 4 files changed, 112 insertions(+), 7 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 7fe6b8c..a169371 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -36,6 +36,7 @@ android:name="protect.babymonitor.DiscoverActivity" android:label="@string/app_name" android:configChanges="orientation|screenSize" + android:windowSoftInputMode="adjustPan" android:parentActivityName="protect.babymonitor.StartActivity" /> + + + + + + + + + + + + + + +