cancel
Showing results for 
Search instead for 
Did you mean: 

UltraliteJ database Stores on Android

Former Member
0 Kudos
2,752

Hi, on-line documentation for ConfigPersistent interface responsible for setting database store options, like: setWriteAdEnd or setShadowPaging has a comment: “This method has no effect on UltraLite databases running on Android smartphones”. So, what persistent store configurations are available for Ultralite on Android?

Thansk

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member

The defaults are supposed to be appropriate for most circumstances, so you should not have to pay much attention to the Configuration Object options until you wish to tune performance or address security issues. I typically use

ConfigFileAndroid config = DatabaseManager.createConfigurationFileAndroid(dbf, context);

I would say the ones of most importance are:

  • setCacheSize (initial cache for the database)
  • setPageSize (when creating a database)
  • enableAesDBEncryption (when creating a database) and
  • setDatabaseKey() for encryption

And I'll add further:

  • the cache is dynamically sized, so you shouldn't have to worry about that

  • the page size only needs to be changed if you have large rows which don't fit on 4k pages (the default) -- you'll know if this is the case because you'll receive an error to that effect on insert; sometimes applications can perform better with a smaller page size, but as Tom said that's a minor performance tuning issue