Book Image

Learning Android Application Development

By : Raimon Ràfols Montane, Laurence Dawson
Book Image

Learning Android Application Development

By: Raimon Ràfols Montane, Laurence Dawson

Overview of this book

The mobile app market is huge. But where do you start? And how you can deliver something that takes Google Play by storm? This guide is the perfect route into Android app development – while it’s easy for new apps to sink without a trace, we’ll give you the best chance of success with practical and actionable guidance that will unlock your creativity and help you put the principles of Android development into practice. From the fundamentals and getting your project started to publishing your app to a huge market of potential customers, follow this guide to become a confident, creative and reliable mobile developer. Get to grips with new components in Android 7 such as RecyclerView, and find out how to take advantage of automated testing, and, of course, much, much more. What are you waiting for? There’s never been a better time – or a better way – to get into Android app development.
Table of Contents (16 chapters)
Learning Android Application Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface

Preface

Mobile development has been a market with huge potential since the very beginning, but there have been some issues in the past, ranging from content discovery, where to download apps and games, to the prohibitive costs of data in some countries. With the launch of iPhone and the App Store, the whole market skyrocketed. Google followed up and introduced Android and the Google Play Store. Today, we all know where we can find applications for our smartphone and flat data rates or, at least, very accessible data plans are more common in many countries. In addition, many companies transformed their operating model to become mobile first and, nowadays, it is very strange not to find a mobile application of a service or business that has direct interaction with consumers that provides services to their employees and, obviously, those companies whose whole business model is based on a mobile application.

The aim of this book is to introduce newcomers to Android development and, for those that are already experienced, to brush up on some concepts and maybe add some final touches to their applications. We will cover several aspects of Android development, ranging from the very basics to the more advanced subjects. We will briefly explain the foundations, as it is important to understand how everything works, but we will focus more on open source and broadly used third-party libraries. Android has a very rich, open source, and extensively tested library ecosystem, and it will be a mistake not to take advantage of it. These libraries are widely used by many of the most downloaded apps in Google Play and knowing how they work is becoming crucial, both to speed up the development time and to perform well in job interviews. Do not forget to contribute back to the community!

What this book covers

Chapter 1, Getting Started with Android Development, will explain how to install Android Studio, create a sample project, and run it on an Android emulator, and finally provide an introduction to the Gradle build system.

Chapter 2, Activities and Fragments – The Backbone of Your App, will demonstrate how to create activities and fragments and understand their lifecycle.

Chapter 3, Working with Views – Interacting with Your App, will show the most common Views and ViewGroups and how to create custom Views.

Chapter 4, Lists and Adapters, will explore how to add lists to our application, ranging from the good old ListView to the new RecyclerView. We will also cover the possible performance issues we might run into.

Chapter 5, Remote Data, will explain how to retrieve data from the network using Android standard classes and then some third-party open source libraries.

Chapter 6, Image Management, will describe how to load images, cache them efficiently, and use different libraries to hide all the complexity.

Chapter 7, Permanent Data, will teach you how to store information on the local device, ranging from temporary files to an SQLite database.

Chapter 8, Testing Your Application, will demonstrate how to automatically test our application and add unit and UI tests.

Chapter 9, Publishing Your Application, will describe how to publish our application to Google Play.

Chapter 10, Monetization – Make Money with Your App, will explain how to add in-app purchases, set the price of our application, and add in-app advertisements.

What you need for this book

To start developing for Android, you will need a version of Android Studio. In this book, we will cover how to download and install the latest stable version and, for the brave, how to install a development or beta version. The development version will contain all the latest features but they might not be as stable as they should be.

Who this book is for

Want to get started with Android development? Start here.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "To edit your app manifest, open the folder manifests and double-click on the AndroidManifest.xml file."

A block of code is set as follows:

public class SampleActivity extends Activity { 
 
  @Override 
  protected void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
 
    // Called when the activity is first created 
}

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Click on this tab and select Android from the top drop-down menu."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail [email protected], and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

You can download the code files by following these steps:

  1. Log in or register to our website using your e-mail address and password.

  2. Hover the mouse pointer on the SUPPORT tab at the top.

  3. Click on Code Downloads & Errata.

  4. Enter the name of the book in the Search box.

  5. Select the book for which you're looking to download the code files.

  6. Choose from the drop-down menu where you purchased this book from.

  7. Click on Code Download.

You can also download the code files by clicking on the Code Files button on the book's webpage at the Packt Publishing website. This page can be accessed by entering the book's name in the Search box. Please note that you need to be logged in to your Packt account.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR / 7-Zip for Windows

  • Zipeg / iZip / UnRarX for Mac

  • 7-Zip / PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/learningandroidapplicationdevelopment. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at [email protected] with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at [email protected], and we will do our best to address the problem.