HowTo: Storing Android offline database files in SD card

Official Content
This documentation is valid for:

Before the generation of an offline Android application with GeneXus, it is possible to specify whether the offline database files are going to be stored in the device local storage, or in the device SD card storage.

The way to do that is by changing the value of a property in the MainApplication.java file. This file is located at C:\<GeneXus installation directory>\Android\Templates\ApplicationProject\src\main\java\com\genexus\namespace\
Once you have found the file, and if you want to store the offline database files in the SD card, change the following line:

application.setUseInternalStorageForDatabase(true);

for this line:

application.setUseInternalStorageForDatabase(false);

The next time you are building your application, the offline database will be created in the device SD card storage.

Considerations

If the offline database was created in the internal storage at the beginning, once you perform the changes mentioned above, the offline database will not be copied to the SD card, it will be created from scratch instead.

See also

 




 


Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.