Book Image

Android Studio 4.1 Development Essentials – Kotlin Edition

By : Neil Smyth
Book Image

Android Studio 4.1 Development Essentials – Kotlin Edition

By: Neil Smyth

Overview of this book

Android 11 has a ton of new capabilities. It comes up with three foci: a people-centric approach to communication, controls to let users quickly access and manage all of their smart devices, and privacy to give users more ways to control how data on devices is shared. This book starts off with the steps necessary to set up an Android development and testing environment, followed by an introduction to programming in Kotlin. An overview of Android Studio and its architecture is provided, followed by an in-depth look at the design of Android applications and user interfaces using the Android Studio environment. You will also learn about the Android architecture components along with some advanced topics such as touch screen handling, gesture recognition, the recording and playback of audio, app links, dynamic delivery, the AndroidStudio profiler, Gradle build configuration, and submitting apps to the Google Play Developer Console. The concepts of material design are also covered in detail. This edition of the book also covers printing, transitions, and cloud-based file storage; foldable device support is the cherry on the cake. By the end of this course, you will be able to develop Android 11 Apps using Android Studio 4.1, Kotlin, and Android Jetpack. The code files for the book can be found here: https://www.ebookfrenzy.com/retail/as41kotlin/index.php
Table of Contents (95 chapters)
95
Index

84.7 Options for Building Print Support into Android Apps

The Printing framework provides a number of options for incorporating print support into Android applications. These options can be categorized as follows:

84.7.1 Image Printing

As the name suggests, this option allows image printing to be incorporated into Android applications. When adding this feature to an application, the first step is to create a new instance of the PrintHelper class:

val imagePrinter = PrintHelper(context)

Next, the scale mode for the printed image may be specified via a call to the setScaleMode() method of the PrintHelper instance. Options are as follows:

SCALE_MODE_FIT – The image will be scaled to fit within the paper size without any cropping or changes to aspect ratio. This will typically result in white space appearing in one dimension.

SCALE_MODE_FILL – The image will be scaled to fill the paper size with cropping performed where necessary to avoid...