Showing posts with label android. Show all posts
Showing posts with label android. Show all posts

Friday, January 23, 2026

Android java: gradle corrupted, how to fix it

This is error message when gradle corrupted due to accidentally deleted or fail updated.

"The contents of the immutable workspace '~/.gradle/caches/9.1.0/groovy-dsl/52b1078aa736f3877f522d2046a7f837' have been modified" 

To make easier to fix gradle, exit Android Studio, open shell and go to project root directory. You will find file gradlew.

Clean up your gradle

$ ./gradlew --stop
Stopping Daemon(s)
2 Daemons stopped
$ rm -rf ~/.gradle/caches/9.1.0/

Run help to force gradlew download and rebuild library required.

$ ./gradlew help
Starting a Gradle Daemon, 2 stopped Daemons could not be reused, use --status for details

> Configure project :app
WARNING: The option setting 'android.usesSdkInManifest.disallowed=false' is deprecated.
The current default is 'true'.
It will be removed in version 10.0 of the Android Gradle plugin.
WARNING: The option setting 'android.sdk.defaultTargetSdkToCompileSdkIfUnset=false' is deprecated.
The current default is 'true'.
It will be removed in version 10.0 of the Android Gradle plugin.
WARNING: The option setting 'android.enableAppCompileTimeRClass=false' is deprecated.
The current default is 'true'.
It will be removed in version 10.0 of the Android Gradle plugin.
WARNING: The option setting 'android.builtInKotlin=false' is deprecated.
The current default is 'true'.
It will be removed in version 10.0 of the Android Gradle plugin.
WARNING: The option setting 'android.newDsl=false' is deprecated.
The current default is 'true'.
It will be removed in version 10.0 of the Android Gradle plugin.
WARNING: The option setting 'android.r8.optimizedResourceShrinking=false' is deprecated.
The current default is 'true'.
It will be removed in version 10.0 of the Android Gradle plugin.
WARNING: The option setting 'android.defaults.buildfeatures.resvalues=true' is deprecated.
The current default is 'false'.
It will be removed in version 10.0 of the Android Gradle plugin.
w: file://~/Workspace/Android/WredaContactBackup/app/build.gradle.kts:5:1: 'fun Project.android(configure: Action<BaseAppModuleExtension>): Unit' is deprecated. Replaced by com.android.build.api.dsl.ApplicationExtension.
This class is not used for the public extensions in AGP when android.newDsl=true, which is the default in AGP 9.0, and will be removed in AGP 10.0.
WARNING: The property android.dependency.excludeLibraryComponentsFromConstraints improves project import performance for very large projects. It should be enabled to improve performance.
To suppress this warning, add android.generateSyncIssueWhenLibraryConstraintsAreEnabled=false to gradle.properties
WARNING: The property android.dependency.excludeLibraryComponentsFromConstraints improves project import performance for very large projects. It should be enabled to improve performance.
To suppress this warning, add android.generateSyncIssueWhenLibraryConstraintsAreEnabled=false to gradle.properties
WARNING: The property android.dependency.excludeLibraryComponentsFromConstraints improves project import performance for very large projects. It should be enabled to improve performance.
To suppress this warning, add android.generateSyncIssueWhenLibraryConstraintsAreEnabled=false to gradle.properties
WARNING: The property android.dependency.excludeLibraryComponentsFromConstraints improves project import performance for very large projects. It should be enabled to improve performance.
To suppress this warning, add android.generateSyncIssueWhenLibraryConstraintsAreEnabled=false to gradle.properties

> Task :help

Welcome to Gradle 9.1.0.

To run a build, run gradlew <task> ...

To see a list of available tasks, run gradlew tasks

To see more detail about a task, run gradlew help --task <task>

To see a list of command-line options, run gradlew --help

For more detail on using Gradle, see https://docs.gradle.org/9.1.0/userguide/command_line_interface.html

For troubleshooting, visit https://help.gradle.org

BUILD SUCCESSFUL in 28s
1 actionable task: 1 executed
Consider enabling configuration cache to speed up this build: https://docs.gradle.org/9.1.0/userguide/configuration_cache_enabling.html

Open your Android Studio, repair android studio project choose index repair.

If this error occurred

"Ambiguous method call: both 'FragmentActivity.onCreate(Bundle) (In ~/.gradle/caches/9.1.0/transforms/dae60150ff0476652c6b13819aa96f10/transformed/fragment-1.5.4/jars/classes.jar!/androidx/fragment/app/FragmentActivity.class)' and 'ComponentActivity.onCreate(Bundle) (In ~/.gradle/caches/9.1.0/transforms/48c7a661e0aa50fff79a603bd45cc34c/transformed/activity-1.12.2/jars/classes.jar!/androidx/activity/ComponentActivity.class)' match"

Invalidate cache (everything) and restart.

If you find some deprecated gradle option like these:

$ ./gradlew help
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details

> Configure project :app
WARNING: The option setting 'android.usesSdkInManifest.disallowed=false' is deprecated.
The current default is 'true'.
It will be removed in version 10.0 of the Android Gradle plugin.
WARNING: The option setting 'android.sdk.defaultTargetSdkToCompileSdkIfUnset=false' is deprecated.
The current default is 'true'.
It will be removed in version 10.0 of the Android Gradle plugin.
WARNING: The option setting 'android.enableAppCompileTimeRClass=false' is deprecated.
The current default is 'true'.
It will be removed in version 10.0 of the Android Gradle plugin.
WARNING: The option setting 'android.builtInKotlin=false' is deprecated.
The current default is 'true'.
It will be removed in version 10.0 of the Android Gradle plugin.
WARNING: The option setting 'android.newDsl=false' is deprecated.
The current default is 'true'.
It will be removed in version 10.0 of the Android Gradle plugin.
WARNING: The option setting 'android.r8.optimizedResourceShrinking=false' is deprecated.
The current default is 'true'.
It will be removed in version 10.0 of the Android Gradle plugin.
WARNING: The option setting 'android.defaults.buildfeatures.resvalues=true' is deprecated.
The current default is 'false'.
It will be removed in version 10.0 of the Android Gradle plugin.
WARNING: The property android.dependency.excludeLibraryComponentsFromConstraints improves project import performance for very large projects. It should be enabled to improve performance.
To suppress this warning, add android.generateSyncIssueWhenLibraryConstraintsAreEnabled=false to gradle.properties
WARNING: The property android.dependency.excludeLibraryComponentsFromConstraints improves project import performance for very large projects. It should be enabled to improve performance.
To suppress this warning, add android.generateSyncIssueWhenLibraryConstraintsAreEnabled=false to gradle.properties
WARNING: The property android.dependency.excludeLibraryComponentsFromConstraints improves project import performance for very large projects. It should be enabled to improve performance.
To suppress this warning, add android.generateSyncIssueWhenLibraryConstraintsAreEnabled=false to gradle.properties
WARNING: The property android.dependency.excludeLibraryComponentsFromConstraints improves project import performance for very large projects. It should be enabled to improve performance.
To suppress this warning, add android.generateSyncIssueWhenLibraryConstraintsAreEnabled=false to gradle.properties

> Task :help

Welcome to Gradle 9.1.0.

To run a build, run gradlew <task> ...

To see a list of available tasks, run gradlew tasks

To see more detail about a task, run gradlew help --task <task>

To see a list of command-line options, run gradlew --help

For more detail on using Gradle, see https://docs.gradle.org/9.1.0/userguide/command_line_interface.html

For troubleshooting, visit https://help.gradle.org

BUILD SUCCESSFUL in 5s
1 actionable task: 1 executed
Consider enabling configuration cache to speed up this build: https://docs.gradle.org/9.1.0/userguide/configuration_cache_enabling.html

Edit file gradle.properties, find those configuration and take some adjustment. You can close Android Studio and back to shell, this is my gradle.properties:

# 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
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
#android.defaults.buildfeatures.resvalues=true #deprecated
#android.sdk.defaultTargetSdkToCompileSdkIfUnset=false #deprecated
#android.enableAppCompileTimeRClass=false #deprecated
#android.usesSdkInManifest.disallowed=false #deprecated
android.uniquePackageNames=false
android.dependency.useConstraints=true
android.r8.strictFullModeForKeepRules=false
#android.r8.optimizedResourceShrinking=false #deprecated
#android.builtInKotlin=false #deprecated
#android.newDsl=false #deprecated
# edited dedetok
#android.enableJetifier=true
android.generateSyncIssueWhenLibraryConstraintsAreEnabled=false

Validate gradle is clear

$ ./gradlew help

> Task :help

Welcome to Gradle 9.1.0.

To run a build, run gradlew <task> ...

To see a list of available tasks, run gradlew tasks

To see more detail about a task, run gradlew help --task <task>

To see a list of command-line options, run gradlew --help

For more detail on using Gradle, see https://docs.gradle.org/9.1.0/userguide/command_line_interface.html

For troubleshooting, visit https://help.gradle.org

BUILD SUCCESSFUL in 503ms
1 actionable task: 1 executed
Consider enabling configuration cache to speed up this build: https://docs.gradle.org/9.1.0/userguide/configuration_cache_enabling.html

Now you have clean project.  

Saturday, January 17, 2026

adb command references (android debug bridge)

to add path for platform-tool edit .bashrc (for Debian), append at the end. log out and sign in again to get affect or run $ source ~/.bashrc

export PATH=$PATH:$HOME/AndroidStudio/Sdk/platform-tools/

to show devices attached 

$ adb devices
* daemon not running; starting now at tcp:5037
adb * daemon started successfully
List of devices attached
A6501D9863TH039779    unauthorized -> Not allow, please allow on your device
$ adb devices
List of devices attached
A6501D9863TH039779    device -> your device allow to debug

to install application (don't support aab, compile to apk) 

$ adb install example.apk
Performing Streamed Install
Success

to uninstall package 

$ adb uninstall com.dedetok.radiowalkman
Success

to uninstall package (bloatware) for user 0 (default user). Use adb shell pm instead directly adb uninstall. Note: it just remove for current default user, it does not remove from firmware, you need to root your device for fully removal. After reset your device, the bloatware will come again.

$ adb uninstall --user 0 com.example.app vs 
$ adb shell uninstall --user 0 com.example.app
$ adb shell pm uninstall --user 0 net.bat.store
Success
com.transsion.aivoiceassistant

to list packages 

$ adb shell pm list packages | grep dedetok
package:com.dedetok.turuntirta
package:com.dedetok.pitrapuja

to list directory Download 

$ adb shell ls /sdcard/Download/com.dedetok.wredacontactbackup
test.txt

to get error Logcat 

$ adb logcat | grep com.dedetok.wredacontactbackup

  • WorkManager
    $ adb logcat -s dedetok WorkManager WM-WorkerWrapper
    --------- beginning of system
    --------- beginning of crash
    --------- beginning of main
    01-20 14:51:59.303 25534 25561 E WM-WorkerWrapper: Didn't find WorkSpec for id 6548d3d5-2c2e-47a0-a795-ff4f9365b2be
    01-20 14:51:59.311 25534 25561 E WM-WorkerWrapper: Didn't find WorkSpec for id e42ac4be-f95e-41e8-9694-e4eb6bc40671
    01-20 14:51:59.319 25534 25561 E WM-WorkerWrapper: Didn't find WorkSpec for id e42ac4be-f95e-41e8-9694-e4eb6bc40671

to get error

$ adb shell dumpsys dropbox | grep com.dedetok.wredacontactbackup

to clear data include cache for package com.dedetok.wredacontactbackup

$ adb shell pm clear com.dedetok.wredacontactbackup

Check JobScheduler (where WorkManager stores jobs)

$ adb shell dumpsys jobscheduler | grep -A 30 "com.dedetok.wredacontactbackup"
  JOB #u0a124/1: 7b2babf com.dedetok.wredacontactbackup/androidx.work.impl.background.systemjob.SystemJobService
    u0a124 tag=*job*/com.dedetok.wredacontactbackup/androidx.work.impl.background.systemjob.SystemJobService

#u0a124/1 last digit /1 is job id  

Force scheduler to run, use job id

$ adb shell cmd jobscheduler run -f com.dedetok.wredacontactbackup 1
Running job [FORCED] 

 

 

 

 

Android java: dealing with Trusted credentials on Android 7.1.1 below for letencrypt

Dealing with connection to https on old android may depend on Trusted credentials on the the device. 

Letsencrypt root certificate does not installed on Trusted credentials prior android 7.1.1.

Some application may throw:

java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

Solution 1 add user Trusted credentials 

Install Letsencrypt pem manually on old phone i.e android version 7.1.1 or older. You can download from https://letsencrypt.org/certs/isrgrootx1.pem?hl=en-US .

On your device (mine is evercoss gen pro x pro android 7.0). Go to setting -> Security.

You may find:

  • Trusted Credentials 
  • User Credentials
  • Install from SD Card

Choose "Install from SD Card":

  • Filed Name of Certification e.g ISGR ROOT X1 or Letsecrypt.
  • Credentials Use select VPN and aps

Open your Android Studio project and create res/xml/network_security_config.xml.

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <base-config>
        <trust-anchors>
            <certificates src="system" />
            <certificates src="user" />
        </trust-anchors>
    </base-config>
</network-security-config>

Edit AndroidManifest.xml

...
   <application
    ... 
   android:networkSecurityConfig="@xml/network_security_config"
   ...
   >
...

If https server ever falls back to http (not https), you should add cleartextTrafficPermitted="true" to the <base-config> tag (Not Recommended except your application need to access http):

...
<base-config 
   ...
   cleartextTrafficPermitted="true"
   ...
>
...

if this XML fix doesn't work, it's not the certificate—it's the Android 7.0 Cipher bug. In that specific case, you will have to use Conscrypt library (Solution 2).

Solution 2 using Conscript Library

Add dependency into gradle.build app

dependencies {
    ...
    implementation 'org.conscrypt:conscrypt-android:2.5.2'
    ...
}

Initialize at application startup or foreground

...
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N_MR1) { 
    // Below Android 7.1.1
    Security.insertProviderAt(Conscrypt.newProvider(), 1);
}
...


Tuesday, January 13, 2026

Android java: input events processing (collection)

There 2 ways to handle input events from user input

  1. Immediate: using listener
  2. At process: at the end to process data, usually user fire "process" button 

TimePicker

1. Immediate 

...
        //on view created
        // date picker
        TimePicker myTimePicker = view.findViewById(R.id.my_time_picker);
        myTimePicker.setOnTimeChangedListener(timeChangeListener);
...
    // TimePicker Listeneer
    private final TimePicker.OnTimeChangedListener timeChangeListener =
            new TimePicker.OnTimeChangedListener() {
        @Override
        public void onTimeChanged(TimePicker view, int hourOfDay, int minute) {
            // TODO
        }
    };

2.  At process

    // Pull the values exactly as they are right now
    int hour = timePicker.getHour();
    int minute = timePicker.getMinute();

RadioGroup

1. Immediate

...
        //on view created
        // date picker
        RadioGroup radioSelectModeBackup = view.findViewById(R.id.radio_select_mode_backup);
        radioSelectModeBackup.setOnCheckedChangeListener(radioListener);
...
    // RadioGroup Listener
    RadioGroup.OnCheckedChangeListener radioListener = new RadioGroup.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(@NonNull RadioGroup radioGroup, int idSelected) {
            if (idSelected==R.id.radio_weekly) {
                // weekly
            } else if (idSelected==R.id.radio_moonthly) {
                // monthly
            }
        }
    };

2. At process 

    // Inside your "Save" or "Submit" button click listener
    int selectedId = radioSelectModeBackup.getCheckedRadioButtonId();

    if (selectedId == R.id.radio_weekly) {
        // Logic for weekly backup
    } else if (selectedId == R.id.radio_moonthly) {
        // Logic for monthly backup
    } else {
        // Nothing is selected (returns -1 if no default is set in XML)
    }

 

 

 

 

Tuesday, January 6, 2026

Debian 13: bash to clean up unused gradle in folder $HOME/.gradle

stop any gradle daemon (better run this after you start your Debian)

copy paste this bash and change permission to execute

#!/bin/bash

# Set the cutoff date yyyy-mm-dd
CUTOFF_DATE="2025-08-01"

# Gradle folder
GRADLE_DIR="$HOME/.gradle"

# List of folders to clean
FOLDERS=("android" "build-scan-data" "caches" "daemon" "kotilin-profile" "native" "notifications" "undefined-build" "wrapper" ".tmp")

# 1. Stop Gradle Daemons first so files aren't locked
if [ -f "$GRADLE_DIR/daemon" ]; then
    echo "Stopping Gradle daemons..."
    gradle --stop 2>/dev/null || ./gradlew --stop 2>/dev/null
fi

echo "Cleaning Gradle folders in $GRADLE_DIR modified before $CUTOFF_DATE..."

for folder in "${FOLDERS[@]}"; do
    TARGET="$GRADLE_DIR/$folder"
    if [ -d "$TARGET" ]; then
        echo "Processing $TARGET..."
        # Find and delete files modified before the cutoff date
        find "$TARGET" -type f ! -newermt "$CUTOFF_DATE" -print -delete
        # Remove empty directories
        find "$TARGET" -type d -empty -print -delete
    else
        echo "Folder $TARGET does not exist, skipping."
    fi
done

echo "Cleanup complete."

Note:

  • change CUTOFF_DATE for any desire date
  • add or remove FOLDERS depends on your folder structure 

termux android: ffmpeg split video and convert h26h video

Requirement

Install termux from 

  • play store 
  • github.com/termux/termux-app latest but require allow install from unknown source

open termux and update

$ pkg upgrade

install ffmpeg

$ pkg install ffmpeg nano

Allow termux to manage files

$ termux-setup-storage

 Split a video by time

Target:

  • every piece has 1 minutes 58 seconds
  • resolution low 480
  • output h264
  • sound mono

command to convert '172967815750944 (1).mp4'

$ ffmpeg -i 172967815750944\ \(1\).mp4 -vf scale=-2:480 -r 25 -c:v libx264 -preset veryfast -crf 28 -ac 1 -c:a aac -b:a 96k -f segment -segment_time 118 -reset_timestamps 1 out_%03d.mp4

this command will create files with name starting with name out_[number].mp4

This is fastest way to split video into smaller size, but you need to write the long command. This is bash sh to split file to avoid write long command. Open nano and copy paste it, name it with mysplitvid.sh. Make it execute $ chmod u+x mysplitvid.sh.

#!/data/data/com.termux/files/usr/bin/bash

# Check input
if [ -z "$1" ]; then
  echo "Usage: $0 inputvideo.mp4"
  exit 1
fi

INPUT="$1"
BASENAME=$(basename "$INPUT" .mp4)

# Output directory (public, visible to other apps)
OUTDIR="/sdcard/Download/${BASENAME}_split"
mkdir -p "$OUTDIR"

# FFmpeg split + encode
ffmpeg -i "$INPUT" \
  -vf scale=-2:480 \
  -r 25 \
  -c:v libx264 \
  -preset veryfast \
  -crf 28 \
  -ac 1 \
  -c:a aac \
  -b:a 96k \
  -f segment \
  -segment_time 118 \
  -reset_timestamps 1 \
  "$OUTDIR/${BASENAME}_out%02d.mp4"

# Notify Android media scanner for all outputs
for file in "$OUTDIR"/*.mp4; do
  am broadcast \
    -a android.intent.action.MEDIA_SCANNER_SCAN_FILE \
    -d "file://$file" >/dev/null
done

echo "✅ Done!"
echo "📂 Output folder: $OUTDIR”

Convert video h256 to social media

Target:

  • Video Codec: H.264 (libx264)
  • Audio Codec: AAC
  • Pixel Format: yuv420p (Required for maximum compatibility)
  • Audio Sample Rate: 48kHz or 44.1kHz
  • Container: MP4  

To convert an H.265 MP4 to a Twitter-compatible, highly compressed, lower-resolution MP4 using FFmpeg, you need to re-encode the video to H.264 video codec, AAC audio codec, a maximum resolution of 1280x720, and a lower bitrate/higher CRF value.

Assume your file is inputfile.mp4 and located at Download folder in your Android.  Here are command to convert your video to make compatible for social media. Currently social media do not support high compression like h265.

~/ $ cd ~/storage
~/storage $ ls
audiobooks downloads movies podcasts
dcim external-0 music shared
documents media-0 pictures
~/storage $ cd downloads
~/storage/downloads $ ls *.mp4
inputfile.mp4
~/storage/downloads $ ffmpeg -i inputfile.mp4 -c:v libx264 -crf 28 -preset medium -vf "scale=1280:720,format=yuv420p" -c:a aac -b:a 128k -movflags faststart output.mp4
...

This is bash sh to split file to avoid write long command. Open nano and copy paste it, name it with myconverth265.sh. Make it execute $ chmod u+x myconverth265.sh.

#!/data/data/com.termux/files/usr/bin/bash

# Usage: ./convert_video.sh videoinput.mp4

INPUT="$1"

if [ -z "$INPUT" ]; then
    echo "Usage: $0 input_video.mp4"
    exit 1
fi

# Remove extension
BASENAME=$(basename "$INPUT")
NAME="${BASENAME%.*}"

# Output path (shared storage)
OUTPUT="/sdcard/Download/${NAME}_out.mp4"

echo "Converting $INPUT → $OUTPUT"

ffmpeg -y -i "$INPUT" \
    -c:v libx264 \
    -crf 28 \
    -preset medium \
    -vf "scale=1280:720,format=yuv420p" \
    -c:a aac \
    -b:a 128k \
    -movflags faststart \
    "$OUTPUT"

# Notify Android media scanner
am broadcast \
    -a android.intent.action.MEDIA_SCANNER_SCAN_FILE \
    -d "file://$OUTPUT"

echo "✅ Done! Video available in Gallery / Files / Photos”

Make your output video accessible by other application 

Your output file is owned by Termux. To make it accessible by other applications e.g. photos, files, etc, you can try these option

• move it to Movies or Download folder

$ mv out_*.mp4 /storage/emulated/0/Movies/

• Force android system to scan your output

$ am broadcast -a android.intent.action.MEDIA_SCANNER_SCAN_FILE -d file:///sdcard/Download/output.mp4


Thursday, December 4, 2025

Android java: improving application screen form factor

In AndroidManifest.xml we can define screen form factor to used (androidmanifest.xml android:screenOrientation).

These are the options

  1. "unspecified" : The default value. The system chooses the orientation. The policy it uses, and therefore the choices made in specific contexts, might differ from device to device.
  2. "behind" : The same orientation as the activity that's immediately beneath it in the activity stack.
  3. "landscape" : Landscape orientation (the display is wider than it is tall).
  4. "portrait" : Portrait orientation (the display is taller than it is wide).
  5. "reverseLandscape" : Landscape orientation in the opposite direction from normal landscape. Added in API level 9.
  6. "reversePortrait" : Portrait orientation in the opposite direction from normal portrait. Added in API level 9.
  7. "sensorLandscape" : Landscape orientation, but can be either normal or reverse landscape based on the device sensor. The sensor is used even if the user has locked sensor-based rotation. Added in API level 9.
  8. "sensorPortrait" : Portrait orientation, but can be either normal or reverse portrait based on the device sensor. The sensor is used even if the user has locked sensor-based rotation. However, depending on the device configuration, upside-down rotation might not be allowed. Added in API level 9.
  9. "userLandscape" : Landscape orientation, but can be either normal or reverse landscape based on the device sensor and the user's preference. Added in API level 18.
  10. "userPortrait" : Portrait orientation, but can be either normal or reverse portrait based on the device sensor and the user's preference. However, depending on the device configuration, upside-down rotation might not be allowed. Added in API level 18.
  11. "sensor" : The device orientation sensor determines the orientation. The orientation of the display depends on how the user is holding the device. It changes when the user rotates the device. Some devices, though, don't rotate to all four possible orientations, by default. To use all four orientations, use "fullSensor". The sensor is used even if the user locked sensor-based rotation.
  12. "fullSensor" : The device orientation sensor determines the orientation for any of the four orientations. This is similar to "sensor", except this allows for any of the four possible screen orientations regardless of what the device normally supports. For example, some devices don't normally use reverse portrait or reverse landscape, but this enables those orientations. Added in API level 9.
  13. "nosensor" : The orientation is determined without reference to a physical orientation sensor. The sensor is ignored, so the display doesn't rotate based on how the user moves the device.
  14. "user" : The user's current preferred orientation.
  15. "fullUser" : If the user has locked sensor-based rotation, this behaves the same as user, otherwise it behaves the same as fullSensor and allows any of the four possible screen orientations. Added in API level 18.
  16. "locked" : Locks the orientation to its current rotation, whatever that is. Added in API level 18. 

Warning: To improve the layout of apps on form factors with smallest width >= 600dp, the system ignores the following values of this attribute for apps that target Android 16 (API level 36):

  1.     portrait
  2.     landscape
  3.     reversePortrait
  4.     reverseLandscape
  5.     sensorPortrait
  6.     sensorLandscape
  7.     userPortrait
  8.     userLandscape 

To create variant for table,  Goto main activity, on your main activity dropdown select "create table qualifier", it will create copy of main activity that require to modify to match tablet out. the layout is on layout -> main_activity -> main_activity.xml (sw600dp).

I use:

  1. main_activity.xml
  2. main_activity.xml (sw600dp)
main_activity.xml will be use for all mobile device, don't create main_activity (land). main_activity.xml (sw600dp) will be use on tablet. 

In case you want to lock phone to use portrait, delete main_activity.xml (land), you need to remove android:screenOrientation from AndroidManifest.xml. To make it consistent, this is sample of code in java for your main activity

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // 1. Enable edge-to-edge for Java Activities
        // You need to import androidx.activity.EdgeToEdge;
        EdgeToEdge.enable(this);
        super.onCreate(savedInstanceState);
        // Fragment
        // layout portrait or lanscape?
        // portrait my_fragment_container
        // langsacpe fragment_config_container, fragment_main_container
        setContentView(R.layout.activity_m); // general, let system choose between portrait and landscape
        // Check if landscape (two-pane) layout is active
        View config = findViewById(R.id.fragment_config_container);
        View main = findViewById(R.id.fragment_main_container);
        isTwoPane = (config != null && main != null); // already checked not null
        // Conditional Orientation Lock
        if (!isTwoPane) {
            // If single-pane (phone), force portrait before fragment transactions
            setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        }
        if (isTwoPane) {
            // dual-pane
            setFragment(R.id.fragment_config_container, new FragmentConfig());
            setFragment(R.id.fragment_main_container, new FragmentMain());
        } else {
            // single-pane
            // all phone must use this activity_m.xml (land)
            setFragment(R.id.my_fragment_container, new FragmentMain());
        }
        ...
    }

    private void setFragment(int containerId, Fragment fragment) {
        View container = findViewById(containerId);
        if (container == null) {
            //Log.e("dedetok", "Container ID " + containerId + " not found in this layout!");
            return;  // prevent crash
        }
        FragmentTransaction transaction = fragmentManager.beginTransaction();
        transaction.replace(containerId, fragment);
        transaction.commit();

    } 

Immediately, lock screen for single pane (phone) to portrait, i.e. setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); 

Tuesday, December 2, 2025

Android java: Releasing resource Activity/Fragment <-> AndroidViewModel <-> MyController

Activity/Fragment <-> AndroidViewModel <-> MyController

MyController will hold

  1. Executor
  2. MediaController 
  3. Network access
  4. Database access
  5. Application context for above operation  

Proper way to clear the resource

  1. Executor
            // MyAndroidViewModel onClear() has been reached
            if (myExecutor!=null) {
                myExecutor.shutdown();
                myExecutor = null;
            }
  2. Media Controller
            if (myMediaController!=null) {
                myMediaController.releaseMediaSession(); // MUST BE CLEAR
                myMediaController = null;
            }
  3. Network access
            myGetRadioLogo=null;
  4. Database access  
            myDBAccess=null;
  5. Application context
            appContext=null; // MUST SET NULL AT ONCLEAR

Fail to release these resources may lead to memory leak

Fail to release resource with not properly sequence may lead application crashed, this crash can be found on logcat.  

Sunday, November 23, 2025

Using private Private DNS in Android 9 and above for more for security

Sometimes we disappointed to use isp's dns resolver. whatever the reasons, since Android 9 (Pie) and later versions, user can change his/her android phone to use Private DNS. Only one DNS server can be used, it does not support multiple DNS resolver! 

Original list was taken from https://www.geeksforgeeks.org/android/how-to-enable-private-dns-on-android/ with additional text.

Private DNS Hostname List for Android

  1. Google DNS: dns.google
  2. Quad9: dns.quad9.net
  3. Cleanbrowsing DNS: security-filter-dns.cleanbrowsing.org
  4. Open DNS: dns.opendns.com for dot, https://doh.opendns.com/dns-query for doh, 208.67.222.222 
  5. NextDNS: your-id.dns.nextdns.io 45.90.28.0 (custom IPv4) require registration to get id and proper full qualified hostname
  6. Cloudflare : cloudflare-dns.com 1.1.1.1

Please check their website or use search engine for more detail and update information.

When you use private DNS in public network, your mobile phone will use your private DNS resolver that have you define. It won't use DNS from public access point. This will prevent you from "man in the middle attack". 

Warning: You also can bypass country blocked to reach your desire web. You don't need vpn if private DNS can solved country limitation.

Tuesday, November 11, 2025

Android java: using DataLive for orientation change

I test it in Android 10 xiaomi mia2

What will happen when orientation change e.g. screen change or language change?

the object in activity will be destroyed. here is the sequence:

  • after orientation change
    V  onPause
    V  onStop
    V  onDestrouy
  • after flusing all data
    V  onCreate
    V  onCreate myClass :null
    V  MyClass constructor
    V  onCreateView myClass.getRandom
    V  onStart
    V  onResume 

At xiomi mia2, override public void onConfigurationChanged(Configuration newConfig) method did not called at all during screen orientation change, not appearred in logcat. except, you put android:configChanges in your layout.

Base on the android behave, these are the solution can be used to keep the object during configuration change:

  1. Local persistence to handle process death for complex or large data. Persistent local storage includes databases or DataStore.
  2. Retained objects such as ViewModel instances to handle UI-related state in memory while the user is actively using the app.
  3. Saved instance state to handle system-initiated process death and keep transient state that depends on user input or navigation. 

ViewModel is recommended used for today an future, These are some options:

  1. ViewModel    Holds UI data & logic    Core architecture component
  2. ComputableLiveData (Deprecated)
  3. MediatorLiveData    Combines multiple LiveData sources    Merging streams
  4. MutableLiveData    Observable, mutable data    UI updates
  5. SavingStateLiveData    LiveData with saved-state persistence    Restore after process death 

Comparison between AndroidViewModel vss ViewModel

AndroidViewModel require Context for DB, prefs, etc. gemini: Avoid if possible. Only use when you absolutely need Context. violates a core principle of good architecture: separation of concerns and testability.
ViewModel UI logic without needing Context Network requirement may use this, it does not need context

NOTE: Don’t store Activity or Fragment in VieModel nor AndroidViewModel! 

These are the java code for education, first text using direct access to object in activity, and second text using live data and AndroidViewModel. this code used AndroidViewModel, because I need application's context to access sqlite.

-- MyClass.java

package com.dedetok.testdataorientation;

import android.content.Context;
import android.util.Log;

import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;

import java.util.Random;

public class MyClass {
    // dummy
    Context context;

    boolean isCreated = false;
    int randomNumber=-1;

    public MyClass(Context context) {
        this.context = context;
        Log.v("deddetok", "MyClass constructor"); // debug

    }

    public String getRandom() {
        if (!isCreated) {
            Random random = new Random();
            randomNumber = random.nextInt(100);
            isCreated = true;
        }
        return String.valueOf(randomNumber);
    }

    public LiveData<String> getRandomLive() {
        if (!isCreated) {
            Random random = new Random();
            randomNumber = random.nextInt(100);
            isCreated = true;
        }
        MutableLiveData<String> returnValue = new MutableLiveData<>();
        returnValue.setValue(String.valueOf(randomNumber));

        return returnValue;
    }
}

-- MyAndroidViewModel

package com.dedetok.testdataorientation;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;

public class MyAndroidViewModel extends AndroidViewModel {
    MyClass myClass;

    public MyAndroidViewModel(@NonNull Application application) {
        super(application);
        myClass = new MyClass(application);
    }

    public LiveData<String> getData() {
        return myClass.getRandomLive();
    }
}

-- MainActivity.java

package com.dedetok.testdataorientation;

import android.content.Context;
import android.content.res.Configuration;
import android.os.Bundle;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import androidx.activity.EdgeToEdge;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.AppCompatTextView;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.lifecycle.ViewModelProvider;

public class MainActivity extends AppCompatActivity {

    MyClass myClass = null;

    AppCompatTextView myTextView1, myTextView2;

    MyAndroidViewModel myAndroidViewModel;

    /* to preserve myclass
     * 1. Local persistence to handle process death for complex or large data. Persistent local storage includes databases or DataStore.
     * 2. Retained objects such as ViewModel instances to handle UI-related state in memory while the user is actively using the app.
     * 3. Saved instance state to handle system-initiated process death and keep transient state that depends on user input or navigation.
     */

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_main);
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
            Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
            return insets;
        });

        Log.v("dedetok", "onCreate"); // debug


        myTextView1 = findViewById(R.id.textView1);
        myTextView2 = findViewById(R.id.textView2);

        Log.v("dedetok", "onCreate myClass :"+myClass); //
        // myTextView1
        if (myClass==null) {
            myClass = new MyClass(this);
        }
        myTextView1.setText(myClass.getRandom()); // work, created in memory

        // ✅ Get ViewModel (it survives rotation)
        // myTextView2
        myAndroidViewModel = new ViewModelProvider(this).get(MyAndroidViewModel.class);
        myAndroidViewModel.getData().observe(this, value -> {
            // 'value' is a plain String here
            myTextView2.setText(value);
        }); //

    }

    @Nullable
    @Override
    public View onCreateView(@Nullable View parent, @NonNull String name, @NonNull Context context, @NonNull AttributeSet attrs) {
        Log.v("dedetok", "onCreateView"); // debug
        //Log.v("dedetok", "onCreateView myClass.getRandom"); // debug
        //myTextView.setText(myClass.getRandom()); // crash textview not ready
        return super.onCreateView(parent, name, context, attrs);
    }

    /*
     * ## activity life cycle 2 ##
     */
    @Override
    protected void onStart() {
        super.onStart();
        Log.v("dedetok", "onCreateView myClass.getRandom"); // debug
        //myTextView1.setText(myClass.getRandom()); // work, view has been created
        myAndroidViewModel.getData().observe(this, value -> {
            // 'value' is a plain String here
            myTextView2.setText(value);
        }); // this is fine place

        Log.v("dedetok", "onStart"); // debug

    }

    /*
     * ## activity life cycle 3 ##
     */
    @Override
    protected void onResume() {
        super.onResume();

        Log.v("dedetok", "onResume"); // debug


    }

    /*
     * ## activity life cycle 4 ##
     */
    @Override
    protected void onPause() {
        Log.v("dedetok", "onPause"); // debug
        super.onPause();

    }

    /*
     * ## activity life cycle 5 ##
     */
    @Override
    protected void onStop() {
        Log.v("dedetok", "onStop"); // debug
        super.onStop();

    }

    /*
     * ## activity life cycle 6 ##
     */
    @Override
    protected void onDestroy() {
        Log.v("dedetok", "onDestrouy"); // debug

        super.onDestroy();
    }

    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
        Log.v("dedetok", "onConfigurationChanged"); // debug
    }
}

-- activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <androidx.appcompat.widget.AppCompatTextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="TextView"
        android:minHeight="50dp"
        android:textSize="24sp"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        />
    <androidx.appcompat.widget.AppCompatTextView
        android:id="@+id/textView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="TextView2"
        android:minHeight="50dp"
        android:textSize="24sp"
        app:layout_constraintTop_toBottomOf="@+id/textView1"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        />
</androidx.constraintlayout.widget.ConstraintLayout>

Some of parts of this content generated by ChatGPT and Gemini with some modification.

Wednesday, November 5, 2025

Android Studio: using Logcat and filter

 

LevelPriorityUse Case
Log.v()Verbose (V)Everything. Detailed tracing of functions, variable values, lifecycle events.
Log.d()Debug (D)General debugging messages useful for development.
Log.i()Info (I)Important business logic messages, typical user actions, system state changes.
Log.w()Warn (W)Use of deprecated APIs, non-critical errors that can be recovered.
Log.e()Error (E)Critical errors that cause a failure or stop a feature from working.
Log.wtf()Assert (A)What a Terrible Failure. Reserved for conditions that should never happen.

Option to filter in Andorid Studio Logcat

  1. tag: Filters messages by a specific log tag.
    Example: tag:MyActivity
  2. level: Filters messages at the specified log level or higher. Levels include VERBOSE (V), DEBUG (D), INFO (I), WARN (W), ERROR (E), and ASSERT (A).
    Example: level:ERROR (shows ERROR and ASSERT logs)
  3. process: Filters messages by the process name or process ID (PID).
    Example: process:1234 or process:com.example.app
  4. age: Filters messages by how recent they are. The value is a number followed by a unit of time: s (seconds), m (minutes), h (hours), or d (days).
    Example: age:5m (shows messages from the last 5 minutes)
  5. is: Can be used with crash to filter only crash logs.
    Example: is:crash
  6. package: A convenient shortcut to filter logs only from the currently running application's package. 

Logical operation can be use in Logcat Filter

  1. && (AND): Requires both conditions to be true.
    Example: package:mine && level:WARN
  2. | (OR): Requires at least one condition to be true.
    Example: tag:Tag1 | tag:Tag2
  3. - (NOT/Exclude): Excludes logs matching the condition. Place the hyphen before the key.
    Example: -tag:ExcludedTag

Example usage Logcat filter:

  1. package:mine level:INFO "user data" -tag:network
  2. tag:MyTag && level:DEBUG || is:crash 

Credit: Table conversion to html online http://the-mostly.ru/online_html_table_generator.html

Tuesday, October 14, 2025

Android Studio 2024.1.4: backup and how you migrate your old project

Android Studio move so fast, the developer and ide tools are racing each other.

These are must you backup: 

  1. Project name
  2. Your key file i.e jks for your project
  3. your project source
    1. <root_app> remove folders .gradle .idea and build, remove file .gitignore
    2. <root_app>/app remove folders build, libs and release, remove file .gitignore
    3. <root_app>/gradle remove file ./gradle/wrapper/gradle-wrapper.jar

For upgrading from old project, and your project does not have libs.versions.toml file:

  1. Create it (see below) or copy from other project <root_app>/gradle/libs.versions.toml.
  2. change build.gradle.kts (:app)
    plugins {
        id("com.android.application")
    }
    into 
    plugins {
        alias(libs.plugins.android.application)
    }
    Change dependency 
    dependencies {

        implementation("androidx.appcompat:appcompat:1.7.1")
        implementation("com.google.android.material:material:1.12.0")
        implementation("androidx.constraintlayout:constraintlayout:2.2.1")
        testImplementation("junit:junit:4.13.2")
        androidTestImplementation("androidx.test.ext:junit:1.2.1")
        androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
        implementation("com.google.android.gms:play-services-ads-lite:24.0.0")

    }
    into
    dependencies {

        implementation(libs.appcompat)
        implementation(libs.material)
        testImplementation(libs.junit)
        androidTestImplementation(libs.ext.junit)
        androidTestImplementation(libs.espresso.core)

        // admob
        implementation(libs.play.services.ads)
    }
  3. Update your libs.versions.toml, revise the version if necessary:
    [versions]
    agp = "8.13.0"
    junit = "4.13.2"
    junitVersion = "1.3.0"
    espressoCore = "3.7.0"
    appcompat = "1.7.1"
    material = "1.13.0"
    playServicesAds = "24.7.0"

    [libraries]
    junit = { group = "junit", name = "junit", version.ref = "junit" }
    ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
    espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
    appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
    material = { group = "com.google.android.material", name = "material", version.ref = "material" }
    play-services-ads = { module = "com.google.android.gms:play-services-ads", version.ref = "playServicesAds" }

    [plugins]
    android-application = { id = "com.android.application", version.ref = "agp" }

Note: if you have other external dependency, keep the library first, and migrate after common library successfully upgraded.

To create libs.versions.toml, at left side Project Files -> gradle -> New -> File, name it with: libs.versions.toml. Continue step 2 above.

This is example of external library, how to move jsoup into libs.versions.toml

Change build.gradle.kts (:app) from  

dependencies {
    ...
    implementation("org.jsoup:jsoup:
1.21.2") // jsoup

}

change into

dependencies {
    ....
    implementation(libs.jsoup)
}

And add into libs.versions.toml

[versions]
...
# Define the version number
jsoup = "1.21.2"
...
[libraries]
...
# Define the library coordinates, referencing the version above
jsoup = { group = "org.jsoup", name = "jsoup", version.ref = "jsoup" }
...

 

Friday, October 10, 2025

Debian 13: Configure NVidia in dual gpu - hybrid mode and how to utilize it in Android Studio

List your VGA: 

# lspci | grep -E "VGA|3D"
01:00.0 VGA compatible controller: NVIDIA Corporation GA107 [GeForce RTX 2050] (rev a1)
05:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Rembrandt [Radeon 680M] (rev 0b)

Installation

# apt-get install firmware-nvidia-graphics nvidia-detect nvidia-driver linux-headers-$(uname -r) vulkan-tools

Warning "Conflicting nouveau kernel module loaded" may appear.

Check your nvidia

# nvidia-detect
Detected NVIDIA GPUs:
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GA107 [GeForce RTX 2050] [10de:25ad] (rev a1)

Checking card:  NVIDIA Corporation GA107 [GeForce RTX 2050] (rev a1)
Your card is supported by all driver versions.
Your card is also supported by the Tesla 535 drivers series.
It is recommended to install the
    nvidia-driver

Chek your nvidia software

# nvidia-smi
Fri Oct 10 23:07:14 2025       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.163.01             Driver Version: 550.163.01     CUDA Version: 12.4     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 2050        On  |   00000000:01:00.0 Off |                  N/A |
| N/A   40C    P0              7W /   45W |       9MiB /   4096MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

Note: run glxinfo in "xfce terminal", not "terminal emulator"  

GLX information

$ glxinfo | grep "OpenGL renderer"
OpenGL renderer string: AMD Radeon 660M (radeonsi, rembrandt, LLVM 19.1.7, DRM 3.61, 6.12.31-amd64)

The desktop will utilize AMD GPU, we want to run Android Studio and utilize GeForce RTX 2050. Create a bash script to run Android Studio using NVidia Geforce RTX2050 instead build in AMD gpu, e.q 

#!/bin/bash
# Launch Android Studio using the NVIDIA GPU (Prime Render Offload)

APP_PATH="$HOME/AndroidStudio/android-studio/bin/studio.sh"

if [ ! -f "$APP_PATH" ]; then
    echo "Error: Android Studio not found at $APP_PATH"
    exit 1
fi

# Run Android Studio with NVIDIA GPU offload
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia "$APP_PATH" &

Usefull command if any systemd error during boot 

# journalctl -b -u systemd-modules-load.service


Saturday, May 3, 2025

Removing bloatware in Android

It is common, every non AOSP android may come with ton of partner's application. The applications are known as bloatware.

Some bloatwares can be uninstall. Or some can only be disable. However, bloatware with disable can still running on background.  

Those bloatwares are used your mobile phone resource. These are steps to remove/uninstall from your mobile using PC, any operation system that can run adb (Android Debugging Bridge). I Assume, you done this.

You must enable development mode and USB Debugging your mobile phone.

Development mode
USB Debugging

Afteer you connect your mobile phone to your PC using USB, from your mobile, you need to trust your PC to make connection and run debugging, include running script via adb.

AllowUSB Debugging

Open your terminal and go to directory where your ADB tool install or placed, e.q. D:\android\sdk\platform-tools. Follow this command

1. detect your android phone

>adb devices
List of devices attached
1xxxxxxxxxxxxxxx        device

2. connect to your device

>adb shell
TECNO-KJ6:/ $

3. run pm to remove bloatware

$ pm uninstall --user 0 com.transsnet.store
Success

4. exit

$ exit
>

To View packages

$ pm list packages | grep store
package:com.google.android.apps.restore
package:com.transsnet.store

This is screen shoot status of application after deletion.

Getting package name
After removing/deletion

You need to know the package name you want to remove. Pick any application you wish in play store with key search "Application Inspector"

Bloatware Table

Application Package Name Tecno Spark 20 Pro KJ6 Infinix note 12 x670
AHA Games net.bat.store n y notes30
Folax com.transsion.aivoiceassistant n y notes30
Hola Browser com.talpa.hibrowser y y notes30
Palm Store com.transsnet.store y y notes30
Visha Player com.transsion.magicshow n y notes30
WeZone com.transsion.wezone n y


NOTE:

  1. The bloatware status uninstall after restart your android
  2. The bloatware still exist in rom, every time you reset your android, the bloatware will come up. You need to re do all steps to remove it.

Reference: https://www.phoneworld.com.pk/the-truth-about-xos-how-infinixs-ui-is-burdened-by-excessive-bloatware/

 

Friday, September 27, 2024

android java: google admob policy collected data checklist

 

In May 2021, Google Play announced the new Data safety section https://developers.google.com/admob/android/privacy/play-data-disclosure. All application must declare data safety, include if application has 3rd partly like Google Google Mobile Ads.

Unfortunately, the guidance data disclosure in https://developers.google.com/admob/android/privacy/play-data-disclosure does not clear. It does mention clues what Google Mobile Ads SDK do with our client data. Here are the clues:

Data

By default, the Google Mobile Ads SDK...

IP address

Collects device's IP address, which may be used to estimate the general location of a device.

User product interactions

Collects user product interactions and interaction information, including app launch, taps, and video views.

Diagnostic information

Collects information related to the performance of your app and the SDK, including crash logs, app launch time, hang rate, and energy usage.

Device and Account identifiers

Collects Android advertising (ad) ID, app set ID, and, if applicable, other identifiers related to signed-in accounts on the device.

We must fill in Data safety section:

A.    Overview
Information about what to fill.

B.    Data Collection and Security

1.     Does your app collect or share any of the required user data types? Y

·       Is all of the user data collected by your app encrypted in transit? Y

·       þ My app does not allow users to create an account

       Can users login to your app with accounts created outside of the app? N

·       Do you provide a way for users to request that their data is deleted? (Optional) N

C.    Data Types

1.     Location:

·       Approximate location

2.     Personal info:

·       User IDs

·       Other info

3.     App activity:

·       App interactions

·       In-app search history

·       Installed apps

4.     App info and performance:

·       Crash logs

·       Diagnostics

·       Other app performance data

5.     Device or other IDs

·       Device or other IDs

D.    Data usage and handling

1.     Personal info - User IDs & Other info

·       Is this data collected, shared, or both?
þ Collected & Shared

·       Is this data processed ephemerally?
þ No, this collected data is not processed ephemerally

·       Is this data required for your app, or can users choose whether it's collected?
þ Data collection is required (users can't turn off this data collection)

·       Why is this user data collected? Select all that apply.
þ Advertising or marketing

·       Why is this user data shared? Select all that apply.
þ Advertising or marketing

2.     Location - Approximate location:

·       Is this data collected, shared, or both?
þ Collected & Shared

·       Is this data processed ephemerally?
þ No, this collected data is not processed ephemerally

·       Is this data required for your app, or can users choose whether it's collected?
þ Data collection is required (users can't turn off this data collection)

·       Why is this user data collected? Select all that apply.
þ Advertising or marketing

·       Why is this user data shared? Select all that apply.
þ Advertising or marketing

3.     App info and performance - Crash logs; Diagnostics; & Other app performance data

·       Is this data collected, shared, or both?
þ Collected & Shared

·       Is this data processed ephemerally?
þ No, this collected data is not processed ephemerally

·       Is this data required for your app, or can users choose whether it's collected?
þ Data collection is required (users can't turn off this data collection)

·       Why is this user data collected? Select all that apply.
þ Analytics

·       Why is this user data shared? Select all that apply.
þ Analytics

4.     App activity - App interactions; In-app search history; & Installed apps

·       Is this data collected, shared, or both?
þ Collected & Shared

·       Is this data processed ephemerally?
þ No, this collected data is not processed ephemerally

·       Is this data required for your app, or can users choose whether it's collected?
þ Data collection is required (users can't turn off this data collection)

·       Why is this user data collected? Select all that apply.
þ Advertising or marketing

·       Why is this user data shared? Select all that apply.
þ Advertising or marketing

5.     Device or other IDs - Device or other IDs:

·       Is this data collected, shared, or both?
þ Collected & Shared

·       Is this data processed ephemerally?
þ No, this collected data is not processed ephemerally

·       Is this data required for your app, or can users choose whether it's collected?
þ Data collection is required (users can't turn off this data collection)

·       Why is this user data collected? Select all that apply.
þ Advertising or marketing

·       Why is this user data shared? Select all that apply.
þ Advertising or marketing