Android for Beginners
eBook - ePub

Android for Beginners

Step by Step guide to develop Android App

  1. English
  2. ePUB (mobile friendly)
  3. Available on iOS & Android
eBook - ePub

Android for Beginners

Step by Step guide to develop Android App

About this book

Build Android apps starting from zero programming experience Key Features

  • Comprehensive coverage of Android lying more stress on examples
  • The book covers the topics in simple and easy form taking practical examples in each topic
  • Simple language, crystal clear approach, straight forward comprehensible presentation
  • Adopting user-friendly classroom lecture style
  • The concepts are duly supported by several examples
  • The book cover the topics in a manner which fulfilled the skill gap among industry and academia


Description
The book has been written in such a way that the concepts are explained in detail, giving adequate emphasis on examples. To make clarity of the programming examples, logic is explained properly as well as discussed using comments in program itself. The book covers the topics right from the Introduction of the Android Studio and writing programs into it. The Android topics are discussed in detail taking into consideration the practical examples from simple to complex for the better understanding of students. Various sample practical exercises are included in the Book and their solutions so as to give students the basic idea of developing apps in Android. The examples given in book are user-focused and have been highly updated including topics, figures and examples.
The book features more on practical approach with more examples covering topics from simple to complex one addressing many of the core concepts required at the beginner level. What You Will Learn

  • Toasts, Activity, Dialogs, Intent, Android Life Cycle, Menus
  • Asynchronous Task, Recycler-view, Broadcast Receiver and Notification
  • Shared Preferences, Sqlite Database, Alarm Manager, Android Services, Testing Activity, Publishing App

  • Who This Book is For
    Students pursuing BE/BSc/ME/MSc/BTech/MTech in Computer Science Table of Contents
    1. Introduction
    2. Toast
    3. Activity
    4. Dialogs
    5. Intent
    6. Android Life Cycle
    7. Menus
    8. Asynchronous Task
    9. Recyclerview
    10. Broadcast Receiver and Notification
    11. Shared Preferences
    12. Sqlite Database
    13. Alarm manager
    14. Android Services
    15. Testing Activity
    16. Publishing App
    17. Appendix I
    18. Exercise 1
    19. Appendix II About the Author
    Pratiyush Guleria has done M.Tech in Computer Science with a Gold Medal, B.Tech in Information Technology and MBA Degree in Operation Research from Indira Gandhi National Open University (IGNOU). He has qualified SLET (State Level Eligibility Test) and has more than nine years of experience in IT Industry and Academics. He has, to his credit, approximately 25 research papers in peer reviewed International Journals and Conferences and has been the Technical Program Committee Member and reviewer for journals and International Conferences. His research interests include Data Mining Machine Learning and Web Technologies. He is also recipient of "Young Scientist Award" for best paper presentation in one of the International Conference. LinkedIn Profile: linkedin.com/in/pratiyush-guleria-2a944157

Tools to learn more effectively

Saving Books

Saving Books

Keyword Search

Keyword Search

Annotating Text

Annotating Text

Listen to it instead

Listen to it instead

Chapter 1

Introduction

1.1 Know about Android

✓ It is a Mobile operating system, which was developed by Google, primarily for mobile devices.
✓ Linux based operating system.
✓ Android Latest version is 8.0-8.1 and is assigned with the code name “Oreo”.
The latest versions running are:
✓ 7.0-7.1.2 and is assigned with the code name “Nougat”.
✓ Android 6.0 and is assigned with the code name “Marshmallow”.
✓ Android 5.0,Android 5.1 and is assigned with the code name “Lollipop”.
The API Level supported by Oreo is 26-27 whereas the API Level supported by Nougat is 24-25 and API Supported in other versions i.e. Marshmallow is 23 and in Lollipop, it is 21-22.
✓ The android programming is based on Java Programming.
Platform Supported and Hardware Support:
✓ It supports on 32-bit as well on 64-bit operating system.
✓ The minimum 8GB RAM should be installed in systems so as to run the programs in Android Studio otherwise on less RAM android versions with API 20+ may not run on the programs properly and results in slow performance of systems.
Brief History about Android Operating System
Android was initially developed by Android Inc. founded by Andy Rubin, Rich Miner, Nick Sears, Chris White and then it is bought by Google in 2005 with the first commercial Android Device launched in September 2008. The first commercial version, Android 1.0 was released in September 2008. Then Android OS is continuously updated by Google since the initial release.
The first two versions i.e. Version 1.0 and 1.1 were released without any specific code names and then after it, all the versions released with specific code names and all code names areconfectionery themed and in alphabetical order since 2009. The list of Android operating system version with their API level is shown in Table 1.0.
Table 1.0. Android Operating System Versions and API Level
Android Program Structure
The program structure of Android Studio shows the hierarchical representation of module. In Figure 1.1, it shows the project modules.
Android app module: This module is a container for app’s source code, resource files, build files and android manifest file.
Figure 1.1: Android Project Modules
The android manifest file is having extension “.xml” and is the root of the project source. This manifest file is responsible for disseminating an information about app to the Android operating system and Google Play store.
Android res module:
The /res directory contains the following sub directories:
1) drawable/ -> This is the place for bitmap files i.e. .gif,.webp,.png etc.
2) layout/ -> layout/ directory will contain XML files defining user interface layout.
3) menu/ -> It contains the XML files for app menus like options menu, context menu and sub menu etc.
4) mipmap ->It is the place for app launcher icons.
5) values -> It is the place for files which describe multiple resources. The values/ directory contain simple values such as strings, integers, colors etc. For example, “array.xml” for resource arrays, “colors. xml” for color values, “dimens.xml” for dimension values, “strings. xml” for string values and “styles.xml” for styles.
The toolbar shown in Figure 1.2 displays few buttons i.e. Android SDK Manager and Android Virtual Device Manager.
Figure 1.2: Android Toolbar displaying Android SDK and Android Virtual Device Manager
Role of Android SDK Manager:
✓ Android SDK Manager is a tool where we view, install, update and uninstall packages.
✓ Android SDK Manager is also responsible for libraries required to build android applications.
✓ Android SDKManager displays the Android API and from there, the API required for personal phone can be downloaded.
✓ The steps to open the Android SDK Manager are shown in Figure 1.3 and the API Level, Android version is shown in Figure 1.4.
Role of Android AVD Manager:
✓ It is a Graphical User Interface where we can create and manage Android Virtual Devices which are required by the Android Emulator.
✓ Android Emulator provides an environment to run the program by using Android Virtual Devices, in caseif it is not possible to run the program on your mobile handset.
To open the AVD Manager, do the following:
Select Tools->Android->AVD Manager. The steps are shown in Figure 1.5.
Figure 1.3: Steps to open Android SDK Manager
Figure 1.4: Android SDK
Figure 1.5: Android AVD Manager

1.2 Let’s Start with Simple User Interface:

In order to build a simple user interface as shown in Figure 1.6, please go through the following
steps:
First of all, open the layout editor and add a textbox, button from the toolbox.
Figure 1.6: Simple User Interface
The xml file generated of the layout shown in Figure 1.6 is: activity_main.xml
Note: The user interface in an Android app is built using a hierarchy of layouts (ViewGroup objects) and widgets (View objects).
The Layouts act as containers that control child views positioning on the screen. ...

Table of contents

  1. Cover Page
  2. Title Page
  3. Copyright Page
  4. Preface
  5. Acknowledgement
  6. Table of Contents
  7. Chapter 1 Introduction
  8. Chapter 2 Toast
  9. Chapter 3 Activity
  10. Chapter 4 Dialogs
  11. Chapter 5 Intent
  12. Chapter 6 Android Life Cycle
  13. Chapter 7 Menus
  14. Chapter 8 Asynchronous Task
  15. Chapter 9 Recyclerview
  16. Chapter 10 Broadcast Receiver and Notification
  17. Chapter 11 Shared Preferences
  18. Chapter 12 Sqlite Database
  19. Chapter 13 Alarm manager
  20. Chapter 14 Android Services
  21. Chapter 15 Testing Activity
  22. Chapter 16 Publishing App
  23. Appendix I
  24. Appendix II

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 990+ topics, we’ve got you covered! Learn about our mission
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
Yes, you can access Android for Beginners by Pratiyush Guleria in PDF and/or ePUB format, as well as other popular books in Computer Science & Operating Systems. We have over one million books available in our catalogue for you to explore.