Building Android Applications for Beginners
By Steve Taylor
()
About this ebook
This book is aimed at people with little or no understanding of developing applications or any experience with Java or computer programming in general.
Rather than immediately delving into details, the book focuses instead on constructing simple Android examples that can immediately be seen to work. As an example, some very simple but yet powerful graphics are developed, the image on the book's front cover is an example.
As the book progresses more skills are developed and the examples extended. Through this process, an understanding of programming, the Java language, the Android application architecture and the associated tools, is developed.
The book is ideal for both students and professionals. The only prerequisite is a PC/laptop and a desire to learn, not even a physical Android device is required.
Steve Taylor
Steve Taylor is the founding pastor of Graceway Baptist Church (www.graceway.org.nz), in Ellerslie, New Zealand. He is completing a PhD on the emerging church and has a Masters in Theology in communicating the cross in a postmodern world. Steve receives requests to supply spirituality resources and to speak in UK and US.
Read more from Steve Taylor
The Leap: The Psychology of Spiritual Awakening Rating: 5 out of 5 stars5/5Extraordinary Awakenings: When Trauma Leads to Transformation Rating: 5 out of 5 stars5/5The Calm Center: Reflections and Meditations for Spiritual Awakening Rating: 4 out of 5 stars4/5The Adventure: A Practical Guide to Spiritual Awakening Rating: 0 out of 5 stars0 ratingsThe Clear Light: Spiritual Reflections and Meditations Rating: 5 out of 5 stars5/5The Meaning Rating: 0 out of 5 stars0 ratingsThe Fall: With Afterword Rating: 5 out of 5 stars5/5I Can See It Now: Experiencing Tomorrow's Joy Today Rating: 0 out of 5 stars0 ratingsThe Out of Bounds Church?: Learning to Create a Community of Faith in a Culture of Change Rating: 4 out of 5 stars4/5The Mirror Rating: 0 out of 5 stars0 ratingsTaylor Made: Car Buying Tips to Save You Time and Money Rating: 0 out of 5 stars0 ratingsGateways to the Soul: Inner Work for the Outer World Rating: 0 out of 5 stars0 ratingsThe Rainbow Gang Rating: 0 out of 5 stars0 ratingsRoamer of Planes: Former title: My life Rating: 0 out of 5 stars0 ratings
Related to Building Android Applications for Beginners
Related ebooks
How To Program A Mobile Game Rating: 4 out of 5 stars4/5Android for Beginners: Step by Step guide to develop Android App Rating: 0 out of 5 stars0 ratingsMastering Android NDK Rating: 0 out of 5 stars0 ratingsGradle for Android Rating: 0 out of 5 stars0 ratingsMastering Android Application Development Rating: 5 out of 5 stars5/5Android Application Development with Maven Rating: 0 out of 5 stars0 ratingsiOS Programming For Beginners: The Ultimate iOS App Developer's Guide Rating: 3 out of 5 stars3/5Android For Beginners. Developing Apps Using Android Studio Rating: 4 out of 5 stars4/5Android Studio 2 Essentials - Second Edition Rating: 0 out of 5 stars0 ratingsAngularJS Deployment Essentials Rating: 0 out of 5 stars0 ratingsBeginning Mobile Application Development in the Cloud Rating: 0 out of 5 stars0 ratingsAndroid System Programming Rating: 5 out of 5 stars5/5Fundamentals of Android App Development: Android Development for Beginners to Learn Android Technology, SQLite, Firebase and Unity Rating: 0 out of 5 stars0 ratingsAndroid Studio Cookbook Rating: 4 out of 5 stars4/5Android App Development For Dummies Rating: 0 out of 5 stars0 ratingsLibgdx Cross-platform Game Development Cookbook Rating: 0 out of 5 stars0 ratingsAndroid Application Development Cookbook - Second Edition Rating: 5 out of 5 stars5/5Haxe Game Development Essentials Rating: 0 out of 5 stars0 ratingsThe Android Game Developer's Handbook Rating: 0 out of 5 stars0 ratingsMeteor Cookbook Rating: 5 out of 5 stars5/5Android Native Development Kit Cookbook Rating: 0 out of 5 stars0 ratingsOpenCV Android Programming By Example Rating: 0 out of 5 stars0 ratingsLearn iOS Application Development: Take Your Mobile App Development Skills to the Next Level with Swift and Xcode (English Edition) Rating: 0 out of 5 stars0 ratingsGame Programming Using Qt: Beginner's Guide Rating: 0 out of 5 stars0 ratingsAndroid for the BeagleBone Black Rating: 0 out of 5 stars0 ratingsFlash Development for Android Cookbook Rating: 3 out of 5 stars3/5Programming Kotlin Applications: Building Mobile and Server-Side Applications with Kotlin Rating: 0 out of 5 stars0 ratings
Programming For You
Python: For Beginners A Crash Course Guide To Learn Python in 1 Week Rating: 4 out of 5 stars4/5Python Programming : How to Code Python Fast In Just 24 Hours With 7 Simple Steps Rating: 4 out of 5 stars4/5HTML & CSS: Learn the Fundaments in 7 Days Rating: 4 out of 5 stars4/5Learn to Code. Get a Job. The Ultimate Guide to Learning and Getting Hired as a Developer. Rating: 5 out of 5 stars5/5SQL: For Beginners: Your Guide To Easily Learn SQL Programming in 7 Days Rating: 5 out of 5 stars5/5101 Amazing Nintendo NES Facts: Includes facts about the Famicom Rating: 4 out of 5 stars4/5Java for Beginners: A Crash Course to Learn Java Programming in 1 Week Rating: 5 out of 5 stars5/5SQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing, and Manipulating Data With SQL Rating: 4 out of 5 stars4/5Pokemon Go: Guide + 20 Tips and Tricks You Must Read Hints, Tricks, Tips, Secrets, Android, iOS Rating: 5 out of 5 stars5/5Coding All-in-One For Dummies Rating: 4 out of 5 stars4/5Python Machine Learning By Example Rating: 4 out of 5 stars4/5Learn SQL in 24 Hours Rating: 5 out of 5 stars5/5Linux: Learn in 24 Hours Rating: 5 out of 5 stars5/5PYTHON: Practical Python Programming For Beginners & Experts With Hands-on Project Rating: 5 out of 5 stars5/5Excel : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Excel Programming: 1 Rating: 5 out of 5 stars5/5C# 7.0 All-in-One For Dummies Rating: 0 out of 5 stars0 ratingsGrokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5SQL All-in-One For Dummies Rating: 3 out of 5 stars3/5ReactJS by Example - Building Modern Web Applications with React Rating: 4 out of 5 stars4/5
Reviews for Building Android Applications for Beginners
0 ratings0 reviews
Book preview
Building Android Applications for Beginners - Steve Taylor
Chapter 1 - Introduction
1.1 Audience
This book is intended for people with little or no knowledge of writing software. It will appeal to students and professionals wanting (or perhaps requiring) software experience and skills.
Little more is assumed of the reader other than a secondary-school understanding of how to use a computer. There is not even a need to own an Android device, the Android emulator discussed in this book will run most of the examples with adequate performance.
1.2 Aim of this book
The overall aim of this book is to allow the reader to learn through the experience and pragmatism of building simple examples and applications that can be visibly seen to run on an Android device. The book is perhaps more of a practical build a working go-kart
than a theoretical study of engineering (it is not intended as an investigation of software development techniques).
As with tutoring in general, the knowledge gained in the early stages may be superseded by more detailed knowledge or sophistication later. Rather than trawling through the detailed operation of tools or the theory of programming languages, the student is instead encouraged to experiment with the examples and applications. The details of tools and programming are developed in small increments, as required. The applications that are developed become more complex as knowledge and skills are built.
The skills developed through this book will however form a foundation for those wishing to progress further.
1.3 Example Java Code
Many of the examples in this book are either very short, or are built up gradually over perhaps a number of sections. In both cases manually typing the code into the editor (see later) is both easy and helpful for learning.
Larger examples however are available from the following website -
https://sites.google.com/site/stevebtaylortraining/
Find the appropriate book and click on Example Java Code
. Most are simply shown as plain text and can thus can be copied straight into the appropriate place in the editor, as described by each section in this book. Some may be sufficiently large that they are packaged in archive/zip files and require downloading and unpacking.
An example of the sort of application that can be built, using the knowledge gained from this book, is shown below -
This is a simple drawing application allowing shapes and colours to be selected and then drawn on the canvas. The Java source code for an example application similar to this can be found on the website and is discussed later in this book.
Chapter 2 - Background on Android Devices
Android is a software execution platform developed by the Open Source Community with support from Google. Android devices include phones (sometimes referred to as smart-phones) and tablets. These devices utilise touch displays and a limited number of physical buttons such as power on/off, audio volume, home, back, etc. Display sizes vary greatly from the smallest of phones through to tablets in excess of ten inches. Devices generally support automatic dynamic rotation and resizing of the display as the physical device is rotated. Storage is usually provided via internal solid state memory with most devices supporting external micro SD cards and tablets also supporting USB memory sticks. Network connectivity includes telephony cellular data on phones and Wi-Fi on many devices. Tablets often support an Ethernet connector. Other common integrated devices include camera (picture and video), microphone and GPS. Whilst intended for mobile use via the touch display, tablets usually support mice and keyboards with some having desktop docking stations.
The core of the Android Operating System is based on a cut-down version of the popular Linux Operating System. Applications for Android are mainly written in the Java programming language using an Android specific User Interface. Hence to build applications for Android some understanding of both Java and the Android Java specifics needs to be developed.
Chapter 3 - Conventions used in the book
Double quotes are used in the book generally to either delineate multi-word terms or to indicate names, the latter are often from Java source code.
The ->
sequence (dash followed by a right angled-bracket) indicates a navigation in a tool, usually a series of mouse clicks are required. The starting point for the navigation is often the tool’s menu bar.
Many programming languages, including Java, make extensive use of brackets (or braces) for various purposes, they each have multiple names, this book uses -
() round brackets or parentheses
[] square brackets
{} curly brackets
<> angle brackets
Chapter 4 - Getting started
The aim of this chapter is to quickly install the Android development tools and to create and run a very simple Android application. The development tools installed are used throughout this book.
4.1 Setup Development Tools
Android applications are generally not developed directly on Android platforms. Instead applications are typically developed on regular PC
s (sometimes referred to as workstations, desk-sides or laptops) and then moved across to an Android device where they run (or execute
). This style of development is sometimes referred to as cross platform development
as the development is being done on a host
platform (the PC) and the execution on a different target
platform (the Android device).
There are several software components that need to be installed to provide the infrastructure for Android application development. The installation of these is very straightforward.
The most visible component that needs to be installed is an Integrated Development Environment
(IDE). This provides facilities to configure the Android application, create graphical display layouts, edit Java Source Code, build the application, automatically transfer the application to an Android device or emulator and then run the application. Without an IDE a large number of tedious and error-prone steps would have to be implemented manually every time the application was changed.
The IDE used in this book is Eclipse
, combined with the Android Software Development Kit
(SDK) and the Android Development Tools (ADT). The Android SDK and ADT provide extensions to Eclipse to support the Android platform including an Android device emulator.
Eclipse is an Open Source IDE or platform
controlled by the Eclipse Foundation, more information, including licensing can be found on the Eclipse website. The SDK and ADT are part of the Android Open Source Project
(AOSP), led by Google, again more information, including licensing can be found on the Android Developer website.
Eclipse requires a Java Development Kit (JDK) to be installed on the host platform in order for it to run. The JDK is owned by Oracle, again more information, including licensing can be found on the Java section of the Oracle Technology Network website.
The following sections cover installation of the JDK, Eclipse, the SDK and the ADT. Ensure that licensing and system requirements are understood before proceeding.
4.2 Step 1 – Install the Java JDK
Download the latest Java Platform, Standard Edition (SE), Java Development Kit (JDK), a web search for Java SE downloads
should readily locate this. Ensure that the correct version for your host Operating System, including whether 32 or 64 bit, is selected. It is the full JDK that is required, not just the JRE
, (the JDK contains the JRE plus Java development tools). No demos, samples or SDK documentation downloads are required at this stage.
Install the SE JDK as per the website instructions. It is advisable to use the default install locations, offered during the JDK install process, certain tools seem to sometimes have difficulty if other locations are used. During the JDK installation process, the Java Runtime Environment (JRE) also installs, again the recommendation is to use the default installation location.
4.3 Step 2 – Install Eclipse
Download the latest version of Eclipse, a web search for perhaps Eclipse downloads
should readily locate the various Eclipse packages on the Eclipse website. The package Eclipse IDE for Java Developers
is recommended for Android development. Ensure that the correct download for your host Operating System, including whether 32 or 64 bit, is selected.
Since Eclipse is itself a Java application there is little to be done regarding installation. Unzip the downloaded Eclipse archive file to a location of your choosing. Within the top level directory of this unzipped archive, run the setup.exe file by double clicking on it. You may wish to create a shortcut to this Eclipse file.
Once running, Eclipse suggests a default directory for the application project files called a workspace
. Use the suggested directory unless you specifically want it elsewhere, you probably also want to select it as the default to prevent the question being asked again on every restart of Eclipse. Make a note of the location chosen, it is needed later. After a few seconds the Eclipse welcome window appears.
4.4 Step 3 – Install Android SDK and ADT
Within the IDE (Eclipse) select Help -> Install New Software
. Click on the Add
button, a new window pops-up, in the Name
field enter Android
, in the Location
field enter -
https://dl-ssl.google.com/android/eclipse/
then click OK
. A pending
message appears, after a few tens of seconds it is replaced with Developer Tools
, tick the box next to this and then click Next
. You may need to read and accept licenses etc as requested. The first stage of the Android tools for the IDE downloads and installs. When prompted restart the IDE.
Upon restart of the IDE a Welcome to Android Development
window appears, tick Install new SDK
then deselect Install the latest available version of Android APIs ...
and instead select Install Android 2.1 ...
. You may also wish to change the default installation location. Now click Next
, you may need to decide whether to allow the sending of usage information. After a few