Avin's Blog

A quick start to Kotlin

January 10, 2021

An introduction to Kotlin. Learn how variables, loops, functions, classes, etc work in Kotlin.

Android Basics: Settings - II

June 28, 2020

How to detect change in Android settings and how to add the current selection of a ListPreferences to its summary. In this post I go over how I implemented nSharedPreferenceChangeListener and added selected option as summary in the ListPreference.

Android Basics: Activity Lifecycle and the difference between UP vs BACK

June 21, 2020

Activities get killed or recreated all the time, knowing about the lifecycle of an activity can help us preserve state and data in events like our app being killed by Android, moving between Activities and screen rotations. In this post I give an overview of Activity Lifecycle, discuss the difference between UP and BACK in android and how I wasted a lot of time figuring out why the RecyclerView won't retain its data when moving between child and parent Activities.

Android Basics: Settings - I

June 05, 2020

In this post I go over how to create the settings screen we see on most of the apps and add a settings screen to the Github Repository App we have been working on.

Android Basics: Intents

May 30, 2020

What are Intents and how you can use them to go from one activity to another in your app or request some action from other apps.

Android Basics: Async Task

May 20, 2020

What is AsyncTask and how do we use AsyncTask to fetch data from Github API and display the fetched data.

Android Basics: Introduction and Setup

May 19, 2020

A series on topics that are essential for Android Development. We will go through Async Task, JSON parsing, Recycler View, Intents, Fragments, Android Lifecycle, Content Providers and so on. We will learn about all the topics by implementing them in the app.

Longest Arithmetic Subsequence [Python]

March 11, 2020

Given an array A of integers, return the length of the longest arithmetic subsequence in A. A sequence is arithmetic if A[i] - A[i-1] are same for all the i.

Max Profit with K Transactions [Python]

February 21, 2020

Given an array of prices of a single stock over multiple days, find the maximum profit you can generate in k transactions. You can only buy one stock and cannot buy again before you sell it.

Minimum Candies - Peaks and Vallies[Python]

February 10, 2020

There are N children standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the following requirements: Each child must have at least one candy. Children with a higher rating get more candies than their neighbors. What is the minimum candies you must give?

Minumum Number Of Jumps [Python]

January 31, 2020

Reach the last index in the minimum number of jumps. Each element in the array represents your maximum jump length from that position.

Four Number Sum [Python]

December 27, 2019

My solution to the algorithmic problem where we have to find all the sets of 4 numbers that sums up to a target number in an array.