From eb0c8951196c637e44daf3c0617b131b997d5d2c Mon Sep 17 00:00:00 2001 From: Lena Date: Thu, 1 Jan 2026 00:00:00 +0000 Subject: scrcpy-android: mirror an Android device over wireless ADB Native Java app for Android 12+ that mirrors another Android device over wireless ADB, forwarding video, audio, touch input, and clipboard. Bundles a pinned scrcpy-server.jar and the vendored libadb-android stack. Supports h264/h265/av1 video and raw/opus audio with in-app codec selection. No NDK, no Kotlin. Includes JVM unit tests and a Docker-based emulator e2e rig. --- app/src/main/java/invalid/lena/scrcpy/Log.java | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 app/src/main/java/invalid/lena/scrcpy/Log.java (limited to 'app/src/main/java/invalid/lena/scrcpy/Log.java') diff --git a/app/src/main/java/invalid/lena/scrcpy/Log.java b/app/src/main/java/invalid/lena/scrcpy/Log.java new file mode 100644 index 0000000..f2c7e87 --- /dev/null +++ b/app/src/main/java/invalid/lena/scrcpy/Log.java @@ -0,0 +1,26 @@ +package invalid.lena.scrcpy; + +import java.util.Locale; + +// Single static wrapper around android.util.Log so every line in this app +// uses the same tag. Filter the whole app with `adb logcat -s scrcpy-android`. +// +// String.format always uses Locale.ROOT so logs are unaffected by device +// locales that use comma decimals or other surprises. +public final class Log { + public static final String TAG = "scrcpy-android"; + + private Log() {} + + public static void i(String fmt, Object... a) { android.util.Log.i(TAG, fmt(fmt, a)); } + public static void w(String fmt, Object... a) { android.util.Log.w(TAG, fmt(fmt, a)); } + public static void e(String fmt, Object... a) { android.util.Log.e(TAG, fmt(fmt, a)); } + + public static void e(Throwable t, String fmt, Object... a) { + android.util.Log.e(TAG, fmt(fmt, a), t); + } + + private static String fmt(String fmt, Object... a) { + return a.length == 0 ? fmt : String.format(Locale.ROOT, fmt, a); + } +} -- cgit v1.2.3