Day 19: Saving State!

Published by

on

Hi Friends!

📊 Daily Stand-Up: Yesterday we finally made it back around to saving state.  And it was a really valuable learning lesson as we found some neat hacks for SharedPreferences.

Firstly understanding what we needed out of it:
Save state of groups/devices ie. labels and associations
and what SharedPreferences does
Provides a platform specific key value storage

With this knowledge, we weren’t first sure that SharedPreferences would work. One concept that tripped us up initially was the fact that despite the several methods offered by SharedPreferences, they all write to the same key, value hashmap. After a little digging and some frustration, we found that folks are often using this in combination with JSON to essentially write out and load small state maps. This was perfect for our use case and we moved to implement to/fromJSON methods for our Groups and Devices shortly thereafter. Check out the linked resources!

Any hooo, we got our state saved and loaded and it functions well.

Today we’ll be looking at inserting a banner Ad into the app. We’ll also step into our PM role and try to set up our next client meeting.

🎵 Playlist: A man who needs no intro, Eric Clapton: https://open.spotify.com/album/6zxsfP7TdXLAS9QEGNN0Uy?si=F3T1gZzoSvKXNXlUMICWYw

đź§  Mental State: Shared Preferences made me happy!

🛠️ Tools: MacBook Pro M2, Ipad Pro, Pixel 6, Intellij, Flutter, Kinesis-Advantage2-Ergonomic-Keyboard, Chat GPT

📚 Resources: 

https://pub.dev/packages/shared_preferences,

https://www.geeksforgeeks.org/flutter-sharedpreferences/,

https://stackoverflow.com/questions/27463831/android-sharedpreferences-get-all-strings-with-same-key,

https://stackoverflow.com/questions/71466089/save-nested-objects-in-shared-preferences,

https://docs.flutter.dev/data-and-backend/serialization/json,

#MobileAppDevelopment #NewBeginnings #TechJourney #FromScratch

By: David Giametta

Leave a Reply

Discover more from Bias To Action Software

Subscribe now to keep reading and get access to the full archive.

Continue reading