Once software projects grow in size it becomes more and more difficult to keep the code clean and you quickly lose sight of the overall architecture.
Android development makes no exception.
After working on several projects, I noticed that Alert Dialog code was spread in all my applications, and I started to replicate code to redefine the same type of custom Dialog here and there.
As many programmers already know, the first good practice of our job is to avoid code repetitions by applying the Don’t Repeat Yourself (DRY) principle.
Also, another issue was the fact that by clicking fastly…
A few months ago I decided to widen my developer knowledge by learning a new web application stack.
There are a lot of different frameworks and technologies to choose from, but after a little research, I picked the MERN stack.
The MERN stack is a very popular and widely used full-stack development stack.
It is based on:
The main reasons why…
UserDefaults in Swift is a class that provides an interface to save key-value pairs in a user’s stored database.
You can use it to save values that are instances of property lists, like NSData, NSString, NSNumber, NSDate, NSArray, or NSDictionary.
In this article, I’ll give you a brief introduction on how UserDefaults works and guide you in the creation of a Singleton class, that will manage all the UserDefaults’ related operations in your iOS application.
UserDefaults are mostly used to save app settings or user’s preferences.
UserDefaults has two types of methods that will allow you to store values persistently…
SharedPreferences is an interface used for accessing and modifying preference data in Android.
It handles objects that point to a file containing key-value pairs and provides some methods to read and write them.
You can use SharedPreferences to store primitive types (Int, Float, Long, Boolean, String, and Set of Strings).
In this article, I’ll show you how to implement a simple Kotlin class that will allow you to manage SharedPreferences easily across your Android application.
First, create a file called Prefs.kt in your project directory and declare a class constructor in it, receiving a Context as a parameter. …
Just a regular guy who loves to code and learn 💻📚 Mobile & web developer from Italy.