Richard Hipp wrote:
> On 4/22/16, Christian Werner <Christian.Werner at t-online.de> wrote:
>> On 04/22/2016 03:46 PM, Richard Hipp wrote:
>>> Why isn't /var/tmp or /tmp usable on Android?
>>
>> There ain't no "/var/tmp" nor "/tmp" on droids. Best of all worst 
>> alternatives
>> is to use the application's own directory or better the subdir "cache" 
>> therein.
>
> Is there a well-defined way to find the name of the application's own 
> directory?

In Java, there is Context.getCacheDir().

It is available from C only if you have a reference to some Android
object (Activity or Context), and do the dance of accessing the Java
stuff:
http://stackoverflow.com/questions/7595324/creating-temporary-files-in-android-with-ndk

It would be possible for the Java code to set sqlite3_temp_directory,
but the Android framework does not do it, and it would probably not be
a good idea to require every app to do it.


Android (and Chromium on Android) just use SQLITE_TEMP_STORE=3 for this
reason:
https://android.googlesource.com/platform/external/sqlite/+/master/dist/Android.mk
https://bugs.chromium.org/p/chromium/issues/detail?id=138128
https://codereview.chromium.org/10809015

Apparently, Martin's SQLite library was compiled differently.


Regards,
Clemens

Reply via email to