Travis Himes
Key-Value
Android-supplied
Simple
Quick
Probably widely understood
SharedPreferences sPrefs = context .getSharedPreferences( ACTIVITY_PREFRENCES, Context.MODE_PRIVATE);
sPrefs .edit() .putString("CANDY_TYPE", "Butterfinger!") .apply();
sPrefs .getString( SHARED_PREFS_KEY, "default value")
Requires Manifest Permission
Internal or External
Holds more than simple types
Device Local
Java Devs have likely worked with Files before
Risks...
Internal vs External directory
Temporary vs "Permanent"
Dealing with File Streams
Space concerns
Creating
Deletion
File file = new File(context.getFilesDir(), filename);
-or-
FileOutputStream outputStream = openFileOutput(filename, Context.MODE_PRIVATE);
File file = new File(context.getCacheDir(), filename); -or- File file = File.createTempFile(fileName, null, context.getCacheDir());
String filename = "myfile"; String string = "Hello world!"; FileOutputStream outputStream; try { outputStream = openFileOutput(filename, Context.MODE_PRIVATE); outputStream.write(string.getBytes()); outputStream.close(); } catch (Exception e) { e.printStackTrace(); }
Content Providers, as their name implies, are not great for storing data, they're useful for providing data (in the manner/presentation that you choose) to other applications and processes.
Therefore, based on the topic of tonight's talk, I won't go into more detail on them than to make some broad comments...
(Illegitimate)
Possible, right now, via forms to store data
It's a hack!
Not the best move, buuuuut
Great for a quick and hackish solution
Good for write, didn't have to read, so - have fun...
Let me explain you my quick hack!
(don't duplicate)
Should show up in the spreadsheet
Test this, and never, ever, ship it
Seriously, this is a hack, don't ship it
(Legitimate)
OAuth setup to allow access
Takes Drive space for users
File storage (like we talked about earlier)
Allows for read and write
Google describes the interaction, seriously, it's all files
Should be accessible from any device with that account
Parse Server is open-source
But, it's a REST API that you're talking with at that point, and that's another whole talk topic...
Google-backed security
File-based
Guess what! (hint, I'm getting repetitive)
File-based off-device storage - go wild
NoSQL database
Key/Value store
Synchronizes with the cloud
I'm no expert!
Requires backend work/agreement
Didn't dive too deeply
@travis_himes