Image for post
Image for post

Recording videos in Android used to be a very involved task where it was necessary to write a lot of boilerplate code to initialise the camera and then keep control of the video state and its metadata.

With the introduction of CameraX to Android Jetpack, it only takes a few lines of code to get that going. Let’s build a video recording application.

You can download the code for this project in this repository if you just want to see it running and not follow along.


In Android Studio create a new project with an empty activity.

On the next screen give your project a name, I called mine Droidagram and made sure to check the Use androidx.* artifacts. I will be using Kotlin here, but you should feel free to use Java if you like typing more code. …

Image for post
Image for post

Handling configuration changes in Android can be a tricky subject. Configuration changes happen when you close an application, but also when you change the device’s orientation for example.

Historically it’s been common practice to use onSaveInstanceState so your data survived configuration changes. The drawback to this is that using this doesn't allow for storing much data about the view.

Let’s look at an example app that we’ve built that generates a random number between 1 and 42 when the application starts.

Running that application should give us a result like this:

Image for post
Image for post

Great, we’ve been able to do this by writing the following code and calling that method from our…

Image for post
Image for post

I dread the idea of having ever to change my phone number. Be it because I’m getting spammed, or because someone thinks it’s a good idea to call me during the night every night for the…rest…of…my…life. I’d much rather throw away all my business cards with a disposable phone number than to dispose of my real phone number which I had for 15 years now.

To make sure we never have to dispose of our real number, today we are going to look at how to provision new phone numbers that you can give out to people or put on your business cards without leaving the Twilio Console. …


Marcos Placona

Marcos Placona is a developer evangelist @ Twilio. He spends most of his time working with Android and .Net open source projects.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store