
Droidchef
35 FOLLOWERS
Ishan Khanna is a multi-award-winning software engineer, content writer, and international tech speaker with over a decade of experience.
Droidchef
2y ago
In this tutorial, you'll learn how to create a custom progress bar with Jetpack Compose Canvas API. The end result looks like the image below.
Steps for Creating Custom Progress Bar with Jetpack Compose Canvas API :
Declaring a canvas
Understanding the drawArc Composable API
Drawing an arc for the background
Drawing an arc for the foreground
Drawing a circle
Positioning the circle on the arc
Assumptions
The radius of the circle is Half of the Height of the Widget.
The color for the background arc will be #90A4AE
The color for the foreground arc will be #4DB6AC
The color for the circle on t ..read more
Droidchef
2y ago
Understanding the Math Equation of a Circle
Before we jump to the code, let's get a small lesson on how are circles represented in a polar coordinate system.
Imagine a circle with a radius r at the Origin. The circle's center can be depicted as (0,0) and (0,r) is a point on the circle.
Another way to represent this point on the circle would be
𝑥=𝑟 sin 𝜃, 𝑦= 𝑟 cos 𝜃
Here 𝜃 is the angle in radians.
Now that we know how to represent a point on the circle, let's translate this into some Kotlin code.
Writing the Code
fun printPointOnTheCircle(thetaInDegrees: Float, radius: Float, cX: Float, cY ..read more
Droidchef
2y ago
Introduction
The Per-App Language Preferences is one of the latest additions to Android 13. What does this mean? For instance, if the default language of your phone is English. You can set Hindi as a language for an app and Spanish as another. This saves the hassle of changing languages back and forth on your device.
Getting Started
For this tutorial, you will build a simple app that greets you in your language of choice. Here is a demo of the app
Setting Up The Project
There are two things to keep in mind to get this working:
Your project has to compile with "android-Tiramisu" SDK.
⚠️
T ..read more
Droidchef
2y ago
In this article, you'll learn how to use Dagger for conditionally provisioning (providing) your dependencies without adding stress to your memory.
As your product grows. You often start trying out new things with it. Since we don't always know what'll work best for the users, we often try multiple strategies to solve a problem. This is done through some sort of an A/B test. However, this comes at a cost. The cost is that two distinct solutions exist in the same version of the app, to solve one customer pain point. Let's try to see it through a lens of an image editing application.
Introducing ..read more
Droidchef
2y ago
Introduction
Wanted to connect my Android side project to Kite Connect API (Stock Broker). The authentication mechanism to obtain an access token looks like this.
Since I don't have a web server I decided to use Firebase Cloud Functions to handle the redirect for the request token and exchange it for an access token that can be returned to the client. Let's get some configurations out of the way before we start writing the code.
Prerequisites
Kite Connect 3 Account
Firebase Account
This article assumes an intermediate familiarity with npm, Javascript, Kotlin, Firebase and Android.
Kite Con ..read more
Droidchef
2y ago
In this hands on tutorial, you will learn how to implement discord login on android using openID AppAuth SDK.
Introduction to OAuth
OAuth refers to an open standard for access delegation. Most of the applications now use it as a way to authenticate users into their platform. It takes away the need for users to have an identity on each app and instead allows them to use one identity in multiple places.
Technically speaking, the OAuth flow, in its simplest form, is only a bunch of network requests executed in a certain order with some specific parameters. Based on what happens during the flow ..read more
Droidchef
2y ago
This is a long story about a small trick I learned about using Regex with Find and Replace in the IDE.
Understanding Our Small Problem
I was writing a small python script to push make some requests to an endpoint for seeding my database.
I had my data in a json file so it was as simple as reading the json array and making a POST request with each JSON object.
Now while writing my function to convert the json event into the request Payload, I just copy pasted the Json object and made necessary changes, however python wasn’t happy about the “” to be used as the keys for my dictionary.
So what I ..read more
Droidchef
2y ago
This is a story about me accidentally crossing paths with the Stack API in Java and Kotlin. Whether you are a seasoned Java and/or Kotlin developer or are just beginning to test the waters. I promise you that by the end of this blog I will convince you to never touch the Stack class in Java/Kotlin even with a ten-foot poll.
Before we dive right in, let’s brush up our memory real quick so that we can enjoy the rest of the show.
What is a Stack?
In computer science, a Stack refers to a data structure for maintaining a collection of elements and it majorly supports these two operations:
push, w ..read more
Droidchef
2y ago
Introduction
Great to see you take an interest to understand the impact of dependency tree depth on your Gradle builds.
After you finish reading this article here is what you’ll take away, depending on where you are with your project setup
If you are new to the concept of modularization, you’ll have a better understanding of how to structure your dependencies when you modularize your project, to get faster Gradle builds.
If you are working on a modularized project, you’ll get insights to further improve your build times by shortening your dependency tree, to speed up your Gradle builds.
Acq ..read more
Droidchef
2y ago
Introduction
In the blue corner, we have Flutter. In the red corner, we have Jetpack Compose. These two titans have been locked in an epic struggle for supremacy ever since Google first announced Jetpack Compose in 2018. But who will come out on top? Let's find out!
The Blade Runner Scenario
In the original Blade Runner movie from 1982, humanity has developed a form of synthetically-created life that is so realistic, it's difficult to tell them apart from humans. These "replicants" are used for dangerous or otherwise undesirable jobs, and when they start rebelling against their human masters ..read more