If you want to write an Android app that interacts with the camera beyond merely taking a picture or shooting some video, you’ll want to make use of the Camera2 API, which became available at API level 21 (a.k.a. Android 5.0, a.k.a. Lollipop), which goes all the way back to late 2014.
There are a number of recently published articles and documents that you can consult if you’d like to explore Camera2:
As I mentioned in the previous article in this series, the biggest development in the latest version of Android Studio (at least as far as I’m concerned) is that Jetpack Compose is now included, and therefore official.
Jetpack Compose is Android’s declarative UI, which puts it in the same general category as iOS’ SwiftUI or Facebook’s React.
Jetpack Compose is called declarative as opposed to imperative, which is often summarized as building UIs in a “this is what it should be like” way versus a “this is how it should be created”. It’s the difference between this…
// Imperative UI (Kotlin)
// ======================
val helloButton = Button()
helloButton.text = "Hello, World!"
val layout = Layout()
layout.add(helloButton)
The first one specifies, step by step, how to build a simple UI, while the second simply says “this is the UI I want”.
This is a brand new way to build Android UIs, and it’s expected to become the standard way. Now is you chance to get a head start, and the following links can be your first steps.
This article introduces Jetpack Compose in small steps, starting with a “Hello, World!” app. It goes from there to introduce key concepts such as state, modifiers, and layouts. Finally, you’re introduced to the list and are shown how to use it by building a list of famous comic book superheroes.
This new version packs a lot of interesting new goodies, but for me, the biggest development is built-in support for Jetpack Compose — the new declarative/reactive/state-driven way to build user interfaces — and the accessibility scanner for the Layout Editor.
To find out more, check out this video from Android Developers:
Mobile apps are often front ends for APIs, so one of the first things you should learn about Android programming after getting a reasonable grasp on the basics is how to access an API. If you’re at this stage, this is your lucky day: Tutorials.EU has just posted a new tutorial titled Everything You Need To Know About Retrofit in Android | Get Data from an API that shows you how to build an app that accesses the Rick and Morty API:
There are a number of Android libraries that you can use to access APIs, including OkHttp, Volley, and the one used in this tutorial: Retrofit.
Both OkHttp and Retrofit are creations of the digital payments and financial services company Square, whose work you’ve probably encountered when buying something. Both are HTTP clients, but when it comes to accessing APIs, you want to use Retrofit, because that’s exactly what it’s for.
This video is the first in a series. This first video will cover the basics of API access with Retrofit. There’ll be a second video where you’ll clean up the app’s architecture using the MVVM pattern, and then a third video where you’ll change the implementation so that it uses coroutines to perform tasks in the background.
I write apps for both iOS and Android devices, so I make it a point to own both an iPhone and an Android phone. Since I’m giving my current Android device, a Motorola One Hyper, to my father-in-law so that he has a mobile phone from the current millennium, I needed a replacement. This set of photos is of that replacement: the RedMagic 6R.
RedMagic, a sub-brand of Nubia, which was originally a sub-brand of higher-end phones from Shenzhen-based phone and telco equipment company ZTE, specializes in gaming phones. In addition to using the better CPU and GPU chipsets required for gaming, RedMagic also does a better job of packaging than you’d expect from many other Chinese phone companies who are competing solely on price.
Case in point: Compare the sleek RedMagic packaging you’ve seen so far to the box that my 3rd-generation Motorola G came in:
I peeled off the shrink wrap and opened the box to see this:
The RedMagic 6R packaging is layered in a manner similar to the iPhone’s. The top layer is a box, which I flipped over to open, as shown below:
In addition to the SIM tray ejection pin, the top layer box contained the following:
Its contents were the Quick Start Guide, a warranty card…
…as well as a basic case, contained within a protective envelope:
The case itself is one of those clear, pliable, “soft gel” ones:
The next layer contained the phone itself:
The phone’s thin protective plastic sleeve has a little tab that makes it easy to lift out of the box, which was a nice little high-end touch:
Here’s the front of the phone, which is still inside its protective plastic sleeve…
…and here’s the back:
Finally, I hit the bottom layer, which contained the AC adapter, a USB-C to USB-A charging/data cable, and a USB-C to 3.5 mm headphone adapter:
I knew that the RedMagic 6R came with a basic soft gel case, I decided to spend an extra 15 bucks for the hard case, which came in this box:
Here’s the case:
This may be my favorite Android unboxing experience of all time. It’s certainly a good deal more photogenic than the 3rd-gen Moto G unboxing experience:
Today, I’m giving you a quick entry for Android August:The Awesome Android Complete Reference repo on GitHub. This is a curated list of great Android development reference material, including tutorials, projects showcasing various architectures, third-party libraries, UI references, notes on performance and optimization, best practices, and more.
While you can buy Android video courses on Udemy and other places, don’t forget that there’s a good selection of great video tutorials for free. These are my current favorites.
If you’re new to Android development, chances are that you’ll actually be learning not one, but two different things simultaneously: the Android framework and the Kotlin programming language.
If you want a solid grasp of Kotlin, I can’t thnk of a better YouTube video than Donn Felker’s Kotlin for Beginners. The video is almost 10 hours long, but it’s quite thorough. Even experienced developers who are new to Kotlin will find it helpful:
My current favorite Android tutorial video on YouTube is Philipp Lackner’s Build a Simple Android App, which walks you through the process of building a “to-do list” app in just over an hour:
Straight from the Google mothership, Android Basics in Kotlin is a YouTube video-based course that tries to walk the middle road between teaching Android development and teaching Kotlin. It does this by having you build a set of apps.
If you’re into certifications, this course is designed to prepare you for the Associate Android Developer certification exam. Units 1 through 5 of the course are available, and there’s a Unit 6 coming soon!