Categories
Mobile Programming

How to fix the “Android emulator crashes when I take a screenshot” bug

The Android emulator for the current stable version of Android Studio (“Arctic Fox” 2020.3.1 Patch 3, built on September 30, 2021) has a bug that could be a problem if you write articles or document apps: When you press the “screenshot” button (the one with the camera icon), it quietly crashes. The application shuts down without an error message, and it doesn’t save a screenshot.

I rely on the emulator’s “take a screenshot” feature in my developer advocate job, so this was a big problem for me. Luckily, I found a fix.

This bug will eventually get fixed, but until that time, the workaround is to update the emulator to the version in the “Canary” build, Android Studio’s leading-edge preview. You don’t have to download the Canary build for all of Android Studio — just the emulator. I’ll show you how to do it in the following steps.

Step 1: Temporarily change Android Studio’s update channel to “Canary”.

Tap to view at full size.

Open Android’s Preferences window, expand the Appearance & Behavior menu, and then its System Settings sub-menu, then select the Updates item.

In the Automatically check updates for menu, select Canary Channel, then click the Apply button.

Android Studio is now set up to get its updates from the Canary Channel, which is where the pre-beta versions of upcoming versions live.

Step 2. Download the Canary Channel version of the emulator.

Tap to view at full size.

Select Android SDK from the left menu, then click the SDK Tools tap in the right pane.

Check the Android Emulator checkbox in the list of SDK tools, and then click the Apply button.

You’ll be presented with this dialog box:

Tap to view at full size.

Click OK and let Android Studio do its thing:

Tap to view at full size.

When the process is complete, you’ll see that you have the 31.1.3 version of the emulator:

Tap to view at full size.

At this point, you’ll have a version of the Android emulator that doesn’t crash when you take a screenshot.

Step 3: Change Android Studio’s update channel back to “Stable”.

Tap to view at full size.

You can stay on the Canary channel if you like living on the bleeding edge, but most of us are better off with Android Studio getting its updates from the Stable channel.

Go back to the Updates screen, select Stable Channel, and click the Apply button and then the OK button.

Categories
Mobile

What the Wendy’s and T-Mobile phone deals tell us about the state of mobile in 2021

Wendy’s Canada: A free Samsung Galaxy A11

Wendy’s — at least the Wendy’s in Canada — has a phone, and they’re giving away one every day!

https://twitter.com/WendysCanada/status/1442466554168414209

The Canadian mobile tech site MobileSyrup reports that it’s a Wendy’s-branded Samsung Galaxy A11, which is one of the better “starter” phones, especially where the camera is concerned.

For those of you like reviews, Android Authority called it a “a solid starter” in their August 1, 2020 review, while Android Police recommended that you should only buy it on sale in their April 15, 2021 piece.

If you prefer specs, the A11 is powered by an older chipset, the Snapdragon SDM450, with octa-core 1.8 GHz Cortex-A53 and Adreno 506 GPU. You can see its full specs on GSMArena.

T-Mobile U.S.: A free Samsung Galaxy A12

I unexpectedly got a free phone — complete with free line! — from T-Mobile last month. I was there to add a line to my plan for someone in my family, and it turned out that I chose the right time. It was during one of those promotions where if you added a line to a plan, they’d give you an extra line that’s free of charge forever and with a free phone!

They asked if I wanted one, and after confirming that it wouldn’t cost me anything extra, said yes.

The free phone is a Samsung Galaxy A12, the successor to the A11 that Wendy’s Canada is giving away. T-Mobile currently offers both phones at the same price: $180, which can be paid off over two years in monthly payments equal to the cost of a Big Mac meal with ice cream cone

As for the reviews, PhoneArena sums up the A12 with the title Cheap can be fun, ExpertReviews gets snarky by calling it A killer battery for a great price, and Android Police say that it’s Aging ungracefully.

The A11 uses the Mediatek MT6765 Helio P35 chipset, with octa-core (4×2.35 GHz Cortex-A53 & 4×1.8 GHz Cortex-A53) and PowerVR GE8320 GPU. You can see its full specs on GSMArena.

The A12 is going to be my new low-end Android test phone, and since it came with a free line, I now have another secret phone number (oh yes, I have a couple of ’em), which is very often a handy thing to have.

What these freebies tell us about the state of mobile in 2021

These phones sell for about $200, the low end of a price spectrum whose high end is about $1,200. Think about it: What other consumer category gives away freebies valued at 16% to 20% of the top-of-the-line versions of the product?

These free phones live in the sweet spot where:

  • They’re cheap enough to give away,
  • yet valuable enough that customers feel that they’re getting an amazing deal when they get one for free.

In the case of the T-Mobile deal with the A12, I got an additional free line for as long as I’m a customer — that’s something they’re willing to give away and write off as a marketing/customer loyalty expense.

According to Pew Research Center, 35% of Americans owned a smartphone a decade ago, which was a mere four years after the industry-changing iPhone keynote and three years after the introduction of the App Store. Smartphones had already moved out of the “early adopter” zone, but they were still in the “nice to have, but not absolutely necessary” category.

Today, 85% of Americans own a smartphone, and they’re now considered to be a necessity with a price for every budget.

Categories
Deals Hardware Mobile

Motorola phones on sale for Labor Day

If you’re looking for an inexpensive Android phone for doing development work or testing, or just as a phone, Motorola, my go-to vendor for inexpensive Android devices is having a Labor Day sale!

Here are three of the phones that are currently on sale that I think would be good for someone who wants to get started with Android development. Yes, you can always use an emulator, but there’s no substitute for developing and testing on an actual device.

All of these devices are fully unlocked, which means they’ll work on any carrier. Motorola don’t include much junkware on their phones — it’s as close to stock Android as you’re going to get without buying a Pixel. All were released this year.

Motorola’s G line has always been a reliable way to get mid-level features at a starter phone price. If you want to get a device that performs at the level of the typical Android phone for users who live outside the G7 bubble (and let’s face it, that’s most of the world), or need to provide a workforce with a mobile computing device, you want this one.

  • Release date: January 14, 2021.
  • OS: Android 10
  • Chipset: Qualcomm Snapdragon 662 (11 nm). Here’s a list of phones that use this chipset.
  • GPU: Adreno 610. Here’s a list of phones that use this GPU.
  • Memory: 2 versions
    • 3 GB RAM, 32 GB “disk”
    • 4 GB RAM, 64 GB “disk”
  • Main camera:
    • 48 megapixel wide sensor,  f/1.7, (wide), 1/2.0″, 0.8µm, PDAF
    • 2 megapixel macro sensor, f/2.4
    • 2 megapixel depth sensor, f/2.4
    • Shoots 1080p video at 30 or 60 fps with gyro-EIS
  • Selfie camera:
    • 8 megapixel sensor, f/2.0, 1.12µm
    • Shoots 1080p video at 30 fps with gyro-EIS
  • Battery: Li-PO 5000 mAh

At the current discount price of $250, the Moto G Stylus is the phone on this list that provides the best bang for the buck. As its name implies, it has a stylus, and if you’re looking for a cheaper alternative to the Galaxy Note line (and a much better choice than the LG Stylo), give this one a look.

  • Release date: January 14, 2021.
  • OS: Android 10
  • Chipset: Qualcomm Snapdragon 678 (11 nm). Here’s a list of phones that use this chipset.
  • GPU: Adreno 612. Here’s a list of phones that use this GPU.
  • Memory: 4 GB RAM, 128 GB “disk”
  • Main camera:
    • 48 megapixel wide sensor,  26mm (wide), 1/2.0″, 0.8µm, PDAF
    • 8 megapixel ultrawide sensor, f/2.2, 118˚, 1/4.0, 1.12µm
    • 2 megapixel macro sensor, f/2.2
    • 2 megapixel depth sensor, f/2.4
    • Shoots 1080p video at 30 or 60 fps with gyro-EIS
  • Selfie camera:
    • 16 megapixel sensor, f/2.0, (wide), 1/3.06″, 1.0µm
    • Shoots 1080p video at 30 fps with gyro-EIS
  • Battery: Li-PO 4000 mAh

I’m including this phone in this list just to make this list of $500-and-lower phones complete. My personal recommendation is to pay $50 less and get the RedMagic 6R, which gives you Samsung Galaxy S21-level power.

At its normal price of $700, I’d say “no”, but at a $200 discount, I’d say “think about it”. You’re getting near-flagship level features at mid-level prices. This phone boasts a 144Hz screen refresh rate (good for gaming), a solid chipset, and cameras with great specs.

But still, I’d say that if you’re looking for maximum computing bang for the buck at this price point, you want the RedMagic 6R, which currently starts at $450.

  • Release date: September 2, 2021.
  • OS: Android 11
  • Chipset: Qualcomm Snapdragon 778G 5G (6 nm). Here’s a list of phones that use this chipset.
  • GPU: Adreno 642L. Here’s a list of phones that use this GPU.
  • Memory: 8 GB RAM, 256 GB “disk”
  • Main camera:
    • 108 megapixel wide sensor,  f/1.9, (wide), 1/1.52″, 0.7µm, PDAF
    • 8 megapixel ultrawide sensor, f/2.2, 119˚ (ultrawide), 1.12µm, AF
    • 2 megapixel depth sensor, f/2.4, (depth), 1.75µm
  • Video:
    • 4K at 30 fps
    • 1080p at 30, 60 or 120 fps
    • 720p at 960 fps
    • Gyro-EIS
  • Selfie camera:
    • 32 megapixel sensor, f/2.3, (wide), 0.7µm
    • Shoots 1080p video at 30 fps with gyro-EIS
  • Battery: Li-PO 5000 mAh
Categories
Hardware Humor Mobile

I keep one in my wallet

Categories
Mobile Reading Material

New book: “Androids: The Team That Built the Android Operating System”

Androids: The Team That Built the Android Operating System is a new book written by Chet Haase, a long-time lead on the Android UI toolkit team, and more recently, an Android developer advocate.

This article is part of the Android August series, in which I’m writing an Android development-related article every day during the month of August 2021.

Haase has been on the Android team since 2010, which is back when it was still considered to be the “wild card” in the race for mobile OS dominance. This gives him serious “in the room where it happened” cred, as well as access to people, photos, documentation, and other behind-the-scenes information about the creation of a operating system that now drives over 3 billion active devices today.

The original demo, written by Brian Swetland and Chris White and later enhanced by Fadden, showing a home screen and several apps (most of which were not implemented). It’s a far cry from a modern Android home screen.
The is the original demo of Android on a mid-2000s phone, showing a home screen and a selection of apps, most of which weren’t implemented at the time. Hey, it was a demo for a pitch! (Photo by Chet Haase)

Android wasn’t originally meant to be a phone OS. The original plan was for it to be an advanced OS for digital cameras, which were more common back in the early 2000s, and it’s the use case they presented to investors in early 2004.

It was later decided that the camera market wasn’t big enough, and that Android should aim for the same space occupied by the big mobile operating systems at the time: Symbian (the most popular mobile OS until 2010) and Windows Mobile. They courted Samsung and HTC, but in July 2005, Google made the prescient decision to acquire Android for $50 million. According to Wikipedia, this move was described in 2010 as Google’s “best deal ever” by their then VP of corporate development, David Lawee, to whom I reported during the dot-com era at OpenCola.

A Look Back at the First Android Phone, 10 Years Later | Digital Trends
The first commercially-available Android device: The HTC Dream, also known as the T-Mobile G1, released September 2008. (Creative Commons photo by Michael Oryl.)

Androids is an insider’s history of the Android operating system, but Haase also promises that it won’t be above a non-techie’s head:

Instead, it’s a history: It describes the events, stories, experiences, thinking, and decisions made by the Android team, most notably in the early days, well before the present-day concept of a smartphone existed.

Want to find more about the book? Check out these articles:

Want to get the book? There are a couple of ways to do so:

The book will also be available in paperback form.

The Connectory
Women Who Code: WWCode is a non profit that helps mid-career engineers get  promoted. | Y Combinator

Here’s another reason to buy the book: Haase is donating profits from the book to Black Girls Code and Women Who Code.

Categories
Mobile Programming

Learn how to build an Android app using MVVM

Last week, I pointed you to Tutorials.EU’s video tutorial, Everything You Need To Know About Retrofit in Android | Get Data from an API, which showed you how to build an app that accesses the Rick and Morty API using the Retrofit HTTP client for Android.

This article is part of the Android August series, in which I’m writing an Android development-related article every day during the month of August 2021.

This week, they expand on that tutorial by showing you how to clean up the project’s architecture by refactoring it so that it uses the MVVM (Model-View-ViewModel) architecture:

This video is the second in a series. In next week’s video, you’ll change the implementation so that it uses coroutines to perform tasks in the background.

Categories
Mobile Programming

Android’s Camera2 API

This article is part of the Android August series, in which I’m writing an Android development-related article every day during the month of August 2021.

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: