From 2e164c0fb2d83b82676b9210862bf15e48ccb56f Mon Sep 17 00:00:00 2001 From: Branden Archer Date: Sat, 26 Dec 2015 15:49:53 -0500 Subject: [PATCH] Add ListenActivity for playing audio from ProtectBabyMonitor services This activity will eventually receive audio from the MonitorActivity of another Android device and play it. --- AndroidManifest.xml | 5 +++ res/layout/activity_listen.xml | 50 +++++++++++++++++++++ src/protect/babymonitor/ListenActivity.java | 48 ++++++++++++++++++++ 3 files changed, 103 insertions(+) create mode 100644 res/layout/activity_listen.xml create mode 100644 src/protect/babymonitor/ListenActivity.java diff --git a/AndroidManifest.xml b/AndroidManifest.xml index a666bab..2d3e46d 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -34,6 +34,11 @@ android:label="@string/app_name" android:parentActivityName="protect.babymonitor.StartActivity" /> + diff --git a/res/layout/activity_listen.xml b/res/layout/activity_listen.xml new file mode 100644 index 0000000..6907746 --- /dev/null +++ b/res/layout/activity_listen.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/protect/babymonitor/ListenActivity.java b/src/protect/babymonitor/ListenActivity.java new file mode 100644 index 0000000..e5224c6 --- /dev/null +++ b/src/protect/babymonitor/ListenActivity.java @@ -0,0 +1,48 @@ +/** + * This file is part of the Protect Baby Monitor. + * + * Protect Baby Monitor is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Protect Baby Monitor is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Protect Baby Monitor. If not, see . + */ +package protect.babymonitor; + +import android.app.Activity; +import android.os.Bundle; + +public class ListenActivity extends Activity +{ + final String TAG = "BabyMonitor"; + + String _address; + int _port; + String _name; + + @Override + protected void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + + Bundle b = getIntent().getExtras(); + _address = b.getString("address"); + _port = b.getInt("port"); + _name = b.getString("name"); + + setContentView(R.layout.activity_listen); + } + + @Override + public void onDestroy() + { + super.onDestroy(); + } +}