Book Image

Android Design Patterns and Best Practice

By : Kyle Mew
Book Image

Android Design Patterns and Best Practice

By: Kyle Mew

Overview of this book

Are you an Android developer with some experience under your belt? Are you wondering how the experts create efficient and good-looking apps? Then your wait will end with this book! We will teach you about different Android development patterns that will enable you to write clean code and make your app stand out from the crowd. The book starts by introducing the Android development environment and exploring the support libraries. You will gradually explore the different design and layout patterns and get to know the best practices of how to use them together. Then you’ll then develop an application that will help you grasp activities, services, and broadcasts and their roles in Android development. Moving on, you will add user-detecting classes and APIs such as gesture detection, touch screen listeners, and sensors to your app. You will also learn to adapt your app to run on tablets and other devices and platforms, including Android Wear, auto, and TV. Finally, you will see how to connect your app to social media and explore deployment patterns as well as the best publishing and monetizing practices. The book will start by introducing the Android development environment and exploring the support libraries. You will gradually explore the different Design and layout patterns and learn the best practices on how to use them together. You will then develop an application that will help you grasp Activities, Services and Broadcasts and their roles in Android development. Moving on, you will add user detecting classes and APIs such as at gesture detection, touch screen listeners and sensors to our app. You will also learn to adapt your app to run on tablets and other devices and platforms, including Android Wear, Auto, and TV. Finally, you will learn to connect your app to social media and explore deployment patterns and best publishing and monetizing practices.
Table of Contents (20 chapters)
Android Design Patterns and Best Practice
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

What we will build


As mentioned earlier, throughout the course of this book, we will be building a small but complete Android application. It will be a good idea now to take a little look at what we will be building and why.

We will put ourselves in the position of an independent Android developer that has been approached by a potential client that runs a small business making and delivering fresh sandwiches to several local office buildings. There are several issues facing our client that they believe can be solved with a mobile app. To see what solutions an app might provide, we will break the situation down into three sections: the scenario, the problem, and the solution.

The scenario

The client runs a small but successful business making and then delivering fresh sandwiches to nearby office workers so that they can buy and eat them at their desks. The sandwiches are very good and, as a result of word-by-mouth advertising, are growing in popularity. There is a good opportunity for the business to expand, but there are some glaring inefficiencies in the business model that the client believes can be resolved with the use of a mobile app.

The problem

It is almost impossible for the client to anticipate demand. There are many occasions where too many of a particular sandwich are made, leading to wastage. Likewise, there are times where insufficient sandwich lines are prepared, leading to a loss in sales. Not only this, but the word-of-mouth advertising the customers provide limits the expansion of the business to a small geographical area. The client has no reliable way of knowing if it is worth investing in more staff, a motorbike to travel further afield, or even whether to open new kitchens in other parts of town.

The solution

A mobile app, provided free for all customers, not only solves these problems but makes available a whole new set of opportunities. Never mind that an app will solve the issues of unanticipated demand; we now have the chance to take this to a whole new level. Why just present the customer with a set menu when we can offer them the chance to construct their own personalized sandwich from a list of ingredients? Maybe they love the cheese and pickle sandwich our client already makes but fancy it with a slice or two of apple, or prefer mango chutney to pickle. Maybe they are vegetarian and prefer to filter out meat products from their choices. Maybe they have allergies. All of these needs can be met with a well-designed mobile app.

Furthermore, the geographical limitations of word-of-mouth advertising, and even local promotions such a as billboards or notices in local papers, gives no indication of just how successful a business might be on a larger stage. The use of social media, on the other hand, can give our client clear insights into current trends as well as spread the word to the widest possible audience.

Not only can our client now judge accurately the scope of their business but can also add entirely new features unique to the digital nature of modern life, such as the gamification of the app. Competitions, puzzles, and challenges can provide a whole new dimension to engaging customers and present a powerful technique to increasing revenue and market presence.

With the task ahead now a little clearer, we are now in a position to start coding. We will start with a very simple demonstration of the factory pattern, and on the way take a closer look at some of the features of the SDK that we will be finding useful along the way.