Tag: androiddev

  • Make a monorepo for your Android projects

    Make a monorepo for your Android projects

    This post describes how you can share code between your side projects without code duplication, remote hosting or versioning.

  • Speed up your build: Non-transitive R files

    Speed up your build: Non-transitive R files

    Non-transitive R files became available to all modules in AGP 4.2. Non-transitive R files allow your builds to be incrementally faster and your AAB/APK’s smaller. This post will explain how to implement and build your app with non-transitive R files. Non-transitive what? In mathematics, non-transitivity is a property of binary relations that are not transitive relations.…

  • Using AdMob banner Ads in a Compose Layout

    Using AdMob banner Ads in a Compose Layout

    This is a real quick post to give you some pointers of how to use Google AdMob banner ads in an Android Jetpack Compose view layout. Right off the bat I want to say two things: 1- The AdMob team hasn’t got their library up to date (in terms of supporting compose), so it’s always…

  • Fix: Jetpack Compose observeAsState Type Error has no method

    This quick blog post helps you solve the error “Type state has no method getValue” when first starting to observe state on your ViewModel.

  • When is a Type not a Type? Kotlin in the IDE

    When is a Type not a Type? Kotlin in the IDE

    This article explains the ‘show type hints’ feature of IntelliJ. To get to see those sweet variable types you desire but not change any of the code conventions in your place of work.

  • Tame Your Gradle Dependencies just BECAUSE!

    Did you know you can specify a reason for using a certain dependency or certain version of a dependency? Yep it’s in the API here and referenced in the DOCS here. void because?(@Nullable String reason) Sets the reason why this dependency should be used. Since: 4.6 Below is a basic example of how its used:…

  • [TUT] Android Things – Alphanumeric Segment Display, I2C on the Rainbow Hat

    This post will explain how you can use the I2C protocol to output from your AndroidThings application. We’ll discuss the Raspberry Pi Rainbow hat and its actuators, in this case the 4-digit Alphanumeric Character Display which we’ll use to count down from 1000. Hardware Prerequisite: We have the Rainbow Hat connected to the top of…

  • [TUT] Android Things – Temperature Sensor, I2C on the Rainbow Hat

    This post will explain how to use the I2C protocol to get input into your Android Things application. We’ll discuss the Raspberry Pi Rainbow Hat temperature sensor which we’ll use to measure air temperature surrounding your pi. Hardware Prerequisite: We have the Rainbow Hat connected to the top of our raspberry pi. Software Prerequisite: An…

  • [TUT] Android Things – Piezzo Transducer, PWM on the Rainbow Hat

    This blog will show you how to play the Pokemon theme tune using the PWM protocol through the peripheral buzzer. We’ll discuss the Raspberry Pi Rainbow hat and its Piezo Transducer which is a buzzer that we can make play sounds, notes or noises. Hardware Prerequisite: We have the Rainbow Hat connected to the top…

  • [TUT] Programmatically create a RippleDrawable of any color

    This tutorial is going to be quick and to the point. When you want to create a Button or other Android Widget you more than likely want a ripple effect when it is pressed. I’ll show you how to do this. What we’ll do: – Create a simple RippleDrawable – Ensure it reacts to touch…

  • [TUT] How to test time and control System.currentTimeMillis

    This post explains how to control time and specifically control System.currentTimeMillis. To make your code more flexible, maintainable and in the end testable! Showing an example application that uses time to define different behaviour for the app in the morning and in the evening. Going on to unit test this in a robust manner. What…

  • Enchant your users, without boring them with repetition – Animations

    I hope you know the Android Design Principles, if not shh quick read them here. There is also a great talk on the principles from Google IO, so if you prefer video click this. Here I want to talk about animations in your application. Animations are great, they can create a delightful, enchanting experience. Animations…

  • [TUT] Front Camera Face Detection – with preview

    This is a continuation on my last face detection tutorial (here) that took you through the basics of retrieving the camera and giving user feedback when a face is detected. Including best practice when loading the camera, how to ensure you always release the camera when finished, get callbacks when faces are seen and when…

  • Arrow Logger – Log louder than everyone else

    Recently I’ve been playing round with a few libraries that people share based upon an api or service that they offer. These libraries offer access to data in a controlled way and more often than not require authorisation to use. When I’ve picked up the library I just want to start coding straight away and…