📜 ⬆️ ⬇️

The book "Android for developers"

Hi, Habrozhiteli! We have the 3rd edition of the book by Paul and Harvey Dattle, Alexander Wald:

image We offer you to get acquainted with the development of applications for Android smartphones and tablets using the Android Software Development Kit (SDK). Many of the programming skills for Android presented in the book are also applicable to the development of applications for Android Wear and Android TV.

The book presents advanced technology development of mobile applications for professional programmers. The book is based on the principle of application-oriented development - the development concepts are shown on the example of fully functional Android applications, and not code fragments. Each of chapters 2–9 begins with an introductory part, which briefly describes the application being developed. Then the results of testing the application and an overview of the technologies used in its development are given. Next is a detailed analysis of the source code of the application.
')


The target audience

It is assumed that the readers of this book know the Java language and have experience in object-oriented programming. It is also assumed that the reader is familiar with XML — as you will see, Android projects contain many XML files, although the programmer often works with XML in an editor that basically hides a significant portion of XML. We use only complete working applications, so without even knowing Java, but with experience in object-oriented programming in C ++, C #, Swift, or Objective-C, you can quickly learn the material in the book, and at the same time learn a lot about Java and object-oriented programming.

This book is not a Java tutorial.

Book Features

Application oriented development. In each of chapters 2–9, one complete application is presented — the functions of the application are discussed, screenshots of the running application, the results of test runs, and an overview of the technologies and architectures used to create the application are given. Then we build the graphical interface of the application, present its full source code and conduct a detailed analysis of this code; We discuss the concepts used in programming and demonstrate the functionality of the Android API used to create the application.

Android 6 SDK. The book discusses the new features of the Android 6 SDK (Software Development Kit).

Android Studio IDE. The free Android Studio (based on IntelliJ IDEA Community Edition) is currently the main integrated environment recommended for developing Android applications (the original Android development tools were based on the Eclipse IDE). The Android Studio, combined with the free Android Software Development Kit (SDK) and the free Java Development Kit (JDK), provides everything you need to create, run, and debug Android applications, support their distribution (for example, send them to Google Play), and more. . e. Instructions on downloading and installing these products are provided in the “Preparation” section.

Material design. In Android 5, Google introduced a new style of application based on the specification of material design.

In this specification, Google provides an overview of the objectives and principles of material design, as well as detailed information on animation methods, styling of on-screen elements, positioning of elements, the use of specific user interface components, standard user interaction schemes, accessibility, internationalization, etc. At this time, Google uses the principles of material design in both its mobile applications and browser applications.

Material design is a very broad topic. In this book we will focus on the following aspects:

Using the built-in Android material themes - the themes ensure that the look and feel of the embedded Android components will follow the principles of material design.

Using the built-in Android Studio application templates - these templates were developed by Google in accordance with the principles of material design.

Uses user interface components recommended by Google for specific purposes, such as FloatingActionButton, TextInputLayout, and RecyclerView.

Support and library compatibility. When using the new features of Android, developers are often faced with the problem of backward compatibility with earlier Android platforms. Many new Android features are now introduced through support libraries. This allows the developer to use the new features in applications focused on both modern and old Android platforms. AppCompat is among these libraries. Application templates in Android Studio have been updated; they now use the AppCompat library and its themes, which allows new applications that you create to work on most Android devices. If you create applications that are originally targeted at the AppCompat library, you do not have to change the code implementation if you want to support older versions of Android to a wider audience of users.

REST-compatible web services and JSON. Chapter 7 presents the Weather Viewer application, which demonstrates the use of web services with the support of the architectural style of REST (Representational State Transfer) - in this case, the 16-day weather forecast service from the OpenWeatherMap.org site. This web service returns the forecast in JSON format (JavaScript Object Notation), a popular text-based data exchange format used to represent objects as key-value pairs. The application also uses the classes from the org.json package to process the response of the web service.

Permissions Android 6.0. Android 6.0 uses a new permissions model designed for user convenience. Before the release of Android 6.0, the user was obliged during the installation to provide in advance all the permissions that the application might ever need. Often, it frightened users from installing applications. In the new model, the application is installed without requesting any permissions. Instead, the user is prompted to request permission only the first time he uses the appropriate feature. Chapter 5 introduces the reader to the new model of permissions and shows how in it to request permission from the user to save the image on external media.

Fragments. Starting in Chapter 4, we will use snippets to create and manage portions of the graphical interface of each slice. Combining several fragments, you can create interfaces that effectively use the space of the tablet screen. The developer can easily replace fragments, which makes the graphical interface more dynamic; An example of fragment switching is discussed in Chapter 9.

Pattern View-Holder, ListView and RecyclerView components. Each of the applications in Chapters 7–9 displays a scrolling list of data. In Chapter 7, the data is displayed in the ListView; it also describes the View-Holder pattern, which increases the scrolling speed by re-using GUI components that go beyond the screen. When working with ListView, using the View-Holder pattern is desirable, but not necessary. In chapters 8 and 9, the data is displayed in a more flexible and efficient RecyclerView component, for which the View-Holder pattern is required.

The seal. Printing capabilities from applications are demonstrated using the PrintHelper class (Chapter 5), which is part of the Android printing infrastructure, as an example. The PrintHelper class provides a user interface for selecting a printer, a method for checking whether a given device supports printing, and a method for printing Bitmap objects. The PrintHelper class is part of the Android Support Library.

Dive mode The status bar at the top of the screen and the menu buttons at the bottom can be hidden so that your applications can use most of the screen. To access the status panel, the user swipes from the top edge of the screen, and the system panel with the Back, Home and Recent Apps buttons - from the bottom edge.

Testing on Android smartphones, tablets and emulator. To achieve optimal results, applications should be tested on physical smartphones and Android tablets. Useful information can also be obtained when testing in the Android emulator (see the “Preparation” section), however, emulation creates a significant load on the processor and can work slowly, especially in games with a large number of moving objects. Chapter 1 lists some Android features not supported by the emulator.

Cloud Test Lab. Google is working on a new Cloud Test Lab service — a site for testing applications on a wide range of devices, device orientations, local contexts, languages, and network conditions. You can conduct automated tests and receive detailed reports with screenshots and video clips, as well as error logs to help you find problems and improve applications.

Android Wear and Android TV. Android Wear runs on smart watches; Android TV works on some smart TVs and media players connected to the TV (usually with an HDMI cable). Many of the programming techniques for Android, presented in the book, also apply to the development of applications for Android Wear and Android TV. Android SDK provides emulators for Android Wear and Android TV, so you can test your applications for these platforms, even if you do not have the devices themselves.

Multimedia. Applications use a variety of Android multimedia capabilities, including graphics, images, frame-by-frame animation, animation, and audio.

Sending apps to Google Play. Chapter 10 describes the process of signing up for Google Play and setting up an account for selling apps. You will learn how to prepare an application to be sent to Google Play, how to set the price for an application, and learn how to monetize applications through advertising and internal sales. Resources will also be presented that can be used for marketing applications. Chapter 10 can be read after chapter 1.

Book Reviewers

We want to thank the reviewers of this and two previous editions of the book. They carefully checked the text and provided many recommendations for improving it: Paul Beusterien, chief specialist of Mobile Developer Solutions; Eric J. Bowden, General Manager, Safe Driving Systems, LLC; Tony Cantrell (Northwestern Technical College of Georgia); Ian G. Clifton (Ian G. Clifton), independent contractor, Android application developer, and author of Android User Interface Design: Implementing Material Design for Developers, 2nd Edition; Daniel Galpin (Daniel Galpin), Android enthusiast Gannon and author of the book “Intro to Android Application Development”; Jim Hathaway, developer from Kellogg; Douglas Jones (Douglas Jones), Senior Software Engineer, Fullpower Technologies; Charles Lasky, Nagautuk Community College; Enrique Lopez-Manas (Enrique Lopez-Manas), Senior Android Architecture Specialist and Computer Science Teacher at the University of Alcala, Madrid; Sebastian Nykopp, Chief Architect, Reaktor; Michael Pardo, Android developer, Mobiata; Ronan "Zero" Schwartz (Ronan "Zero" Schwarz), director of information technology, the company OpenIntents; Arijit Sengupta, Wright State University; Donald Smith, Columbia College; Jesus Ubaldo, Quevedo Torrero, University of Wisconsin, Parkside; Dawn Wick, Southwestern Municipal College; Frank Xu, Gannon University.

About the authors

Paul J. Deitel (Paul J. Deitel), general and technical director of Deitel & Associates, Inc., graduated from the Massachusetts Institute of Technology (MIT) with a degree in Information Technology. Java Certified Programmer, Java Certified Developer and Oracle Java Champion. Paul also won the Microsoft Most Valuable Professional (MVP) C # award in 2012–2014. In Deitel & Associates, Inc. He has conducted hundreds of classes around the world for corporate clients, including Cisco, IBM, Siemens, Sun Microsystems, Dell, Fidelity, NASA (Kennedy Space Center), National Center for Strong Storm Forecasting, White Sands Rocket Test Site, Rogue Wave Software, Boeing , SunGard Higher Education, Stratus, Cambridge Technology Partners, One Wave, Hyperion Software, Adra Systems, Entergy, CableData Systems, Nortel Networks, Puma, iRobot, Invensys, and many others. Paul and his co-author, Dr. Harvey M. Deytel, are authors of world-famous bestsellers — textbooks on programming languages ​​for beginners and professionals, as well as video courses.

Harvey M. Deitel (Dr. Harvey M. Deitel), Chairman and Chief Strategist of Deitel & Associates, Inc., has 50 years of experience in information technology. He holds bachelor’s and master’s degrees from the Massachusetts Institute of Technology and a Ph.D. from Boston University. In the 1960s, he worked in groups dedicated to the creation of various IBM operating systems, at Advanced Computer Techniques and Computer Usage Corporation, and in the 1970s he developed commercial software systems. Harvey has extensive college teaching experience and has served as chairman of the information technology department at Boston College. In 1991, he founded Deitel & Associates, Inc. with his son, Paul J. Deytel. Harvey and Paul wrote dozens of books and released dozens of LiveLessons video courses. The books they wrote received international recognition and were published in Chinese, Korean, Japanese, German, Russian, Spanish, French, Polish, Italian, Portuguese, Greek, Turkish, and Urdu. Daytel has conducted hundreds of programming workshops in large corporations, academic institutions, and government and military organizations.

Alexander Wald , an intern at Deitel, helped us transform the book and apps for Android 4.3 and 4.4 using Eclipse on Android 6 using Android Studio. Currently, Alexander is going to get a bachelor's degree in the field of "Information Technology" at the Worcester Polytechnic Institute with a non-core education in the field of electrical engineering. He became interested in mathematics and science at an early age and wrote a program code for about 9 years. He is inspired by a passion for creativity and innovation, as well as a desire to share his knowledge with others.

More information about the book can be found on the publisher's website.
Table of contents
Excerpt


For Habrozhiteley 25% coupon discount - Android for Programmers

Source: https://habr.com/ru/post/303208/


All Articles