David Griffiths

Author
+ Follow
since May 09, 2015
David likes ...
Android Python Ruby
Merit badge: grant badges
Biography
I write code for computers and words for humans.
Cows and Likes
Cows
Total received
15
In last 30 days
0
Total given
0
Likes
Total received
30
Received in last 30 days
0
Total given
12
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by David Griffiths

Congratulations, everyone!

Hope you enjoy the book!

D+D
2 years ago
Did you forget to call ps.setString(1, <email>) before executing the query?
2 years ago
Hello Giovanni,

We don't know the exact requirements of your app, but you should seriously look at Jetpack Compose. It is still interoperable with existing libraries and third party code. The only fundamental restriction is that you need to use Kotlin, and the minimum API is 21. That is currently supported by about 98% of devices.

Some libraries are still in beta (for example, the Compose library for navigation) but are looking really solid.

We think that it will take you a day or two to get used to creating apps with Compose, but once you do, you will create code far more rapidly. You will also be able to break your application up into far smaller components, which you will be able to design and test in a more straightforward fashion.

Good luck!

D+D
2 years ago
Hello Ted,

We don't cover it in the book, but this kind of thing is much easier to do in Jetpack Compose using the animation APIs:

https://developer.android.com/jetpack/compose/animation

D+D
2 years ago
Hello Ted,

Good question The code is designed to be understandable, not to be efficient, so in a real application you would most certainly look for efficiencies and to remove duplication. But for the purposes of teaching, we will often leave duplications in place, if it leaves the code easier to understand.

D+D
2 years ago
Hello Cosimo,

Yes it does. In the early chapters it still goes through layouts and fragments, because they are important for understanding the underpinnings of Android development, and for maintaining existing applications.

D+D
2 years ago
Hello Cosimo,

Yes, Randy is exactly right. It has been re-written for Kotlin and the new APIs.

D+D
2 years ago
Hello Cosimo,

Thanks for your question. We try to avoid having a single architectural approach to building apps, because most of the time we are creating apps that demonstrate some particular aspect of Android development. We did spend a lot of time making sure that the code was as simple and sparse as we could make it, so that it would be easy to read.

In the Jetpack Compose course next week:

https://www.oreilly.com/live-events/building-android-apps-with-jetpack-compose/0636920060990/0636920062245/

We do use a suggested architecture for Compose apps. But it is just a suggested architecture, because your mileage may vary, so we use it as an example and as something you might find useful.

Thanks for the question.

D+D
2 years ago
Hello Olufisayo,

Partly. We keep a careful eye on feedback to see which parts of the material feel like they're too fast or too slow, and then adjust accordingly. A significant factor in this new edition was simply the amount of changes that had occurred in the Android APIs.

Thanks for the question

D+D
2 years ago
Hi Sebastian! <waves/>
2 years ago
Hello Sebastian,

Head First Android Development focuses on the motivations behind the features, so it doesn't just teach how to do things, but also *why* things work the way they do.

Android Development has become an immensely complex area, and Google documentation often shows how you would have done things 10 years ago, mixed in with how modern Android developers would do it today. This is inevitable because they have to support developers with legacy apps, as well as new developers.

Consequently, it's easy to find lots of material about the "how" of Android, and rather harder to find out about *why* and *when* you should do something.

If you are comparing titles, then we would definitely recommend looking for a book that includes Kotlin (you can still use Java for many things, but the tide is very much towards Kotlin now) and something that gives some kind of introduction to the Jetpack libraries, including Jetpack Compose. It should also include the fundamental concepts of Android: activities, lifecycles, view-models and so on.

Good luck with your Android journey!

D+D
2 years ago
Exactly!

In fact, back in the days before Windows 95, when dinosaurs still ruled the Earth, Windows 3.1 had a cooperative multi-tasking model where an application could make regular calls to allow other applications process events. It's a similar idea in co-routines, some suspendable functions (like "delay") allow other co-routines to take a turn.

D+D
2 years ago
Hello Burk,

Yes! Every time you sit down to teach something, it inevitably changes the way you think about it. An important feature of Head First books (don't tell the competition...) is *motivation*. When we start work on a topic we begin with a survey of all of the material that's available, and then we start to ask *why* things work as they do. The best way to motivate a topic is to find a problem that a thing solves. Then you create a project to do something. Point out some difficulty that needs to be overcome. Then introduce the new thing that you *really* want to teach. And finally step through how to use the new thing.

This is closely related to an analytical technique called OODA: Observe, Orient, Decide, Act.

https://en.wikipedia.org/wiki/OODA_loop

Consequently, when we started writing the first edition of HFAD we started to identify the *whys* behind the major topics, and the problems that each of the concepts solve. This has continued with each new addition.

For the changes in the new edition, Randy summed it up nicely: the switch from Java to Kotlin, and the use of new APIs. The new edition is a complete re-write of the book. There may be some similarities in the first chapter (things like how to create an app with Android Studio) but fairly quickly the book is very different from earlier versions. If you compare the tables of contents, you will see that they are quite different.

Thanks for the question.

D+D
2 years ago
Hello Salil,

That's an excellent question. I think if you want to get up and running quickly, and don't have a lot of time, you might be better to simply go through a course than a book. If you really need a short book, then there is one called "Hello, Android" from PragProg, which is excellent, although I think it's quite old now and I don't *think* it covers Kotlin.

D+D
2 years ago