Add ListenActivity for playing audio from ProtectBabyMonitor services
This activity will eventually receive audio from the MonitorActivity of another Android device and play it.
This commit is contained in:
@@ -34,6 +34,11 @@
|
|||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:parentActivityName="protect.babymonitor.StartActivity"
|
android:parentActivityName="protect.babymonitor.StartActivity"
|
||||||
/>
|
/>
|
||||||
|
<activity
|
||||||
|
android:name="protect.babymonitor.ListenActivity"
|
||||||
|
android:label="@string/app_name"
|
||||||
|
android:parentActivityName="protect.babymonitor.DiscoverActivity"
|
||||||
|
/>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|||||||
50
res/layout/activity_listen.xml
Normal file
50
res/layout/activity_listen.xml
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||||
|
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||||
|
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||||
|
android:paddingTop="@dimen/activity_vertical_margin"
|
||||||
|
android:keepScreenOn="true"
|
||||||
|
tools:context="protect.babymonitor.MonitorActivity" >
|
||||||
|
|
||||||
|
<TableLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_marginTop="124dp" >
|
||||||
|
|
||||||
|
<TableRow
|
||||||
|
android:id="@+id/tableRow1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content" >
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textStatusTitle"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="@dimen/activity_horizontal_margin"
|
||||||
|
android:text="Status:"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||||
|
|
||||||
|
<Space
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textStatus"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Listening..."
|
||||||
|
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||||
|
|
||||||
|
<Space
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
</TableRow>
|
||||||
|
|
||||||
|
</TableLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
48
src/protect/babymonitor/ListenActivity.java
Normal file
48
src/protect/babymonitor/ListenActivity.java
Normal file
@@ -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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user