Android Question samsung - SM-X210 - android 16 sdk 36 sqlite database problems

Robert Valentino

Well-Known Member
Licensed User
Longtime User
one of my users has as Samsung SM-X210 running Android 16 with SDK 36.

My software is complied with SDK 35 (just to let you know)

His database keeps getting what appears to be corrupted to me. Things that should take seconds or less take over 20 minutes.
I think he is having a hardware problem but cannot prove it.

when I search google I got this results and was wondering if anyone else en counted something similar

My program runs on hundreds of device flawless and he is the only one seeing this. I am sure he is having a hardware problem. When he sends me his database and I restart it everything works fine. Any help

Google Search:
SQLite database problems on a Samsung SM-X210 (Galaxy Tab A9+) targeting Android 16 (SDK 36) likely stem from tightened data access restrictions, threading issues, or database corruption, rather than native SQLite bugs
. Address these by employing transaction-based batching, using WAL (Write-Ahead Logging) mode, and upgrading to modern data persistence libraries like Room.
Key Troubleshooting & Best Practices

    Handle Corruption: SQLiteDatabaseCorruptException is common. Ensure database helpers properly handle closing connections on multiple threads.
    Optimize Performance: Enable WAL mode (db.enableWriteAheadLogging()) for better concurrency.
    Batch Operations: Wrap multiple INSERT or UPDATE statements within a single transaction to prevent performance bottlenecks on Android 16.
    Use Proper Tools: Use Perfetto tracing and dumpsys meminfo to diagnose locking issues on the SM-X210.
    Targeting SDK 36: Ensure that database file paths and permissions comply with the latest Android 16 behavior changes regarding file storage.

For robust solutions, migrate to Android Jetpack Room, which abstraction over SQLite often resolves concurrency issues.

ADDITIONAL NOTE: My app is not crashing so I have nothing to debug
 

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Database (very small) is only 104kb - nothing special.

Don't believe I have anyone else that is running Android 16 and SDK 36

Just wondering if his device is using 16k page size and wonder if there could be a problem there.

How would I make sure my app ran right with 16k page size - could there be a hole here that I need to plug?

Found these posts
Android 16 SKD 36 - Enforces 16kb page size:
Android 16 (SDK 36) introduces, and enforces, 16 KB page size compatibility to improve performance, causing crashes (e.g.,
SIGBUS, dlopen failed) in apps using native SQLCipher or SQLite libraries built with 4 KB alignment. The fix requires updating native SQLite dependencies to be 16 KB aligned using NDK r27+, AGP 8.5.1+, and 16 KB alignment flags.
Key 16 KB Page Size SQLite Problems & Solutions

    Native Library Incompatibility: Apps using native SQLite binaries (.so files) that are 4 KB-aligned (Align 0x1000) will crash on Android 16, which requires 16 KB alignment (Align 0x4000).
    Fixing Native Libraries: Update to native libraries (such as libsqlite3x.so) that are compiled with 16 KB ELF alignment.
    Android NDK Requirement: Update to NDK r27c or higher to ensure proper 16 KB alignment during build.
    Database File Incompatibility: SQLite database files created with a 4 KB page size might face performance issues or potential read/write errors on 16 KB devices, though usually, only native binary alignment causes outright crashes.
    Workaround: For immediate issues, use android:pageSizeCompat in your AndroidManifest.xml to allow older apps to run on 16 KB devices, although this is not a permanent solution.

Looked on Google and it says my app supports 16kb page size but am going to test in an emulator to make sure
 
Last edited:
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Well, I tried in emulator and everything runs fine.
Turns out my Samsung ZFold-Z runs Android 16 sdk 36 and everything works fine.

I have a lot of users and have never seen this happening. Believe their device could be defected?? Will stay on it. If I learn anything new will report back
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…