Logo

dev-resources.site

for different kinds of informations.

SharedPreferences Debugging: Unlocking the Developer Mode with Prefixer

Published at
4/13/2024
Categories
android
sharedpreferences
compose
debugging
Author
vishalgaur
Author
10 person written this
vishalgaur
open
SharedPreferences Debugging: Unlocking the Developer Mode with Prefixer

Hello, my amazing cohort of Android developers!

Do you remember the last time you were neck-deep in debugging, wishing there was a way to just peek into your app's SharedPreferences without plugging into the matrix of your development setup? Oh, what you wouldn't have given to simply tap your phone and instantly see what mischief current_visit_count is up to or if remember_me is really remembering you. đź’ˇ Well, now there's an Android library called Prefixer.

✨ What's Prefixer?

Prefixer takes the pain out of SharedPreferences debugging. I'm talking about the kind of ease and capability to change shared preferences – all from the comfort of your Android device. No more chains tying you to your system, no more elaborate rituals to simply check if a boolean is true or false. Just you, your app, and a seamless bridge to your SharedPreferences.

All Preferences Activity Edit Boolean Preferences Edit String/Number Prefs
Preferences View. Edit Boolean Preferences Edit String/Number/Floats Preferences.

🚀 Features That Spark Joy

  • Device Direct Access: Forget about the cumbersome tether to your development machine. With Prefixer, your SharedPreferences are accessible right on your device, providing you the freedom to debug on the fly.
  • Simple Yet Powerful: Launch a dedicated activity to display all stored preferences with a couple of taps, and jump into editing mode with a long press. It's like having a secret dashboard for your app's inner workings.
  • Developer Zen: This library is all about bringing peace to your development chaos, enabling you to focus on crafting fantastic experiences for your users, not wrestling with SharedPreferences.

đź›  The One Key Use Case That Changes Everything

Imagine you're out grabbing coffee, away from the safe harbour of your development setup, when you get an epiphany or need to squash a particularly sneaky bug. It could involve checking if current_visit_count is counting correctly or verifying the state of remember_me. Normally, you'd sigh, thinking of the debugging odyssey awaiting you back at your desk.

Enter Prefixer. 🧙‍♂️

With this library, the only thing you need is your Android device and a few taps. Launch the Prefixer activity within your app, and you're greeted with all your SharedPreferences laid out before your eyes. Need to make a change? Long press, edit, and boom – you're done. No cables, no laptops, just you saving the day, one SharedPreferences at a time.

🌟 Getting Started

Ready to embrace your new debugging superpowers? Here's how to get started:

Step 1: Let The Magic In

Add the glittering dust of Prefixer to your app by popping this into your module's build.gradle:

dependencies {
    implementation 'dev.vishalgaur:prefixer:1.2.0'
}
Enter fullscreen mode Exit fullscreen mode

Step 2: Wake the Wizard Within

Make Prefixer come alive with a simple incantation in your Activity or Fragment:

val prefixerInstance = Prefixer.initialize(applicationContext, "your_pref_file_name")
Enter fullscreen mode Exit fullscreen mode

Just replace "your_pref_file_name" with your own or summon the default SharedPreferences with null.

Step 3: Open the Gates

Whenever you feel the need to consult the oracles (a.k.a. check your SharedPreferences), just do:

val launchIntent = prefixerInstance.getLaunchIntent(context);
startActivity(launchIntent)
Enter fullscreen mode Exit fullscreen mode

And just like that, you're in.

🎉 Wrap Up: Join the Fellowship

Adding Prefixer to your development toolkit is like forming a fellowship with other developers who've chosen the path of ease and efficiency. It’s not just about the convenience; it’s about transforming the way we approach SharedPreferences debugging — together.

Check out the spellbook (a.k.a. the GitHub repo - Prefixer) for more details. Give a star, if you feel this can be helpful and can be improved more. Contributions, feedback, or magical insights are always welcome. After all, the strength of the fellowship lies in its members.
Happy coding, my fellow wizards! May your SharedPreferences always behave, and your debugging be as enchanting as ever.


Remember, in the grand adventure of coding, tools like Prefixer are your trusty companions, helping you navigate through the forests of development with a bit more ease and a lot less stress. Let's keep crafting spellbinding apps, shall we?

compose Article's
30 articles in total
Favicon
Getting Started with Android Testing: Building Reliable Apps with Confidence (Part 3/3)
Favicon
Getting Started with Android Testing: Building Reliable Apps with Confidence (Part 2/3)
Favicon
Our experience becoming a Compose-first app
Favicon
Building a subscription tracker Desktop and iOS app with compose multiplatform — Offline data
Favicon
Mastering @Stable in Jetpack Compose for Better UI Performance
Favicon
Do you still use version in Docker compose?
Favicon
Building a subscription tracker Desktop and iOS app with compose multiplatform—Providing feedbacks
Favicon
Self-host - Part 2 - Zero-Downtime Deployment using Docker Swarm
Favicon
Building a subscription tracker Desktop and iOS app with compose multiplatform - Configuring Notion
Favicon
How to create LazyColumn with drag and drop elements in Jetpack Compose. Part 1.
Favicon
Retro on "Docker Compose for Developers"
Favicon
CountryCodePicker in Compose Multiplatform for Android and iOS
Favicon
Coil and Ktor in Kotlin Multiplatform Compose project
Favicon
Adaptar Kotlin 2.0 en aplicaciones Android
Favicon
Building a subscription tracker Desktop and iOS app with compose multiplatform - Setup
Favicon
30-days plan to master Jetpack Compose with resources and three practice projects
Favicon
CMPPreference - Compose Multiplatform
Favicon
Introducing Compose Multiplatform Media Player: Your Go-To Solution for Seamless Media Playback
Favicon
QRKit — QRCode Scanning in Compose Multiplatform for Android and iOS
Favicon
SDP-SSP-Compose-Multiplatform
Favicon
Using docker compose watch with Node.js
Favicon
SharedPreferences Debugging: Unlocking the Developer Mode with Prefixer
Favicon
Navigation in Compose Multiplatform with Animations
Favicon
Introducing Backgroundable - Your Wallpaper Companion! 🌟
Favicon
Kilua - new Kotlin/Wasm web framework
Favicon
I've just open sourced N8
Favicon
One Minute: Compose
Favicon
State using Jetpack Compose
Favicon
compose middleware
Favicon
How to create my first Jetpack Compose Android App

Featured ones: