Mastering Android Studio 3
eBook - ePub

Mastering Android Studio 3

Kyle Mew

Buch teilen
  1. 220 Seiten
  2. English
  3. ePUB (handyfreundlich)
  4. Über iOS und Android verfügbar
eBook - ePub

Mastering Android Studio 3

Kyle Mew

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

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.

Häufig gestellte Fragen

Wie kann ich mein Abo kündigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich Bücher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bücher zum Download über die App zur Verfügung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die übrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst für Lehrbücher, bei dem du für weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit über 1 Million Büchern zu über 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
Unterstützt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist Mastering Android Studio 3 als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu Mastering Android Studio 3 von Kyle Mew im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Ciencia de la computación & Programación en Java. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

Information

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...

Inhaltsverzeichnis