Please fill out as much known and relevant information as possible.
Version Information:
GeoPackage Android Version: 2.0.1+ (as long as it uses java.io.File to read database or GPKG files in shared storage of Android10+ scoped storage such as public Documents folder)
Android Studio Arctic Fox | 2020.3.1
Build #AI-203.7717.56.2031.7583922, built on July 27, 2021
Runtime version: 11.0.10+0-b96-7249189 amd64
VM: OpenJDK 64-Bit Server VM by Oracle Corporation
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 1280M
Cores: 4
Registry: analyze.exceptions.on.the.fly=true, external.system.auto.import.disabled=true, ide.images.show.chessboard=true
Non-Bundled Plugins: com.alayouni.ansiHighlight, com.intellij.ideolog, JFormDesigner, idea.plugin.protoeditor, io.protostuff.protostuff-jetbrains-plugin, Dart, org.jetbrains.kotlin, io.flutter, org.intellij.plugins.markdown
Android Version Number: 11
Android SDK Version: 30
Platform & OS: Android Studio on Windows 10 21H1
Other Relevant Libraries: N/A
Expected Results:
What did you expect to happen?
GeoPackage is able to read/write folders or files in the Android10+ storage model (such as shared storage such as public Documents folder or MediaStore like Downloads, Music, etc.)
Observed Results:
What happened instead?
The use of java.io.File to read/write folders or files in a scoped storage environment especially shared storage such as public Documents folder or MediaStore like Downloads, Music, etc. will be a major problem. Refer osmdroid/osmdroid#1743
How often does this occur?
Always!
Output:
Any logs, errors, or output messages?
2021-09-25 12:26:30.220 17694-17694/? E/SQLiteDatabase: Error inserting
android.database.sqlite.SQLiteException: near "null": syntax error (code 1 SQLITE_ERROR[1]): , while compiling: INSERT INTO "geopackage"(null) VALUES (NULL)
at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:1463)
at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:901)
at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:590)
at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:62)
at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:33)
at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:2217)
at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:2088)
at mil.nga.geopackage.db.GeoPackageDatabase.insert(GeoPackageDatabase.java:127)
at mil.nga.geopackage.db.metadata.GeoPackageMetadataDataSource.create(GeoPackageMetadataDataSource.java:51)
at mil.nga.geopackage.factory.GeoPackageManagerImpl.importGeoPackage(GeoPackageManagerImpl.java:1319)
at mil.nga.geopackage.factory.GeoPackageManagerImpl.importGeoPackage(GeoPackageManagerImpl.java:658)
at mil.nga.geopackage.factory.GeoPackageManagerImpl.importGeoPackage(GeoPackageManagerImpl.java:572)
Steps to Reproduce:
Just use any code sample that has GeoPackageFactory.importGeoPackage() calls or has made java.io.File calls to read/write database or files.
Relevant Code:
Just use any code sample that has GeoPackageFactory.importGeoPackage() calls or has made java.io.File calls to read/write database or files.
Test Files:
Links to any files needed for testing? N/A
Additional Information:
Any additional configuration, data, or information that might help with the issue? N/A
Please fill out as much known and relevant information as possible.
Version Information:
java.io.File
to read database or GPKG files in shared storage of Android10+ scoped storage such as public Documents folder)Expected Results:
Observed Results:
java.io.File
to read/write folders or files in a scoped storage environment especially shared storage such as public Documents folder or MediaStore like Downloads, Music, etc. will be a major problem. Refer osmdroid/osmdroid#1743Output:
Steps to Reproduce:
Just use any code sample that has
GeoPackageFactory.importGeoPackage()
calls or has madejava.io.File
calls to read/write database or files.Relevant Code:
Just use any code sample that has
GeoPackageFactory.importGeoPackage()
calls or has madejava.io.File
calls to read/write database or files.Test Files:
Additional Information: