Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26877] Android: Ti.Database.install() should throw exception like iOS if source db file not found

GitHub Issuen/a
TypeImprovement
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2019-05-16T22:54:37.000+0000
Affected Version/sn/a
Fix Version/sRelease 8.1.0
ComponentsAndroid
Labelsandroid, database, engArch, install, parity
ReporterJoshua Quick
AssigneeJoshua Quick
Created2019-03-05T23:26:09.000+0000
Updated2019-05-16T22:54:37.000+0000

Description

*Summary:* The [Ti.Database.install()](https://docs.appcelerator.com/platform/latest/#!/api/Titanium.Database-method-install) API is intended to copy a "source" database file embedded within the app to a writeable location. The idea being that the app developer can preconfigure a SQLite database's tables/columns/indexes, embed that preconfigured database file within the app, thus avoiding having to do set up a database dynamically within the app's code. On iOS, if the 1st argument (the source database file path) is not found, then the install() function will throw an exception. This is good because this tells the app developer that he/she has set the path wrong to the embedded database file. On Android, if the source database file is not found, then an empty database is installed to the given location. This may confuse the app developer. It should throw an exception instead like iOS to clearly indicate that it's a path issue.

Comments

  1. Joshua Quick 2019-03-12

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/10770
  2. Keerthi Mahalingam 2019-05-16

    FR passed. PR merged
  3. Keerthi Mahalingam 2019-05-16

    Verified the fix on sdk 8.1.0.v20190516120244.Works as expected. Test information found under the PR https://github.com/appcelerator/titanium_mobile/pull/10770

JSON Source