Book Image

Building Android UIs with Custom Views

By : Raimon Ràfols Montane
Book Image

Building Android UIs with Custom Views

By: Raimon Ràfols Montane

Overview of this book

To build great user interfaces for your Android apps that go beyond the standard UI elements, you need to use custom Android views. With these, you can give your app a distinctive look and ensure that it functions properly across multiple devices. This book will help you construct a great UI for your apps by teaching you how to create custom Android views. You will start by creating your first Android custom view and go through the design considerations. You will then see how the right choices will enable your custom view to perform seamlessly across multiple platforms and Android versions. You will create custom styleable attributes that work with Android XML layouts, learn to process touch events, define custom attributes, and add properties and events to them. By the end of this book, you will be able to create apps with custom views that are responsive and adaptable to make your app distinctive and an instant hit with its users.
Table of Contents (12 chapters)

Preface

Many years ago, before the launch of Android and the iPhone, one of the major concerns was having a central place to purchase and download mobile applications. Nowadays, we manage to solve this issue with widely available centralized application stores such as Google Play, at the expense of application discoverability.

Google Play, like any other mobile application store, is highly saturated. Unless an application does something unique or has something special, it's extremely hard to stand out from the dozens of applications doing approximately the same, or even if they’re completely unrelated.

Increasing marketing spending might temporarily alleviate the issue but, in the long term, applications still need to figure out that unique functionality or that detail that makes them different.

One way to make a distinctive application is to slightly diverge from the Android standard widgets and UI components and include a specific custom view custom menu, or, at the end of the day, anything that makes it exceptional. We should be aware that this doesn't mean we should completely ignore the Android standard widgets and rewrite the whole UI of the application. As with almost everything, do user tests and discover what works and what doesn’t work for them. Explore new options and solve the pains they have, but don't overdo it. Sometimes, creating a particular menu on top of your application might solve navigation problems, or a well-defined animation might communicate the right transition for the application's users.

In this book, we will see how to start building custom views for Android and integrate them into our applications. We’ll see in detail how to interact with them and add animations and comprehensive examples, both using 2D and 3D rendering capabilities. Finally, we will also see how to share our custom views so they can be reused in our enterprise environment, and also how to open source them and make them available to the Android development community.