250 Commits

Author SHA1 Message Date
pi b4d11a72e5 first try f-droid 2025-11-12 00:54:08 +01:00
pi 21e19f0eba fix and closes
commit: 453e265963

fixes: #3
closes: #3
2025-11-11 02:05:07 +01:00
pi bcaa8d0b3f first commit fix
commit 453e265963

fixes #3
2025-11-11 02:02:48 +01:00
pi b4098a6cac Update README.md
fix #3
2025-11-11 01:59:27 +01:00
pi 3073f03323 Merge remote-tracking branch 'child-monitor-multiple-clients/adding-retrys' into adding-retrys 2025-11-11 01:45:09 +01:00
pi 453e265963 corrected version number 2025-11-11 01:43:10 +01:00
pi 130906a6b0 added retries and fixxed status update 2025-11-11 01:39:35 +01:00
pi 62f44a1654 play alert at the end + english comments 2025-10-27 12:42:45 +01:00
pi cb7e9ac8ac 3 retys added frst attempt 2025-10-27 11:39:42 +01:00
pi adafa6279a now correct "streaming" notice 2025-10-25 12:14:21 +02:00
pi 46cf690ba3 klappt mit multiplen vom originalen child monitor 2025-10-25 10:28:54 +02:00
edr a08967059b Add VPN hint to README.md 2025-06-07 11:04:15 +02:00
edr 06d793fe16 Merge pull request #27 from yurtpage/rm_tx
Delete unsupported .tx/config for Transifex
2025-05-18 20:28:52 +02:00
Yurt Page 6baa9eb203 Delete unsupported .tx/config 2025-05-18 11:30:05 +03:00
edr 79165dfe5e Update CONTRIBUTING.md
No more translations please
2025-05-12 19:01:33 +02:00
edr 01f357a985 v1.4 2024-04-10 21:30:11 +02:00
edr ebe395fc8f More tolerant socket timeout 2024-04-08 23:21:34 +02:00
edr 9c8e0b881f Merge pull request #13 from fwiesel/normalize_relative_brightness
Normalize volume for brightness
2024-04-06 23:39:05 +02:00
edr 4d9c805b96 Merge pull request #14 from fwiesel/less_setters
Remove setters, and rename callbacks for onSomething
2024-04-03 17:18:18 +02:00
Fabian Wiesel 1305eca655 Remove setters, and rename callbacks for onSomething
- Setters are rather java-esque, and ...
- callbacks in the Android ecosystem are usually more
  called on<EventName> than <EventName>Callback.
2024-03-30 22:33:23 +01:00
Fabian Wiesel 4200a19378 Normalize volume for brightness
Undo an unintentional change done in f6a429e.
The brightness was calculated from the normalized volume, but when factoring
the norm out in the history, that norm was dropped.
2024-03-30 07:36:56 +01:00
edr 33a7a82a6a v1.3 2024-03-26 21:17:42 +01:00
edr 72830e020e Set socket timeout to properly detect when remote end loses network connection 2024-03-20 20:15:11 +01:00
edr b874584cf7 Fix wrong success state upon reading zero bytes 2024-03-20 20:14:45 +01:00
edr 1018ded2d9 Refactor error handling in ListenService 2024-03-20 19:52:01 +01:00
edr 4bc2b0f8a7 Merge pull request #12 from fwiesel/kotlin
Modernize the Stack Kotlin Edition
2024-03-20 19:33:08 +01:00
Fabian Wiesel 3588622bd2 ListenService: Wrap Socket in a Result
This way we can handle the IOException in the same place
as in the java version, without throwing passing unchecked exceptions
2024-03-16 20:50:46 +01:00
Fabian Wiesel a784eed506 Undo refactoring in ListenService 2024-03-04 20:36:06 +01:00
Fabian Wiesel 019c5e6e9f Removed public modifier 2024-03-01 20:40:00 +01:00
Fabian Wiesel be2b9084cb Missed to log the exception 2024-03-01 20:26:12 +01:00
Fabian Wiesel ea8357bb3c Use try-catch where appropriate 2024-03-01 18:32:33 +01:00
Fabian Wiesel 282753854f Made volumeHistory public 2024-03-01 18:03:33 +01:00
Fabian Wiesel eba51360c1 Remove unnessary unit from function 2024-03-01 18:01:46 +01:00
Fabian Wiesel 03b7aff579 Missing closing brace 2024-03-01 17:59:01 +01:00
Fabian Wiesel f5aa9da84c Various style fixes 2024-03-01 17:24:35 +01:00
Fabian Wiesel b9964d24d2 Changed G711UCodec license comment 2024-03-01 17:10:00 +01:00
Fabian Wiesel d7ac99665d Added comment about modifications 2024-02-28 21:32:28 +01:00
Fabian Wiesel 32235302c6 Use lateinit for notificationManager and nsdManager 2024-02-26 21:05:11 +01:00
Fabian Wiesel 41506bc601 Wrap java exceptions in runCatching blocks 2024-02-26 20:42:45 +01:00
Fabian Wiesel c6c60d9dbd Move service name to constructor 2024-02-26 19:41:52 +01:00
Fabian Wiesel 58095bc67b Use ?.let instead if-null-test, avoid runnable 2024-02-26 19:41:52 +01:00
Fabian Wiesel fa6e4da2c5 Move DiscoverActivity constant to companion object 2024-02-26 19:41:52 +01:00
Fabian Wiesel c5b542a333 Unused arguments and unnessecary null checks 2024-02-26 19:41:52 +01:00
Fabian Wiesel 5d17453c14 G711UCode: Rename variable to avoid shadowing 2024-02-26 19:41:52 +01:00
Fabian Wiesel dee59d4735 Use foojay-resolver and set all java version to 21 2024-02-26 19:41:52 +01:00
Fabian Wiesel 029e82941e Change AudioCodecDefines to simple object 2024-02-26 19:41:52 +01:00
Fabian Wiesel b8025b2300 G711UCodec move cod out of inner run() 2024-02-26 19:41:52 +01:00
Fabian Wiesel cf790b330b G711UCodec: Drop unused function getSampleCount 2024-02-26 19:41:52 +01:00
Fabian Wiesel 2d57b16226 Move kotlin files into its own directory 2024-02-26 19:41:52 +01:00
Fabian Wiesel 9101c01af6 Merge branch 'master' into kotlin 2024-02-26 18:21:22 +01:00
edr 775cea84a4 v1.2 2024-02-24 16:45:58 +01:00
Fabian Wiesel cd6c4b60a6 WIP: Modernize the Stack Kotlin Edition 2024-02-23 17:57:54 +01:00
edr 946de1d65b Merge pull request #10 from fwiesel/foreground-service-child
Move Monitor Mode for Child to its own Service
2024-02-21 22:14:05 +01:00
edr 9526f23c0c More specific log message in ListenActivity.java 2024-02-21 21:21:59 +01:00
edr 30a0c26826 Minor fixup MonitorActivity.java 2024-02-21 21:21:59 +01:00
edr 1077b2e527 Minor fixup in MonitorService.java 2024-02-21 21:21:59 +01:00
Fabian Wiesel 77c8456d45 Only log the exception when unexpected
The socket is closed in another thread to stop the transmission.
That causes an exception, but that is the expected behaviour, so
do not log it.
2024-02-21 21:21:59 +01:00
Fabian Wiesel 523ee93d75 Split-off MonitorService
Same motivation as for the parent device:
The monitor activity will be quickly destroyed,
unless it is connected to a foreground service.

By moving the thread and audio listener to a service,
this should be avoided.
2024-02-21 21:21:59 +01:00
edr 1ac22e872b Merge branch 'master' into feature/listen-service 2024-02-21 18:58:01 +01:00
edr 7473fffa8a Fix possible NullPointerException 2024-02-21 18:56:14 +01:00
edr f412e43e02 Use more arbitrary ID 2024-02-21 18:51:07 +01:00
edr 2818384c6e Reduce TAG visibility 2024-02-21 18:50:48 +01:00
edr 6edc59236a Remove member var name m prefixes 2024-02-21 18:47:29 +01:00
edr 2190ef1c94 Fix inappropriate canvas.getHeight/Width 2024-02-21 16:09:50 +01:00
edr 3be08d09f0 Make all license comments non-javadoc 2024-02-21 16:08:25 +01:00
edr c9c4cdc282 Make paint member final 2024-02-21 16:00:05 +01:00
edr 8e754557fa Add missing license headers 2024-02-21 15:57:29 +01:00
edr f01aaaf196 Merge pull request #9 from fwiesel/foreground-service
Move listening to ListenService
2024-02-21 15:42:48 +01:00
edr 6b6458b04b Fix ArrayIndexOutOfBoundsException 2024-02-19 20:45:15 +01:00
Fabian Wiesel d7e6ba2b5a Post error message from Listening Thread 2024-02-17 07:49:11 +01:00
edr 8a75044153 Remove unused entry from strings.xml 2024-02-17 02:46:31 +01:00
edr 43a7a66caa Fix possible NullPointerExceptions 2024-02-17 02:44:18 +01:00
edr e95a554717 Delete unused method 2024-02-17 02:09:27 +01:00
edr 703406b517 Taking snapshots of volume view no longer needed 2024-02-17 02:07:44 +01:00
edr 0ae2ca4a65 Fix volume monitor scrolling 2024-02-17 01:17:41 +01:00
edr 7359716c09 Fix notification click handler 2024-02-17 01:00:55 +01:00
edr 5b0ccaa8a1 Store child device name as member var that can be queried later 2024-02-17 00:59:19 +01:00
Fabian Wiesel 7fd7451700 Get last length elements, not first 2024-02-17 00:55:27 +01:00
edr a9f5b233e6 Avoid synchronized by scheduling writes on the main event loop 2024-02-17 00:01:59 +01:00
Fabian Wiesel f6a429e545 Split out ListenService and VolumeHistory
This moves the model of the historic volume to its own class (VolumeHistory),
and extracts the listening out of the ListenActivity to the ListenService.
2024-02-16 20:50:19 +01:00
Fabian Wiesel b339602184 Adopt settings from Android Studio
It doesn't change any functionality, only the format and
settings according to the recommendations of Android Studio
2024-02-16 20:35:48 +01:00
edr f27e30f524 Prevent inserting duplicate entries into child device list 2024-02-14 23:44:31 +01:00
edr b61a6f5ba8 v1.1 2024-01-12 21:11:58 +01:00
edr eaeec23986 Add hint regarding version incompatibility 2024-01-12 21:04:55 +01:00
edr 37b21ad495 Upgrade gradle 2023-10-01 21:43:17 +02:00
edr 9d052fae2f Reenable build failure on lintErrors 2023-10-01 21:32:26 +02:00
edr 3d0cf2444c Remove redundant article in license text 2023-10-01 20:57:42 +02:00
edr 4571b06b23 Reenable build errors on lintFailure 2023-10-01 20:44:41 +02:00
edr 1625d50359 Fix some warnings 2023-10-01 20:37:03 +02:00
edr db032437dd Reduce sampling frequency to 8000 Hz 2023-10-01 20:18:03 +02:00
edr b8c78797e4 Set port field by default 2023-10-01 20:17:31 +02:00
edr f98526b4fb Fix another crash and some reformatting 2023-10-01 00:52:43 +02:00
edr d1e7c1b239 optimize imports 2023-09-30 19:17:40 +02:00
edr a52bebc8ab Update dependency type compile -> implementation 2023-09-30 19:12:10 +02:00
edr 5d2fd1fba8 Enforce client disconnect when closing monitoring view 2023-09-30 16:43:50 +02:00
edr 9ec30c33da Add AudioCompression (ulaw) 2023-09-30 16:31:35 +02:00
edr 0fc379c25b upgrade gradle 2023-09-30 13:58:23 +02:00
edr aacadfd689 add gradle distribution checksum 2023-06-30 21:55:13 +02:00
edr 4a79fa637a v0.5 2023-06-30 18:17:59 +02:00
edr 27bbfc73b7 Update gradle 2023-06-30 18:15:47 +02:00
edr 7bd4416193 Remember last entered child device address & port 2023-06-30 17:59:45 +02:00
edr 6ceda0b022 Fix service discovery on android 12 2023-06-30 17:45:04 +02:00
edr 40fd35c20e Merge pull request #3 from ghost/master
ptbr translation
2023-06-30 16:46:56 +02:00
mezysinc dda00cfbe3 ptbr translation
string in ptbr
2021-01-08 14:53:56 -03:00
edr 086a999738 Move metadata from fdroid to fastlane structure 2020-12-01 20:15:59 +01:00
edr f07230bced Add German translation to fastlane folder structure 2020-09-07 19:24:30 +02:00
edr b662391db5 Add metadata for f-droid in fastlane folder structure 2020-09-07 19:12:11 +02:00
edr e81c5692a2 Replace icon 2020-07-22 22:03:32 +02:00
edr b2df26e13b List all listening network interfaces 2020-05-13 21:36:33 +02:00
edr 9b5857e2c8 Add acknowledgement to brarcher 2020-05-04 22:14:14 +02:00
edr da87a67e37 Remove acknowledgement to app icons 2020-04-23 00:27:17 +02:00
edr f79d1a487f Change Icon 2020-04-23 00:26:10 +02:00
edr 8045151603 Change Icon 2020-04-23 00:24:18 +02:00
edr d0ed6c1bba Change project name to "Child Monitor" 2020-04-22 22:52:56 +02:00
edr 10f2d0a253 Smarter relative volume computation 2020-04-22 21:42:31 +02:00
edr 471e4ead82 Check for audio recording permissions before opening MonitorActivity 2020-04-20 23:03:24 +02:00
edr 1f36cb7938 Reduce member variable visibility 2020-04-19 21:39:32 +02:00
edr 8c8e711f3b Initialize member vars in onCreate 2020-04-19 21:01:26 +02:00
edr 4ab2b83eb5 Fix first y coordinate in volume graph 2020-04-16 20:44:20 +02:00
edr a4c6d39265 Close serverSocket more reliably 2020-04-15 22:50:49 +02:00
edr 1848126888 Visualize volume over time 2020-04-15 21:13:37 +02:00
edr d124158ad3 Statically listen on port 10000 2020-04-15 20:25:35 +02:00
edr cb067be24c Reduce volume indicator flickering when volume is low 2020-04-15 20:15:14 +02:00
edr 3991687565 First prototype for volume visualization 2020-04-15 19:51:20 +02:00
edr 816f4554bb Update gradle config and fix minSdkVersion problems in manifest 2020-04-15 19:46:38 +02:00
Branden Archer 92bfb5db5f Merge pull request #48 from brarcher/brarcher-readme
Mention hiatus in README
2020-02-27 07:33:57 -08:00
Branden Archer 1f69082ca5 Mention hiatus in README 2020-02-24 23:11:31 -08:00
Branden Archer 7ff065149d Merge pull request #44 from brarcher/readme
Update translation instructions in README
2019-01-28 19:27:06 -08:00
Branden Archer cab3916e06 Update translation instructions in README 2019-01-28 07:09:19 -08:00
Branden Archer 34829bf9e3 Merge pull request #40 from brarcher/privacy
Update privacy policy
2018-06-26 19:17:40 -04:00
Branden Archer cdac5f4fa1 Update privacy policy 2018-06-26 17:35:00 -04:00
Branden Archer f6bc4824b7 Merge pull request #39 from brarcher/transifex
Add Dutch translations
2018-06-19 07:45:47 -04:00
Branden Archer e7b4330d9c Add Dutch translations 2018-06-18 17:16:46 -04:00
Branden Archer a123b1d09a Merge pull request #38 from brarcher/transifex
Transifex config file and translation updates
2018-06-16 18:07:11 -04:00
Branden Archer 25caeb3fa4 Update translations 2018-06-16 17:56:09 -04:00
Branden Archer 5b7e87b877 Add Transifex config file 2018-06-16 17:56:09 -04:00
Branden Archer 618c674477 Merge pull request #36 from brarcher/settings
Remove unused settings menu
2018-02-26 21:57:26 -05:00
Branden Archer e1c44ca66a Remove unused settings menu
The settings menu was present in the Child Device view, but
did not do anything when selected.
2018-02-26 21:03:12 -05:00
Branden Archer 2c9d02019d Merge pull request #34 from brarcher/german
Add German translations
2018-02-13 21:29:01 -05:00
Branden Archer 75c065fd23 Add German translations
Translations contributed by Alexander Muro on Transifex
2018-02-13 21:24:55 -05:00
Branden Archer 17792c2a69 Merge pull request #32 from brarcher/install-crash-workaround
Workaround install crash on Android 5 and below
2018-01-24 17:16:04 -05:00
Branden Archer 3e321d6049 Workaround install crash on Android 5 and below
The aapt2 tool, new to Android Studio 3, creates an APK which fails
to install on Android 5 and below if it contains the following bug:

  https://issuetracker.google.com/issues/64434571

Build tools 27.0.1 has a mitigation. Avoiding aapt2 also avoids hitting
the bug.
2018-01-24 17:06:20 -05:00
Branden Archer d2f96e364a Merge pull request #31 from brarcher/contributing
Create CONTRIBUTING.md
2018-01-24 16:21:36 -05:00
Branden Archer 45456ce18e Create CONTRIBUTING.md 2018-01-24 16:05:30 -05:00
Branden Archer 859d402db6 Merge pull request #30 from brarcher/notification
Notification updates
2017-12-27 19:50:54 -05:00
Branden Archer 1c64b15c00 remove unnecessary Runnable in onCreate()
onCreate is already running on the UI thread, no need
to create a separate runnable.
2017-12-27 19:03:46 -05:00
Branden Archer 043c26481a Set ongoing status for notifications 2017-12-27 18:52:17 -05:00
Branden Archer 388b9b378f Use white icon for notifications 2017-12-27 18:52:04 -05:00
Branden Archer d84b27adc8 Merge pull request #28 from brarcher/privacy-policy
Add privacy policy
2017-12-25 17:50:54 -05:00
Branden Archer 86bc8195d8 Add privacy policy 2017-12-25 17:40:46 -05:00
Branden Archer 8e8fdc6bec Merge pull request #27 from brarcher/pre-v0.3
Update for v0.3
2017-12-25 17:20:49 -05:00
Branden Archer a9d36258fa Update for v0.3
The version name and code were not brought over
from the AndroidManafest.xml file. Previously they
were for v0.2.
2017-12-25 17:14:34 -05:00
Branden Archer e4debe7dd8 Merge pull request #26 from shacharr/master
Implement Persistent Notification
2017-12-25 17:09:09 -05:00
Shachar R 64db907c2b Cosmetics 2017-12-25 08:31:33 -08:00
Shachar R e19f1cc09a Fix comments from pull-request review 2017-12-24 17:46:12 -08:00
Branden Archer 51dc915512 Update travis to use Android tools 26.0.2 2017-12-24 18:43:59 -05:00
Shachar R 053cf34ea2 Fix a leak in the wifiManager usage in Android version smaller than N
Update the SDK version to match the version in gradle.
2017-12-24 11:27:50 -08:00
Shachar R 0009c3bbdd Add notification icon for listening and disconnected events
TODO: Change icon color/details for connected vs. disconnected status
2017-12-24 11:26:22 -08:00
Shachar R 38dd1e6664 Upgrade gradle to 3.0.1 (current android-studio version)
Add google maven repository, to allow importing compatibility libs
2017-12-24 11:15:07 -08:00
Branden Archer b022b27f46 Merge pull request #24 from johanehnberg/master
Updated README with SDK 16
2017-09-13 15:07:50 -04:00
Johan Ehnberg 0322cd1ae4 Updated README with SDK 16 2017-09-13 21:53:03 +03:00
Branden Archer 585abee4ef Merge pull request #23 from brarcher/min-sdk
Reduce min SDK to 16
2017-09-13 14:46:14 -04:00
Branden Archer 9ba6a9434a Add paddingLeft/Right
This is to support SDK 16 and below
2017-09-13 14:42:25 -04:00
Branden Archer 80fcd4d44e Remove usage of listPreferredItemPaddingStart/End
These are only available in SDK 17
2017-09-13 14:42:08 -04:00
Branden Archer fd7fa95c7d Reduce min SDK to 16
It turns out that the min SDK the application will support is
16, as the NsdManager is available only at SDK 16 and above.
2017-09-13 13:54:45 -04:00
Branden Archer 90ef44977d Merge pull request #22 from brarcher/findbugs
Add support for FindBugs
2017-09-13 10:54:18 -04:00
Branden Archer c88fc677ac Add support for running FindBugs 2017-09-13 10:48:55 -04:00
Branden Archer 4d3360b04e Change TAG field to be static 2017-09-13 10:48:55 -04:00
Branden Archer e3540e4ab7 Merge pull request #21 from brarcher/gradle
Convert project from ant to gradle
2017-09-13 10:38:04 -04:00
Branden Archer 3a63c45015 Convert project from ant to gradle 2017-09-13 10:33:55 -04:00
Branden Archer ffee8003f0 Merge pull request #17 from brarcher/readme
README: add Transifex info
2017-08-11 22:43:39 -04:00
Branden Archer d6d230ec77 README: add Transifex info 2017-08-11 22:34:15 -04:00
Branden Archer 149c137271 Merge pull request #15 from brarcher/readme
Improvements to README.md
2016-01-30 01:12:55 -05:00
Branden Archer 781c8143df Improvements to README.md 2016-01-30 01:09:26 -05:00
Branden Archer ac7f1aa855 Merge pull request #13 from brarcher/correct-icon-location
Correct source of app icon in README.md
2016-01-12 19:39:28 -05:00
Branden Archer 871ce134f1 Correct source of app icon in README.md
The source of the app icon was Icons4Android. Mentioning WPZOOM instead was a typo.
2016-01-12 19:06:35 -05:00
Branden Archer 51b56fd59c Merge pull request #12 from brarcher/release
Prepare 0.2 release
2016-01-03 19:44:34 -05:00
Branden Archer e7681624cf prepare for release 2016-01-03 19:42:02 -05:00
Branden Archer d1e0c60be1 Mention Japanese translations in NEWS 2016-01-03 19:41:51 -05:00
brarcher c4333c59fd Merge pull request #8 from naofum/master
Added Japanese translation
2016-01-01 23:05:17 -05:00
naofum 057ec17e28 Updated Japanese translation 2016-01-02 10:25:37 +09:00
naofum 7d9ad919be Merge remote-tracking branch 'upstream/master' 2016-01-02 10:15:26 +09:00
brarcher d5ee75a143 Merge pull request #11 from brarcher/enter-address
Allow parent to enter child's address and port to connect
2016-01-01 17:01:37 -05:00
Branden Archer c032e9f642 Allow parent device to pair to child via IP Address and port
If mDNS fails to locate the child device, allow the parent device
to enter an IP address and port to connect.
2016-01-01 16:58:53 -05:00
Branden Archer 562a2bb164 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.
2016-01-01 16:20:24 -05:00
Branden Archer 7cb2138d13 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
2016-01-01 16:20:24 -05:00
Branden Archer fddb8ceede Use camel case for variable name 2016-01-01 16:20:24 -05:00
brarcher 7f9023d281 Merge pull request #10 from brarcher/update-news
Update NEWS
2016-01-01 14:06:18 -05:00
brarcher 800439457b Update NEWS 2016-01-01 14:05:28 -05:00
brarcher 2ad4780557 Merge pull request #9 from brarcher/authors-file
Create AUTHORS file
2016-01-01 14:00:58 -05:00
brarcher aa336c4cdb Create AUTHORS file 2016-01-01 14:00:05 -05:00
naofum 378ecd7fe8 Added Japanese translation 2016-01-02 00:15:34 +09:00
brarcher d2528f0f79 Merge pull request #7 from brarcher/improve-audio
Improve audio
2016-01-01 02:30:27 -05:00
Branden Archer 1603ff11bb Replace \032 in a service name with " "
Some implementations of mDNS on Android display a space as
  \\032
and some display it as
  \032

Attempt to convert both types to a " " before displaying it
2016-01-01 01:22:20 -05:00
Branden Archer b361d56539 Use byteBufferSize instead of bufferSize*2
byteBufferSize is already defined to be bufferSize*2
2016-01-01 01:21:28 -05:00
Branden Archer f2007e1693 Change variables which never should change to 'final' 2016-01-01 01:20:26 -05:00
Branden Archer f49e6be777 Increase TCP send buffer size to the minimum audio buffer size
The original buffer sized used was 1/2 what was intended.
2016-01-01 01:17:35 -05:00
Branden Archer bd2726370f simplify playback of audio without AudioPlayer
The additional thread to feed the AudioTrack was unnecessary.
Because the AudioTrack API is blocking when data is written,
and internally it buffers data, writing the data as soon
as it is received from the network leads to better playback
performance. It is also much simpler.
2016-01-01 01:09:31 -05:00
brarcher 07892afea1 Merge pull request #6 from brarcher/use-list-view
Use a ListView to store discovered child devices
2015-12-29 16:26:29 -05:00
brarcher ec9d22301e Merge branch 'master' into use-list-view 2015-12-29 16:25:37 -05:00
Branden Archer a4f8adf7a5 Use a ListView to store discovered child devices
The previous approach was to list buttons in a TableLayout.
However, this approach does not work well if there are more
items than can fit on the screen.

To allow scrolling of items, and also a better presentation
of said items, use a ListView.
2015-12-29 16:19:56 -05:00
brarcher 0f99fec0eb Merge pull request #5 from brarcher/update-versionName
Update versionName to be 0.1 for initial release
2015-12-28 21:10:35 -05:00
Branden Archer 68d9c69a01 Update versionName to be 0.1 for initial release 2015-12-28 21:01:26 -05:00
brarcher f1c34274c5 Merge pull request #4 from brarcher/add-news
Create NEWS
2015-12-28 20:24:13 -05:00
brarcher 039cf0447d Create NEWS 2015-12-28 20:23:29 -05:00
brarcher 8f5b0cc4d2 Merge pull request #3 from brarcher/staging
Better recovery from connection disconnects
2015-12-28 17:22:25 -05:00
Branden Archer c022fa8168 Update README.md, removing some improvements which are complete 2015-12-28 17:17:14 -05:00
Branden Archer cb4c48d5fb Remove unused import 2015-12-28 17:14:05 -05:00
Branden Archer cfddbf22c1 Explicitly list some methods private
These methods are not needed outside of this class
2015-12-28 17:13:58 -05:00
Branden Archer e35126096f Play audio alert if child is disconnected
If the child device disconnects unexpectedly, alert the
user, in case they were not expecting the disconnect.

The audio file being played is originally from here:
https://freesound.org/people/pan14/sounds/263655/
2015-12-28 17:13:34 -05:00
Branden Archer 0d829708c7 Only post message if connection to child was lost
If the connection to the child was intentionally severed, do not
post a "disconnected" message, as the activity is likely closing.
2015-12-28 17:11:58 -05:00
Branden Archer 6dd26b70fe improve logging for service discovery 2015-12-28 16:24:06 -05:00
Branden Archer c25b0fdeba Allow child device to establish new connection after parent disconnects
Previously the monitor activity would only support one connection,
after which the activity would need to be restarted. With this change,
if a connection is established with a parent device but is eventually
disconnected the child device will begin advertising again.

Note that because the child device can only support one connection
at a time currently, after the connection is established it will
now stop advertising. When a connection is lost and advertising
starts again, it may end up advertising as another service. E.g.
  ProtectBabyMonitor (2)
instead of
  ProtectBabyMonitor
2015-12-28 16:12:49 -05:00
Branden Archer 375242d6fb Cleanup AudioRecord if socket throws an exception
Previously an IOException would prevent the AudioRecord
from being cleaned up.
2015-12-28 16:08:59 -05:00
Branden Archer 0c45351c5a Create wrapper function for unregistering baby monitor service
This will eventually be called in multiple places
2015-12-28 16:06:35 -05:00
brarcher 14118499fa Merge pull request #2 from brarcher/staging
Improve usability - volume control, survive screen rotation, screen stays on
2015-12-27 20:52:41 -05:00
Branden Archer 6af9dff004 Prevent screen rotation or resize from destroying activities
If the screen is rotated by default Android destroys the
activity and recreates it. This causes issues if a child and
parent are already paired, as the connection is lost.

To prevent Android from destroying the Activity, instead
invoke a configuration change on an orientation or resize.
2015-12-27 20:50:25 -05:00
Branden Archer 7f604c47ce Prevent child device from sleeping if listening
If the screen turns off, the child device will be unable to
record from the microphone. Keep the screen on in the monitor
activity to keep microphone on.
2015-12-27 20:50:25 -05:00
Branden Archer 516ba5a225 Allow volume control to adjust playback volume
The AudioTrack for playing audio from the child device
was sending audio to the voice call stream. It is more
appropriate to use the music stream. In addition, suggest
that the activity control the music stream's volume with
the hardware controls.
2015-12-27 20:50:25 -05:00
brarcher 133baf9a48 Merge pull request #1 from brarcher/staging
Improve layout and appearance of application
2015-12-27 17:40:18 -05:00
Branden Archer 9eaf90fcda Use Travis CI to build project 2015-12-27 17:36:45 -05:00
Branden Archer 2e9ca0de88 Improve listen activity layout with Linear Layout 2015-12-27 16:20:32 -05:00
Branden Archer c455e966cd Use buttons to list available child devices
It may not have been obvious that the labels were clickable before.
2015-12-27 16:20:31 -05:00
Branden Archer 72d5c75357 Replace \\032 in reported service name with " "
When mDNS returns the service name, any spaces are replaced
with \\032. Change this back into a space
2015-12-27 16:20:31 -05:00
Branden Archer dd737c0be5 Improve layout of dicover activity with Linear Layout 2015-12-27 16:20:31 -05:00
Branden Archer ea29a0f4eb Improve monitor activity with LinearLayout and helper text 2015-12-27 16:20:22 -05:00
Branden Archer eb1eac8111 Improve start activity layout with LinearLayout and helper text 2015-12-27 15:29:59 -05:00
Branden Archer 429c3005a9 Use Holo theme 2015-12-27 14:28:54 -05:00
Branden Archer 7273e4231f Change app launcher icon to a camera 2015-12-27 14:02:13 -05:00
Branden Archer eac8bfeed6 Mention name of connected device on ListenActivity 2015-12-26 18:54:56 -05:00
Branden Archer b1a0044fda Simplify MonitorActivity to only list relevant text in tables 2015-12-26 18:54:09 -05:00
Branden Archer 592c55c156 Simply StartActivity to two buttons 2015-12-26 18:53:29 -05:00
Branden Archer 21b59fde84 Update app name to Protect Baby Monitor 2015-12-26 18:50:16 -05:00
Branden Archer f2a13c9160 Change terminology to child and parent devices
The "monitor" and "connect to monitor" descriptions may
have been confusing. Changing the terminology to refer to
a child and parent device.
2015-12-26 18:50:01 -05:00
brarcher c962228e86 Update README.md 2015-12-26 17:51:22 -05:00
Branden Archer 6901745d5b Pass received audio samples to the AudioPlayer for processing
Whenever a sample is received from the socket, pass it to
the AudioPlayer thread via a blocking queue. The AudioPlayer
thread will then play the sample and wait for more input.
2015-12-26 17:51:22 -05:00
Branden Archer 8bcfe2af67 Add AudioPlayer thread for playing audio samples from a queue
This thread will be used for playing audio samples. The samples
will be provided by a blocking queue.

It is assumed that the configuration of the passed AudioTrack and
the samples from the blocking queue are compatible.
2015-12-26 17:51:22 -05:00
Branden Archer 936410e851 Receive audio from ProtectBabyMonitor, discarding it
When connected to a ProtectBabyMonitor service, accept
audio over the network. However, for now, discard the audio
instead of playing it.
2015-12-26 17:51:21 -05:00
Branden Archer 00049d4b2f Allow launch of ListenActivity from found ProtectBabyMonitor service
If any ProtectBabyMonitor services are found on the network, clicking
on one will start a ListenActivity with information on the service.
2015-12-26 17:51:21 -05:00
Branden Archer 2e164c0fb2 Add ListenActivity for playing audio from ProtectBabyMonitor services
This activity will eventually receive audio from the MonitorActivity
of another Android device and play it.
2015-12-26 17:51:21 -05:00
Branden Archer 1f7f6f04fe Populate list with ProtectBabyMonitor providers 2015-12-26 17:51:21 -05:00
Branden Archer 8d448d0ecc Discover ProtectBabyMonitor service providers on the network
Attempt to discover any providers of the ProtectBabyMonitor
service on the local network, resolving any which are found.
For now nothing is done with the information on found
providers.
2015-12-26 17:51:21 -05:00
Branden Archer eb9cd75c3a Add DiscoverActivity - lists of baby monitors on the network
This is the stub of the DiscoverActivity, which is responsible for
discovering all available ProtectBabyMonitor services on the
local network.
2015-12-26 17:51:21 -05:00
Branden Archer 4635a78574 Set the TCP send buffer size to avoid buffering audio
If the send buffer size is large and the receiver is unable
to keep up, then audio samples will collect on the monitor
and lag will accumulate. As only the most recent sample is
important, reduce the send buffer size to the minimum
AudioRecord buffer size.
2015-12-26 17:51:16 -05:00
Branden Archer 828e6a16f6 Stream audio data to connected clients
While connected, send packets of audio data to connected clients.
2015-12-26 17:50:33 -05:00
Branden Archer 7819c31275 Stub for servicing connection to ProtectBabyMonitor service
If a client connects to the advertised ProtectBabyMonitor service,
attempt to service the connection.

For now, simply close the connection instead of sending data.
2015-12-26 15:49:17 -05:00
Branden Archer 716d82dc1c Register ProtectBabyMonitor service via mDNS
When the MonitorActivity is started it will create a ServerSocket.
The assigned port is then advertised over mDNS for a
"ProtectBabyMonitor" service.

Eventually, when something connects to the ServerSocket audio
data will be streamed out.
2015-12-26 15:49:17 -05:00
Branden Archer 11bf3822b6 Add MonitorActivity - for registering on network and sending audio
This commit adds the shell of the MonitorActivity. This activity
will register its service on the local network, wait for a connection,
then send audio data.
2015-12-26 15:49:12 -05:00
Branden Archer 7bd19f2325 Add StartActivity - landing page of baby monitor
The StartActivity is the first activity which will be launched
in the baby monitor, and in the future will list the two main
options: become a monitor or a listener.
2015-12-26 15:48:42 -05:00
brarcher 8b1b1a7414 Initial commit 2015-12-26 13:23:26 -05:00
143 changed files with 3414 additions and 1398 deletions
+3 -9
View File
@@ -1,15 +1,9 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
/.idea
.DS_Store
/build
/app/build
/app/release
/captures
.externalNativeBuild
.cxx
local.properties
-3
View File
@@ -1,3 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AndroidProjectSystem">
<option name="providerId" value="com.android.tools.idea.GradleProjectSystem" />
</component>
</project>
-123
View File
@@ -1,123 +0,0 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<JetCodeStyleSettings>
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</JetCodeStyleSettings>
<codeStyleSettings language="XML">
<option name="FORCE_REARRANGE_MODE" value="1" />
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
<arrangement>
<rules>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:android</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:id</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>style</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>ANDROID_ATTRIBUTE_ORDER</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>.*</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
</rules>
</arrangement>
</codeStyleSettings>
<codeStyleSettings language="kotlin">
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</codeStyleSettings>
</code_scheme>
</component>
-5
View File
@@ -1,5 +0,0 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="21" />
</component>
</project>
-10
View File
@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetSelector">
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
</SelectionState>
</selectionStates>
</component>
</project>
-19
View File
@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="CHOOSE_PER_TEST" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
</GradleProjectSettings>
</option>
</component>
</project>
-10
View File
@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectMigrations">
<option name="MigrateToGradleLocalJavaHome">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
</component>
</project>
-9
View File
@@ -1,9 +0,0 @@
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>
-17
View File
@@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
<option value="com.intellij.execution.junit.PatternConfigurationProducer" />
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
<option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
<option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
<option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
</set>
</option>
</component>
</project>
Generated
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
-45
View File
@@ -1,45 +0,0 @@
kotlin version: 2.0.21
error message: Failed connecting to the daemon in 4 retries
error message: Daemon compilation failed: Could not connect to Kotlin compile daemon
java.lang.RuntimeException: Could not connect to Kotlin compile daemon
at org.jetbrains.kotlin.compilerRunner.GradleKotlinCompilerWork.compileWithDaemon(GradleKotlinCompilerWork.kt:214)
at org.jetbrains.kotlin.compilerRunner.GradleKotlinCompilerWork.compileWithDaemonOrFallbackImpl(GradleKotlinCompilerWork.kt:159)
at org.jetbrains.kotlin.compilerRunner.GradleKotlinCompilerWork.run(GradleKotlinCompilerWork.kt:111)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction.execute(GradleCompilerRunnerWithWorkers.kt:76)
at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:63)
at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:66)
at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:62)
at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:100)
at org.gradle.workers.internal.NoIsolationWorkerFactory$1.lambda$execute$0(NoIsolationWorkerFactory.java:62)
at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:44)
at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:41)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:210)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:205)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:67)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:60)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:167)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:60)
at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:54)
at org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41)
at org.gradle.workers.internal.NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:59)
at org.gradle.workers.internal.DefaultWorkerExecutor.lambda$submitWork$0(DefaultWorkerExecutor.java:174)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:194)
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.access$700(DefaultConditionalExecutionQueue.java:127)
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner$1.run(DefaultConditionalExecutionQueue.java:169)
at org.gradle.internal.Factories$1.create(Factories.java:31)
at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:263)
at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:127)
at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:132)
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:164)
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:133)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:48)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
+15
View File
@@ -0,0 +1,15 @@
language: android
sudo: true
install:
- echo y | android update sdk -u -a -t tools
- echo y | android update sdk -u -a -t platform-tools
- echo y | android update sdk -u -a -t build-tools-26.0.2
- echo y | android update sdk -u -a -t android-25
- echo y | android update sdk -u -a -t extra-google-m2repository
- echo y | android update sdk -u -a -t extra-android-m2repository
script: ./gradlew assembleRelease testReleaseUnitTest lintRelease
after_failure:
- cat app/build/reports/tests/debug/index.html
+9
View File
@@ -0,0 +1,9 @@
Branden Archer:
Initial concept and implementation
Naofumi Fukue:
Added Japanese translation
Enguerrand de Rochefort
Continuation of implementation
Anybody who has contributed code to Child Monitor (or Protect Baby Monitor) is considered
an author. Send pull requests to this project for additions to this file.
+87
View File
@@ -0,0 +1,87 @@
How to Submit Patches to the Child Monitor Project
===============================================================================
https://github.com/enguerrand/child-monitor
This document is intended to act as a guide to help you contribute to the
Child Monitor project. It is not perfect, and there will always be exceptions
to the rules described here, but by following the instructions below you
should have a much easier time getting your work merged with the upstream
project.
## Test Your Code
There are four possible tests you can run to verify your code. The first
is unit tests, which check the basic functionality of the application, and
can be run by gradle using:
# ./gradlew testReleaseUnitTest
The second check for common problems uses static analysis.
This is the Android lint checker, run using:
# ./gradlew lintRelease
The final check is by testing the application on a live device and verifying
the basic functionality works as expected.
## Explain Your Work
At the top of every patch you should include a description of the problem you
are trying to solve, how you solved it, and why you chose the solution you
implemented. If you are submitting a bug fix, it is also incredibly helpful
if you can describe/include a reproducer for the problem in the description as
well as instructions on how to test for the bug and verify that it has been
fixed.
## Sign Your Work
The sign-off is a simple line at the end of the patch description, which
certifies that you wrote it or otherwise have the right to pass it on as an
open-source patch. The "Developer's Certificate of Origin" pledge is taken
from the Linux Kernel and the rules are pretty simple:
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
... then you just add a line to the bottom of your patch description, with
your real name, saying:
Signed-off-by: Random J Developer <random@developer.example.org>
## Submit Patch(es) for Review
Finally, you will need to submit your patches so that they can be reviewed
and potentially merged into the main Child Monitor repository. The preferred
way to do this is to submit a Pull Request to the Child Monitor project.
Changes need to apply cleanly onto the master branch and pass all
unit tests and produce no errors during static analysis.
## Translations
I decided to stop accepting any PRs for translations except for languages that I speak well enough to ensure a minimum quality level.
These would be english, german, french.
For all other languages I will neither accept new strings.xml nor guarantee to keep the present ones around.
+675
View File
@@ -0,0 +1,675 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{one line to give the program's name and a brief idea of what it does.}
Copyright (C) {year} {name of author}
This program 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.
This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
{project} Copyright (C) {year} {fullname}
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+14
View File
@@ -0,0 +1,14 @@
Sun Jan 3, 2016: Release 0.2
* Improve and simplify audio playback to reduce dropped
audio samples
* A parent device may pair with a child device by entering
the child's IP address and port.
* Japanese translation
Mon Dec 28, 2015: Release 0.1
* Initial release
+34
View File
@@ -0,0 +1,34 @@
# Child Monitor
An Open Source Child Monitor for Android
_Child Monitor_ allows two Android devices to act as a baby monitor. The first device,
left in the room with the baby, will advertise itself on the network and stream audio
to a connected client. The second device, with the parent, will connect to the monitoring
device and receive an audio stream.
The project is a fork of _Protect Baby Monitor_ which is declared as "on hiatus" by its developer.
_Child Monitor_ works on Android 5.0 (Lollipop) and newer, i.e. Android SDK 21.
The current version of _Child Monitor_ is rudimentary at best. It is capable
of successfully advertising itself on the network, allows clients to connect,
and streams audio. Room for improvement includes:
1. Robust usage of the AudioTrack API
2. Handle dropped packets gracefully
3. Use of GSM when no internet connectivity is available
At the time this project was forked from _Protect Baby Monitor_ there was no obvious open source solution for a
baby monitor for Android in F-Droid.
# Running on different networks
To use this App with two phones that are not connected to the same WIFI network a VPN can be used.
Since auto discovery is not supported in this scenario the child device's ip address must be entered manually in the parent device. You can find the VPN ip address among the listed ip addresses on the child device once the listen mode was entered.
The child device will usually bind to port 10000 (unless that port is already taken by another application).
# License information
_Child Monitor_ is licensed under the GPLv3. The Ulaw encoding / decoding code is licensed under the Apache License, Version 2.0 and taken from the Android Open Source Project.
# Thanks
Audio file originals from [freesound](https://freesound.org).
This whole project originally created by [brarcher](https://github.com/brarcher/protect-baby-monitor).
-1
View File
@@ -1 +0,0 @@
/build
+42
View File
@@ -0,0 +1,42 @@
apply plugin: 'com.android.application'
apply plugin: 'org.jetbrains.kotlin.android'
android {
compileSdk 34
defaultConfig {
applicationId "com.example.childmonitor_multiple"
minSdkVersion 21
targetSdkVersion 34
versionCode 14
versionName "1.5"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
dependencies {
}
namespace 'com.example.childmonitor_multiple'
lint {
abortOnError true
warning 'MissingTranslation'
}
compileOptions {
// Sets Java compatibility to Java 21
sourceCompatibility JavaVersion.VERSION_21
targetCompatibility JavaVersion.VERSION_21
}
kotlin {
jvmToolchain(21)
}
}
dependencies {
implementation 'androidx.core:core:1.12.0'
implementation 'androidx.core:core-ktx:1.12.0'
}
-62
View File
@@ -1,62 +0,0 @@
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.compose)
}
android {
namespace = "com.example.babyphone"
compileSdk {
version = release(36)
}
defaultConfig {
applicationId = "com.example.babyphone"
minSdk = 21
targetSdk = 36
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = "11"
}
buildFeatures {
compose = true
}
}
dependencies {
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.activity.compose)
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.ui)
implementation(libs.androidx.compose.ui.graphics)
implementation(libs.androidx.compose.ui.tooling.preview)
implementation(libs.androidx.compose.material3)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(platform(libs.androidx.compose.bom))
androidTestImplementation(libs.androidx.compose.ui.test.junit4)
debugImplementation(libs.androidx.compose.ui.tooling)
debugImplementation(libs.androidx.compose.ui.test.manifest)
implementation("androidx.appcompat:appcompat:1.6.1")
}
@@ -0,0 +1,16 @@
Categories:
- Productivity
License: GPL-3.0-or-later
AuthorName: Ben
SourceCode: https://github.com/abwesendkr/child-monitor-multiple-clients
IssueTracker: https://github.com/abwesendkr/child-monitor-multiple-clients/issues
Changelog: https://github.com/abwesendkr/child-monitor-multiple-clients/releases
AutoName: child-monitor-multiple-clients
RepoType: git
Repo: https://github.com/abwesendkr/child-monitor-multiple-clients.git
Builds:
- versionName: 1.5
versionCode: 1
commit: v1.0
gradle:
- yes
-21
View File
@@ -1,21 +0,0 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
@@ -1,24 +0,0 @@
package com.example.babyphone
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.example.babyphone", appContext.packageName)
}
}
+55 -12
View File
@@ -1,26 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.INTERNET" />
android:versionCode="2"
android:versionName="0.2">
<uses-permission
android:name="android.permission.ACCESS_NETWORK_STATE"
android:required="true" />
<uses-permission
android:name="android.permission.INTERNET"
android:required="true" />
<uses-permission
android:name="android.permission.RECORD_AUDIO"
android:required="true" />
<uses-permission
android:name="android.permission.ACCESS_WIFI_STATE"
android:required="true" />
<uses-permission
android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE"
android:required="true" />
<uses-permission
android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission
android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK"/>
<uses-permission
android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE"/>
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
android:theme="@android:style/Theme.Holo">
<activity android:name=".MainActivity"
android:exported="true"
android:theme="@style/AppTheme">
<service
android:name=".ListenService"
android:enabled="true"
android:foregroundServiceType="mediaPlayback"
android:exported="false"/>
<service
android:name=".MonitorService"
android:enabled="true"
android:foregroundServiceType="microphone"
android:exported="false"/>
<activity
android:name=".StartActivity"
android:configChanges="orientation|screenSize"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MonitorActivity"
android:configChanges="orientation|screenSize"
android:parentActivityName=".StartActivity" />
<activity
android:name=".DiscoverActivity"
android:configChanges="orientation|screenSize"
android:parentActivityName=".StartActivity"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ListenActivity"
android:configChanges="orientation|screenSize"
android:parentActivityName=".DiscoverActivity" />
</application>
</manifest>
@@ -1,253 +0,0 @@
package com.example.babyphone;
import android.Manifest;
import android.content.pm.PackageManager;
import android.media.AudioFormat;
import android.media.AudioRecord;
import android.media.MediaRecorder;
import android.os.Build;
import android.os.Bundle;
import android.widget.Button;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.ServerSocket;
import java.net.Socket;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
private static final int SAMPLE_RATE = 8000;
private static final int PORT = 50005;
private boolean isStreaming = false;
private Thread recordingThread;
private Thread clientListenerThread;
private ServerSocket serverSocket;
private final List<Socket> clients = new ArrayList<>();
private String getLocalIpAddress() {
try {
for (java.util.Enumeration<java.net.NetworkInterface> en = java.net.NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) {
java.net.NetworkInterface intf = en.nextElement();
for (java.util.Enumeration<java.net.InetAddress> enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();) {
java.net.InetAddress inetAddress = enumIpAddr.nextElement();
if (!inetAddress.isLoopbackAddress() && inetAddress instanceof java.net.Inet4Address) {
return inetAddress.getHostAddress();
}
}
}
} catch (Exception ex) {
ex.printStackTrace();
}
return "unbekannt";
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView ipAddressText = findViewById(R.id.ipAddressText);
String ip = getLocalIpAddress();
ipAddressText.setText("Sever(Kinder)-IP-Adresse: " + ip);
Button startStreamButton = findViewById(R.id.startStreamButton);
startStreamButton.setOnClickListener(v -> {
if (!isStreaming) {
if (checkPermissions()) {
startStreaming();
startStreamButton.setText("Stop Streaming");
}
} else {
stopStreaming();
startStreamButton.setText("Start Streaming");
}
});
}
private boolean checkPermissions() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (checkSelfPermission(Manifest.permission.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.RECORD_AUDIO}, 1);
return false;
}
}
return true;
}
private void startStreaming() {
isStreaming = true;
try {
serverSocket = new ServerSocket(PORT);
showToast("Server gestartet auf Port " + PORT);
} catch (IOException e) {
showToast("Fehler beim Start des Servers: " + e.getMessage());
return;
}
// Thread: Neue Clients annehmen
clientListenerThread = new Thread(() -> {
while (isStreaming) {
try {
Socket client = serverSocket.accept();
synchronized (clients) {
clients.add(client);
}
showToast("Neuer Client: " + client.getInetAddress());
} catch (IOException e) {
if (isStreaming) {
showToast("Fehler beim Client-Connect: " + e.getMessage());
}
}
}
});
clientListenerThread.start();
// Thread: Audio aufnehmen und an alle Clients senden (mit µ-law)
// Thread: Audio aufnehmen und an alle Clients senden (µ-Law, 8kHz)
recordingThread = new Thread(() -> {
int minBufferSize = AudioRecord.getMinBufferSize(8000, // neue Sample-Rate
AudioFormat.CHANNEL_IN_MONO,
AudioFormat.ENCODING_PCM_16BIT);
if (ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO)
!= PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.RECORD_AUDIO},
1001);
return;
}
AudioRecord recorder = null;
try {
recorder = new AudioRecord(
MediaRecorder.AudioSource.MIC,
44100, // Aufnahme weiterhin mit nativer Rate
AudioFormat.CHANNEL_IN_MONO,
AudioFormat.ENCODING_PCM_16BIT,
minBufferSize
);
} catch (SecurityException e) {
e.printStackTrace();
return;
}
byte[] pcmBuffer = new byte[minBufferSize];
recorder.startRecording();
// Buffer für Resampling
short[] pcmSamples = new short[minBufferSize / 2];
while (isStreaming) {
int read = recorder.read(pcmBuffer, 0, pcmBuffer.length);
if (read > 0) {
// PCM Byte-Array → short[]
ByteBuffer.wrap(pcmBuffer, 0, read).order(ByteOrder.LITTLE_ENDIAN).asShortBuffer().get(pcmSamples, 0, read / 2);
// Resample 44.1kHz -> 8kHz (einfaches Downsampling, z.B. jede 5.5. Probe nehmen)
short[] downsampled = new short[(int) (pcmSamples.length * 8000f / 44100f)];
for (int i = 0; i < downsampled.length; i++) {
downsampled[i] = pcmSamples[(int) (i * 44100f / 8000f)];
}
// PCM → µ-Law
byte[] muLawData = new byte[downsampled.length];
for (int i = 0; i < downsampled.length; i++) {
muLawData[i] = linearToMuLawSample(downsampled[i]);
}
// Senden an alle Clients
synchronized (clients) {
Iterator<Socket> iterator = clients.iterator();
while (iterator.hasNext()) {
Socket client = iterator.next();
try {
OutputStream out = client.getOutputStream();
out.write(muLawData);
} catch (IOException e) {
try { client.close(); } catch (IOException ignored) {}
iterator.remove();
showToast("Client getrennt");
}
}
}
}
}
recorder.stop();
recorder.release();
});
recordingThread.start();
}
private void stopStreaming() {
isStreaming = false;
// Schließe alle Clients
synchronized (clients) {
for (Socket client : clients) {
try {
client.close();
} catch (IOException ignored) {}
}
clients.clear();
}
// Server stoppen
try {
if (serverSocket != null) {
serverSocket.close();
}
} catch (IOException ignored) {}
showToast("Streaming gestoppt");
}
private void showToast(String msg) {
runOnUiThread(() -> Toast.makeText(MainActivity.this, msg, Toast.LENGTH_SHORT).show());
}
// ========================
// PCM16 → µ-Law Umwandlung
// ========================
private static byte linearToMuLawSample(short sample) {
final int MU = 255;
int sign = (sample >> 8) & 0x80;
if (sign != 0) sample = (short) -sample;
if (sample > 32635) sample = 32635;
sample = (short) (sample + 132);
int exponent = 7;
for (int expMask = 0x4000; (sample & expMask) == 0 && exponent > 0; exponent--, expMask >>= 1) {}
int mantissa = (sample >> ((exponent == 0) ? 4 : (exponent + 3))) & 0x0F;
int muLawByte = ~(sign | (exponent << 4) | mantissa);
return (byte) muLawByte;
}
private static byte[] pcm16ToMuLaw(byte[] pcmData, int length) {
ByteArrayOutputStream baos = new ByteArrayOutputStream(length / 2);
ByteBuffer bb = ByteBuffer.wrap(pcmData, 0, length).order(ByteOrder.LITTLE_ENDIAN);
while (bb.remaining() > 1) {
short sample = bb.getShort();
baos.write(linearToMuLawSample(sample));
}
return baos.toByteArray();
}
}
@@ -1,11 +0,0 @@
package com.example.babyphone.ui.theme
import androidx.compose.ui.graphics.Color
val Purple80 = Color(0xFFD0BCFF)
val PurpleGrey80 = Color(0xFFCCC2DC)
val Pink80 = Color(0xFFEFB8C8)
val Purple40 = Color(0xFF6650a4)
val PurpleGrey40 = Color(0xFF625b71)
val Pink40 = Color(0xFF7D5260)
@@ -1,58 +0,0 @@
package com.example.babyphone.ui.theme
import android.app.Activity
import android.os.Build
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.darkColorScheme
import androidx.compose.material3.dynamicDarkColorScheme
import androidx.compose.material3.dynamicLightColorScheme
import androidx.compose.material3.lightColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.platform.LocalContext
private val DarkColorScheme = darkColorScheme(
primary = Purple80,
secondary = PurpleGrey80,
tertiary = Pink80
)
private val LightColorScheme = lightColorScheme(
primary = Purple40,
secondary = PurpleGrey40,
tertiary = Pink40
/* Other default colors to override
background = Color(0xFFFFFBFE),
surface = Color(0xFFFFFBFE),
onPrimary = Color.White,
onSecondary = Color.White,
onTertiary = Color.White,
onBackground = Color(0xFF1C1B1F),
onSurface = Color(0xFF1C1B1F),
*/
)
@Composable
fun BabyphoneTheme(
darkTheme: Boolean = isSystemInDarkTheme(),
// Dynamic color is available on Android 12+
dynamicColor: Boolean = true,
content: @Composable () -> Unit
) {
val colorScheme = when {
dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
val context = LocalContext.current
if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
}
darkTheme -> DarkColorScheme
else -> LightColorScheme
}
MaterialTheme(
colorScheme = colorScheme,
typography = Typography,
content = content
)
}
@@ -1,34 +0,0 @@
package com.example.babyphone.ui.theme
import androidx.compose.material3.Typography
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.sp
// Set of Material typography styles to start with
val Typography = Typography(
bodyLarge = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
fontSize = 16.sp,
lineHeight = 24.sp,
letterSpacing = 0.5.sp
)
/* Other default text styles to override
titleLarge = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
fontSize = 22.sp,
lineHeight = 28.sp,
letterSpacing = 0.sp
),
labelSmall = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Medium,
fontSize = 11.sp,
lineHeight = 16.sp,
letterSpacing = 0.5.sp
)
*/
)
@@ -0,0 +1,27 @@
/*
* This file is part of 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 com.example.childmonitor_multiple
import android.media.AudioFormat
object AudioCodecDefines {
const val FREQUENCY = 8000
const val ENCODING = AudioFormat.ENCODING_PCM_16BIT
val CODEC = G711UCodec()
const val CHANNEL_CONFIGURATION_IN = AudioFormat.CHANNEL_IN_MONO
const val CHANNEL_CONFIGURATION_OUT = AudioFormat.CHANNEL_OUT_MONO
}
@@ -0,0 +1,235 @@
/*
* This file is part of 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 com.example.childmonitor_multiple
import android.app.Activity
import android.content.Intent
import android.net.nsd.NsdManager
import android.net.nsd.NsdManager.DiscoveryListener
import android.net.nsd.NsdServiceInfo
import android.net.wifi.WifiManager
import android.os.Bundle
import android.util.Log
import android.view.View
import android.widget.AdapterView
import android.widget.AdapterView.OnItemClickListener
import android.widget.ArrayAdapter
import android.widget.Button
import android.widget.EditText
import android.widget.ListView
import android.widget.Toast
class DiscoverActivity : Activity() {
private lateinit var nsdManager: NsdManager
private var discoveryListener: DiscoveryListener? = null
override fun onCreate(savedInstanceState: Bundle?) {
Log.i(TAG, "ChildMonitor start")
this.nsdManager = this.getSystemService(NSD_SERVICE) as NsdManager
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_discover)
val discoverChildButton = findViewById<Button>(R.id.discoverChildButton)
discoverChildButton.setOnClickListener { _: View? -> loadDiscoveryViaMdns() }
val enterChildAddressButton = findViewById<Button>(R.id.enterChildAddressButton)
enterChildAddressButton.setOnClickListener { _: View? -> loadDiscoveryViaAddress() }
}
private fun loadDiscoveryViaMdns() {
setContentView(R.layout.activity_discover_mdns)
startServiceDiscovery("_childmonitor._tcp.")
}
private fun loadDiscoveryViaAddress() {
setContentView(R.layout.activity_discover_address)
val connectButton = findViewById<Button>(R.id.connectViaAddressButton)
val addressField = findViewById<EditText>(R.id.ipAddressField)
val portField = findViewById<EditText>(R.id.portField)
val preferredAddress = getPreferences(MODE_PRIVATE).getString(PREF_KEY_CHILD_DEVICE_ADDRESS, null)
if (!preferredAddress.isNullOrEmpty()) {
addressField.setText(preferredAddress)
}
val preferredPort = getPreferences(MODE_PRIVATE).getInt(PREF_KEY_CHILD_DEVICE_PORT, -1)
if (preferredPort > 0) {
portField.setText(preferredPort.toString())
} else {
portField.setText("10000")
}
connectButton.setOnClickListener { _: View? ->
Log.i(TAG, "Connecting to child device via address")
val addressString = addressField.text.toString()
val portString = portField.text.toString()
if (addressString.isEmpty()) {
Toast.makeText(this@DiscoverActivity, R.string.invalidAddress, Toast.LENGTH_LONG).show()
return@setOnClickListener
}
val port: Int = try {
portString.toInt()
} catch (e: NumberFormatException) {
Toast.makeText(this@DiscoverActivity, R.string.invalidPort, Toast.LENGTH_LONG).show()
return@setOnClickListener
}
val preferencesEditor = getPreferences(MODE_PRIVATE).edit()
preferencesEditor.putString(PREF_KEY_CHILD_DEVICE_ADDRESS, addressString)
preferencesEditor.putInt(PREF_KEY_CHILD_DEVICE_PORT, port)
preferencesEditor.apply()
connectToChild(addressString, port, addressString)
}
}
override fun onDestroy() {
Log.i(TAG, "ChildMonitoring stop")
this.discoveryListener?.let {
this.discoveryListener = null
Log.i(TAG, "Unregistering monitoring service")
this.nsdManager.stopServiceDiscovery(it)
}
super.onDestroy()
}
private fun startServiceDiscovery(serviceType: String) {
val nsdManager = this.getSystemService(NSD_SERVICE) as NsdManager
val wifi = this.applicationContext.getSystemService(WIFI_SERVICE) as WifiManager
val multicastLock = wifi.createMulticastLock("multicastLock")
multicastLock.setReferenceCounted(true)
multicastLock.acquire()
val multicastReleaser = {
try {
multicastLock.release()
} catch (ignored: Exception) {
// don't really care
}
}
val serviceTable = findViewById<ListView>(R.id.ServiceTable)
val availableServicesAdapter = ArrayAdapter<ServiceInfoWrapper>(this,
R.layout.available_children_list)
serviceTable.adapter = availableServicesAdapter
serviceTable.onItemClickListener = OnItemClickListener { parent: AdapterView<*>, _: View?, position: Int, _: Long ->
val info = parent.getItemAtPosition(position) as ServiceInfoWrapper
info.address?.let {
connectToChild(it, info.port, info.name)
}
}
// Instantiate a new DiscoveryListener
this.discoveryListener = object : DiscoveryListener {
// Called as soon as service discovery begins.
override fun onDiscoveryStarted(regType: String) {
Log.d(TAG, "Service discovery started")
}
override fun onServiceFound(service: NsdServiceInfo) {
// A service was found! Do something with it.
Log.d(TAG, "Service discovery success: $service")
if (service.serviceType != serviceType) {
// Service type is the string containing the protocol and
// transport layer for this service.
Log.d(TAG, "Unknown Service Type: " + service.serviceType)
} else if (service.serviceName.contains("ChildMonitor")) {
val resolver: NsdManager.ResolveListener = object : NsdManager.ResolveListener {
override fun onResolveFailed(serviceInfo: NsdServiceInfo, errorCode: Int) {
// Called when the resolve fails. Use the error code to debug.
Log.e(TAG, "Resolve failed: error $errorCode for service: $serviceInfo")
}
override fun onServiceResolved(serviceInfo: NsdServiceInfo) {
Log.i(TAG, "Resolve Succeeded: $serviceInfo")
runOnUiThread {
for (index in 0 until availableServicesAdapter.count) {
val item = availableServicesAdapter.getItem(index)
if (item != null && item.matches(serviceInfo)) {
// Prevent inserting duplicates
return@runOnUiThread
}
}
availableServicesAdapter.add(ServiceInfoWrapper(serviceInfo))
}
}
}
this@DiscoverActivity.nsdManager.resolveService(service, resolver)
} else {
Log.d(TAG, "Unknown Service name: " + service.serviceName)
}
}
override fun onServiceLost(service: NsdServiceInfo) {
// When the network service is no longer available.
// Internal bookkeeping code goes here.
Log.e(TAG, "Service lost: $service")
multicastReleaser()
}
override fun onDiscoveryStopped(serviceType: String) {
Log.i(TAG, "Discovery stopped: $serviceType")
multicastReleaser()
}
override fun onStartDiscoveryFailed(serviceType: String, errorCode: Int) {
Log.e(TAG, "Discovery failed: Error code: $errorCode")
nsdManager.stopServiceDiscovery(this)
multicastReleaser()
}
override fun onStopDiscoveryFailed(serviceType: String, errorCode: Int) {
Log.e(TAG, "Discovery failed: Error code: $errorCode")
nsdManager.stopServiceDiscovery(this)
multicastReleaser()
}
}
nsdManager.discoverServices(
serviceType, NsdManager.PROTOCOL_DNS_SD, discoveryListener
)
}
private fun connectToChild(address: String, port: Int, name: String) {
val i = Intent(applicationContext, ListenActivity::class.java)
val b = Bundle()
b.putString("address", address)
b.putInt("port", port)
b.putString("name", name)
i.putExtras(b)
startActivity(i)
}
companion object {
private const val TAG = "ChildMonitor"
private const val PREF_KEY_CHILD_DEVICE_ADDRESS = "childDeviceAddress"
private const val PREF_KEY_CHILD_DEVICE_PORT = "childDevicePort"
}
}
internal class ServiceInfoWrapper(private val info: NsdServiceInfo) {
fun matches(other: NsdServiceInfo): Boolean {
return info.host == other.host && info.port == other.port
}
val address: String?
get() = info.host.hostAddress
val port: Int
get() = info.port
// If there is more than one service with the same name on the network, it will
// have a number at the end, but will appear as the following:
// "ChildMonitor\\032(number)
// or
// "ChildMonitor\032(number)
// Replace \\032 and \032 with a " "
val name: String = info.serviceName
.replace("\\\\032", " ")
.replace("\\032", " ")
override fun toString(): String {
return name
}
}
@@ -0,0 +1,108 @@
package com.example.childmonitor_multiple
import android.app.Activity
import android.content.ComponentName
import android.content.Context
import android.content.Intent
import android.content.ServiceConnection
import android.media.AudioManager
import android.os.Bundle
import android.os.IBinder
import android.util.Log
import android.widget.TextView
import android.widget.Toast
import androidx.core.content.ContextCompat
import com.example.childmonitor_multiple.ListenService.ListenBinder
class ListenActivity : Activity() {
// Don't attempt to unbind from the service unless the client has received some
// information about the service's state.
private var shouldUnbind = false
private lateinit var statusText: TextView
private val connection: ServiceConnection = object : ServiceConnection {
override fun onServiceConnected(className: ComponentName, service: IBinder) {
// This is called when the connection with the service has been
// established, giving us the service object we can use to
// interact with the service. Because we have bound to a explicit
// service that we know is running in our own process, we can
// cast its IBinder to a concrete class and directly access it.
val bs = (service as ListenBinder).service
Toast.makeText(this@ListenActivity, R.string.connect, Toast.LENGTH_SHORT).show()
val connectedText = findViewById<TextView>(R.id.connectedTo)
connectedText.text = bs.childDeviceName
val volumeView = findViewById<VolumeView>(R.id.volume)
volumeView.volumeHistory = bs.volumeHistory
bs.onUpdate = { volumeView.postInvalidate() }
bs.onError = { postErrorMessage() }
statusText.text = "Connected and listening..."
}
override fun onServiceDisconnected(className: ComponentName) {
// This is called when the connection with the service has been
// unexpectedly disconnected -- that is, its process crashed.
// Because it is running in our same process, we should never
// see this happen.
Toast.makeText(this@ListenActivity, R.string.disconnected, Toast.LENGTH_SHORT).show()
statusText.text = "Disconnected"
}
}
private fun ensureServiceRunningAndBind(bundle: Bundle?) {
val context: Context = this
val intent = Intent(context, ListenService::class.java)
bundle?.let {
intent.putExtra("name", it.getString("name"))
intent.putExtra("address", it.getString("address"))
intent.putExtra("port", it.getInt("port"))
ContextCompat.startForegroundService(context, intent)
}
// Attempts to establish a connection with the service. We use an
// explicit class name because we want a specific service
// implementation that we know will be running in our own process
// (and thus won't be supporting component replacement by other
// applications).
if (bindService(intent, connection, BIND_AUTO_CREATE)) {
shouldUnbind = true
Log.i(TAG, "Bound to ListenService")
} else {
Log.e(TAG, "Error: Could not bind to ListenService.")
statusText.text = "Failed to bind service."
}
}
private fun doUnbindAndStopService() {
if (shouldUnbind) {
unbindService(connection)
shouldUnbind = false
}
stopService(Intent(this, ListenService::class.java))
}
fun postErrorMessage() {
statusText.post {
statusText.text = "Connection failed after 3 attempts."
}
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_listen)
statusText = findViewById(R.id.textStatus)
statusText.text = "Attempting to connect..."
volumeControlStream = AudioManager.STREAM_MUSIC
ensureServiceRunningAndBind(intent.extras)
}
override fun onDestroy() {
doUnbindAndStopService()
super.onDestroy()
}
companion object {
private const val TAG = "ListenActivity"
}
}
@@ -0,0 +1,243 @@
/*
* This file is part of 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 com.example.childmonitor_multiple
import android.app.Notification
import android.app.NotificationChannel
import android.app.NotificationManager
import android.app.PendingIntent
import android.app.Service
import android.content.Intent
import android.content.pm.ServiceInfo
import android.media.AudioManager
import android.media.AudioTrack
import android.media.MediaPlayer
import android.os.Binder
import android.os.Build
import android.os.IBinder
import android.util.Log
import android.widget.Toast
import androidx.core.app.NotificationCompat
import androidx.core.app.ServiceCompat
import java.io.IOException
import java.net.Socket
class ListenService : Service() {
private val frequency: Int = AudioCodecDefines.FREQUENCY
private val channelConfiguration: Int = AudioCodecDefines.CHANNEL_CONFIGURATION_OUT
private val audioEncoding: Int = AudioCodecDefines.ENCODING
private val bufferSize = AudioTrack.getMinBufferSize(frequency, channelConfiguration, audioEncoding)
private val byteBufferSize = bufferSize * 2
private val binder: IBinder = ListenBinder()
private lateinit var notificationManager: NotificationManager
private var listenThread: Thread? = null
val volumeHistory = VolumeHistory(16384)
var childDeviceName: String? = null
private set
var onError: (() -> Unit)? = null
var onUpdate: (() -> Unit)? = null
override fun onCreate() {
super.onCreate()
this.notificationManager = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
}
override fun onStartCommand(intent: Intent, flags: Int, startId: Int): Int {
Log.i(TAG, "Received start id $startId: $intent")
// Display a notification about us starting. We put an icon in the status bar.
createNotificationChannel()
intent.extras?.let {
val name = it.getString("name")
childDeviceName = name
val n = buildNotification(name)
val foregroundServiceType =
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R)
ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK else 0
ServiceCompat.startForeground(this, ID, n, foregroundServiceType)
val address = it.getString("address")
val port = it.getInt("port")
doListenWithRetries(address, port)
}
return START_REDELIVER_INTENT
}
override fun onDestroy() {
this.listenThread?.interrupt()
this.listenThread = null
// Cancel the persistent notification.
notificationManager.cancel(R.string.listening)
ServiceCompat.stopForeground(this, ServiceCompat.STOP_FOREGROUND_REMOVE)
// Tell the user we stopped.
Toast.makeText(this, R.string.stopped, Toast.LENGTH_SHORT).show()
}
override fun onBind(intent: Intent): IBinder = binder
inner class ListenBinder : Binder() {
val service: ListenService
get() = this@ListenService
}
private fun buildNotification(name: String?, status: String = getString(R.string.listening)): Notification {
// In this sample, we'll use the same text for the ticker and the expanded notification
val text = status
val contentIntent = PendingIntent.getActivity(
this, 0,
Intent(this, ListenActivity::class.java),
PendingIntent.FLAG_IMMUTABLE
)
return NotificationCompat.Builder(this, CHANNEL_ID)
.setSmallIcon(R.drawable.listening_notification)
.setOngoing(true)
.setTicker(text)
.setContentTitle(text)
.setContentText(name)
.setContentIntent(contentIntent)
.build()
}
private fun createNotificationChannel() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val serviceChannel = NotificationChannel(
CHANNEL_ID,
"Foreground Service Channel",
NotificationManager.IMPORTANCE_DEFAULT
)
notificationManager.createNotificationChannel(serviceChannel)
}
}
/** New logic: automatically retry connection up to 3 times **/
private fun doListenWithRetries(address: String?, port: Int) {
val lt = Thread {
var attempts = 0
var connected = false
while (attempts < 3 && !connected && !Thread.currentThread().isInterrupted) {
try {
Log.i(TAG, "Connection attempt ${attempts + 1} to $address:$port ...")
val socket = Socket(address, port)
socket.soTimeout = 30_000
connected = streamAudio(socket)
if (!connected) {
Log.w(TAG, "Streaming failed, attempt ${attempts + 1}")
attempts++
Thread.sleep(2000)
}
} catch (e: IOException) {
attempts++
Log.e(TAG, "Error while connecting (attempt $attempts of 3)", e)
if (attempts < 3) Thread.sleep(2000)
}
}
if (!connected) {
Log.e(TAG, "Failed to connect after 3 attempts.")
playAlert()
updateNotification(getString(R.string.disconnected))
onError?.invoke()
} else {
Log.i(TAG, "Connection established successfully.")
}
}
this.listenThread = lt
lt.start()
}
private fun streamAudio(socket: Socket): Boolean {
Log.i(TAG, "Starting audio stream")
val audioTrack = AudioTrack(
AudioManager.STREAM_MUSIC,
frequency,
channelConfiguration,
audioEncoding,
bufferSize,
AudioTrack.MODE_STREAM
)
try {
audioTrack.play()
} catch (e: IllegalStateException) {
Log.e(TAG, "Failed to start AudioTrack", e)
return false
}
val inputStream = try {
socket.getInputStream()
} catch (e: IOException) {
Log.e(TAG, "Failed to open input stream", e)
return false
}
val readBuffer = ByteArray(byteBufferSize)
val decodedBuffer = ShortArray(byteBufferSize * 2)
return try {
while (!Thread.currentThread().isInterrupted) {
val len = inputStream.read(readBuffer)
if (len < 0) return false
val decoded = AudioCodecDefines.CODEC.decode(decodedBuffer, readBuffer, len, 0)
if (decoded > 0) {
audioTrack.write(decodedBuffer, 0, decoded)
val decodedBytes = ShortArray(decoded)
System.arraycopy(decodedBuffer, 0, decodedBytes, 0, decoded)
volumeHistory.onAudioData(decodedBytes)
onUpdate?.invoke()
}
}
true
} catch (e: Exception) {
Log.e(TAG, "Connection lost during streaming", e)
updateNotification(getString(R.string.disconnected))
playAlert()
onError?.invoke()
false
} finally {
try {
audioTrack.stop()
audioTrack.release()
socket.close()
} catch (_: Exception) {}
}
}
private fun updateNotification(status: String) {
val n = buildNotification(childDeviceName, status)
notificationManager.notify(ID, n)
}
private fun playAlert() {
val mp = MediaPlayer.create(this, R.raw.upward_beep_chromatic_fifths)
if (mp != null) {
Log.i(TAG, "Playing alert sound")
mp.setOnCompletionListener { it.release() }
mp.start()
} else {
Log.e(TAG, "Failed to play alert sound")
}
}
companion object {
private const val TAG = "ListenService"
const val CHANNEL_ID = TAG
const val ID = 902938409
}
}
@@ -0,0 +1,135 @@
/*
* This file is part of 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 com.example.childmonitor_multiple
import android.app.Activity
import android.content.ComponentName
import android.content.Context
import android.content.Intent
import android.content.ServiceConnection
import android.net.ConnectivityManager
import android.os.Bundle
import android.os.IBinder
import android.util.Log
import android.widget.TextView
import android.widget.Toast
import androidx.core.content.ContextCompat
import com.example.childmonitor_multiple.MonitorService.MonitorBinder
class MonitorActivity : Activity() {
private val connection: ServiceConnection = object : ServiceConnection {
override fun onServiceConnected(className: ComponentName, service: IBinder) {
// This is called when the connection with the service has been
// established, giving us the service object we can use to
// interact with the service. Because we have bound to an explicit
// service that we know is running in our own process, we can
// cast its IBinder to a concrete class and directly access it.
val bs = (service as MonitorBinder).service
bs.monitorActivity = this@MonitorActivity
}
override fun onServiceDisconnected(className: ComponentName) {
// This is called when the connection with the service has been
// unexpectedly disconnected -- that is, its process crashed.
// Because it is running in our same process, we should never
// see this happen.
Toast.makeText(this@MonitorActivity, R.string.disconnected,
Toast.LENGTH_SHORT).show()
}
}
private var shouldUnbind = false
override fun onCreate(savedInstanceState: Bundle?) {
Log.i(TAG, "ChildMonitor start")
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_monitor)
val addressText = findViewById<TextView>(R.id.address)
val listenAddresses = listenAddresses
if (listenAddresses.isNotEmpty()) {
val sb = StringBuilder()
for (i in listenAddresses.indices) {
val listenAddress = listenAddresses[i]
sb.append(listenAddress)
if (i != listenAddresses.size - 1) {
sb.append("\n\n")
}
}
addressText.text = sb.toString()
} else {
addressText.setText(R.string.notConnected)
}
ensureServiceRunningAndBind()
}
private val listenAddresses: List<String>
get() {
val cm = getSystemService(CONNECTIVITY_SERVICE) as ConnectivityManager
val listenAddresses: MutableList<String> = ArrayList()
for (network in cm.allNetworks) {
val networkInfo = cm.getNetworkInfo(network)
val connected = networkInfo!!.isConnected
if (connected) {
val linkAddresses = cm.getLinkProperties(network)!!.linkAddresses
for (linkAddress in linkAddresses) {
val address = linkAddress.address
val hostAddress = address.hostAddress
if (!address.isLinkLocalAddress && !address.isLoopbackAddress && hostAddress != null) {
listenAddresses.add(hostAddress + " (" + networkInfo.typeName + ")")
}
}
}
}
return listenAddresses
}
public override fun onDestroy() {
doUnbindAndStopService()
super.onDestroy()
}
private fun ensureServiceRunningAndBind() {
val context: Context = this
val intent = Intent(context, MonitorService::class.java)
ContextCompat.startForegroundService(context, intent)
// Attempts to establish a connection with the service. We use an
// explicit class name because we want a specific service
// implementation that we know will be running in our own process
// (and thus won't be supporting component replacement by other
// applications).
if (bindService(intent, connection, BIND_AUTO_CREATE)) {
this.shouldUnbind = true
Log.i(TAG, "Bound monitor service")
} else {
Log.e(TAG, "Error: The requested service doesn't " +
"exist, or this client isn't allowed access to it.")
}
}
private fun doUnbindAndStopService() {
if (this.shouldUnbind) {
this.shouldUnbind = false
// Release information about the service's state.
unbindService(connection)
}
val context: Context = this
val intent = Intent(context, MonitorService::class.java)
context.stopService(intent)
}
companion object {
const val TAG = "ChildMonitor"
}
}
@@ -0,0 +1,252 @@
package com.example.childmonitor_multiple
import android.app.Notification
import android.app.NotificationChannel
import android.app.NotificationManager
import android.app.Service
import android.content.Intent
import android.content.pm.ServiceInfo
import android.media.AudioRecord
import android.media.MediaRecorder
import android.net.nsd.NsdManager
import android.net.nsd.NsdManager.RegistrationListener
import android.net.nsd.NsdServiceInfo
import android.os.Binder
import android.os.Build
import android.os.IBinder
import android.util.Log
import android.widget.TextView
import android.widget.Toast
import androidx.core.app.NotificationCompat
import androidx.core.app.ServiceCompat
import java.io.IOException
import java.net.ServerSocket
import java.net.Socket
class MonitorService : Service() {
private val binder: IBinder = MonitorBinder()
private lateinit var nsdManager: NsdManager
private var registrationListener: RegistrationListener? = null
private var currentSocket: ServerSocket? = null
private var connectionToken: Any? = null
private var currentPort = 0
private lateinit var notificationManager: NotificationManager
private var monitorThread: Thread? = null
var monitorActivity: MonitorActivity? = null
override fun onCreate() {
super.onCreate()
this.notificationManager = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
this.nsdManager = this.getSystemService(NSD_SERVICE) as NsdManager
this.currentPort = 10000
this.currentSocket = null
Log.i(TAG, "ChildMonitor start")
}
override fun onStartCommand(intent: Intent, flags: Int, startId: Int): Int {
createNotificationChannel()
val n = buildNotification()
val foregroundServiceType =
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R)
ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE
else 0
ServiceCompat.startForeground(this, ID, n, foregroundServiceType)
ensureMonitorThread()
return START_REDELIVER_INTENT
}
private fun ensureMonitorThread() {
if (monitorThread?.isAlive == true) return
val currentToken = Any()
this.connectionToken = currentToken
monitorThread = Thread {
while (connectionToken == currentToken) {
try {
ServerSocket(currentPort).use { serverSocket ->
currentSocket = serverSocket
registerService(serverSocket.localPort)
val clients = mutableListOf<Socket>()
// Thread: neue Clients akzeptieren
Thread {
try {
while (!Thread.currentThread().isInterrupted) {
val client = serverSocket.accept()
client.tcpNoDelay = true
synchronized(clients) { clients.add(client) }
Log.i(TAG, "Neuer Client: ${client.inetAddress}")
// Statusanzeige auf Streaming
monitorActivity?.runOnUiThread {
monitorActivity?.findViewById<TextView>(R.id.textStatus)
?.setText(R.string.streaming)
}
}
} catch (e: IOException) {
Log.e(TAG, "Client-Akzeptierungsfehler: ${e.message}")
}
}.start()
// Aufnahme + Multi-Client-Streaming starten
handleMultiClientStreaming(serverSocket, clients)
}
} catch (e: Exception) {
if (connectionToken == currentToken) {
currentPort++
Log.e(TAG, "Failed to open server socket. Port increased to $currentPort", e)
}
}
}
}.also { it.start() }
}
private fun handleMultiClientStreaming(serverSocket: ServerSocket, clients: MutableList<Socket>) {
val frequency = AudioCodecDefines.FREQUENCY
val channelConfiguration = AudioCodecDefines.CHANNEL_CONFIGURATION_IN
val audioEncoding = AudioCodecDefines.ENCODING
val bufferSize = AudioRecord.getMinBufferSize(frequency, channelConfiguration, audioEncoding)
val audioRecord = AudioRecord(
MediaRecorder.AudioSource.MIC,
frequency,
channelConfiguration,
audioEncoding,
bufferSize
)
val pcmBufferSize = bufferSize * 2
val pcmBuffer = ShortArray(pcmBufferSize)
val ulawBuffer = ByteArray(pcmBufferSize)
try {
audioRecord.startRecording()
Log.i(TAG, "Mehrere Clients aktiv Aufnahme gestartet.")
while (!Thread.currentThread().isInterrupted && !serverSocket.isClosed) {
val read = audioRecord.read(pcmBuffer, 0, bufferSize)
if (read > 0) {
val encoded = AudioCodecDefines.CODEC.encode(pcmBuffer, read, ulawBuffer, 0)
synchronized(clients) {
val iterator = clients.iterator()
while (iterator.hasNext()) {
val client = iterator.next()
try {
client.getOutputStream().write(ulawBuffer, 0, encoded)
} catch (e: IOException) {
try { client.close() } catch (_: IOException) {}
iterator.remove()
Log.w(TAG, "Client getrennt: ${client.inetAddress}")
}
}
// Wenn keine Clients mehr da, Status auf "Warte auf Eltern"
if (clients.isEmpty()) {
monitorActivity?.runOnUiThread {
monitorActivity?.findViewById<TextView>(R.id.textStatus)
?.setText(R.string.waitingForParent)
}
}
}
}
}
} catch (e: Exception) {
Log.e(TAG, "Streaming-Fehler", e)
} finally {
audioRecord.stop()
audioRecord.release()
synchronized(clients) {
clients.forEach {
try { it.close() } catch (_: IOException) {}
}
clients.clear()
}
Log.i(TAG, "Audioaufnahme beendet, alle Clients getrennt.")
monitorActivity?.runOnUiThread {
monitorActivity?.findViewById<TextView>(R.id.textStatus)
?.setText(R.string.waitingForParent)
}
}
}
private fun registerService(port: Int) {
val serviceInfo = NsdServiceInfo().apply {
serviceName = "ChildMonitor on ${Build.MODEL}"
serviceType = "_childmonitor._tcp."
this.port = port
}
registrationListener = object : RegistrationListener {
override fun onServiceRegistered(nsdServiceInfo: NsdServiceInfo) {
monitorActivity?.runOnUiThread {
monitorActivity?.findViewById<TextView>(R.id.textStatus)
?.setText(R.string.waitingForParent)
monitorActivity?.findViewById<TextView>(R.id.textService)
?.text = nsdServiceInfo.serviceName
monitorActivity?.findViewById<TextView>(R.id.port)
?.text = port.toString()
}
}
override fun onRegistrationFailed(serviceInfo: NsdServiceInfo, errorCode: Int) {
Log.e(TAG, "Registration failed: $errorCode")
}
override fun onServiceUnregistered(arg0: NsdServiceInfo) {}
override fun onUnregistrationFailed(serviceInfo: NsdServiceInfo, errorCode: Int) {}
}
nsdManager.registerService(serviceInfo, NsdManager.PROTOCOL_DNS_SD, registrationListener)
}
private fun unregisterService() {
registrationListener?.let {
registrationListener = null
nsdManager.unregisterService(it)
}
}
private fun createNotificationChannel() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val channel = NotificationChannel(
CHANNEL_ID,
"Foreground Service Channel",
NotificationManager.IMPORTANCE_DEFAULT
)
notificationManager.createNotificationChannel(channel)
}
}
private fun buildNotification(): Notification {
return NotificationCompat.Builder(this, CHANNEL_ID)
.setSmallIcon(R.drawable.listening_notification)
.setOngoing(true)
.setTicker("Child Device")
.setContentTitle("Child Device")
.build()
}
override fun onDestroy() {
monitorThread?.interrupt()
monitorThread = null
unregisterService()
connectionToken = null
currentSocket?.close()
currentSocket = null
notificationManager.cancel(R.string.listening)
ServiceCompat.stopForeground(this, ServiceCompat.STOP_FOREGROUND_REMOVE)
Toast.makeText(this, R.string.stopped, Toast.LENGTH_SHORT).show()
super.onDestroy()
}
override fun onBind(intent: Intent): IBinder = binder
inner class MonitorBinder : Binder() {
val service: MonitorService get() = this@MonitorService
}
companion object {
const val TAG = "MonitorService"
const val CHANNEL_ID = TAG
const val ID = 1338
}
}
@@ -0,0 +1,87 @@
/*
* This file is part of 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 com.example.childmonitor_multiple
import android.Manifest
import android.app.Activity
import android.content.Intent
import android.content.pm.PackageManager
import android.os.Bundle
import android.util.Log
import android.view.View
import android.widget.Button
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
class StartActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
Log.i(TAG, "ChildMonitor launched")
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_start)
val monitorButton = findViewById<Button>(R.id.useChildDevice)
monitorButton.setOnClickListener { _: View? ->
Log.i(TAG, "Starting up monitor")
if (isAudioRecordingPermissionGranted) {
startActivity(Intent(applicationContext, MonitorActivity::class.java))
} else {
requestAudioPermission()
}
}
val connectButton = findViewById<Button>(R.id.useParentDevice)
connectButton.setOnClickListener { _: View? ->
Log.i(TAG, "Starting connection activity")
if (isMulticastPermissionGranted) {
val i = Intent(applicationContext, DiscoverActivity::class.java)
startActivity(i)
} else {
requestMulticastPermission()
}
}
}
private val isMulticastPermissionGranted: Boolean
get() = (ContextCompat.checkSelfPermission(this@StartActivity, Manifest.permission.CHANGE_WIFI_MULTICAST_STATE)
== PackageManager.PERMISSION_GRANTED)
private val isAudioRecordingPermissionGranted: Boolean
get() = (ContextCompat.checkSelfPermission(this@StartActivity, Manifest.permission.RECORD_AUDIO)
== PackageManager.PERMISSION_GRANTED)
private fun requestAudioPermission() {
ActivityCompat.requestPermissions(this@StartActivity, arrayOf(Manifest.permission.RECORD_AUDIO),
PERMISSIONS_REQUEST_RECORD_AUDIO)
}
private fun requestMulticastPermission() {
ActivityCompat.requestPermissions(this@StartActivity, arrayOf(Manifest.permission.CHANGE_WIFI_MULTICAST_STATE),
PERMISSIONS_REQUEST_MULTICAST)
}
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String>, grantResults: IntArray) {
if (requestCode == PERMISSIONS_REQUEST_RECORD_AUDIO && grantResults.size > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
startActivity(Intent(applicationContext, MonitorActivity::class.java))
} else if (requestCode == PERMISSIONS_REQUEST_MULTICAST) {
// its okay if the permission was denied... the user will have to type the address manually
startActivity(Intent(applicationContext, DiscoverActivity::class.java))
}
}
companion object {
const val TAG = "ChildMonitor"
private const val PERMISSIONS_REQUEST_RECORD_AUDIO = 298349824
private const val PERMISSIONS_REQUEST_MULTICAST = 298349825
}
}
@@ -0,0 +1,63 @@
/*
* This file is part of 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 com.example.childmonitor_multiple
import android.os.Handler
import android.os.Looper
import androidx.collection.CircularArray
class VolumeHistory internal constructor(private val maxHistory: Int) {
private var maxVolume = 0.25
var volumeNorm = 1.0 / this.maxVolume
private set
private val historyData: CircularArray<Double> = CircularArray(maxHistory)
private val uiHandler: Handler = Handler(Looper.getMainLooper())
operator fun get(i: Int): Double {
return historyData[i]
}
fun size(): Int {
return historyData.size()
}
private fun addLast(volume: Double) {
// schedule editing of member vars on the ui event loop to avoid concurrency problems
uiHandler.post {
if (volume > this.maxVolume) {
this.maxVolume = volume
this.volumeNorm = 1.0 / volume
}
historyData.addLast(volume)
historyData.removeFromStart(historyData.size() - maxHistory)
}
}
fun onAudioData(data: ShortArray) {
if (data.isEmpty()) {
return
}
val scale = 1.0 / 128.0
var sum = 0.0
for (datum in data) {
val rel = datum * scale
sum += rel * rel
}
val volume = sum / data.size
addLast(volume)
}
}
@@ -0,0 +1,89 @@
/*
* This file is part of 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 com.example.childmonitor_multiple
import android.content.Context
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.util.AttributeSet
import android.view.View
import kotlin.math.min
class VolumeView : View {
private val paint: Paint
var volumeHistory: VolumeHistory? = null
constructor(context: Context?) : super(context) {
paint = initPaint()
}
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs) {
paint = initPaint()
}
constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
paint = initPaint()
}
private fun initPaint(): Paint {
val paint = Paint()
paint.color = Color.rgb(255, 127, 0)
return paint
}
override fun onDraw(canvas: Canvas) {
val volumeHistory = this.volumeHistory ?: return
val height = height
val width = width
val size = volumeHistory.size() // Size is at most width
val volumeNorm = volumeHistory.volumeNorm
val minBrightness = 0.3
val relativeBrightness: Double = if (size > 0) {
(volumeNorm * volumeHistory[size - 1]).coerceAtLeast(minBrightness)
} else {
minBrightness
}
val blue: Int
val rest: Int
if (relativeBrightness > 0.5) {
blue = 255
rest = (2 * 255 * (relativeBrightness - 0.5)).toInt()
} else {
blue = (255 * (relativeBrightness - 0.2) / 0.3).toInt()
rest = 0
}
val rgb = Color.rgb(rest, rest, blue)
canvas.drawColor(rgb)
if (size == 0) {
return
}
val margins = height * 0.1
val graphHeight = height - 2.0 * margins
val leftMost = (volumeHistory.size() - width).coerceAtLeast(0)
val graphScale = graphHeight * volumeNorm
var xPrev = 0
var yPrev = (margins + graphHeight - volumeHistory[leftMost] * graphScale).toInt()
val length = min(size, width)
for (xNext in 1 until length - 1) {
val yNext = (margins + graphHeight - volumeHistory[leftMost + xNext] * graphScale).toInt()
canvas.drawLine(xPrev.toFloat(), yPrev.toFloat(), xNext.toFloat(), yNext.toFloat(), paint)
xPrev = xNext
yPrev = yNext
}
}
}
@@ -0,0 +1,97 @@
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Taken from https://android.googlesource.com/platform/external/nist-sip/+/6f95fdeab4481188b6260041b41d1db12b101266/src/com/android/sip/media/G711UCodec.java
* Adopted to the needs of the Child Monitor project.
*/
package com.example.childmonitor_multiple
/**
* G.711 codec. This class provides u-law conversion.
*/
class G711UCodec {
fun decode(b16: ShortArray, ulaw: ByteArray, count: Int, offset: Int): Int {
var i = 0
var j = offset
while (i < count) {
b16[i] = table8to16[ulaw[j].toInt() and 0xFF]
i++
j++
}
return count
}
fun encode(b16: ShortArray, count: Int, b8: ByteArray, offset: Int): Int {
var i = 0
var j = offset
while (i < count) {
b8[j] = table13to8[b16[i].toInt() shr 4 and 0x1FFF]
i++
j++
}
return count
}
companion object {
// s00000001wxyz...s000wxyz
// s0000001wxyza...s001wxyz
// s000001wxyzab...s010wxyz
// s00001wxyzabc...s011wxyz
// s0001wxyzabcd...s100wxyz
// s001wxyzabcde...s101wxyz
// s01wxyzabcdef...s110wxyz
// s1wxyzabcdefg...s111wxyz
private val table13to8 = ByteArray(8192)
private val table8to16 = ShortArray(256)
init {
// b13 --> b8
var p = 1
var q = 0
while (p <= 0x80) {
var i = 0
var j = (p shl 4) - 0x10
while (i < 16) {
val v = i + q xor 0x7F
val value1 = v.toByte()
val value2 = (v + 128).toByte()
var m = j
val e = j + p
while (m < e) {
table13to8[m] = value1
table13to8[8191 - m] = value2
m++
}
i++
j += p
}
p = p shl 1
q += 0x10
}
// b8 --> b16
for (r in 0..7) {
var i = 0
var m = r shl 4
while (i < 16) {
val v = (i + 0x10 shl r) - 0x10 shl 3
table8to16[m xor 0x7F] = v.toShort()
table8to16[(m xor 0x7F) + 128] = (65536 - v).toShort()
i++
m++
}
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 626 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 854 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

@@ -1,170 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
<vector
android:height="108dp"
android:width="108dp"
android:viewportHeight="108"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#3DDC84"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z"/>
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
</vector>
@@ -0,0 +1,59 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.childmonitor_multiple.MonitorActivity" >
<TextView
android:id="@+id/parentDeviceTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/parentDevice"
android:textSize="25sp" />
<Space
android:layout_width="match_parent"
android:layout_height="15dip" />
<Button
android:id="@+id/discoverChildButton"
style="?android:attr/buttonStyleSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/discoverChild"
android:textSize="17sp" />
<TextView
android:id="@+id/discoverChildDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/discoverChildDescription"
android:textSize="14sp" />
<Space
android:layout_width="match_parent"
android:layout_height="15dip" />
<Button
android:id="@+id/enterChildAddressButton"
style="?android:attr/buttonStyleSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/enterChildAddress"
android:textSize="17sp" />
<TextView
android:id="@+id/enterChildAddressDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/enterChildAddressDescription"
android:textSize="14sp" />
</LinearLayout>
@@ -0,0 +1,102 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.childmonitor_multiple.MonitorActivity">
<TextView
android:id="@+id/parentDeviceTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/parentDevice"
android:textSize="25sp" />
<Space
android:layout_width="match_parent"
android:layout_height="15dip" />
<TextView
android:id="@+id/enterAddressInstructions"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/enterAddressInstructions" />
<Space
android:layout_width="match_parent"
android:layout_height="15dip" />
<TextView
android:id="@+id/ipAddressTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:text="@string/addressTitle" />
<EditText
android:id="@+id/ipAddressField"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="@string/exampleAddress"
android:inputType="textUri"
android:textSize="20sp"
android:nextFocusForward="@+id/portField" >
</EditText>
<TextView
android:id="@+id/portTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:text="@string/portTitle" />
<EditText
android:id="@+id/portField"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="20sp"
android:ems="10"
android:inputType="number"
android:maxLength="5"
android:hint="@string/examplePort"
android:nextFocusForward="@+id/retryField" />
<TextView
android:id="@+id/retryTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:text="Retry attempts" />
<EditText
android:id="@+id/retryField"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="20sp"
android:ems="10"
android:inputType="number"
android:maxLength="2"
android:text="3"
android:hint="Default: 3"
android:nextFocusForward="@+id/connectViaAddressButton" />
<Space
android:layout_width="match_parent"
android:layout_height="15dip" />
<Button
android:id="@+id/connectViaAddressButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/connect" />
</LinearLayout>
@@ -0,0 +1,41 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.childmonitor_multiple.MonitorActivity" >
<TextView
android:id="@+id/parentDeviceTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/parentDevice"
android:textSize="25sp" />
<Space
android:layout_width="match_parent"
android:layout_height="15dip" />
<TextView
android:id="@+id/selectChildDeviceTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/selectChildDevice"
android:textSize="20sp" />
<ListView
android:id="@+id/ServiceTable"
android:scrollbars="vertical"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.32"
android:padding="10dp" >
</ListView>
</LinearLayout>
@@ -0,0 +1,67 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:keepScreenOn="true"
android:orientation="vertical"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="com.example.childmonitor_multiple.MonitorActivity">
<TextView
android:id="@id/parentDeviceTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/parentDevice"
android:textSize="25sp" />
<Space
android:layout_width="match_parent"
android:layout_height="15dip" />
<TextView
android:id="@+id/connectedToTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/connectedTo"
android:textSize="20sp" />
<TextView
android:id="@+id/connectedTo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textSize="20sp" />
<Space
android:layout_width="match_parent"
android:layout_height="15dip" />
<TextView
android:id="@+id/status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/status"
android:textSize="20sp" />
<TextView
android:id="@+id/textStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textSize="20sp" />
<Space
android:layout_width="match_parent"
android:layout_height="15dip" />
<com.example.childmonitor_multiple.VolumeView
android:id="@+id/volume"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
-31
View File
@@ -1,31 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:padding="24dp"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/startStreamButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Start Streaming"/>
<TextView
android:id="@+id/ipAddressText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="IP-Adresse: wird geladen..."
android:textSize="16sp"
android:textColor="@android:color/black" />
<TextView
android:id="@+id/PortText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="Port zu wählen: 50005"
android:textSize="16sp"
android:textColor="@android:color/black" />
</LinearLayout>
@@ -0,0 +1,117 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
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="com.example.childmonitor_multiple.MonitorActivity" >
<TextView
android:id="@+id/childDeviceTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/childDevice"
android:textSize="25sp" />
<Space
android:layout_width="match_parent"
android:layout_height="15dip" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:id="@+id/LinearLayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:keepScreenOn="true"
tools:context="com.example.childmonitor_multiple.MonitorActivity" >
<TextView
android:id="@+id/serviceTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/serviceTitle"
android:textSize="20sp" />
<TextView
android:id="@+id/textService"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/loading"
android:textSize="20sp" />
<TextView
android:id="@+id/serviceDescription"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/serviceDescription" />
<Space
android:layout_width="match_parent"
android:layout_height="15dip" />
<Space
android:layout_width="match_parent"
android:layout_height="15dip" />
<TextView
android:id="@+id/portTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/portTitle"
android:textSize="20sp" />
<TextView
android:id="@+id/port"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/loading"
android:textSize="20sp"/>
<Space
android:layout_width="match_parent"
android:layout_height="15dip" />
<TextView
android:id="@+id/addressTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/addressTitle"
android:textSize="20sp" />
<Space
android:layout_width="match_parent"
android:layout_height="15dip" />
<TextView
android:id="@+id/address"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text=""
android:textSize="15sp"/>
<Space
android:layout_width="match_parent"
android:layout_height="15dip" />
<TextView
android:id="@+id/textStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textSize="20sp" />
</LinearLayout>
</ScrollView>
</LinearLayout>
@@ -0,0 +1,46 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.childmonitor_multiple.StartActivity" >
<Button
android:id="@+id/useChildDevice"
style="?android:attr/buttonStyleSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/useAsChildDevice"
android:textSize="17sp" />
<TextView
android:id="@+id/childDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/childDescription"
android:textSize="14sp" />
<Space
android:layout_width="match_parent"
android:layout_height="15dip" />
<Button
android:id="@+id/useParentDevice"
style="?android:attr/buttonStyleSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/useAsParentDevice"
android:textSize="17sp" />
<TextView
android:id="@+id/parentDescription"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/parentDescription" />
</LinearLayout>
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/availableChildrenList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceListItemSmall"
android:gravity="center_vertical"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:paddingEnd="16dp"
android:paddingRight="16dp"
android:minHeight="?android:attr/listPreferredItemHeightSmall" />
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 982 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

+36
View File
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Child Monitor Multiple Clients</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>
<string name="childDescription">Gerät ist beim Kind platziert und sendet Tonsignale zum Eltern-Gerät</string>
<string name="parentDescription">Gekoppelt mit Kind-Gerät und gibt empfangene Tonsignale wieder.</string>
<string name="childDevice">Kind-Gerät</string>
<string name="serviceTitle">Dienst:</string>
<string name="serviceDescription">Name des Diensten, mit dem sich die Eltern verbinden müssen.</string>
<string name="loading">Lade...</string>
<string name="stopped">Angehalten</string>
<string name="streaming">Streaming...</string>
<string name="waitingForParent">Warte auf Eltern</string>
<string name="parentDevice">Eltern-Gerät</string>
<string name="selectChildDevice">Wähle Kind-Gerät</string>
<string name="status">Status:</string>
<string name="connectedTo">Verbunden mit:</string>
<string name="disconnected">Getrennt</string>
<string name="listening">Lausche...</string>
<string name="addressTitle">Adressen:</string>
<string name="portTitle">Port:</string>
<string name="notConnected">Mit keinem Netzwerk verbunden</string>
<string name="enterAddressInstructions">Gib die IP-Adresse und den Port des Kind-Gerätes ein und klicke auf Verbinden</string>
<string name="connect">Verbinden</string>
<string name="exampleAddress">192.168.1.2</string>
<string name="examplePort">10000</string>
<string name="invalidPort">Entweder wurde kein Port eingegeben oder er ist ungültig</string>
<string name="invalidAddress">Das Adressfeld muss ausgefüllt sein</string>
<string name="discoverChild">Suche Kind im Netzwerk</string>
<string name="discoverChildDescription">Wähle ein Kind aus einer Liste der erkannten Kinder im Netzwerk</string>
<string name="enterChildAddress">Wähle Kind durch Adresse</string>
<string name="enterChildAddressDescription">Gib die Adresse und den Port des Kind ein</string>
</resources>
+36
View File
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">子モニター</string>
<string name="action_settings">設定</string>
<string name="useAsParentDevice">親機として使用する</string>
<string name="useAsChildDevice">子機として使用する</string>
<string name="childDescription">端末をベビーの横に置くと、音声が親機に送られます</string>
<string name="parentDescription">子機とペアにして、受信した音声を再生します</string>
<string name="childDevice">子機</string>
<string name="serviceTitle">サービス:</string>
<string name="serviceDescription">親機がペアにするサービスの名前</string>
<string name="loading">読み込み中...</string>
<string name="stopped">停止しました</string>
<string name="streaming">ストリーム中...</string>
<string name="waitingForParent">親機を待機中...</string>
<string name="parentDevice">親機</string>
<string name="selectChildDevice">子機を選択:</string>
<string name="status">ステータス:</string>
<string name="connectedTo">接続しました:</string>
<string name="disconnected">切断しました</string>
<string name="listening">リスニング中...</string>
<string name="addressTitle">アドレス:</string>
<string name="portTitle">ポート:</string>
<string name="notConnected">ネットワークに接続されていません</string>
<string name="enterAddressInstructions">子機の IP アドレスとポートを入力して、接続をクリックしてください</string>
<string name="connect">接続</string>
<string name="exampleAddress">192.168.1.2</string>
<string name="examplePort">10000</string>
<string name="invalidPort">ポートが入力されていないか正しくありません</string>
<string name="invalidAddress">アドレスフィールドを入力してください</string>
<string name="discoverChild">ネットワークで子機を探索</string>
<string name="discoverChildDescription">ネットワークで検出した子機を選択します</string>
<string name="enterChildAddress">子機をアドレスで選択</string>
<string name="enterChildAddressDescription">子機のアドレスとポートを入力します</string>
</resources>
+36
View File
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Child Monitor Multiple Clients</string>
<string name="action_settings">Instellingen</string>
<string name="useAsParentDevice">Gebruiken als ouderapparaat</string>
<string name="useAsChildDevice">Gebruiken als kindapparaat</string>
<string name="childDescription">Het apparaat wordt bij de baby geplaatst en verstuurt audio naar een gekoppeld ouderapparaat.</string>
<string name="parentDescription">Verbindt met kindapparaat en speelt ontvangen audio af</string>
<string name="childDevice">Kindapparaat</string>
<string name="serviceTitle">Dienst:</string>
<string name="serviceDescription">Naam van de dienst waar de ouder mee moet verbinden</string>
<string name="loading">Bezig met laden...</string>
<string name="stopped">Gestopt</string>
<string name="streaming">Bezig met uitzenden...</string>
<string name="waitingForParent">Bezig met wachten op ouderapparaat...</string>
<string name="parentDevice">Ouderapparaat</string>
<string name="selectChildDevice">Selecteer kindapparaat:</string>
<string name="status">Status:</string>
<string name="connectedTo">Verbonden met:</string>
<string name="disconnected">Verbinding verbroken</string>
<string name="listening">Bezig met luisteren...</string>
<string name="addressTitle">Adressen:</string>
<string name="portTitle">Poort:</string>
<string name="notConnected">Niet verbonden met een netwerk</string>
<string name="enterAddressInstructions">Voer het IP-adres en de poort van een kindapparaat in en druk op Verbinden</string>
<string name="connect">Verbinden</string>
<string name="exampleAddress">192.168.1.2</string>
<string name="examplePort">10000</string>
<string name="invalidPort">Er is geen of een ongeldig poortnummer ingevoerd</string>
<string name="invalidAddress">Het adresveld moet worden ingevuld</string>
<string name="discoverChild">Kindapparaat ontdekken op netwerk</string>
<string name="discoverChildDescription">Selecteer het kindapparaat uit een lijst van ontdekte apparaten op het netwerk</string>
<string name="enterChildAddress">Selecteer kindapparaat middels adres</string>
<string name="enterChildAddressDescription">Voer het adres en de poort in van een kindapparaat</string>
</resources>
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Monitor para crianças</string>
<string name="action_settings">Configurações</string>
<string name="useAsParentDevice">Usar como Dispositivo de Pais</string>
<string name="useAsChildDevice">Usar como Dispositivo para Crianças</string>
<string name="childDescription">O dispositivo é colocado com o bebê para enviar áudio a um Dispositivo de Pais conectado</string>
<string name="parentDescription">Conecta com o Dispositivo para Crianças e reproduz o áudio recebido</string>
<string name="childDevice">Dispositivo para Crianças</string>
<string name="serviceTitle">Serviço:</string>
<string name="serviceDescription">Nome do serviço ao qual os pais devem se conectar</string>
<string name="loading">Carregando...</string>
<string name="stopped">Parado</string>
<string name="streaming">Transmitindo...</string>
<string name="waitingForParent">Esperando os Pais...</string>
<string name="parentDevice">Dispositivo de Pais</string>
<string name="selectChildDevice">Selecione o Dispositivo para Crianças:</string>
<string name="status">Status:</string>
<string name="connectedTo">Conectado a:</string>
<string name="disconnected">Desconectado</string>
<string name="listening">Ouvindo...</string>
<string name="addressTitle">Endereços:</string>
<string name="portTitle">Porta:</string>
<string name="notConnected">Não conectado a nenhuma rede</string>
<string name="enterAddressInstructions">Digite o endereço IP e a Porta de Dispositivo para Criança e clique em Conectar</string>
<string name="connect">Conectar</string>
<string name="exampleAddress">192.168.1.2</string>
<string name="examplePort">10000</string>
<string name="invalidPort">Ou não foi digitada nenhuma Porta ou é inválida</string>
<string name="invalidAddress">O campo de endereço precisa ser preenchido</string>
<string name="discoverChild">Descubra o Dispositivo para Criança na Rede</string>
<string name="discoverChildDescription">Selecione um Dispositivo para Criança de uma lista que foi encontrada na rede</string>
<string name="enterChildAddress">Selecione Dispositivo para Criança por Endereço</string>
<string name="enterChildAddressDescription">Digite o endereço e a Porta de Dispositivo para Criança</string>
</resources>
+11
View File
@@ -0,0 +1,11 @@
<resources>
<!--
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light">
<!-- API 11 theme customizations can go here. -->
</style>
</resources>
+12
View File
@@ -0,0 +1,12 @@
<resources>
<!--
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<!-- API 14 theme customizations can go here. -->
</style>
</resources>
+10
View File
@@ -0,0 +1,10 @@
<resources>
<!--
Example customization of dimensions originally defined in res/values/dimens.xml
(such as screen margins) for screens with more than 820dp of available width. This
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively).
-->
<dimen name="activity_horizontal_margin">64dp</dimen>
</resources>
-10
View File
@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="purple_200">#FFBB86FC</color>
<color name="purple_500">#FF6200EE</color>
<color name="purple_700">#FF3700B3</color>
<color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
</resources>
+7
View File
@@ -0,0 +1,7 @@
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
</resources>
+34 -1
View File
@@ -1,3 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Babyphone</string>
<string name="app_name">Child Monitor Multiple Clients</string>
<string name="action_settings">Settings</string>
<string name="useAsParentDevice">Use as Parent Device</string>
<string name="useAsChildDevice">Use as Child Device</string>
<string name="childDescription">Device is placed with baby, and sends audio to a paired parent device</string>
<string name="parentDescription">Pairs with child device and plays received audio</string>
<string name="childDevice">Child Device</string>
<string name="serviceTitle">Service:</string>
<string name="serviceDescription">Name of the service that parent must pair to</string>
<string name="loading">Loading...</string>
<string name="stopped">Stopped</string>
<string name="streaming">Streaming...</string>
<string name="waitingForParent">Waiting for Parent...</string>
<string name="parentDevice">Parent Device</string>
<string name="selectChildDevice">Select Child Device:</string>
<string name="status">Status:</string>
<string name="connectedTo">Connected To:</string>
<string name="disconnected">Disconnected</string>
<string name="listening">Listening...</string>
<string name="addressTitle">Addresses:</string>
<string name="portTitle">Port:</string>
<string name="notConnected">Not connected to any network</string>
<string name="enterAddressInstructions">Enter the IP Address and port of a child and click Connect</string>
<string name="connect">Connect</string>
<string name="exampleAddress">192.168.1.2</string>
<string name="examplePort">10000</string>
<string name="invalidPort">Either no port was entered or it is invalid</string>
<string name="invalidAddress">The address field needs to be filled out</string>
<string name="discoverChild">Discover Child on Network</string>
<string name="discoverChildDescription">Select child from a list of discovered children on the network</string>
<string name="enterChildAddress">Select Child by Address</string>
<string name="enterChildAddressDescription">Enter the address and port of the child</string>
</resources>
+8 -7
View File
@@ -1,9 +1,10 @@
<!-- res/values/styles.xml -->
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryDark">@color/purple_700</item>
<item name="colorAccent">@color/teal_200</item>
</style>
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<!-- Application theme. -->
</resources>
-5
View File
@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Babyphone" parent="android:Theme.Material.Light.NoActionBar" />
</resources>
-13
View File
@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?><!--
Sample backup rules file; uncomment and customize as necessary.
See https://developer.android.com/guide/topics/data/autobackup
for details.
Note: This file is ignored for devices older than API 31
See https://developer.android.com/about/versions/12/backup-restore
-->
<full-backup-content>
<!--
<include domain="sharedpref" path="."/>
<exclude domain="sharedpref" path="device.xml"/>
-->
</full-backup-content>
@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?><!--
Sample data extraction rules file; uncomment and customize as necessary.
See https://developer.android.com/about/versions/12/backup-restore#xml-changes
for details.
-->
<data-extraction-rules>
<cloud-backup>
<!-- TODO: Use <include> and <exclude> to control what is backed up.
<include .../>
<exclude .../>
-->
</cloud-backup>
<!--
<device-transfer>
<include .../>
<exclude .../>
</device-transfer>
-->
</data-extraction-rules>
@@ -1,17 +0,0 @@
package com.example.babyphone
import org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}
+35
View File
@@ -0,0 +1,35 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
kotlin_version = '1.9.22'
}
repositories {
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.2.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.9.22'
}
allprojects {
repositories {
mavenCentral()
google()
}
}
repositories {
mavenCentral()
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
}
-6
View File
@@ -1,6 +0,0 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.compose) apply false
}
@@ -0,0 +1,6 @@
<p>Ein quelloffenes Babyfon f&uuml;r Android</p>
<p>Child Monitor l&auml;sst zwei Androidger&auml;te als Babyfon fungieren. Das erste Ger&auml;t bleibt im Kinderzimmer. Das zweite Ger&auml;t kann sich &uuml;ber das Netzwerk mit ihm verbinden und einen Audiostream empfangen.</p>
<p>Dieses Projekt ist ein Fork von Protect Baby Monitor, welches von seinem Entwickler als "on hiatus" (pausiert) gekennzeichnet wurde.</p>
<p>Child Monitor funktioniert auf Android 5.0 (Lollipop) und neuer, d.h. ab Android SDK 21.</p>
<p>Achtung: Diese Version von Child Monitor ist inkompatibel zu älteren Versionen als 1.0!</p>
<p>Fehlerbehebung in dieser Version: Falsche Berechnung des Hintergrundfarbe des Lautstärkemonitors.</p>

Some files were not shown because too many files have changed in this diff Show More