Change project name to "Child Monitor"

This commit is contained in:
edr
2020-04-22 22:52:08 +02:00
parent 10f2d0a253
commit d0ed6c1bba
29 changed files with 159 additions and 140 deletions

View File

@@ -7,14 +7,14 @@ findbugs {
}
android {
compileSdkVersion 25
compileSdkVersion 26
defaultConfig {
applicationId "protect.babymonitor"
applicationId "child.monitor"
minSdkVersion 19
targetSdkVersion 26
versionCode 3
versionName "0.3"
versionCode 4
versionName "0.4"
}
buildTypes {
@@ -25,7 +25,7 @@ android {
}
dependencies {
compile "com.android.support:support-compat:25.4.0"
compile "com.android.support:support-compat:26.1.0"
}
}

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="protect.babymonitor"
package="de.rochefort.childmonitor"
android:versionCode="2"
android:versionName="0.2" >
@@ -14,7 +14,7 @@
android:label="@string/app_name"
android:theme="@android:style/Theme.Holo" >
<activity
android:name="protect.babymonitor.StartActivity"
android:name="de.rochefort.childmonitor.StartActivity"
android:label="@string/app_name"
android:configChanges="orientation|screenSize"
>
@@ -24,23 +24,23 @@
</intent-filter>
</activity>
<activity
android:name="protect.babymonitor.MonitorActivity"
android:name="de.rochefort.childmonitor.MonitorActivity"
android:label="@string/app_name"
android:configChanges="orientation|screenSize"
android:parentActivityName="protect.babymonitor.StartActivity"
android:parentActivityName="de.rochefort.childmonitor.StartActivity"
/>
<activity
android:name="protect.babymonitor.DiscoverActivity"
android:name="de.rochefort.childmonitor.DiscoverActivity"
android:label="@string/app_name"
android:configChanges="orientation|screenSize"
android:windowSoftInputMode="adjustPan"
android:parentActivityName="protect.babymonitor.StartActivity"
android:parentActivityName="de.rochefort.childmonitor.StartActivity"
/>
<activity
android:name="protect.babymonitor.ListenActivity"
android:name="de.rochefort.childmonitor.ListenActivity"
android:label="@string/app_name"
android:configChanges="orientation|screenSize"
android:parentActivityName="protect.babymonitor.DiscoverActivity"
android:parentActivityName="de.rochefort.childmonitor.DiscoverActivity"
/>
</application>

View File

@@ -0,0 +1,31 @@
/**
* This file is part of the Child Monitor.
*
* Child 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.
*
* Child 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 Child Monitor. If not, see <http://www.gnu.org/licenses/>.
*/
package de.rochefort.childmonitor;
import android.media.AudioFormat;
public class AudioCodecDefines {
public static final int FREQUENCY = 11025;
public static final int ENCODING = AudioFormat.ENCODING_PCM_16BIT;
public static final int CHANNEL_CONFIGURATION_IN = AudioFormat.CHANNEL_IN_MONO;
public static final int CHANNEL_CONFIGURATION_OUT = AudioFormat.CHANNEL_OUT_MONO;
private AudioCodecDefines() {
throw new IllegalStateException("Do not instantiate!");
}
}

View File

@@ -0,0 +1,21 @@
/**
* This file is part of the Child Monitor.
*
* Child 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.
*
* Child 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 Child Monitor. If not, see <http://www.gnu.org/licenses/>.
*/
package de.rochefort.childmonitor;
public interface AudioListener {
void onAudio(byte[] audioBytes);
}

View File

@@ -1,20 +1,20 @@
/**
* This file is part of the Protect Baby Monitor.
* This file is part of the Child Monitor.
*
* Protect Baby Monitor is free software: you can redistribute it and/or modify
* Child 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,
* Child 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/>.
* along with Child Monitor. If not, see <http://www.gnu.org/licenses/>.
*/
package protect.babymonitor;
package de.rochefort.childmonitor;
import android.app.Activity;
import android.content.Context;
@@ -32,9 +32,10 @@ import android.widget.EditText;
import android.widget.ListView;
import android.widget.Toast;
public class DiscoverActivity extends Activity
{
final String TAG = "BabyMonitor";
final String TAG = "ChildMonitor";
NsdManager _nsdManager;
@@ -43,7 +44,7 @@ public class DiscoverActivity extends Activity
@Override
protected void onCreate(Bundle savedInstanceState)
{
Log.i(TAG, "Baby monitor start");
Log.i(TAG, "ChildMonitor start");
_nsdManager = (NsdManager)this.getSystemService(Context.NSD_SERVICE);
@@ -74,7 +75,7 @@ public class DiscoverActivity extends Activity
private void loadDiscoveryViaMdns()
{
setContentView(R.layout.activity_discover_mdns);
startServiceDiscovery("_babymonitor._tcp.");
startServiceDiscovery("_childmonitor._tcp.");
}
private void loadDiscoveryViaAddress()
@@ -121,7 +122,7 @@ public class DiscoverActivity extends Activity
@Override
protected void onDestroy()
{
Log.i(TAG, "Baby monitoring stop");
Log.i(TAG, "ChildMonitoring stop");
if(_discoveryListener != null)
{
@@ -176,7 +177,7 @@ public class DiscoverActivity extends Activity
// transport layer for this service.
Log.d(TAG, "Unknown Service Type: " + service.getServiceType());
}
else if (service.getServiceName().contains("ProtectBabyMonitor"))
else if (service.getServiceName().contains("ChildMonitor"))
{
NsdManager.ResolveListener resolver = new NsdManager.ResolveListener()
{
@@ -285,9 +286,9 @@ class ServiceInfoWrapper
{
// If there is more than one service on the network, it will
// have a number at the end, but will appear as the following:
// "ProtectBabyMonitor\\032(number)
// "ChildMonitor\\032(number)
// or
// "ProtectBabyMonitor\032(number)
// "ChildMonitor\032(number)
// Replace \\032 and \032 with a " "
String serviceName = _info.getServiceName();
serviceName = serviceName.replace("\\\\032", " ");

View File

@@ -1,20 +1,20 @@
/**
* This file is part of the Protect Baby Monitor.
* This file is part of the Child Monitor.
*
* Protect Baby Monitor is free software: you can redistribute it and/or modify
* Child 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,
* Child 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/>.
* along with Child Monitor. If not, see <http://www.gnu.org/licenses/>.
*/
package protect.babymonitor;
package de.rochefort.childmonitor;
import java.io.IOException;
import java.io.InputStream;
@@ -22,7 +22,6 @@ import java.net.Socket;
import java.net.UnknownHostException;
import android.app.Activity;
import android.media.AudioFormat;
import android.media.AudioManager;
import android.media.AudioTrack;
import android.media.MediaPlayer;
@@ -34,7 +33,7 @@ import android.support.v4.app.NotificationManagerCompat;
public class ListenActivity extends Activity
{
final String TAG = "BabyMonitor";
final String TAG = "ChildMonitor";
// Sets an ID for the notification
final static int mNotificationId = 1;

View File

@@ -1,20 +1,20 @@
/**
* This file is part of the Protect Baby Monitor.
* This file is part of the Child Monitor.
*
* Protect Baby Monitor is free software: you can redistribute it and/or modify
* Child 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,
* Child 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/>.
* along with Child Monitor. If not, see <http://www.gnu.org/licenses/>.
*/
package protect.babymonitor;
package de.rochefort.childmonitor;
import java.io.IOException;
import java.io.OutputStream;
@@ -24,7 +24,6 @@ import java.util.Objects;
import android.app.Activity;
import android.content.Context;
import android.media.AudioFormat;
import android.media.AudioRecord;
import android.media.MediaRecorder;
import android.net.nsd.NsdManager;
@@ -37,7 +36,7 @@ import android.util.Log;
import android.widget.TextView;
public class MonitorActivity extends Activity {
final static String TAG = "BabyMonitor";
final static String TAG = "ChildMonitor";
private NsdManager nsdManager;
@@ -96,7 +95,7 @@ public class MonitorActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
Log.i(TAG, "Baby monitor start");
Log.i(TAG, "ChildMonitor start");
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_monitor);
@@ -158,7 +157,7 @@ public class MonitorActivity extends Activity {
@Override
protected void onDestroy() {
Log.i(TAG, "Baby monitor stop");
Log.i(TAG, "ChildMonitor stop");
unregisterService();
@@ -176,8 +175,8 @@ public class MonitorActivity extends Activity {
private void registerService(final int port) {
final NsdServiceInfo serviceInfo = new NsdServiceInfo();
serviceInfo.setServiceName("ProtectBabyMonitor");
serviceInfo.setServiceType("_babymonitor._tcp.");
serviceInfo.setServiceName("ChildMonitor");
serviceInfo.setServiceType("_childmonitor._tcp.");
serviceInfo.setPort(port);
registrationListener = new NsdManager.RegistrationListener() {

View File

@@ -1,20 +1,20 @@
/**
* This file is part of the Protect Baby Monitor.
* This file is part of the Child Monitor.
*
* Protect Baby Monitor is free software: you can redistribute it and/or modify
* Child 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,
* Child 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/>.
* along with Child Monitor. If not, see <http://www.gnu.org/licenses/>.
*/
package protect.babymonitor;
package de.rochefort.childmonitor;
import android.Manifest;
import android.app.Activity;
@@ -29,12 +29,12 @@ import android.widget.Button;
public class StartActivity extends Activity
{
static final String TAG = "BabyMonitor";
static final String TAG = "ChildMonitor";
private final static int PERMISSIONS_REQUEST_RECORD_AUDIO = 298349824;
@Override
protected void onCreate(Bundle savedInstanceState) {
Log.i(TAG, "Baby monitor launched");
Log.i(TAG, "ChildMonitor launched");
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_start);

View File

@@ -1,4 +1,20 @@
package protect.babymonitor;
/**
* This file is part of the Child Monitor.
*
* Child 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.
*
* Child 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 Child Monitor. If not, see <http://www.gnu.org/licenses/>.
*/
package de.rochefort.childmonitor;
import android.content.Context;
import android.graphics.Canvas;
@@ -6,7 +22,6 @@ import android.graphics.Color;
import android.graphics.Paint;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import java.util.LinkedList;

View File

@@ -1,15 +0,0 @@
package protect.babymonitor;
import android.media.AudioFormat;
public class AudioCodecDefines {
public static final int FREQUENCY = 11025;
public static final int ENCODING = AudioFormat.ENCODING_PCM_16BIT;
public static final int CHANNEL_CONFIGURATION_IN = AudioFormat.CHANNEL_IN_MONO;
public static final int CHANNEL_CONFIGURATION_OUT = AudioFormat.CHANNEL_OUT_MONO;
private AudioCodecDefines() {
throw new IllegalStateException("Do not instantiate!");
}
}

View File

@@ -1,5 +0,0 @@
package protect.babymonitor;
public interface AudioListener {
void onAudio(byte[] audioBytes);
}

View File

@@ -8,7 +8,7 @@
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="protect.babymonitor.MonitorActivity" >
tools:context="de.rochefort.childmonitor.MonitorActivity" >
<TextView
android:id="@+id/parentDeviceTitle"

View File

@@ -8,7 +8,7 @@
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="protect.babymonitor.MonitorActivity" >
tools:context="de.rochefort.childmonitor.MonitorActivity" >
<TextView
android:id="@+id/parentDeviceTitle"

View File

@@ -8,7 +8,7 @@
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="protect.babymonitor.MonitorActivity" >
tools:context="de.rochefort.childmonitor.MonitorActivity" >
<TextView
android:id="@+id/parentDeviceTitle"

View File

@@ -9,7 +9,7 @@
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="protect.babymonitor.MonitorActivity">
tools:context="de.rochefort.childmonitor.MonitorActivity">
<TextView
android:id="@id/parentDeviceTitle"
@@ -59,7 +59,7 @@
android:layout_width="match_parent"
android:layout_height="15dip" />
<protect.babymonitor.VolumeView
<de.rochefort.childmonitor.VolumeView
android:id="@+id/volume"
android:layout_width="match_parent"
android:layout_height="match_parent" />

View File

@@ -9,7 +9,7 @@
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:keepScreenOn="true"
tools:context="protect.babymonitor.MonitorActivity" >
tools:context="de.rochefort.childmonitor.MonitorActivity" >
<TextView
android:id="@+id/childDeviceTitle"

View File

@@ -8,7 +8,7 @@
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="protect.babymonitor.StartActivity" >
tools:context="de.rochefort.childmonitor.StartActivity" >
<Button
android:id="@+id/useChildDevice"

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Protect Baby Monitor</string>
<string name="app_name">Child Monitor</string>
<string name="action_settings">Einstellungen</string>
<string name="useAsParentDevice">Als Eltern-Gerät benutzen</string>
<string name="useAsChildDevice">Als Kind-Gerät benutzen</string>

View File

@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
</resources>

View File

@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
</resources>

View File

@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
</resources>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">安全ベビー モニター</string>
<string name="app_name">モニター</string>
<string name="action_settings">設定</string>
<string name="useAsParentDevice">親機として使用する</string>
<string name="useAsChildDevice">子機として使用する</string>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Bescherm-babymonitor</string>
<string name="app_name">ChildMonitor</string>
<string name="action_settings">Instellingen</string>
<string name="useAsParentDevice">Gebruiken als ouderapparaat</string>
<string name="useAsChildDevice">Gebruiken als kindapparaat</string>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Protect Baby Monitor</string>
<string name="app_name">Child Monitor</string>
<string name="action_settings">Settings</string>
<string name="useAsParentDevice">Use as Parent Device</string>
<string name="useAsChildDevice">Use as Child Device</string>