Mastering Android Studio 3
eBook - ePub

Mastering Android Studio 3

Kyle Mew

  1. 220 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e Android
eBook - ePub

Mastering Android Studio 3

Kyle Mew

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Informazioni sul libro

Unleash the power of Android Studio 3 to develop mobile applications faster and efficiently.About This Book• Use Android Studio not just as an IDE but as a complete testing and build solution• Produce customized APKs with Gradle to suit various versions of an app, such as test versions and free versions of an otherwise paid app.• Explore all aspects of UI development and testing using working XML and Java examples.• Learn seamless migration from Eclipse and other development platforms to Android Studio.Who This Book Is ForThis book targets developers, with experience of developing for Android, who are new to Android Studio or wish to migrate from another IDE such as Eclipse. This book will show you how to get the utmost from this powerful tool.What You Will Learn• Create styles, themes, and material designs• Set up, configure, and run virtual devices using the AVD manager• Improve the design of your application using support libraries• Learn about GitHub libraries• Use emulators to design layouts for a wide variety of devices, including wearables.• Improve application performance in terms of memory, speed, and power usageIn DetailAndroid Studio is an Integrated Development Environment (IDE) designed for developing Android apps. As with most development processes, Android keeps resources and logic nicely separated, and so this book covers the management of imagery and other resources, and the development and testing tools provided by the IDE.After introducing the software, the book moves straight into UI development using the sophisticated, WYSIWYG layout editor and XML code to design and test complex interfaces for a wide variety of screen configurations.With activity design covered, the book continues to guide the reader through application logic development, exploring the latest APIs provided by the SDK. Each topic will be demonstrated by working code samples that can be run on a device or emulator.One of Android Studio's greatest features is the large number of third-party plugins available for it, and throughout the book we will be exploring the most useful of these, along with samples and libraries that can be found on GitHub.The final module of the book deals with the final stages of development: building and distribution. The book concludes by taking the reader through the registration and publication processes required by Google. By the time you have finished the book, you will be able to build faster, smoother, and error-free Android applications, in less time and with fewer complications than you ever thought possible.Style and approachThis is a step-by-step guide with examples demonstrating how Android Studio can be used as a complete solution for developing, testing, and deploying apps from start to finish.

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
Mastering Android Studio 3 è disponibile online in formato PDF/ePub?
Sì, puoi accedere a Mastering Android Studio 3 di Kyle Mew in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Ciencia de la computación e Programación en Java. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Anno
2017
ISBN
9781786468451

Assets and Resources

So far, in this book, we have covered layouts, design, and the libraries and tools that support them. We then went on to explore developing for different screen sizes, shapes, and densities, as well as other form factors. This is the last chapter in the UI development module where we will look at how Android Studio manages various assets and resources, such as icons and other drawables.
Android Studio is very accommodating when it comes to including drawables in our projects and, particularly, when it comes to vector graphics, which are invaluable to an Android developer, as they scale nicely across different screen sizes and densities, and this is catered for with a very valuable tool, the vector asset studio. Along with this, there is an asset studio to generate and configure bitmap images.
Vector drawables are widely used for in-app icons and in components such as menus, tabs, and the notification area and are also very flexible when it comes to animating icons and transforming them from one icon to another icon, a very useful space-saving function on small screens.
In this chapter, you will learn to do the following:
  • Creating icons with asset studios
  • Building adaptive icons
  • Creating material launcher icons
  • Using a material icon plugin
  • Creating vector assets
  • Importing vector assets
  • Animating icons
  • Viewing dynamic layouts with plugins
  • Extracting prominent colors from an image

Asset Studio

There are very few, if any, apps that do not employ some forms of icons and even if these are only launcher and, action icons, the correct choices and design make the difference between a successful UI and a confusing one.
Although it is not essential, Google is very keen that we use material design icons. This is an attempt to create a uniform user experience across the platform to counter the perception that iOS offers a more consistent feel. This is unsurprising, as iOS is a closed system that places a lot of restrictions on the developer. Google, on the other hand, prefers to offer a far more creative freedom to developers. In the past, this has led Apple devices to gain a reputation for being generally slicker than Android and, to counter this, Google introduced material design guidelines, which have gone on to far exceed original expectations and can now be found on many other platforms, including iOS.
As would be expected, Android Studio provides tools to assist us in incorporating these design features and drawables. This comes in the form of Asset Studio. This facilitates the creation and configuration of all manner of icons, from brightly colored detailed launcher icons to fully customized and scalable vector graphic action and notification icons. Along with API level 26, Android introduced Adaptive Icons that can display as different shapes on different devices and perform simple animations.
Asset Studio comes with two separate interfaces: one for general images and one for vector graphics. We will look at the first of these in the next section.

Image Asset Studio

When creating images for different screen configurations, we often have to create several versions of the same image and this is usually not a great deal of work. When it comes to icons, on the other hand, we may have several individual icons and dozens of versions, making resizing and scaling them a tedious process. Fortunately, Android Studio provides a neat solution to this in the form of Image Asset Studio.
Device manufacturers are perhaps even more concerned with creating a consistent look and feel across their models. This is particularly apparent when it comes to the way launcher icons are displayed on their home screens. An ideal situation would be if developers could design a single icon and manufacturers could then fit that into a uniform shape, such as a square or circle, depending on its location on a device and the manufacturer's own design ideals.
Image Asset Studio achieves this by creating a two-layered icon that uses our original imagery and a plain background layer that a mask can be applied to in order to create the desired overall shape, often one of the three following images:
Adaptive icons
The Image Asset Studio can be opened by selecting New | Image Asset from your project's drawable context menu:
Asset Studio
There are several stages to create icons that will work across the widest range of devices and API levels, and these stages are represented by the following three tabs in the wizard: Foreground Layer, Background Layer, and Legacy. There are some valuable features included in each of these tabs, which will be outlined in the next section.

Layered icons

The foreground layer is where we apply our imagery. This can be our own artwork, in the case of a launcher icon, or clip art/text, if we are creating action icons. The wizard automatically generates an icon for each possible usage, including a Play Store icon, which involves creating an entirely new asset. The Show Safe Zone feature is, without doubt, the most useful of the preview features, as it displays a bounding circle that our asset should not extend beyond if our icon is to display correctly on all devices and platforms. The Resize: control allows us to quickly ensure that none of our icons extend beyond this zone.
Selecting Trim: as a scaling option will remove any excess pixels before creating the finished icon, meaning that redundant transparent pixels are removed from the top layer, often significantly reducing its file size.
The background layer of an adaptive icon needs to be large enough to allow any trimming required to create the shapes and sizes shown in the preceding image. The default ic_launcher_background.xml produces a vector graphic describing a grid. This is very helpful when it comes to positioning and sizing our artwork, but it is not intended for use in a completed application. Google recommends that you use plain backgrounds with no borders or external shadows and, although Material guidelines allow some internal shading, the simplest solution is to use a color rather than an image for the background layer. This also allows us to select a prominent color from our theme, further promoting our brand.
Asset background selection
The preceding image uses an icon from the clip art selection, which demonstrates nicely the purpose of the guidelines when it comes to designing our own.
The source image can only be selected when editing the foreground layer, regardless of the tab you are working on.
The legacy tab allows us to ensure that our icons will still work on devices that run API level 25 and lower and provides us with all the design features that devices running these earlier versions need, such as the elongated rectangular icon that suited many of these devices.
Editing legacy icons
Many developers are also accomplished artists and will be more than comfortable to design launcher icons from scratch. For these readers, it is important to know that the specified dimensions of launcher icons have changed since the inception of API level 26. Although icon...

Indice dei contenuti