PCSalt
YouTube GitHub

PCSalt

Adds taste to your computing.

Tech tutorials on Android, Java, Backend Development, and IoT

Hi, I'm Navkrishna — I write about Android, backend development with Kotlin & Spring Boot, and hands-on IoT projects.

Android Java Kotlin IoT Architecture

Recent Posts

SharedPreferences in Android — The Complete Guide

Everything you need to know about SharedPreferences in Android — when to use it, how to save, read, remove, and list all stored values. All examples in Kotlin.

AlertDialog in Android — The Complete Guide

Everything you need to know about AlertDialog in Android — basic usage, selection dialogs, custom layouts, and button customization. All in Kotlin.

CQRS with Spring Boot, Kafka & MongoDB — Part 1: What is CQRS and why you need it

Understanding Command Query Responsibility Segregation, when it makes sense, and how Spring Boot, Kafka, and MongoDB fit together in a CQRS architecture.

Display Item Selected from AutoCompleteTextView in Chip

In this blog we are going to display a list of planets in an AutoCompleteTextView. The list of planets will...

Add Border to Just One Side of View

At some point there is a need to display a layout with border(s). And sometimes the border is required in...

BottomSheetDialogFragment — Disable Cancel on Touch Outside and Drag

Disable Cancel on Touch Outside & on Back press In order to create a BottomSheetDialogFragment which should not dismiss on...

Rearrange positive and negative numbers in an array — Java

Partition an array so all negative numbers appear on the left and positive numbers on the right, in-place with only one extra variable.

Convert JSON to comma-separated key=value pairs — Java

Recursively flatten a nested JSON object into a compact comma-separated key=value string in Java.

Add Badge Count to Navigation Drawer Hamburger Icon

NavigationDrawer provides easy access to menu functions. Sometimes the menu items have some actionable content available. To notify user that...

Migrate to Android Room with Date Column

Migrating our apps to Android Room from conventional SQLite Database was flawless except when we encountered issue with Date column...

Generate App Name with Version Code and Flavour Name

After a build is shared to a team or group of people, sometimes a question arises that what was the...

Detecting obstacle with IR (Infrared) Sensor Raspberry Pi 3

Concept: IR (Infrared) Sensor IR (Infrared) Sensor works by emitting infrared signal/radiation and receiving of the signal when the signal...

“Check if a string has balanced brackets — Java”

“Use a stack to check if a string has balanced opening and closing brackets. Handles parentheses, square brackets, and curly braces.”

== vs equals() in Java — What's the difference?

Understanding the difference between the == operator and equals() method in Java, and why using the wrong one leads to subtle bugs.

Product Flavors in Android

Environment plays a vital role in the application development. As per the requirements, we have to create few environments, viz....

Set Margins in DP Programmatically

Sometimes at runtime, it is required to set margin to a view. But, the problem is getting different size for...

EditText with Single Line, Line Wrapping and Done Action in Android

Regular formula for making an EditText- Single Line : no new line <Enter> allowed,- Line Wrapping : Single line wrapped...

Android Studio for Android App Development

In Google I/O 2013, Google revealed an IDE - Android Studio - especially designed for Android Application Development. That time,...

Copy to Clipboard Programmatically

Clipboard is a type of register where copied contents are kept by Android. If you require to keep some text...

JSON Parsing

The last post XML Parsing using SAXParser was about parsing a web service providing XML. In this post we are...

Create List Using ListView

Update: Instead of using ListView now you should start using RecyclerView. If you are unfamiliar with RecyclerView then you can...

String Concatenation in Java — concat() vs + vs StringBuilder

Understanding the real differences between concat(), the + operator, and StringBuilder in Java — what actually matters and what doesn't.

Add EditText Programmatically

Sometimes it is the requirement of the program to add EditText programmatically. The following code can be used to add...