diff --git a/.gitignore b/.gitignore
index 614bbe7173..96b3be364d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -52,3 +52,13 @@ MediaInfoLib.VC.db
# Temporary files
*~
+
+# Android app directories
+**/.cxx/*
+**/.gradle
+**/.idea
+**/local.properties
+/Source/AndroidLib/app/build
+/Source/AndroidLib/build
+/Source/Example/HowToUse_Dll-Android/app/build
+/Source/Example/HowToUse_Dll-Android/build
diff --git a/Project/CMake/CMakeLists.txt b/Project/CMake/CMakeLists.txt
index 76612e2840..25471e0e41 100644
--- a/Project/CMake/CMakeLists.txt
+++ b/Project/CMake/CMakeLists.txt
@@ -422,8 +422,10 @@ endif()
# disable some features. Maybe it should be enabled.
target_compile_definitions(mediainfo PRIVATE MEDIAINFO_LIBMMS_NO)
target_compile_definitions(mediainfo PRIVATE FMT_UNICODE=0)
-if(NOT CURL_FOUND)
+if(NOT CURL_FOUND AND NOT curl_FOUND)
target_compile_definitions(mediainfo PRIVATE MEDIAINFO_LIBCURL_DLL_RUNTIME)
+elseif(TARGET curl::curl_static)
+ target_link_libraries(mediainfo curl::curl_static)
else()
include_directories(${CURL_INCLUDE_DIRS})
target_link_libraries(mediainfo ${CURL_LIBRARIES})
diff --git a/Release/Release_DLL_Android.sh b/Release/Release_DLL_Android.sh
index 94eaabc5d8..27520b4313 100755
--- a/Release/Release_DLL_Android.sh
+++ b/Release/Release_DLL_Android.sh
@@ -17,44 +17,29 @@ if [ -z "$VERSION" ] ; then
VERSION=$(<"$releasedir"/../Project/version.txt)
fi
-if [ -z "$NDK" ] ; then
- echo "error: missing mandatory environment \$NDK" >&2
+if [ -z "$JAVA_HOME" ] ; then
+ echo "error: missing mandatory environment \$JAVA_HOME" >&2
exit 1
fi
-if [ -z "$MINSDKVERSION" ] ; then
- MINSDKVERSION=24 # Android 7.0 needed for -D_FILE_OFFSET_BITS=64
+if [ -z "$ANDROID_HOME" ] ; then
+ echo "error: missing mandatory environment \$ANDROID_HOME" >&2
+ exit 1
fi
#-----------------------------------------------------------------------
# Clean
-rm -fr "$releasedir"/build
-rm -fr "$releasedir"/MediaInfo_DLL_Android
-rm -f "$releasedir"/MediaInfo_DLL_*_Android.zip
+rm -fr "$releasedir"/../Source/AndroidLib/mediainfolib/.cxx
+rm -fr "$releasedir"/../Source/AndroidLib/mediainfolib/build
+rm -f "$releasedir"/MediaInfo_DLL_*_Android.aar
#-----------------------------------------------------------------------
# Build
-abis=(arm64-v8a armeabi-v7a x86_64 x86)
-for abi in "${abis[@]}" ; do
- mkdir -p "$releasedir"/build/$abi
- pushd "$releasedir"/build/$abi
- cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="$NDK"/build/cmake/android.toolchain.cmake -DANDROID_ABI=$abi -DANDROID_PLATFORM=android-$MINSDKVERSION -DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON -DBUILD_SHARED_LIBS=1 -DBUILD_ZENLIB=1 "$releasedir"/../Project/CMake
- ninja
- mkdir -p "$releasedir"/MediaInfo_DLL_Android/lib/$abi
- cp libmediainfo.so "$releasedir"/MediaInfo_DLL_Android/lib/$abi
- popd
-done
-
-mkdir -p "$releasedir"/MediaInfo_DLL_Android/include/MediaInfo
-cp -f "$releasedir"/../Source/MediaInfo/MediaInfo.h "$releasedir"/MediaInfo_DLL_Android/include/MediaInfo
-cp -f "$releasedir"/../Source/MediaInfo/MediaInfoList.h "$releasedir"/MediaInfo_DLL_Android/include/MediaInfo
-cp -f "$releasedir"/../Source/MediaInfo/MediaInfo_Const.h "$releasedir"/MediaInfo_DLL_Android/include/MediaInfo
-cp -f "$releasedir"/../Source/MediaInfo/MediaInfo_Events.h "$releasedir"/MediaInfo_DLL_Android/include/MediaInfo
-mkdir -p "$releasedir"/MediaInfo_DLL_Android/include/MediaInfoDLL
-cp -f "$releasedir"/../Source/MediaInfoDLL/MediaInfoDLL.h "$releasedir"/MediaInfo_DLL_Android/include/MediaInfoDLL
-cp -f "$releasedir"/../Source/MediaInfoDLL/MediaInfoDLL_Static.h "$releasedir"/MediaInfo_DLL_Android/include/MediaInfoDLL
+pushd "$releasedir"/../Source/AndroidLib
+ chmod +x ./gradlew
+ ./gradlew assembleRelease
+popd
#-----------------------------------------------------------------------
# Package
-zip -r MediaInfo_DLL_${VERSION}_Android.zip MediaInfo_DLL_Android
-
+cp "$releasedir"/../Source/AndroidLib/mediainfolib/build/outputs/aar/mediainfolib-release.aar "$releasedir"/MediaInfo_DLL_${VERSION}_Android.aar
diff --git a/Source/AndroidLib/build.gradle b/Source/AndroidLib/build.gradle
new file mode 100644
index 0000000000..760a93ccca
--- /dev/null
+++ b/Source/AndroidLib/build.gradle
@@ -0,0 +1,22 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+ repositories {
+ google()
+ mavenCentral()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:9.2.0'
+ classpath 'com.android.tools.build:gradle-settings-api:9.2.0'
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ google()
+ mavenCentral()
+ }
+}
\ No newline at end of file
diff --git a/Source/AndroidLib/gradle.properties b/Source/AndroidLib/gradle.properties
new file mode 100644
index 0000000000..743d692ce1
--- /dev/null
+++ b/Source/AndroidLib/gradle.properties
@@ -0,0 +1,13 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx1536m
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
diff --git a/Source/AndroidLib/gradle/gradle-daemon-jvm.properties b/Source/AndroidLib/gradle/gradle-daemon-jvm.properties
new file mode 100644
index 0000000000..5c34300fa6
--- /dev/null
+++ b/Source/AndroidLib/gradle/gradle-daemon-jvm.properties
@@ -0,0 +1,13 @@
+#This file is generated by updateDaemonJvm
+toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/56a19bc915b9ba2eb62ba7554c61b919/redirect
+toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/398ffe3949748bfb1d5636f023d228fd/redirect
+toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/56a19bc915b9ba2eb62ba7554c61b919/redirect
+toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/398ffe3949748bfb1d5636f023d228fd/redirect
+toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/e99bae143b75f9a10ead10248f02055e/redirect
+toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/04e088f8677de3b384108493cc9481d0/redirect
+toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/56a19bc915b9ba2eb62ba7554c61b919/redirect
+toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/398ffe3949748bfb1d5636f023d228fd/redirect
+toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/e55dccbfe27cb97945148c61a39c89c5/redirect
+toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/dbd05c4936d573642f94cd149e1356c8/redirect
+toolchainVendor=JETBRAINS
+toolchainVersion=21
diff --git a/Source/AndroidLib/gradle/wrapper/gradle-wrapper.jar b/Source/AndroidLib/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000000..d997cfc60f
Binary files /dev/null and b/Source/AndroidLib/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/Source/AndroidLib/gradle/wrapper/gradle-wrapper.properties b/Source/AndroidLib/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000000..c61a118f7d
--- /dev/null
+++ b/Source/AndroidLib/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,7 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
+networkTimeout=10000
+validateDistributionUrl=true
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/Source/AndroidLib/gradlew b/Source/AndroidLib/gradlew
new file mode 100644
index 0000000000..739907dfd1
--- /dev/null
+++ b/Source/AndroidLib/gradlew
@@ -0,0 +1,248 @@
+#!/bin/sh
+
+#
+# Copyright © 2015 the original authors.
+#
+# 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
+#
+# https://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.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+
+##############################################################################
+#
+# Gradle start up script for POSIX generated by Gradle.
+#
+# Important for running:
+#
+# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
+# noncompliant, but you have some other compliant shell such as ksh or
+# bash, then to run this script, type that shell name before the whole
+# command line, like:
+#
+# ksh Gradle
+#
+# Busybox and similar reduced shells will NOT work, because this script
+# requires all of these POSIX shell features:
+# * functions;
+# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
+# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
+# * compound commands having a testable exit status, especially «case»;
+# * various built-in commands including «command», «set», and «ulimit».
+#
+# Important for patching:
+#
+# (2) This script targets any POSIX shell, so it avoids extensions provided
+# by Bash, Ksh, etc; in particular arrays are avoided.
+#
+# The "traditional" practice of packing multiple parameters into a
+# space-separated string is a well documented source of bugs and security
+# problems, so this is (mostly) avoided, by progressively accumulating
+# options in "$@", and eventually passing that to Java.
+#
+# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
+# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
+# see the in-line comments for details.
+#
+# There are tweaks for specific operating systems such as AIX, CygWin,
+# Darwin, MinGW, and NonStop.
+#
+# (3) This script is generated from the Groovy template
+# https://github.com/gradle/gradle/blob/2d6327017519d23b96af35865dc997fcb544fb40/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# within the Gradle project.
+#
+# You can find Gradle at https://github.com/gradle/gradle/.
+#
+##############################################################################
+
+# Attempt to set APP_HOME
+
+# Resolve links: $0 may be a link
+app_path=$0
+
+# Need this for daisy-chained symlinks.
+while
+ APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
+ [ -h "$app_path" ]
+do
+ ls=$( ls -ld "$app_path" )
+ link=${ls#*' -> '}
+ case $link in #(
+ /*) app_path=$link ;; #(
+ *) app_path=$APP_HOME$link ;;
+ esac
+done
+
+# This is normally unused
+# shellcheck disable=SC2034
+APP_BASE_NAME=${0##*/}
+# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
+APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD=maximum
+
+warn () {
+ echo "$*"
+} >&2
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+} >&2
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "$( uname )" in #(
+ CYGWIN* ) cygwin=true ;; #(
+ Darwin* ) darwin=true ;; #(
+ MSYS* | MINGW* ) msys=true ;; #(
+ NONSTOP* ) nonstop=true ;;
+esac
+
+
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD=$JAVA_HOME/jre/sh/java
+ else
+ JAVACMD=$JAVA_HOME/bin/java
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD=java
+ if ! command -v java >/dev/null 2>&1
+ then
+ die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+fi
+
+# Increase the maximum file descriptors if we can.
+if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
+ case $MAX_FD in #(
+ max*)
+ # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC2039,SC3045
+ MAX_FD=$( ulimit -H -n ) ||
+ warn "Could not query maximum file descriptor limit"
+ esac
+ case $MAX_FD in #(
+ '' | soft) :;; #(
+ *)
+ # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC2039,SC3045
+ ulimit -n "$MAX_FD" ||
+ warn "Could not set maximum file descriptor limit to $MAX_FD"
+ esac
+fi
+
+# Collect all arguments for the java command, stacking in reverse order:
+# * args from the command line
+# * the main class name
+# * -classpath
+# * -D...appname settings
+# * --module-path (only if needed)
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if "$cygwin" || "$msys" ; then
+ APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
+
+ JAVACMD=$( cygpath --unix "$JAVACMD" )
+
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ for arg do
+ if
+ case $arg in #(
+ -*) false ;; # don't mess with options #(
+ /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
+ [ -e "$t" ] ;; #(
+ *) false ;;
+ esac
+ then
+ arg=$( cygpath --path --ignore --mixed "$arg" )
+ fi
+ # Roll the args list around exactly as many times as the number of
+ # args, so each arg winds up back in the position where it started, but
+ # possibly modified.
+ #
+ # NB: a `for` loop captures its iteration list before it begins, so
+ # changing the positional parameters here affects neither the number of
+ # iterations, nor the values presented in `arg`.
+ shift # remove old arg
+ set -- "$@" "$arg" # push replacement arg
+ done
+fi
+
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Collect all arguments for the java command:
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
+# and any embedded shellness will be escaped.
+# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
+# treated as '${Hostname}' itself on the command line.
+
+set -- \
+ "-Dorg.gradle.appname=$APP_BASE_NAME" \
+ -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
+ "$@"
+
+# Stop when "xargs" is not available.
+if ! command -v xargs >/dev/null 2>&1
+then
+ die "xargs is not available"
+fi
+
+# Use "xargs" to parse quoted args.
+#
+# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
+#
+# In Bash we could simply go:
+#
+# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
+# set -- "${ARGS[@]}" "$@"
+#
+# but POSIX shell has neither arrays nor command substitution, so instead we
+# post-process each arg (as a line of input to sed) to backslash-escape any
+# character that might be a shell metacharacter, then use eval to reverse
+# that process (while maintaining the separation between arguments), and wrap
+# the whole thing up as a single "set" statement.
+#
+# This will of course break if any of these variables contains a newline or
+# an unmatched quote.
+#
+
+eval "set -- $(
+ printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
+ xargs -n1 |
+ sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
+ tr '\n' ' '
+ )" '"$@"'
+
+exec "$JAVACMD" "$@"
diff --git a/Source/AndroidLib/gradlew.bat b/Source/AndroidLib/gradlew.bat
new file mode 100644
index 0000000000..c4bdd3ab8e
--- /dev/null
+++ b/Source/AndroidLib/gradlew.bat
@@ -0,0 +1,93 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+@rem SPDX-License-Identifier: Apache-2.0
+@rem
+
+@if "%DEBUG%"=="" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%"=="" set DIRNAME=.
+@rem This is normally unused
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if %ERRORLEVEL% equ 0 goto execute
+
+echo. 1>&2
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto execute
+
+echo. 1>&2
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
+
+goto fail
+
+:execute
+@rem Setup the command line
+
+
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
+
+:end
+@rem End local scope for the variables with windows NT shell
+if %ERRORLEVEL% equ 0 goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+set EXIT_CODE=%ERRORLEVEL%
+if %EXIT_CODE% equ 0 set EXIT_CODE=1
+if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
+exit /b %EXIT_CODE%
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/Source/AndroidLib/mediainfolib/.gitignore b/Source/AndroidLib/mediainfolib/.gitignore
new file mode 100644
index 0000000000..42afabfd2a
--- /dev/null
+++ b/Source/AndroidLib/mediainfolib/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/Source/AndroidLib/mediainfolib/CMakeLists.txt b/Source/AndroidLib/mediainfolib/CMakeLists.txt
new file mode 100644
index 0000000000..e6e19a0ac6
--- /dev/null
+++ b/Source/AndroidLib/mediainfolib/CMakeLists.txt
@@ -0,0 +1,40 @@
+# For more information about using CMake with Android Studio, read the
+# documentation: https://d.android.com/studio/projects/add-native-code.html
+
+cmake_minimum_required(VERSION 3.5.0...4.3.0)
+
+project(MediaInfoLib)
+
+# Build MediaInfoLib
+set(BUILD_SHARED_LIBS ON CACHE BOOL "Force shared library build" FORCE)
+set(BUILD_ZENLIB ON CACHE BOOL "Build bundled ZenLib" FORCE)
+
+find_package(curl REQUIRED CONFIG)
+
+add_subdirectory(../../../Project/CMake ${CMAKE_CURRENT_BINARY_DIR}/MediaInfoLib)
+
+target_link_options(mediainfo
+ PRIVATE
+ -Wl,--version-script,${CMAKE_CURRENT_SOURCE_DIR}/libmediainfo.map.txt
+ # This causes the linker to emit an error when a version script names a
+ # symbol that is not found, rather than silently ignoring that line.
+ -Wl,--no-undefined-version
+)
+
+# Without this, changes to the version script will not cause the library to relink.
+set_target_properties(mediainfo
+ PROPERTIES
+ LINK_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/libmediainfo.map.txt
+)
+
+# disable warning in aes_via_ace.h for x86 arch
+if(NOT "${CMAKE_VERSION}" VERSION_LESS "3.18")
+ set_property(
+ SOURCE
+ "../../../Source/ThirdParty/aes-gladman/aes_modes.c"
+ "../../../Source/ThirdParty/aes-gladman/aeskey.c"
+ DIRECTORY "../../../Project/CMake"
+ APPEND
+ PROPERTY COMPILE_OPTIONS "-Wno-qualified-void-return-type"
+ )
+endif()
diff --git a/Source/AndroidLib/mediainfolib/build.gradle.kts b/Source/AndroidLib/mediainfolib/build.gradle.kts
new file mode 100644
index 0000000000..521fdb9d13
--- /dev/null
+++ b/Source/AndroidLib/mediainfolib/build.gradle.kts
@@ -0,0 +1,94 @@
+plugins {
+ id("com.android.library")
+}
+
+val consolidateHeaders by tasks.registering(Copy::class) {
+ from("../../../Source/MediaInfo") {
+ include(
+ "MediaInfo.h",
+ "MediaInfoList.h",
+ "MediaInfo_Const.h",
+ "MediaInfo_Events.h"
+ )
+ into("MediaInfo")
+ }
+ from("../../../Source/MediaInfoDLL") {
+ include(
+ "MediaInfoDLL.h",
+ "MediaInfoDLL_Static.h",
+ )
+ into("MediaInfoDLL")
+ }
+ destinationDir = layout.buildDirectory.dir("prefabHeadersStaging").get().asFile
+}
+
+android {
+ namespace = "net.mediaarea.mediainfo.lib"
+ compileSdk {
+ version = release(37)
+ }
+
+ defaultConfig {
+ minSdk = 24
+
+ aarMetadata {
+ minCompileSdk = minSdk
+ }
+
+ @Suppress("UnstableApiUsage")
+ externalNativeBuild {
+ cmake {
+ arguments(
+ "-DANDROID_STL=c++_shared",
+ "-DENABLE_UNICODE=ON"
+ )
+ }
+ }
+
+ consumerProguardFiles("consumer-rules.pro")
+ }
+
+ externalNativeBuild {
+ cmake {
+ path = file("CMakeLists.txt")
+ }
+ }
+ buildTypes {
+ release {
+ isMinifyEnabled = false
+ proguardFiles(
+ getDefaultProguardFile("proguard-android-optimize.txt"),
+ "proguard-rules.pro"
+ )
+ }
+ }
+ buildFeatures {
+ prefabPublishing = true
+ prefab = true
+ }
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_21
+ targetCompatibility = JavaVersion.VERSION_21
+ }
+ packaging {
+ jniLibs {
+ keepDebugSymbols.add("**/*.so")
+ }
+ }
+ prefab {
+ create("mediainfo") {
+ headers = consolidateHeaders.map { it.destinationDir.absolutePath }.get()
+ }
+ }
+}
+
+tasks.configureEach {
+ if (name.contains("prefab") && name.contains("ConfigurePackage")) {
+ dependsOn(consolidateHeaders)
+ }
+}
+
+dependencies {
+ // Curl static build from https://github.com/vvb2060/curl-android
+ implementation("io.github.vvb2060.ndk:curl:8.18.0")
+}
diff --git a/Source/AndroidLib/mediainfolib/consumer-rules.pro b/Source/AndroidLib/mediainfolib/consumer-rules.pro
new file mode 100644
index 0000000000..27cb7647be
--- /dev/null
+++ b/Source/AndroidLib/mediainfolib/consumer-rules.pro
@@ -0,0 +1,3 @@
+-keepclassmembers class net.mediaarea.mediainfo.MediaInfo {
+ *;
+}
\ No newline at end of file
diff --git a/Source/AndroidLib/mediainfolib/libmediainfo.map.txt b/Source/AndroidLib/mediainfolib/libmediainfo.map.txt
new file mode 100644
index 0000000000..51345bb5b2
--- /dev/null
+++ b/Source/AndroidLib/mediainfolib/libmediainfo.map.txt
@@ -0,0 +1,18 @@
+# The name used here also doesn't matter. This is the name of the "version"
+# which matters when the version script is actually used to create multiple
+# versions of the same symbol, but that's not what we're doing.
+LIBMEDIAINFO {
+ global:
+ # Every symbol named in this section will have "default" (that is, public)
+ # visibility. See below for how to refer to C++ symbols without mangling.
+ JNI_OnLoad;
+ MediaInfo_*;
+ MediaInfoA_*;
+ MediaInfoList_*;
+ MediaInfoListA_*;
+ local:
+ # Every symbol in this section will have "local" (that is, hidden)
+ # visibility. The wildcard * is used to indicate that all symbols not listed
+ # in the global section should be hidden.
+ *;
+};
diff --git a/Source/AndroidLib/mediainfolib/proguard-rules.pro b/Source/AndroidLib/mediainfolib/proguard-rules.pro
new file mode 100644
index 0000000000..481bb43481
--- /dev/null
+++ b/Source/AndroidLib/mediainfolib/proguard-rules.pro
@@ -0,0 +1,21 @@
+# 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
\ No newline at end of file
diff --git a/Source/AndroidLib/mediainfolib/src/main/AndroidManifest.xml b/Source/AndroidLib/mediainfolib/src/main/AndroidManifest.xml
new file mode 100644
index 0000000000..a5918e68ab
--- /dev/null
+++ b/Source/AndroidLib/mediainfolib/src/main/AndroidManifest.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/Source/AndroidLib/mediainfolib/src/main/java/net/mediaarea/mediainfo/MediaInfo.kt b/Source/AndroidLib/mediainfolib/src/main/java/net/mediaarea/mediainfo/MediaInfo.kt
new file mode 100644
index 0000000000..b2d5c0a047
--- /dev/null
+++ b/Source/AndroidLib/mediainfolib/src/main/java/net/mediaarea/mediainfo/MediaInfo.kt
@@ -0,0 +1,70 @@
+/* Copyright (c) MediaArea.net SARL. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license that can
+ * be found in the License.html file in the root of the source tree.
+ */
+
+package net.mediaarea.mediainfo
+
+class MediaInfo {
+ companion object {
+ // load the native library.
+ init {
+ System.loadLibrary("mediainfo")
+ }
+ }
+
+ enum class Stream {
+ General,
+ Video,
+ Audio,
+ Text,
+ Other,
+ Image,
+ Menu,
+ Max
+ }
+
+ enum class Info {
+ Name,
+ Text,
+ Measure,
+ Options,
+ Name_Text,
+ Measure_Text,
+ Info,
+ HowTo,
+ Domain,
+ Max
+ }
+
+ val mi: Long = Init()
+
+ external fun Init(): Long
+ external fun Destroy(): Int
+ private external fun OpenFd(fd: Int, name: String): Int
+ external fun Open(name:String): Int
+ fun Open(fd: Int, name: String): Int {
+ return OpenFd(fd, name)
+ }
+ external fun Open_Buffer_Init(fileSize: Long, fileOffset: Long): Int
+ external fun Open_Buffer_Continue(buffer: ByteArray, bufferSize: Long): Int
+ external fun Open_Buffer_Continue_GoTo_Get(): Long
+ external fun Open_Buffer_Finalize(): Long
+ external fun Close(): Int
+ external fun Inform(): String
+ private external fun GetI(streamKind: Int, streamNumber: Int, parameter: Int, infoKind: Int): String
+ private external fun GetS(streamKind: Int, streamNumber: Int, parameter: String, infoKind: Int, searchKind: Int): String
+ fun Get(streamKind: Stream, streamNumber: Int, parameter: Int, infoKind: Info = Info.Text) : String {
+ return GetI(streamKind.ordinal, streamNumber, parameter, infoKind.ordinal)
+ }
+ fun Get(streamKind: Stream, streamNumber: Int, parameter: String, infoKind: Info = Info.Text, searchKind: Info = Info.Name) : String {
+ return GetS(streamKind.ordinal, streamNumber, parameter, infoKind.ordinal, searchKind.ordinal)
+ }
+ external fun Option(option: String, value: String = ""): String
+ external fun State_Get(): Int
+ private external fun Count_Get(streamKind: Int, streamNumber: Int): Int
+ fun Count_Get(streamKind: Stream, streamNumber: Int = -1): Int {
+ return Count_Get(streamKind.ordinal, streamNumber)
+ }
+}
diff --git a/Source/AndroidLib/settings.gradle b/Source/AndroidLib/settings.gradle
new file mode 100644
index 0000000000..fd021ceac3
--- /dev/null
+++ b/Source/AndroidLib/settings.gradle
@@ -0,0 +1,4 @@
+plugins {
+ id 'org.gradle.toolchains.foojay-resolver-convention' version '1.0.0'
+}
+include ':mediainfolib'
diff --git a/Source/Example/HowToUse_Dll-Android/app/CMakeLists.txt b/Source/Example/HowToUse_Dll-Android/app/CMakeLists.txt
new file mode 100644
index 0000000000..3275f43bd9
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/app/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required(VERSION 3.22.1)
+
+project("mediainfolib_example_cmake")
+
+find_package(mediainfolib REQUIRED CONFIG)
+
+add_library(mediainfolib_example_bridge SHARED
+ mediainfolib_example_bridge.cpp
+)
+
+target_link_libraries(mediainfolib_example_bridge
+ mediainfolib::mediainfo
+)
diff --git a/Source/Example/HowToUse_Dll-Android/app/build.gradle.kts b/Source/Example/HowToUse_Dll-Android/app/build.gradle.kts
new file mode 100644
index 0000000000..785a73f7f6
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/app/build.gradle.kts
@@ -0,0 +1,75 @@
+plugins {
+ alias(libs.plugins.android.application)
+ alias(libs.plugins.kotlin.compose)
+}
+
+android {
+ namespace = "net.mediaarea.mediainfo.example"
+ compileSdk {
+ version = release(37)
+ }
+
+ defaultConfig {
+ applicationId = "net.mediaarea.mediainfo.example"
+ minSdk = 24
+ targetSdk = 37
+ versionCode = 1
+ versionName = "1.0"
+
+ testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
+
+ @Suppress("UnstableApiUsage")
+ externalNativeBuild {
+ cmake {
+ arguments(
+ "-DANDROID_STL=c++_shared"
+ )
+ }
+ }
+ }
+
+ buildTypes {
+ release {
+ isMinifyEnabled = false
+ proguardFiles(
+ getDefaultProguardFile("proguard-android-optimize.txt"),
+ "proguard-rules.pro"
+ )
+ }
+ }
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_21
+ targetCompatibility = JavaVersion.VERSION_21
+ }
+ buildFeatures {
+ compose = true
+ prefab = true
+ }
+ externalNativeBuild {
+ cmake {
+ path = file("CMakeLists.txt")
+ }
+ }
+}
+
+dependencies {
+ // Point to location of downloaded AAR file or to Maven package ID (if it is published)
+ implementation(files("../../../AndroidLib/mediainfolib/build/outputs/aar/mediainfolib-release.aar"))
+ implementation(platform(libs.androidx.compose.bom))
+ implementation(libs.androidx.activity.compose)
+ implementation(libs.androidx.compose.material3)
+ implementation(libs.androidx.compose.material3.adaptive.navigation.suite)
+ implementation(libs.androidx.compose.ui)
+ implementation(libs.androidx.compose.ui.graphics)
+ implementation(libs.androidx.compose.ui.tooling.preview)
+ implementation(libs.androidx.core.ktx)
+ implementation(libs.androidx.lifecycle.runtime.ktx)
+ implementation(libs.androidx.lifecycle.viewmodel.compose)
+ testImplementation(libs.junit)
+ androidTestImplementation(platform(libs.androidx.compose.bom))
+ androidTestImplementation(libs.androidx.compose.ui.test.junit4)
+ androidTestImplementation(libs.androidx.espresso.core)
+ androidTestImplementation(libs.androidx.junit)
+ debugImplementation(libs.androidx.compose.ui.test.manifest)
+ debugImplementation(libs.androidx.compose.ui.tooling)
+}
\ No newline at end of file
diff --git a/Source/Example/HowToUse_Dll-Android/app/mediainfolib_example_bridge.cpp b/Source/Example/HowToUse_Dll-Android/app/mediainfolib_example_bridge.cpp
new file mode 100644
index 0000000000..9fd2f0b1fa
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/app/mediainfolib_example_bridge.cpp
@@ -0,0 +1,40 @@
+#include
+#include
+#include // Header supplied automatically by Prefab!
+
+// This can be your custom native logic to do whatever processing before passing the result to your Kotlin side
+
+extern "C"
+JNIEXPORT jstring JNICALL
+Java_net_mediaarea_mediainfo_example_Bridge_Version(JNIEnv *env, jobject thiz) {
+ MediaInfoDLL::MediaInfo MI;
+ std::string MediaInfo_Output = MI.Option(__T("Info_Version"));
+ return env->NewStringUTF(MediaInfo_Output.c_str());
+}
+
+extern "C"
+JNIEXPORT jstring JNICALL
+Java_net_mediaarea_mediainfo_example_Bridge_Info(JNIEnv *env, jobject thiz) {
+ MediaInfoDLL::MediaInfo MI;
+ std::string MediaInfo_Output;
+ MediaInfo_Output += __T("\n\nInfo_Parameters\n");
+ MediaInfo_Output += __T("====================\n");
+ MediaInfo_Output += MI.Option(__T("Info_Parameters"));
+ MediaInfo_Output += __T("\n\nInfo_Codecs\n");
+ MediaInfo_Output += __T("====================\n");
+ MediaInfo_Output += MI.Option(__T("Info_Codecs"));
+ return env->NewStringUTF(MediaInfo_Output.c_str());
+}
+
+extern "C"
+JNIEXPORT jstring JNICALL
+Java_net_mediaarea_mediainfo_example_Bridge_Inform(JNIEnv *env, jobject thiz, jstring path) {
+ const char *nativePath = env->GetStringUTFChars(path, nullptr);
+ MediaInfoDLL::MediaInfo MI;
+ MI.Option(__T("Language"), __T(" Config_Text_ColumnSize;20"));
+ MI.Open(nativePath);
+ std::string MediaInfo_Output = __T("\n\nInform\n");
+ MediaInfo_Output += __T("====================\n");
+ MediaInfo_Output += MI.Inform();
+ return env->NewStringUTF(MediaInfo_Output.c_str());
+}
diff --git a/Source/Example/HowToUse_Dll-Android/app/proguard-rules.pro b/Source/Example/HowToUse_Dll-Android/app/proguard-rules.pro
new file mode 100644
index 0000000000..481bb43481
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/app/proguard-rules.pro
@@ -0,0 +1,21 @@
+# 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
\ No newline at end of file
diff --git a/Source/Example/HowToUse_Dll-Android/app/src/androidTest/java/net/mediaarea/mediainfo/example/ExampleInstrumentedTest.kt b/Source/Example/HowToUse_Dll-Android/app/src/androidTest/java/net/mediaarea/mediainfo/example/ExampleInstrumentedTest.kt
new file mode 100644
index 0000000000..2a15ba13a0
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/app/src/androidTest/java/net/mediaarea/mediainfo/example/ExampleInstrumentedTest.kt
@@ -0,0 +1,24 @@
+package net.mediaarea.mediainfo.example
+
+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("net.mediaarea.mediainfo.example", appContext.packageName)
+ }
+}
\ No newline at end of file
diff --git a/Source/Example/HowToUse_Dll-Android/app/src/main/AndroidManifest.xml b/Source/Example/HowToUse_Dll-Android/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000000..393a8c0c88
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/app/src/main/AndroidManifest.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Source/Example/HowToUse_Dll-Android/app/src/main/java/net/mediaarea/mediainfo/example/Bridge.kt b/Source/Example/HowToUse_Dll-Android/app/src/main/java/net/mediaarea/mediainfo/example/Bridge.kt
new file mode 100644
index 0000000000..69552df3d7
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/app/src/main/java/net/mediaarea/mediainfo/example/Bridge.kt
@@ -0,0 +1,13 @@
+package net.mediaarea.mediainfo.example
+
+class Bridge {
+ companion object {
+ init {
+ System.loadLibrary("mediainfolib_example_bridge")
+ }
+ }
+
+ external fun Version(): String
+ external fun Info(): String
+ external fun Inform(path: String): String
+}
diff --git a/Source/Example/HowToUse_Dll-Android/app/src/main/java/net/mediaarea/mediainfo/example/MainActivity.kt b/Source/Example/HowToUse_Dll-Android/app/src/main/java/net/mediaarea/mediainfo/example/MainActivity.kt
new file mode 100644
index 0000000000..2e2ce16e4b
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/app/src/main/java/net/mediaarea/mediainfo/example/MainActivity.kt
@@ -0,0 +1,287 @@
+package net.mediaarea.mediainfo.example
+
+import android.os.Bundle
+import androidx.activity.ComponentActivity
+import androidx.activity.compose.setContent
+import androidx.activity.enableEdgeToEdge
+import androidx.compose.foundation.layout.Arrangement
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.Spacer
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.height
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.rememberScrollState
+import androidx.compose.foundation.verticalScroll
+import androidx.compose.material3.Button
+import androidx.compose.material3.Card
+import androidx.compose.material3.CardDefaults
+import androidx.compose.material3.CircularProgressIndicator
+import androidx.compose.material3.Icon
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.OutlinedTextField
+import androidx.compose.material3.Scaffold
+import androidx.compose.material3.Text
+import androidx.compose.material3.adaptive.navigationsuite.NavigationSuiteScaffold
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.rememberCoroutineScope
+import androidx.compose.runtime.saveable.rememberSaveable
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.res.painterResource
+import androidx.compose.ui.text.font.FontFamily
+import androidx.compose.ui.text.font.FontWeight
+import androidx.compose.ui.tooling.preview.PreviewScreenSizes
+import androidx.compose.ui.unit.dp
+import androidx.lifecycle.viewmodel.compose.viewModel
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.launch
+import kotlinx.coroutines.withContext
+import net.mediaarea.mediainfo.MediaInfo
+import net.mediaarea.mediainfo.example.ui.theme.MediaInfoLibExampleTheme
+
+
+class MainActivity : ComponentActivity() {
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ enableEdgeToEdge()
+ setContent {
+ val viewModel: MediaViewModel = viewModel()
+ MediaInfoLibExampleTheme {
+ MediaInfoLibExampleApp(viewModel.uiState)
+ }
+ }
+ }
+}
+
+@Composable
+private fun MediaInfoLibExampleApp(state: MediaInfoState) {
+ var currentDestination by rememberSaveable { mutableStateOf(AppDestinations.HOME) }
+
+ NavigationSuiteScaffold(
+ navigationSuiteItems = {
+ AppDestinations.entries.forEach {
+ item(
+ icon = {
+ Icon(
+ painterResource(it.icon),
+ contentDescription = it.label
+ )
+ },
+ label = { Text(it.label) },
+ selected = it == currentDestination,
+ onClick = { currentDestination = it }
+ )
+ }
+ }
+ ) {
+ Scaffold(
+ modifier = Modifier
+ .fillMaxSize()
+ .padding(10.dp)
+ ) { innerPadding ->
+ // Use a 'when' expression to swap the content dynamically
+ when (currentDestination) {
+ AppDestinations.HOME -> HomeScreen(
+ modifier = Modifier
+ .padding(innerPadding)
+ .verticalScroll(rememberScrollState())
+ )
+
+ AppDestinations.KOTLIN -> KotlinScreen(
+ modifier = Modifier
+ .padding(innerPadding)
+ .verticalScroll(rememberScrollState()),
+ state = state
+ )
+
+ AppDestinations.NATIVE -> NativeScreen(
+ modifier = Modifier
+ .padding(innerPadding)
+ .verticalScroll(rememberScrollState()),
+ state = state
+ )
+
+ AppDestinations.URL -> NetworkScreen(
+ modifier = Modifier
+ .padding(innerPadding)
+ .verticalScroll(rememberScrollState()),
+ )
+ }
+ }
+ }
+}
+
+private enum class AppDestinations(
+ val label: String,
+ val icon: Int,
+) {
+ HOME("Home", R.drawable.ic_home),
+ KOTLIN("Kotlin", R.drawable.android_48px),
+ NATIVE("Native (C++)", R.drawable.code_48px),
+ URL("URL", R.drawable.http_48px),
+}
+
+@Composable
+private fun HomeScreen(modifier: Modifier = Modifier) {
+ Column(
+ modifier = modifier.padding(20.dp)
+ ) {
+ Text(
+ text = "MediaInfoLib Android Example App",
+ style = MaterialTheme.typography.headlineMedium,
+ color = MaterialTheme.colorScheme.primary,
+ modifier = Modifier.fillMaxWidth()
+ )
+ Spacer(modifier = Modifier.height(16.dp))
+ Text(
+ text = "This app features dedicated navigation pages showcasing MediaInfoLib Android library's dual-language integration paths as well as Curl integration. " +
+ "Explore the Kotlin page to see the included JNI wrapper in action, or switch to the Native page to see how MediaInfoLib integrates directly into C/C++ workflows using Prefab and CMake. " +
+ "Check out the URL page to try out MediaInfoLib's native Curl (libcurl) integration by analyzing a file from a URL.",
+ style = MaterialTheme.typography.bodyLarge,
+ color = MaterialTheme.colorScheme.onBackground,
+ modifier = Modifier.fillMaxWidth()
+ )
+ }
+}
+
+@Composable
+private fun KotlinScreen(modifier: Modifier = Modifier, state: MediaInfoState) {
+ // Using net.mediaarea.mediainfo Kotlin JNI wrapper
+ Column(
+ modifier = modifier,
+ verticalArrangement = Arrangement.spacedBy(12.dp) // Adds space between the cards
+ ) {
+ InfoCard(title = "Info Version", value = state.version)
+ InfoCard(
+ title = "Inform",
+ value = state.inform,
+ fontFamily = FontFamily.Monospace,
+ )
+ InfoCard(title = "Info Parameters", value = state.parameters)
+ InfoCard(title = "Info Codecs", value = state.codecs)
+ }
+}
+
+@Composable
+private fun NativeScreen(modifier: Modifier = Modifier, state: MediaInfoState) {
+ Text(
+ text = state.nativeOutput,
+ style = MaterialTheme.typography.bodySmall,
+ fontFamily = FontFamily.Monospace,
+ modifier = modifier
+ )
+}
+
+@Composable
+private fun NetworkScreen(modifier: Modifier = Modifier) {
+ var url by remember { mutableStateOf("https://raw.githubusercontent.com/MediaArea/MediaInfoLib/refs/heads/master/Source/Resource/Image/MediaInfo.ico") }
+ var result by remember { mutableStateOf("") }
+ var isLoading by remember { mutableStateOf(false) }
+
+ // Create a coroutine scope tied to this composable's lifecycle
+ val scope = rememberCoroutineScope()
+
+ Column(
+ modifier = modifier,
+ verticalArrangement = Arrangement.spacedBy(16.dp)
+ ) {
+ OutlinedTextField(
+ value = url,
+ onValueChange = { url = it },
+ label = { Text("Enter URL") },
+ modifier = Modifier.fillMaxWidth(),
+ enabled = !isLoading
+ )
+ Button(
+ onClick = {
+ if (url.isNotBlank()) {
+ isLoading = true
+ result = ""
+
+ // Launch background worker thread
+ scope.launch {
+ val returned = withContext(Dispatchers.IO) {
+ val mi = MediaInfo()
+ mi.Option("Language", " Config_Text_ColumnSize;20")
+ mi.Open(url)
+ mi.Inform()
+ }
+ result = returned
+ isLoading = false
+ }
+ }
+ },
+ modifier = Modifier.fillMaxWidth(),
+ enabled = !isLoading && url.isNotBlank()
+ ) {
+ Text(if (isLoading) "Processing..." else "Process URL")
+ }
+ if (isLoading) {
+ CircularProgressIndicator(
+ modifier = Modifier.align(Alignment.CenterHorizontally)
+ )
+ }
+ if (result.isNotEmpty()) {
+ InfoCard(
+ title = "MediaInfoLib Inform Text Output",
+ value = result,
+ fontFamily = FontFamily.Monospace
+ )
+ }
+ }
+}
+
+@Composable
+private fun InfoCard(
+ title: String,
+ value: String,
+ modifier: Modifier = Modifier,
+ fontFamily: FontFamily = FontFamily.Default,
+) {
+ Card(
+ modifier = modifier.fillMaxWidth(),
+ colors = CardDefaults.cardColors(
+ containerColor = MaterialTheme.colorScheme.surfaceVariant
+ ),
+ elevation = CardDefaults.cardElevation(defaultElevation = 2.dp)
+ ) {
+ Column(
+ modifier = Modifier
+ .padding(16.dp)
+ .fillMaxWidth()
+ ) {
+ Text(
+ text = title,
+ style = MaterialTheme.typography.titleSmall,
+ fontWeight = FontWeight.Bold,
+ color = MaterialTheme.colorScheme.primary
+ )
+ Spacer(modifier = Modifier.height(8.dp))
+ Text(
+ text = value.ifEmpty { "None detected" },
+ style = MaterialTheme.typography.bodySmall,
+ color = MaterialTheme.colorScheme.onSurfaceVariant,
+ fontFamily = fontFamily
+ )
+ }
+ }
+}
+
+@PreviewScreenSizes
+@Composable
+private fun MediaInfoMultiSizePreview() {
+ val mockState = MediaInfoState(
+ version = "",
+ inform = "",
+ parameters = "",
+ codecs = ""
+ )
+ MediaInfoLibExampleTheme {
+ MediaInfoLibExampleApp(mockState)
+ }
+}
diff --git a/Source/Example/HowToUse_Dll-Android/app/src/main/java/net/mediaarea/mediainfo/example/ViewModel.kt b/Source/Example/HowToUse_Dll-Android/app/src/main/java/net/mediaarea/mediainfo/example/ViewModel.kt
new file mode 100644
index 0000000000..99791e6d62
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/app/src/main/java/net/mediaarea/mediainfo/example/ViewModel.kt
@@ -0,0 +1,97 @@
+package net.mediaarea.mediainfo.example
+
+import android.app.Application
+import android.content.Context
+import android.graphics.Bitmap
+import android.graphics.Canvas
+import android.graphics.Color
+import android.os.ParcelFileDescriptor
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.setValue
+import androidx.core.graphics.createBitmap
+import androidx.lifecycle.AndroidViewModel
+import androidx.lifecycle.viewModelScope
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.launch
+import kotlinx.coroutines.withContext
+import net.mediaarea.mediainfo.MediaInfo
+import java.io.File
+import java.io.FileOutputStream
+import java.io.IOException
+
+data class MediaInfoState(
+ val version: String = "Loading...",
+ val inform: String = "Loading...",
+ val parameters: String = "Loading...",
+ val codecs: String = "Loading...",
+ val nativeOutput: String = "Loading..."
+)
+
+class MediaViewModel(application: Application) : AndroidViewModel(application) {
+ var uiState by mutableStateOf(MediaInfoState())
+ private set
+
+ init {
+ loadData()
+ }
+
+ private fun loadData() {
+ viewModelScope.launch(Dispatchers.IO) {
+ val context = getApplication()
+
+ // Create sample file
+ val path = createSamplePng(context)
+
+ // Kotlin interface
+ // Using net.mediaarea.mediainfo Kotlin JNI wrapper
+ val mi = MediaInfo()
+ val version = mi.Option("Info_Version")
+ val parameters = mi.Option("Info_Parameters")
+ val codecs = mi.Option("Info_Codecs")
+ mi.Option("Language", " Config_Text_ColumnSize;20")
+ if (path != null) {
+ val file = File(path)
+ val pfd = ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY)
+ val fd = pfd.detachFd()
+ mi.Open(fd, "sample.png")
+ }
+ val info = mi.Inform()
+
+ // C++ interface
+ // Bridge is just an example bridge that receives output from C++ code
+ val bridge = Bridge()
+ var output = bridge.Version()
+ output += bridge.Inform(path ?: "")
+ output += bridge.Info()
+
+ withContext(Dispatchers.Main) {
+ uiState = MediaInfoState(
+ version = version,
+ inform = info,
+ parameters = parameters,
+ codecs = codecs,
+ nativeOutput = output
+ )
+ }
+ }
+ }
+
+ private fun createSamplePng(context: Context): String? {
+ val bitmap = createBitmap(100, 100)
+ val canvas = Canvas(bitmap)
+ canvas.drawColor(Color.GRAY)
+
+ val file = File(context.filesDir, "sample.png")
+
+ try {
+ FileOutputStream(file).use { out ->
+ bitmap.compress(Bitmap.CompressFormat.PNG, 100, out)
+ return file.absolutePath
+ }
+ } catch (e: IOException) {
+ e.printStackTrace()
+ return null
+ }
+ }
+}
diff --git a/Source/Example/HowToUse_Dll-Android/app/src/main/java/net/mediaarea/mediainfo/example/ui/theme/Color.kt b/Source/Example/HowToUse_Dll-Android/app/src/main/java/net/mediaarea/mediainfo/example/ui/theme/Color.kt
new file mode 100644
index 0000000000..66913e4cff
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/app/src/main/java/net/mediaarea/mediainfo/example/ui/theme/Color.kt
@@ -0,0 +1,11 @@
+package net.mediaarea.mediainfo.example.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)
\ No newline at end of file
diff --git a/Source/Example/HowToUse_Dll-Android/app/src/main/java/net/mediaarea/mediainfo/example/ui/theme/Theme.kt b/Source/Example/HowToUse_Dll-Android/app/src/main/java/net/mediaarea/mediainfo/example/ui/theme/Theme.kt
new file mode 100644
index 0000000000..c0a52f6e99
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/app/src/main/java/net/mediaarea/mediainfo/example/ui/theme/Theme.kt
@@ -0,0 +1,57 @@
+package net.mediaarea.mediainfo.example.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 MediaInfoLibExampleTheme(
+ 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
+ )
+}
\ No newline at end of file
diff --git a/Source/Example/HowToUse_Dll-Android/app/src/main/java/net/mediaarea/mediainfo/example/ui/theme/Type.kt b/Source/Example/HowToUse_Dll-Android/app/src/main/java/net/mediaarea/mediainfo/example/ui/theme/Type.kt
new file mode 100644
index 0000000000..7ede5aac38
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/app/src/main/java/net/mediaarea/mediainfo/example/ui/theme/Type.kt
@@ -0,0 +1,34 @@
+package net.mediaarea.mediainfo.example.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
+ )
+ */
+)
\ No newline at end of file
diff --git a/Source/Example/HowToUse_Dll-Android/app/src/main/res/drawable/android_48px.xml b/Source/Example/HowToUse_Dll-Android/app/src/main/res/drawable/android_48px.xml
new file mode 100644
index 0000000000..905c7a727c
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/app/src/main/res/drawable/android_48px.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/Source/Example/HowToUse_Dll-Android/app/src/main/res/drawable/code_48px.xml b/Source/Example/HowToUse_Dll-Android/app/src/main/res/drawable/code_48px.xml
new file mode 100644
index 0000000000..82c3146c27
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/app/src/main/res/drawable/code_48px.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/Source/Example/HowToUse_Dll-Android/app/src/main/res/drawable/http_48px.xml b/Source/Example/HowToUse_Dll-Android/app/src/main/res/drawable/http_48px.xml
new file mode 100644
index 0000000000..bbdc1ebdd5
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/app/src/main/res/drawable/http_48px.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/Source/Example/HowToUse_Dll-Android/app/src/main/res/drawable/ic_home.xml b/Source/Example/HowToUse_Dll-Android/app/src/main/res/drawable/ic_home.xml
new file mode 100644
index 0000000000..6bb3421a44
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/app/src/main/res/drawable/ic_home.xml
@@ -0,0 +1,9 @@
+
+
+
\ No newline at end of file
diff --git a/Source/Example/HowToUse_Dll-Android/app/src/main/res/drawable/ic_launcher_background.xml b/Source/Example/HowToUse_Dll-Android/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000000..07d5da9cbf
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Source/Example/HowToUse_Dll-Android/app/src/main/res/drawable/ic_launcher_foreground.xml b/Source/Example/HowToUse_Dll-Android/app/src/main/res/drawable/ic_launcher_foreground.xml
new file mode 100644
index 0000000000..2b068d1146
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/app/src/main/res/drawable/ic_launcher_foreground.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000000..6f3b755bf5
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000000..6f3b755bf5
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-hdpi/ic_launcher.webp
new file mode 100644
index 0000000000..c209e78ecd
Binary files /dev/null and b/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ
diff --git a/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
new file mode 100644
index 0000000000..b2dfe3d1ba
Binary files /dev/null and b/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ
diff --git a/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-mdpi/ic_launcher.webp
new file mode 100644
index 0000000000..4f0f1d64e5
Binary files /dev/null and b/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ
diff --git a/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
new file mode 100644
index 0000000000..62b611da08
Binary files /dev/null and b/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ
diff --git a/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp
new file mode 100644
index 0000000000..948a3070fe
Binary files /dev/null and b/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ
diff --git a/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000000..1b9a6956b3
Binary files /dev/null and b/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ
diff --git a/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
new file mode 100644
index 0000000000..28d4b77f9f
Binary files /dev/null and b/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ
diff --git a/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000000..9287f50836
Binary files /dev/null and b/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ
diff --git a/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
new file mode 100644
index 0000000000..aa7d6427e6
Binary files /dev/null and b/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ
diff --git a/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000000..9126ae37cb
Binary files /dev/null and b/Source/Example/HowToUse_Dll-Android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ
diff --git a/Source/Example/HowToUse_Dll-Android/app/src/main/res/values/colors.xml b/Source/Example/HowToUse_Dll-Android/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000000..f8c6127d32
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/app/src/main/res/values/colors.xml
@@ -0,0 +1,10 @@
+
+
+ #FFBB86FC
+ #FF6200EE
+ #FF3700B3
+ #FF03DAC5
+ #FF018786
+ #FF000000
+ #FFFFFFFF
+
\ No newline at end of file
diff --git a/Source/Example/HowToUse_Dll-Android/app/src/main/res/values/strings.xml b/Source/Example/HowToUse_Dll-Android/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000000..4ff47f4245
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/app/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ MediaInfoLib Example
+
\ No newline at end of file
diff --git a/Source/Example/HowToUse_Dll-Android/app/src/main/res/values/themes.xml b/Source/Example/HowToUse_Dll-Android/app/src/main/res/values/themes.xml
new file mode 100644
index 0000000000..1322f87da1
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/app/src/main/res/values/themes.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/Source/Example/HowToUse_Dll-Android/app/src/main/res/xml/backup_rules.xml b/Source/Example/HowToUse_Dll-Android/app/src/main/res/xml/backup_rules.xml
new file mode 100644
index 0000000000..4df9255824
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/app/src/main/res/xml/backup_rules.xml
@@ -0,0 +1,13 @@
+
+
+
+
\ No newline at end of file
diff --git a/Source/Example/HowToUse_Dll-Android/app/src/main/res/xml/data_extraction_rules.xml b/Source/Example/HowToUse_Dll-Android/app/src/main/res/xml/data_extraction_rules.xml
new file mode 100644
index 0000000000..9ee9997b0b
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/app/src/main/res/xml/data_extraction_rules.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Source/Example/HowToUse_Dll-Android/app/src/test/java/net/mediaarea/mediainfo/example/ExampleUnitTest.kt b/Source/Example/HowToUse_Dll-Android/app/src/test/java/net/mediaarea/mediainfo/example/ExampleUnitTest.kt
new file mode 100644
index 0000000000..78495ae3b2
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/app/src/test/java/net/mediaarea/mediainfo/example/ExampleUnitTest.kt
@@ -0,0 +1,17 @@
+package net.mediaarea.mediainfo.example
+
+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)
+ }
+}
\ No newline at end of file
diff --git a/Source/Example/HowToUse_Dll-Android/build.gradle.kts b/Source/Example/HowToUse_Dll-Android/build.gradle.kts
new file mode 100644
index 0000000000..18318bec56
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/build.gradle.kts
@@ -0,0 +1,5 @@
+// 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.compose) apply false
+}
\ No newline at end of file
diff --git a/Source/Example/HowToUse_Dll-Android/gradle.properties b/Source/Example/HowToUse_Dll-Android/gradle.properties
new file mode 100644
index 0000000000..34c5e9eb72
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/gradle.properties
@@ -0,0 +1,15 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. For more details, visit
+# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
+# org.gradle.parallel=true
+# Kotlin code style for this project: "official" or "obsolete":
+kotlin.code.style=official
\ No newline at end of file
diff --git a/Source/Example/HowToUse_Dll-Android/gradle/gradle-daemon-jvm.properties b/Source/Example/HowToUse_Dll-Android/gradle/gradle-daemon-jvm.properties
new file mode 100644
index 0000000000..6c1139ec06
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/gradle/gradle-daemon-jvm.properties
@@ -0,0 +1,12 @@
+#This file is generated by updateDaemonJvm
+toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/ec7520a1e057cd116f9544c42142a16b/redirect
+toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/4c4f879899012ff0a8b2e2117df03b0e/redirect
+toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/ec7520a1e057cd116f9544c42142a16b/redirect
+toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/4c4f879899012ff0a8b2e2117df03b0e/redirect
+toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/73bcfb608d1fde9fb62e462f834a3299/redirect
+toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/846ee0d876d26a26f37aa1ce8de73224/redirect
+toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/ec7520a1e057cd116f9544c42142a16b/redirect
+toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/4c4f879899012ff0a8b2e2117df03b0e/redirect
+toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/9482ddec596298c84656d31d16652665/redirect
+toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/39701d92e1756bb2f141eb67cd4c660e/redirect
+toolchainVersion=21
diff --git a/Source/Example/HowToUse_Dll-Android/gradle/libs.versions.toml b/Source/Example/HowToUse_Dll-Android/gradle/libs.versions.toml
new file mode 100644
index 0000000000..432f902bab
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/gradle/libs.versions.toml
@@ -0,0 +1,34 @@
+[versions]
+agp = "9.2.1"
+coreKtx = "1.18.0"
+junit = "4.13.2"
+junitVersion = "1.3.0"
+espressoCore = "3.7.0"
+lifecycleRuntimeKtx = "2.10.0"
+lifecycle = "2.10.0"
+activityCompose = "1.13.0"
+kotlin = "2.3.21"
+composeBom = "2026.05.00"
+
+[libraries]
+androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
+junit = { group = "junit", name = "junit", version.ref = "junit" }
+androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
+androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
+androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" }
+androidx-lifecycle-viewmodel-compose = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version.ref = "lifecycle" }
+androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" }
+androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
+androidx-compose-ui = { group = "androidx.compose.ui", name = "ui" }
+androidx-compose-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
+androidx-compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
+androidx-compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
+androidx-compose-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
+androidx-compose-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
+androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3" }
+androidx-compose-material3-adaptive-navigation-suite = { group = "androidx.compose.material3", name = "material3-adaptive-navigation-suite" }
+
+[plugins]
+android-application = { id = "com.android.application", version.ref = "agp" }
+kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
+
diff --git a/Source/Example/HowToUse_Dll-Android/gradle/wrapper/gradle-wrapper.jar b/Source/Example/HowToUse_Dll-Android/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000000..8bdaf60c75
Binary files /dev/null and b/Source/Example/HowToUse_Dll-Android/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/Source/Example/HowToUse_Dll-Android/gradle/wrapper/gradle-wrapper.properties b/Source/Example/HowToUse_Dll-Android/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000000..354f95d41f
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,9 @@
+#Sat May 16 15:49:03 MYT 2026
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionSha256Sum=2ab2958f2a1e51120c326cad6f385153bb11ee93b3c216c5fccebfdfbb7ec6cb
+distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
+networkTimeout=10000
+validateDistributionUrl=true
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/Source/Example/HowToUse_Dll-Android/gradlew b/Source/Example/HowToUse_Dll-Android/gradlew
new file mode 100644
index 0000000000..ef07e0162b
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/gradlew
@@ -0,0 +1,251 @@
+#!/bin/sh
+
+#
+# Copyright © 2015 the original authors.
+#
+# 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
+#
+# https://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.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+
+##############################################################################
+#
+# Gradle start up script for POSIX generated by Gradle.
+#
+# Important for running:
+#
+# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
+# noncompliant, but you have some other compliant shell such as ksh or
+# bash, then to run this script, type that shell name before the whole
+# command line, like:
+#
+# ksh Gradle
+#
+# Busybox and similar reduced shells will NOT work, because this script
+# requires all of these POSIX shell features:
+# * functions;
+# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
+# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
+# * compound commands having a testable exit status, especially «case»;
+# * various built-in commands including «command», «set», and «ulimit».
+#
+# Important for patching:
+#
+# (2) This script targets any POSIX shell, so it avoids extensions provided
+# by Bash, Ksh, etc; in particular arrays are avoided.
+#
+# The "traditional" practice of packing multiple parameters into a
+# space-separated string is a well documented source of bugs and security
+# problems, so this is (mostly) avoided, by progressively accumulating
+# options in "$@", and eventually passing that to Java.
+#
+# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
+# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
+# see the in-line comments for details.
+#
+# There are tweaks for specific operating systems such as AIX, CygWin,
+# Darwin, MinGW, and NonStop.
+#
+# (3) This script is generated from the Groovy template
+# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# within the Gradle project.
+#
+# You can find Gradle at https://github.com/gradle/gradle/.
+#
+##############################################################################
+
+# Attempt to set APP_HOME
+
+# Resolve links: $0 may be a link
+app_path=$0
+
+# Need this for daisy-chained symlinks.
+while
+ APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
+ [ -h "$app_path" ]
+do
+ ls=$( ls -ld "$app_path" )
+ link=${ls#*' -> '}
+ case $link in #(
+ /*) app_path=$link ;; #(
+ *) app_path=$APP_HOME$link ;;
+ esac
+done
+
+# This is normally unused
+# shellcheck disable=SC2034
+APP_BASE_NAME=${0##*/}
+# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
+APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD=maximum
+
+warn () {
+ echo "$*"
+} >&2
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+} >&2
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "$( uname )" in #(
+ CYGWIN* ) cygwin=true ;; #(
+ Darwin* ) darwin=true ;; #(
+ MSYS* | MINGW* ) msys=true ;; #(
+ NONSTOP* ) nonstop=true ;;
+esac
+
+CLASSPATH="\\\"\\\""
+
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD=$JAVA_HOME/jre/sh/java
+ else
+ JAVACMD=$JAVA_HOME/bin/java
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD=java
+ if ! command -v java >/dev/null 2>&1
+ then
+ die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+fi
+
+# Increase the maximum file descriptors if we can.
+if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
+ case $MAX_FD in #(
+ max*)
+ # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC2039,SC3045
+ MAX_FD=$( ulimit -H -n ) ||
+ warn "Could not query maximum file descriptor limit"
+ esac
+ case $MAX_FD in #(
+ '' | soft) :;; #(
+ *)
+ # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC2039,SC3045
+ ulimit -n "$MAX_FD" ||
+ warn "Could not set maximum file descriptor limit to $MAX_FD"
+ esac
+fi
+
+# Collect all arguments for the java command, stacking in reverse order:
+# * args from the command line
+# * the main class name
+# * -classpath
+# * -D...appname settings
+# * --module-path (only if needed)
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if "$cygwin" || "$msys" ; then
+ APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
+ CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
+
+ JAVACMD=$( cygpath --unix "$JAVACMD" )
+
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ for arg do
+ if
+ case $arg in #(
+ -*) false ;; # don't mess with options #(
+ /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
+ [ -e "$t" ] ;; #(
+ *) false ;;
+ esac
+ then
+ arg=$( cygpath --path --ignore --mixed "$arg" )
+ fi
+ # Roll the args list around exactly as many times as the number of
+ # args, so each arg winds up back in the position where it started, but
+ # possibly modified.
+ #
+ # NB: a `for` loop captures its iteration list before it begins, so
+ # changing the positional parameters here affects neither the number of
+ # iterations, nor the values presented in `arg`.
+ shift # remove old arg
+ set -- "$@" "$arg" # push replacement arg
+ done
+fi
+
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Collect all arguments for the java command:
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
+# and any embedded shellness will be escaped.
+# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
+# treated as '${Hostname}' itself on the command line.
+
+set -- \
+ "-Dorg.gradle.appname=$APP_BASE_NAME" \
+ -classpath "$CLASSPATH" \
+ -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
+ "$@"
+
+# Stop when "xargs" is not available.
+if ! command -v xargs >/dev/null 2>&1
+then
+ die "xargs is not available"
+fi
+
+# Use "xargs" to parse quoted args.
+#
+# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
+#
+# In Bash we could simply go:
+#
+# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
+# set -- "${ARGS[@]}" "$@"
+#
+# but POSIX shell has neither arrays nor command substitution, so instead we
+# post-process each arg (as a line of input to sed) to backslash-escape any
+# character that might be a shell metacharacter, then use eval to reverse
+# that process (while maintaining the separation between arguments), and wrap
+# the whole thing up as a single "set" statement.
+#
+# This will of course break if any of these variables contains a newline or
+# an unmatched quote.
+#
+
+eval "set -- $(
+ printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
+ xargs -n1 |
+ sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
+ tr '\n' ' '
+ )" '"$@"'
+
+exec "$JAVACMD" "$@"
diff --git a/Source/Example/HowToUse_Dll-Android/gradlew.bat b/Source/Example/HowToUse_Dll-Android/gradlew.bat
new file mode 100644
index 0000000000..db3a6ac207
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/gradlew.bat
@@ -0,0 +1,94 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+@rem SPDX-License-Identifier: Apache-2.0
+@rem
+
+@if "%DEBUG%"=="" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%"=="" set DIRNAME=.
+@rem This is normally unused
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if %ERRORLEVEL% equ 0 goto execute
+
+echo. 1>&2
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto execute
+
+echo. 1>&2
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
+
+goto fail
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=
+
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
+
+:end
+@rem End local scope for the variables with windows NT shell
+if %ERRORLEVEL% equ 0 goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+set EXIT_CODE=%ERRORLEVEL%
+if %EXIT_CODE% equ 0 set EXIT_CODE=1
+if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
+exit /b %EXIT_CODE%
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/Source/Example/HowToUse_Dll-Android/settings.gradle.kts b/Source/Example/HowToUse_Dll-Android/settings.gradle.kts
new file mode 100644
index 0000000000..8d64d938d0
--- /dev/null
+++ b/Source/Example/HowToUse_Dll-Android/settings.gradle.kts
@@ -0,0 +1,27 @@
+pluginManagement {
+ repositories {
+ google {
+ content {
+ includeGroupByRegex("com\\.android.*")
+ includeGroupByRegex("com\\.google.*")
+ includeGroupByRegex("androidx.*")
+ }
+ }
+ mavenCentral()
+ gradlePluginPortal()
+ }
+}
+plugins {
+ id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
+}
+@Suppress("UnstableApiUsage")
+dependencyResolutionManagement {
+ repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
+ repositories {
+ google()
+ mavenCentral()
+ }
+}
+
+rootProject.name = "MediaInfoLib Example"
+include(":app")