Categories
Mobile Programming

What’s new in Android Studio Arctic Fox?

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 haven’t updated Android Studio lately, you may not be aware that the newest revision, codenamed Arctic Fox, has been released on the stable channel. That means that it’s the official current version of Android Studio.

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:

Categories
Mobile Programming

Learn how to access an API in Android with Retrofit

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.

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:

https://www.youtube.com/watch?v=FyqK1hbZ6Z4

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.

Categories
Mobile Podcasts

Recommended Android developer podcasts for 2021

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’re a regular podcast listener and an Android developer (or an aspiring Android developer), you’ll want to check out these podcasts. Not only are they informative, but they’re also active, or in other words, they’re still in the process of making more episodes. Add them to your playlist and deepen your Android knowledge!

Android Developers Backstage (171 episodes)

This is probably the longest-running Android developer podcasts. Hosted by Nick and Romain, two developers from the Android engineering team, Android Developers Backstage covers topics of interest to Android programmers, with in-depth discussions and interviews with engineers on the Android team at Google.

Jetpack Compose, the reactive data-driven UI toolkit for Android, has finally hit the 1.0 stage, and it’s included in the “Arctic Fox” release of Android Studio. It’s the hot new thing, and Android Developers Backstage is right on top of it, with several recent episodes covering different aspects of Jetpack Compose.

Fragmented: The Software Podcast (220 episodes)

For sheer volume of developer-focused episodes and topics, you can’t beat Fragmented, the Android-centric developer podcast hosted by Donn Felker and Kaushik Gopal. While they do talk a lot about Android, they focus on all sorts of topics that are relevant to software developers of all stripes, such as the importance of having a growth mindset, the importance of code conventions, the three things every developer needs to be able to do, growing an online presence in the software industry, and more.

Talking Kotlin (101 episodes)

I’m sure that there are still lots of Android developers out there who prefer to code in Java, but as far as I’m concered, Kotlin is the Android programming language. And wouldn’t you know it — there is a Kotlin programming podcast, and it comes straight from the source: JetBrains, the dev tool vendor behind Android Studio and Kotlin. Better still, it’s hosted by Kotlin’s best advocate, Hadi Hariri, JetBrains’ VP of Developer Advocacy.

Now in Android (43 episodes)

This is the official Android developer podcast, put together by the Android team. It provides summaries of what the Android team has been up to that you, the developer should know about. It covers library and platform releases, articles, videos, podcasts, samples, code labs — whatever seems relevant and interesting for Android developers.

Lately, there’ve been a number of episodes covering the beta version of the upcoming Android 12.

All About Android (535 episodes)

“All About Android” is aptly named: For over 500 episodes, they’ve been covering all sorts of Android developments — “the biggest news, freshest hardware, best apps and geekiest how-tos”.

POW! Samsung Developer Program (21 episodes)

Samsung, the people behind what’s considered to be the Android flagship phone, have a developer podcast: POW! The Samsung Developers Podcast. It’s hosted Samsung senior developer evangelist Tony Morelan, Sr..

The RayWenderlich.com Podcast

This is the official podcast of my friends at RayWenderlich.com, the premier mobile development tutorial site. RayWenderlich.com started off as an iOS dev tutorial site (it’s how I learned), but they’ve expanded to cover Android, Unity, and Flutter development, and so has the podcast.

Categories
Mobile Programming

Learn Android development by joining an Android Study Jam

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.

While you can learn Android programming alone and on your own, it’s often helpful to learn in a group setting, where you can ask questions, share ideas, and tackle problems together. That’s where Android Study Jams come in.

Android Study Jams are community events where people get together to learn how to build Android apps. Android Study Jam participants work through a curriculum created by Google that allows everyone to work at their own pace. These Jams are led by facilitators who organize events in their area and invite others to join and learn.

GDG SunCoast is the Tampa Bay area Google Developer Group, a group for developers and aspiring developers who are interested in Google’s developer technology. It covers everything developer-y that Google offers, such as Android, Java & Kotlin, Firebase, Progressive Web Apps with Polymer, Angular web apps, Google Cloud Platform), machine learning with TensorFlow and more.

GDG Suncoast has a regular online Android Study Jams session, and there’s one every Wednesday evening in August! They’re online, and they’re free — all you need is a computer that can run Android Studio (a Windows machine made in the last 5 to 6 years, or a Mac made in the last 10 years can do it). Check out their Meetup page, set aside an hour on Wednesday evenings, and learn some Android programming!

And in case you needed a reason to learn Android programming, check out these stats from ZipRecruiter:

Screenshot as of July 1, 2021. Tap to view the source.

If your interest is piqued, there’s an Android Study Jam this Wednesday.

Categories
Programming

Friday 5: Useful things for coders (March 26, 2021 edition)

Every Friday, I publish the Friday 5, a list of 5 links to useful things for coders.

In this week’s Friday 5: a site that catalogs VS Code’s surprising capabilities, a look at the darker corners of Go, background processing in Android, a full-text search in 150 lines of Python, and generating brighter and darker versions of color in JS.

VSCodeCanDoThat.com

Visual Studio Code is a far more capable editor than you might suspect, and the VS Code Can Do That?! can help you discover tips, tricks, and techniques to help you get the most out of this editor.

Each tip/trick/technique comes with a video showing the tip/trick/technique in action and a link to a more detailed description of the tip/trick/technique.

Check it out: VSCodeCanDoThat.com

Darker Corners of Go

The Go (golang) gopher holding a flashlight

Rytis Bieliunas writes:

While simplicity is at the core of Go philosophy you’ll find in further text it nevertheless enables numerous creative ways of shooting yourself in a foot.

Since now I have used Go for production applications for several years and on the account of the many holes in my feet I thought I’d put together a text for the fellow noob students of Go.

My goal is to collect in one place various things in Go that might be surprising to new developers and perhaps shed some light on the more unusual features of Go. I hope that would save the reader lots of Googling and debugging time and possibly prevent some expensive bugs.

Check it out: Darker Corners of Go

Background Processing in Android

Screenshot of Android app doing background processing

Here’s an article from the Auth0 Developer Blog, where I’m one of the writers/editors:

Android apps use the main thread to handle UI updates and operations (like user input). Running long-running operations on the main thread can lead to app freezes, unresponsiveness and thus, poor user experience. To mitigate this, long-running operations should be run in the background. Android has several options for running tasks in the background and in this article, we’ll look at the recommended options for running different types of tasks.

This article uses Java and covers threading, WorkManager, and AlarmManager.

Check it out: Background Processing in Android

Building a full-text search engine in 150 lines of Python code

Flow diagram showing text tokenization

If you’ve wondered how full-text search engines work and thought about building your own, this basic implementation in Python is worth trying out. In this article, you’ll build an engine that searches Wikipedia’s article abstracts and ranks them for relevance, and it’ll do so in milliseconds!

The article covers these major topics:

  • Collecting and formatting the data
  • Indexing the collected data (which includes stemming the words in the data to their basic forms)
  • Searching
  • Ranking results by relevance

Check it out: Building a full-text search engine in 150 lines of Python code

Generate Brighter And Darker Versions Of Color With JavaScript

Chart showing lighter and darker versions of the color redTinyColor is a fantastic JavaScript library that can help you out with a whole bunch of tasks when you’re working with colors. This article takes a quick look at this more-useful-than-you-might-think library.

Check it out: Generate Brighter And Darker Versions Of Color With JavaScript

Are there useful things for coders that should appear in the next edition of Friday 5? Let me know at joey@joeydevilla.com!

Categories
Uncategorized

Mobile developer news roundup #1: The phablet era, UX lessons from restaurants, Evernote’s 5% problem, Android and OpenJDK, and Solitaire’s secret history

We’re in the phablet era now

Chart: Time spent on mobile grows 117% year over year.

Click the graph to see it at full size.

Venture capitalist Fred Wilson looked at research firm Flurry’s State of Mobile 2015 report and took note of the chart above, which shows that the greatest growth in time spent on mobile came from “phablets” — those large phones that blur the line between phone and tablet — and wrote:

There’s not a lot new in this data to be honest, but it confirms a lot of what everyone believes is happening. We are converging on a single device format in mobile and that’s driving some important changes in usage. We are in the phablet era.

Everything I needed to know about good user experience I learned while working in restaurants

Waiter and cook working in a restaurant.

At the Neilsen/Norman Group’s blog, Everything I Needed to Know About Good User Experience I Learned While Working in Restaurants lists the many things that you can learn from restaurants and apply to your applications, from designing for both new and expert users to interaction design and error handling to community management.

If you’re not familiar with the Nielsen/Norman Group, they’re the “Monsters of Rock” of user interface and experience. Their principals are:

The cautionary lessons of Evernote’s “5% problem”

An out-of-focus Evernote icon.

Evernote used to be my go-to note-taking app in 2011. I worked across platforms, and I loved that I could start a note on my laptop, continue on my iPad, and then later make tweaks or addenda on my phone. But as time went by, it got buggier and increasingly less usable to the point where I abandoned it worse and buggier until I abandoned it in annoyance.

Their note-taking app got buggier as the company tried to expand so that they had offerings that would appeal to as many people as possible. Therein lay their problem: as their own former CEO put it, people at Evernote conferences would go up to him and say that they loved the platform, but used only 5% of what it could do. The problem was that there was a different 5% for every person. They spread themselves too thin, lost their focus, started half-assign their product lines, and in an attempt to please everyone, ended up annoying them.

Keep calm and carry on developing Android apps

The classic 'Keep Calm and Carry On' poster.

You may have heard that the ongoing legal battle between Oracle (who own Java) and Google (who own Android, which is Java-based) has led to Google’s decision to move from their proprietary version of the JDK to Oracle’s OpenJDK. You may be concerned, but you probably shouldn’t be. It may cause headaches for Google and Android mobile phone vendors, but as Android developers, it shouldn’t really affect you.

As Android developer and online tutor Tim Buchalka puts it:

We write our code accessing the same libraries, and things just work. Of course its going to be a decent chunk of work for Google to get this all working so that we dont have to worry about it, but if anyone has the resources to do it, Google do.

What do you need to do as an Android developer? Absolutely nothing, its business as normal! You dont need to change anything in your development process and it may well be that when Android N arrives you won’t have to either. So fire up Android Studio, and get back to coding!

A story you might not know about Microsoft Solitaire: it was created by a summer intern!

Screen shot of Microsoft Solitaire on Windows 3.1

Is Wes Cherry a bit annoyed that he never got paid to write one of the most-used applications of the Windows 3.x/9x days? He once answered “Yeah, especially since you are all probably paid to play it!”

Categories
Uncategorized

Pivoting is the sincerest form of flattery (or: What the Android team did when the iPhone was announced)

Photoillustration of a woman photocopying an iPhone.

Relax, Fandroids. I kid because I care.

Cover of 'Dogfight' by Fred Vogelstein.“As a consumer, I was blown away,” says Googler Chris DeSalvo in a quote from Fred Vogelstein’s book, Dogfight, upon seeing the now-legendary January 9, 2007 Stevenote when he unveiled the first iPhone.

“I wanted one immediately,” DeSalvo continues. “But as a Google engineer, I thought ‘We’re going to have to start over.’

According to the Atlantic article The Day Google Had to ‘Start Over’ on Android, an excerpt from Dogfight, Google’s big concern at the time was Microsoft. It made sense at the time: They seemed to be making the right moves. If you remember those days, Windows Mobile 5.0 was the third revision of their mobile operating system, and true to the general rule about Microsoft revs, it was finally good enough. They’d lined up an impressive array of nearly 50 hardware partners, including HTC, who’d end up shipping the most WinMo phones, and the big coup: Palm, whom they’d convinced to build phones that ran WinMo. Their OS featured mobile versions of Office. The industry rumblings were that Microsoft would end up eating away at the dominant phone OS player at the time, Symbian. “Microsoft comes out fighting when threatened,” the conventional wisdom said. “Remember what happened in the browser wars?”

Here’s what was considered to be the game-changer that would make Microsoft a serious mobile threat: the Palm Treo 700w

Palm Treo 700w phone

The Palm Treo 700w.

The best smartphones of the era followed a design template that had been defined years earlier by the Blackberry: screen at the top, physical keyboard at the bottom, augmented by some kind of device to move the cursor (first a scroll wheel, then a D-pad, and optionally, a stylus).

Then this happened:

(If you haven’t seen it before or in a while, watch it again. You can almost feel the audience’s excitement in the opening moments, as Steve teases them with hints of what he’s about to announce. You can also feel the envy when Google’s Eric Schmidt comes onstage at the 51-minute mark — remember that he was on Apple’s board then.)

From the article:

On the day Jobs announced the iPhone, the director of the Android team, Andy Rubin, was six hundred miles away in Las Vegas, on his way to a meeting with one of the myriad handset makers and carriers that descend on the city for the Consumer Electronics Show. He reacted exactly as DeSalvo predicted. Rubin was so astonished by what Jobs was unveiling that, on his way to a meeting, he had his driver pull over so that he could finish watching the webcast.

“Holy crap,” he said to one of his colleagues in the car. “I guess we’re not going to ship that phone.”

Another key quote, this time from Ethan Beard, one of Android’s early biz dev people:

“We knew that Apple was going to announce a phone. Everyone knew that. We just didn’t think it would be that good.

With the announcement of the iPhone, the Android project, whose members had been working “sixty-tp-eighty-hour weeks for fifteen months — some for more than two years” made a pivot whose effects we’re still feeling today. The BlackBerry-like phone that they’d been working on — codename “Sooner”, with a physical keyboard, no touchscreen, and a general “me-too” design — was pushed aside. They filed mobile phone-related patents galore in September 2007. The iPhone forced them to rethink the OS and phone design, and from that came a new design, codenamed “Dream”. This pivot would require them to delay their first release by a year, and the end result was the HTC Dream, released in October 2008.

HTC Dream phone, shown in landscape mode with the sliding keyboard extended.

The HTC Dream.

As you can see, the Android weren’t so sure about all of Apple’s design decisions, hence the physical keyboard and trackball. Today’s phone designs tell you how those choices by the Android team worked out.

I’ll close with an observation based on the article by John “Daring Fireball” Gruber. He may be Apple’s freelance PR guy, but he’s often right, including in this case:

Remember a few years ago, at the height of the “Android is a ripoff of the iPhone” controversy, when Android supporters claimed that the similarities were just some sort of amazing coincidence, like Newton and Leibniz discovering calculus concurrently, because Android had started life a few years before the iPhone was introduced? Good times.

I’m going to get my paws on a copy of Dogfight and read it over the holidays. Expect a review of it in the coming weeks.