Posts: 7
Joined: Mon Sep 17, 2018 6:48 pm

[Kotlin] how to access SD card storage with app code

Fri Sep 13, 2019 11:32 pm

Hi all,

I am writing an app in Kotlin (similar to Javascript) for a keg washer and have a need to permanently store a variable "kegCount" which tracks the number of kegs that have been washed. This variable will be forever incremented and I want to save the value even after the Pi is switched off. I don't want to use any cloud stuff I just want the app to be local. How do I access SD card storage through coding in Kotlin? (Android Things OS) Any help is appreciated!!

Posts: 15948
Joined: Tue Jul 17, 2012 3:02 pm

Re: how to access SD card storage with app code

Sat Sep 14, 2019 4:50 am

How about writing and reading a file on the SD cards file system: ... le-io.html
Memory in C++ is a leaky abstraction .

Return to “Other”