RSSAmplifier

Blog

helw.net

Recent content on helw.net

helw.netRSS feed ↗338 posts

Latest posts

Fun With Sliders and Compose

I noticed a pretty neat UI interaction in Ayah for iOS that I wanted to
see if I could replicate in Android. 
 
 
 Your browser does not support the video tag.
 


 You’ll notice a few different things here: 
 
 on pressing the thumb, the search and jump buttons disappear, and the track expands. 
 when the track expands, the thumb sometimes moves…

Running Android Auto on an Emulator

The desktop-head-unit is used for testing Android Auto apps, typically in conjunction with running on a physical device and then running desktop-head-unit --usb . What if we want to test an Android Auto app without a physical device? 
 The Android Auto version that can be seen on Google Play emulators says that “This app isn’t compatible with your device anymore.” Some time…

Compose UI without an Activity

Recently, I needed to add a custom marker to a MapLibre map with the upcoming street name, while respecting various rules (supporting RTL, etc). Inspired by our iOS team, I solved this by writing the street name marker code in Compose, and then taking a screenshot of the Composable on demand and rendering it to the map. This solution worked well, and everything was great until I wanted to show the…

Arabic Numbers and Regions

In Android 16, I noticed that my apps that explicitly tried to show Arabic-Hindi numerals (٠, ١, ٢, ٣, …), were now showing Western numerals (0, 1, 2, 3, …) instead. This happened irrespective of the phone’s primary locale. 
 
			 Android 15, api 35 
		 
 

 
			 Android 16, api 36 
		 
 
 
…

Quick Notes about Edge to Edge

When upgrading an app to target Android 15 ( targetSdk 35 ), edge to edge layouts are enabled by default . While the documentation about doing this for Compose and Views is very detailed and has everything needed for the migration, I want to call out some quick points that weren’t immediately obvious (or that I missed in the documentation the first time). 1 
 Android 29 and Below 
…

Pitfalls when working with KMP Strings

Alternative Title: “One cannot simply use string indices from Kotlin in Swift.” 
 One of the apps I am working on uses Kotlin Multiplatform for the business logic, and then has a specific Swift UI implementation for iOS and a Compose multiplatform implementation for other platforms. I built a fairly complex search feature that outputs a list of search results, with each result…

Scaling Android without a Monorepo

Abdulahi and I gave another talk this year at Droidcon NYC . This one talks about how to scale Android development without a monorepo. The talk discusses various topics, including: 
 
 building an architecture to support an app spread out over many repos 
 binary compatibility 
 tooling to understand changes to the dependency tree 
 
 The video is here , and the slides can…

Single Gesture Interaction between Multiple Composables

Introduction 
 Recently, I spent some time trying to replicate a gesture I liked on iOS 1 . I had a simple button where, if you long press it, a menu shows up from which an item can be selected. On the iOS app, you could select an item from this menu in a single gesture. By long pressing the button and not letting go, you could drag your finger to the item and select a menu item in one…

Tidbits About Compose Web

Compose on the web has always fascinated me. It’s always been really cool to take a working application on Android and have it run with minimal changes on various other platforms, including the web. While I’ve written about it in the past and show cased it in talks , it’s always been a toy of sorts for me. 
 This changed one day when I wanted to write a tool for visualizing…

Server Driven Ui from a Design System

My coworker Abdulahi Osoble and I recently gave a talk at Droidcon NYC about how to use a design system to make building Server Driven UI easier. We go through the motivations and building blocks, along with architectural decisions that need to be made along the way. 
 The video is here , the slide deck is here , and the accompanying open source repository is here . The repository is my…

Performance when Scripting with Kotlin

Not too long ago, I came across Kaushik’s blog post and repo about Kotlin scripting. Around the same time, I was trying to automate a process of cleaning up some images I had. Given a set of transparent pngs, I wanted to find out if the last line was a solid line, and, if so, and if nothing is touching that line, remove it. While typically, I turn to using Pillow and Python for image…

Using Compose on the Web without Wasm

At KotlinConf this year, JetBrains announced that Compose for Web will be powered by WebAssembly . The example repository was very compelling, showing that a composable function can now be written on Android and shared across to iOS and web. I quickly got to work updating one of our internal projects to support this and was able to get it working fairly quickly. My coworker, Efeturi , said,…

Tips for Safely Migrating From Gson to Moshi

Several people have already written about their journey migrating from Gson to Moshi . So why write this post? While migrating a fairly large project to Moshi, my team learned a few things (and came up with a few simple tools) that made it safer and easier to do this migration. Some of these points were either mentioned in passing in the aforementioned articles, or were skipped over altogether,…

Kotlin Multiplatform - Beyond iOS and Android

A little over a year ago, I gave a talk about building a PrayerTimes mobile application for iOS and Android using Kotlin Multiplatform some time ago. I recently gave a second talk about expanding this application to run on a plethora of other platforms (desktop, web, macOS, Linux, watchOS, iOS using Compose). You can watch it here and see the code on GitHub .

Fixing Build Regressions

In a previous article , I talked about writing profiler-util , a tool I open sourced for visualizing build performance over time for personal projects (it interops the files generated by gradle-profiler and uploads the data to a Google Spreadsheet, along with providing tools for detecting regressions). 
 I typically run gradle-profiler on my personal projects every handful of PRs, especially…

Android Resource Cleanup

As an Android code base grows and has increasing code churn, unused resources are very likely to exist. While Android Studio has an option for cleaning up and removing unused resources, there are some reported bugs in this functionality that are still not fixed. 
 I started searching for another solution for finding and cleaning up unused resources in Android projects. I found this project ,…

Productive Mobile App Development

I gave a talk at The Assembly in Dubai about tips and tricks for productively building mobile applications. In it, I discuss experimentation, catching issues earlier in CI/CD, multiplatform, and various other topics. Here are the slides . 
 
			 
		

Visualizing Gradle Build Perf Over Time

Monitoring Gradle Build Speeds for Smaller Projects 
 Today, there are many great articles and videos about how to optimize Gradle performance for Android builds. Larger companies watch these metrics closely, since build time translates into money. These two comics sum up the situation pretty nicely. 
 I write and maintain several of my own Android applications. This got me to thinking…

Finding out why a Dependency was Requested

I wanted to write a short post about how to find the reason for a particular version of a dependency to be selected by Gradle. 
 Today, while building our app, we started getting this error: 
 The minCompileSdk (31) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion…

Building a PrayerTimes App in KMP

I gave a talk about building a PrayerTimes mobile application for iOS and Android using Kotlin Multiplatform. The talk is mostly a live coding talk in which we write a simple PrayerTimes mobile app from scratch. Under the hood, the app is using a Kotlin Multiplatform port of the BatoulApps Adhan library. In addition to the video, you can see the code on Github here , and the (very short, 10 slide)…

Aggregating Annotation Processors Across Repos

Note - A plethora of excellent articles and talks describing how to write an annotation processor exist - consequently, this blog post will not talk about the details on how to build an annotation processor. Instead, it addresses a specific case that I had a much more difficult time finding answers for online and a strategy for solving it. 
 Scenario 
 Suppose we are shipping an app with…

Building a SuperApp

One of the interesting projects I worked on this year was building Careem’s SuperApp. To do this, we combined Careem’s main two applications, the RideHailing application and the Food deliveries application, into a single app. This may sound simple at first, but it is actually an interesting problem with many layers to unravel. 
 I gave a talk about this at 360|AnDev this year. You can find the…

Multithreading in Kotlin Multiplatform Apps

update - i did a small presentation about this as part of TouchlabShare - you can watch the video here . 
 In the past few days, I began looking at multithreading in Kotlin Multiplatform more carefully when I started a new iOS/Android project that I wanted to share business logic for. I realized that, despite understanding the rules of multithreading in Kotlin Native, I didn’t fully grasp the…

Kotlin Default Interface Methods and Binary Compatibility

TL;DR - adding default interface functions in Kotlin constitutes a source-compatible (but not necessarily a binary-compatible) change. 
 Whenever I used to run across issues mentioning binary compatibility, I used to always think, “this is super interesting, but that’s for library developers, I don’t have to worry about this while working on apps.” Little did I know how wrong I was. 
 This…

Your Multiplatform Captain Has Arrived

I gave a talk at KotlinConf 2019 about what we
learned sharing code between iOS and Android using Kotlin Multiplatform at
Careem. Here are the slides . 
 
			 
		

ViewPager2 under the Hood

Today, Google released the first alpha of ViewPager2 . I had been looking at the code as it was developed in the Android X repository for a while now, and wanted to write a bit about how it works. 
 Motivations 
 ViewPager2 builds on top of the versatile RecyclerView to make ViewPager2 a worthy successor to ViewPager . 
 Per the release notes , there are 3 major features that…

Emulator Snapshots Save a lot of Time

One of the features of the Android emulator that I knew about but never used until recently is snapshots. The snapshot feature lets the emulator save its current state (including the state of the file system, installed apps, etc) and lets the developer reload it again at any time. 
 This feature is amazing for testing upgrades and fixing upgrade related issues. Install the old version of the…

AppCompat View Inflation

Today, it’s likely that most newly written Activity s extend AppCompatActivity . The fact that it adds backwards compatibility has made life significantly easier for us as Android developers. Yet, how does it work? Specifically, how does it replace a TextView in a xml layout with an AppCompatTextView ? This post aims to do a deep dive into one aspect of AppCompatActivity - view inflation. 
…

I See Continuous Improvement

I gave my second talk at droidcon dubai this year with my coworker, Oubai Abbasi. We spoke about the importance of continuous integration on Android, along with some of the nice things that it can help catch and that you can do with it. Here is a link to the speakerdeck . 
 
			 
		

runtime generics in an erasure world

as we already know, generics in java are a compile time concept to help
enforce type safety. during compilation, type erasure kicks in, resulting in
the underlying bytecode being free of any generics information. 
 sometimes, however, we need generics information at runtime (such as when we
need to convert a json string into its object form, for example). i was
curious, how…

3 things i learned about rxjava 2 subjects

intro 
 sometime in late december or early january, i decided to write a blog post per month. since it’s january 31st, i figured i should write about something to avoid dropping the ball so early in the year. 
 i introduced one of my friends to rxjava 2 not too long ago - his initial reaction was, “what? why would i want this?” - a few days later, it turned to, “hey, this…

haramain updates

it’s been a while since i first wrote about Haramain . there have been some pretty massive updates recently that i wanted to briefly write about here. 
 an app for iOS 
 i’ve wanted to release an app for iOS for a long time now, and unfortunately never got around to doing so. i thought Haramain was a good candidate to be a first app, and so august 29th of this year, i finally…

rxjava and a synchronous main thread

not too long ago, someone pointed me to this blog post about keeping your main thread synchronous. it referenced Ray Ryan’s excellent talk about the matter. the talk and blog post lead me to a set of investigations, which prompted me to write this blog post. 
 quick note: why keep the main thread synchronous 
 if you are curious as to the kinds of problems that can occur if the main…

rtl on Android

i gave my first talk at droidcon sf this year.
the talk was about RTL on Android. check it out if you haven’t already (the
slides are here ). 
 
			 
		

on LinearLayout measures

seeing that LinearLayout is one of the most often used ViewGroup types in Android development, i wanted to write a little bit about how LinearLayout measures its children (this was also inspired by Sriram’s post about Custom ViewGroups ). 
 tldr; (key takeaways that this post will discuss): 
 
 a (non-nested) LinearLayout will measure each non-hidden child either 1x, 2x, or 3x ( gone…

intellij structural replace

intellij’s structural search and replace is an amazing feature that can save a lot of time. the value of this feature first hit home in the excellent Android Studio for Experts talk during Android Dev Summit 2015 (excellent video if you haven’t already seen it, btw!) 
 today, i was trying to replace my usages of android.util.Log.* with Timber . to use Timber, we’d need to…

quran android no longer open source

update - as of 12/31/2015, i’ve re-open sourced the app after the discussion
 here . 
 today is a very sad day for me, since i have finally decided to close quran android’s source code once and for all. throughout the past few years, i’ve come across several examples of people republishing the app with the intention of making money (placing ads on the index page, or,…

migrating to hugo from hexo

i haven’t written in a long time. it’s not that i have nothing to write about
(i actually have a set of post ideas written somewhere), but more of just not
having the time for writing. 
 just yesterday, after seeing a fellow developer’s new blog based on jekyll, i
decided to search for a nicer theme for this blog. in the process, i came
across hugo , a…

mouse scrolling with RecyclerView

i’ve recently began using RecyclerView in some of my projects, and one thing that stood out as being broken was that mouse scrolling no longer worked. while this is perhaps only a theoretical issue, it is fairly vexing when developing on an emulator, especially while dealing with long lists of data. i’ve opened a bug about it. 
 this is solved by using onGenericMotionEvent . as per…

haramain for android

one of my favorite sites on the web is haramain recordings . haramain recordings posts the latest prayers from masjid al haram and masjid al nabawi on a daily basis (every fajr, maghrib, and isha salah, along with jum3a khutbas, salat al tarawee7, and more). 
 because i found myself visiting haramain recordings very frequently, i started thinking, “it would be really great if i could…

ripples with probe

today, i was having a discussion with Mostafa Gazar about android animations and his Widgets library, and Lucas Rocha’s probe project came to mind. 
 i decided to experiment and see if i could use probe to automatically add a ripple effect to a set of views without having to touch existing code. turns out it’s fairly easy to do! i did two separate implementations. 
 
 
…

saudi matches 1.0.1

not too long back, i posted about euro matches . earlier this year, we also pushed saudi matches . it includes a new ui, new features, and so on. saudi matches was done in conjunction with Khalid Sudairy , Bandar Raffah , and Taylor Ling . 
 
 
 
 you can download it here .

quran plugin for alfred and launchbar

several months ago, i posted a plugin for searching the quran with alfred. i was playing with launchbar 6 recently, and while trying to figure out whether i want to use alfred or launchbar, i decided to write a plugin for searching the quran,
with suggestions, for launchbar. 
 
 download the launchbar plugin 
 i also decided to update the plugin for alfred (to have autocomplete).…

migrating from octopress to hexo

it’s been a long time since my last blog post, but i am hoping to become better about blogging. anyhow, the other day, i found nikola , a python blogging engine. i played with it and thought, “it would be cool to migrate my blog to it.” someone had written a migration script from octopress, and so i played with a migrated version locally. 
 unfortunately, some things (like…

quranicaudio.com web update for ios7

since ios7 brings such a huge change to the ui of ios, i’ve updated the web interface for quranicaudio.com for the iphone. here are the before/after pictures: 
 
 
 
 this was made a lot easier thanks to ios7 templates . i realize that there is no support for android at the moment, but insha’Allah will hopefully get to this eventually since it is important to do (and…

quran android 2.4.0

quran android 2.4.0 should be going live shortly insha’Allah. the most notable changes are tablet support while reading, better images for the s4/htc one, support for multiple sdcards, and various improvements. 
 


euro matches for android

the latest project i’ve been working on is matches for android, done in conjunction with khalid al sudairy, batoulapps, bandar raffah, and taylor ling. the app is free and can be downloaded from the google play store here . 
 
 


qamardeen for android


 
 another thing i didn’t get a chance to write about earlier is the public beta of qamardeen for android . qamardeen is an application that lets you “taste your islam.” i think the official qamardeen page gives a pretty good explanation of what it is and how it is useful. 
 the android version uses a whole slew of custom views to make the views appear the way they do (while making it…

quran android 2.x

quran for android has seen many changes before ramadan in bringing up the 2.0 release. i just wanted to highlight some of them here, seeing as though i have blog posts talking about other releases of quran android. 
 what’s new? 
 
 complete code re-write to make the code cleaner and easier to maintain. 
 fragment based architecture - pages, translations, bookmarks, etc are all in…

double standards

tl;dr edition 
 
 to any egyptian reading this - vote for whoever you think is best for egypt’s future, but in the process, never forget the importance of respect and character in such difficult times. i find these verses particularly relevant to the situation in egypt today and important for every egyptian to contemplate over (irrespective of who they support in the elections).…