<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Vishal Gaur</title>
    <description>The latest articles on DEV Community by Vishal Gaur (@vishalgaur).</description>
    <link>https://dev.to/vishalgaur</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F531630%2Ff0625101-3dd9-44e5-b363-5df81c949e2e.jpg</url>
      <title>DEV Community: Vishal Gaur</title>
      <link>https://dev.to/vishalgaur</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vishalgaur"/>
    <language>en</language>
    <item>
      <title>SharedPreferences Debugging: Unlocking the Developer Mode with Prefixer</title>
      <dc:creator>Vishal Gaur</dc:creator>
      <pubDate>Sat, 13 Apr 2024 20:16:56 +0000</pubDate>
      <link>https://dev.to/vishalgaur/sharedpreferences-debugging-unlocking-the-developer-mode-with-prefixer-5dm1</link>
      <guid>https://dev.to/vishalgaur/sharedpreferences-debugging-unlocking-the-developer-mode-with-prefixer-5dm1</guid>
      <description>&lt;p&gt;Hello, my amazing cohort of Android developers!&lt;/p&gt;

&lt;p&gt;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 &lt;code&gt;current_visit_count&lt;/code&gt; is up to or if &lt;code&gt;remember_me&lt;/code&gt; is really remembering you. 💡 Well, now there's an Android library called &lt;strong&gt;&lt;a href="https://github.com/i-vishi/Prefixer"&gt;Prefixer&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  ✨ What's Prefixer?
&lt;/h2&gt;

&lt;p&gt;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 &lt;em&gt;boolean&lt;/em&gt; is true or false. Just you, your app, and a seamless bridge to your SharedPreferences.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;All Preferences Activity&lt;/th&gt;
&lt;th&gt;Edit Boolean Preferences&lt;/th&gt;
&lt;th&gt;Edit String/Number Prefs&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fes3v8lrfocqrrnwppz9r.png" alt="Preferences View" width="720" height="1600"&gt;.&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1shsnan6tt9ipdghvz4h.png" alt="Edit Boolean Preferences" width="720" height="1600"&gt;&lt;/td&gt;
&lt;td&gt;
&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9eel8ce4kfiquf34oej1.png" alt="Edit String/Number/Floats Preferences" width="720" height="1600"&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  🚀 Features That Spark Joy
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Device Direct Access&lt;/strong&gt;: 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.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Simple Yet Powerful&lt;/strong&gt;: Launch a dedicated activity to display all stored preferences with a couple of taps, and jump into editing mode with a &lt;em&gt;long press&lt;/em&gt;. It's like having a secret dashboard for your app's inner workings.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Developer Zen&lt;/strong&gt;: 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.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🛠 The One Key Use Case That Changes Everything
&lt;/h3&gt;

&lt;p&gt;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 &lt;code&gt;current_visit_count&lt;/code&gt; is counting correctly or verifying the state of &lt;code&gt;remember_me&lt;/code&gt;. Normally, you'd sigh, thinking of the debugging odyssey awaiting you back at your desk.&lt;/p&gt;

&lt;p&gt;Enter Prefixer. 🧙‍♂️&lt;/p&gt;

&lt;p&gt;With this library, the only thing you need is your Android device and a few taps. Launch the &lt;strong&gt;Prefixer&lt;/strong&gt; 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.&lt;/p&gt;

&lt;h2&gt;
  
  
  🌟 Getting Started
&lt;/h2&gt;

&lt;p&gt;Ready to embrace your new debugging superpowers? Here's how to get started:&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Let The Magic In
&lt;/h3&gt;

&lt;p&gt;Add the glittering dust of Prefixer to your app by popping this into your module's &lt;code&gt;build.gradle&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight gradle"&gt;&lt;code&gt;&lt;span class="k"&gt;dependencies&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;implementation&lt;/span&gt; &lt;span class="s1"&gt;'dev.vishalgaur:prefixer:1.2.0'&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Wake the Wizard Within
&lt;/h3&gt;

&lt;p&gt;Make Prefixer come alive with a simple incantation in your Activity or Fragment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="kd"&gt;val&lt;/span&gt; &lt;span class="py"&gt;prefixerInstance&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Prefixer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;initialize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;applicationContext&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"your_pref_file_name"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Just replace &lt;code&gt;"your_pref_file_name"&lt;/code&gt; with your own or summon the default SharedPreferences with &lt;code&gt;null&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Open the Gates
&lt;/h3&gt;

&lt;p&gt;Whenever you feel the need to consult the oracles (a.k.a. check your SharedPreferences), just do:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="kd"&gt;val&lt;/span&gt; &lt;span class="py"&gt;launchIntent&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;prefixerInstance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getLaunchIntent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nf"&gt;startActivity&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;launchIntent&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And just like that, you're in.&lt;/p&gt;

&lt;h2&gt;
  
  
  🎉 Wrap Up: Join the Fellowship
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;Check out the spellbook (a.k.a. &lt;a href="https://github.com/i-vishi/Prefixer"&gt;the GitHub repo - Prefixer&lt;/a&gt;) 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.&lt;br&gt;
Happy coding, my fellow wizards! May your SharedPreferences always behave, and your debugging be as enchanting as ever.&lt;/p&gt;




&lt;p&gt;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?&lt;/p&gt;

</description>
      <category>android</category>
      <category>sharedpreferences</category>
      <category>compose</category>
      <category>debugging</category>
    </item>
  </channel>
</rss>
