INTRODUCTION TO ANDROID. Slide 2 Introduction I take a top-down approach to describing an application’s anatomy.

Slides:



Advertisements
Similar presentations
Programming Mobile Applications with Android
Advertisements

Programming with Android: SDK install and initial setup Luca Bedogni Marco Di Felice Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna.
All About Android Introduction to Android 1. Creating a New App “These aren’t the droids we’re looking for.” Obi-wan Kenobi 1. Bring up Eclipse. 2. Click.
The Android Activity Lifecycle. Slide 2 Introduction Working with the Android logging system Rotation and multiple layouts Understanding the Android activity.
Hello world Follow steps under the sections “Create an AVD” and “Create a New Android Project” at
Filip Debelić What is it? Android is a mobile operating system (OS) based on the Linux kernel and currently developed by Google Android,
User Interface Android Applications. Activities An activity presents a visual user interface. Each activity is given a default window to draw in. The.
Android: Hello World Frank Xu Gannon University. Steps Configuration ▫Android SDK ▫Android Development Tools (ADT)  Eclipse plug-in ▫Android SDK and.
Android Life Cycle CS328 Dick Steflik. Life Cycle The steps that an application goes through from starting to finishing Slightly different than normal.
Basic, Basic, Basic Android. What are Packages? Page 346 in text Package statement goes before any import statements Indicates that the class declared.
Android Programming Beomjoo Seo Sep., 12 CS5248 Fall 2012.
ANDROID PROGRAMMING MODULE 1 – GETTING STARTED
INTERNATIONAL SUMMER ACADEMIC COURSE UNIVESITY OF NIS ISAC – Android programming.
Android Programming. Outline Preparation Create new project Build and Run a project Debug a project Deploy on devices.
Android Application Development 2013 PClassic Chris Murphy 1.
Better reference the original webpage :
Mobile Programming Lecture 1 Getting Started. Today's Agenda About the Eclipse IDE Hello, World! Project Android Project Structure Intro to Activities,
Introduction to Android Programming Content Basic environmental structure Building a simple app Debugging.
Introducing the Sudoku Example
Chapter 3 Navigating a Project Goals & Objectives 1.Get familiar with the navigation of the project. How is everything structured? What settings can you.
 Understanding an activity  Starting an activity  Passing information between activities  Understanding intents  Understanding the activity lifecycle.
CS5103 Software Engineering Lecture 08 Android Development II.
© Keren Kalif Intro to Android Development Written by Keren Kalif, Edited by Liron Blecher Contains slides from Google I/O presentation.
Favorite Twitter® Searches App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
Hello world Follow steps under the sections “Create an AVD” and “Create a New Android Project” at
Chapter 2: Simplify! The Android User Interface
Intro to Android Development Ben Lafreniere. Getting up and running Don’t use the VM! ials/hello-world.html.
1 Programming in Android. 2 Outline 3 What you get from Android An Android Application is a Loosely-Coupled Software System The Project Structure The.
Tip Calculator App Building an Android App with Java © by Pearson Education, Inc. All Rights Reserved.
CS378 - Mobile Computing Intents.
Eclipse Tutorial Barrett Summer Scholars 2011 Sustainable Engineering: Learning to Engineer Truly Green Products.
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Android Boot Camp.
Chapter 2 The Android User Interface. Objectives  In this chapter, you learn to:  Develop a user interface using the TextView, ImageView, and Button.
INTRODUCTION TO ANDROID. Slide 2 Application Components An Android application is made of up one or more of the following components Activities We will.
Android Boot Camp for Developers Using Java, 3E
Resources. Application Resources Resources are strings, images, and other pieces of application information that are stored and maintained (externalized)
Configuring Android Development Environment Nilesh Singh.
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 2: Simplify! The Android User Interface.
Android 3: Exploring Apps and the Development Environment Kirk Scott 1.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Introduction to Android (Part.
Android Hello World 1. Click on Start and type eclipse into the textbox 2.
Creating an Example Android App in Android Studio Activity lifecycle & UI Resources.
Android 3: Exploring Apps and the Development Environment Kirk Scott 1.
First Venture into the Android World Chapter 1 Part 2.
Introduction to Android
ANDROID AND MODEL / VIEW / CONTROLLER. Slide 2 Design Patters Common solutions to programming problems are called design patterns Design patterns are.
HW#9 Clues CSCI 571 Fall, HW#9 Prototype
ANDROID APPLICATION DEVELOPMENT. ANDROID DEVELOPMENT DEVELOPER.ANDROID.COM/INDEX.HTML THE OFFICIAL SITE FOR ANDROID DEVELOPERS. PROVIDES THE ANDROID SDK.
Intoduction to Andriod studio Environment With a hello world program.
ANDROID LAYOUTS AND WIDGETS. Slide 2 Introduction Parts of the Android screen Sizing widgets and fonts Layouts and their characteristics Buttons, checkboxes.
Android apps development - Eclipse, Android SDK, and ADT plugin Introduction of.
CHAPTER 1 part 1 Introduction. Chapter objectives: Understand Android Learn the differences between Java and Android Java Examine the Android project.
Introduction to Android Programming
Introduction to Android Chapter 1 1. Objectives Understand what Android is Learn the differences between Java and Android Java Examine the Android project.
Android 3: Exploring Apps and the Development Environment
Android 3: Exploring Apps and the Development Environment
Android Mobile Application Development
Mobile Application Development BSCS-7 Lecture # 2
Obtaining the Required Tools
Mobile Application Development Chapter 3 [Using Eclipse Android Studio for Android Development] IT448-Fall 2017 IT448- Fall2017.
Android Studio, Android System Basics and Git
MAD.
Development-Introduction
The Android Activity Lifecycle
Anatomy of an Android Application
Android Developer Fundamentals V2 Lesson 1
Android Application Development
Mobile Programming Dr. Mohsin Ali Memon.
Presentation transcript:

INTRODUCTION TO ANDROID

Slide 2 Introduction I take a top-down approach to describing an application’s anatomy

Slide 3 Android Manifest (Description) It contains the information necessary to compile and run an Android application It’s an XML document that uses the Android namespace It defines the SDK versions It defines the activity(s) and startup activity

Slide 4 Android Manifest (Illustration) The purpose of AndroidManifest.xml is similar to web.config or app.config Simply put, it describes the application

Slide 5 Android Manifest (Editing) Eclipse supports a WYSISYG editor

Slide 6 Resources (Introduction) Android uses resources to store data such as strings and window sizes layouts (windows) Icons And more All are represented as XML documents All appear in the folder res

Slide 7 Resources (Folders) These folder names are significant res/drawable-xxx contains the icons used by an application res/menu contains the application’s menu(s) res/values/strings.xml contains string resources res/values/dimens.xml contains sizes res/values/styles contains themes

Slide 8 The res/Menu Folder It defines an application’s menu(s) element contains elements Again, Eclipse provides a WYSIWYG editor More later

Slide 9 The res/values Fodler The folder values\strings.xml contains the application’s textual content

Slide 10 String Resources (res/values/Strings.xml) Strings literals are stored in the file strings.xml Root element is elements contain the literal strings name attribute contains the id Element’s value contains the string’s value

Slide 11 Strings.xml And we reference those strings from the layout.xml

Slide 12 Dimens.xml It contains default screen values element contains a dimension name attribute contains the key Element content contains the value

Slide 13 Resource Files Android R.java is an auto-generated file by AAPT (Android Asset Packaging Tool) that contains resource IDs for all the resources of res/ directory If you create any component in the activity_main.xml file, the id for the corresponding component is automatically created in this file The id can be used in the activity source file to perform any action on the component

Slide 14 Resource File (Example)

Slide 15 Activities (Introduction) An Activity has a single screen with a UI Program logic is wired to a screen in a structured way (MVC) A program is initiated by running the default activity (Rather than main in a Java program) An activity is executed via predefined callbacks These are just procedures called by the Android infrastructure Most programs will have several activities

Slide 16 Activities (Parts) And activity has two parts One or more layouts that depict the screen A code file (Java)

Slide 17 Activity (Layout) Each activity appears as an XML file in the res/layout folder It defines layout of the screen and the widgets appearing on the screen

Slide 18 Activity (Layout) (Example) x

Slide 19 Application Components (Activities) (2) An activity is a class that derives from Activity Then we must override a couple of base class methods onCreate() And several others

Slide 20 Application Components (Activities) ( onCreate indicates that we are overriding a base class method It’s an informative annotation Annotations are used to control compiler behavior Similar to.NET attributes

Slide 21 Application Components (Activities) ( onCreate ) super.onCreate calls the base class method super is roughly equivalent MyBase in VB It typically appears as the first statement in the method

Slide 22 Application Components (Activities) ( onCreate ) setContentView takes one argument – the resource id corresponding to the activity It associates a particular view with the activity The resource is always named R layout is the layout that you want to use Followed by the resource id of the layout

Slide 23

Slide 24 Creating a First Project Click File, New, Project. Select Android Application Project

Slide 25 Define Application Parameters (1) Don’t use an old Minimum Required SDK

Slide 26 Define Application Parameters (1) The Application Name appears in the store when deployed The Project Name is only relevant to Eclipse The Package Name contains a reverse domain name It must be unique and must not be changed – this is how versioning is performed

Slide 27 Define Application Parameters (2) Minimum Required SDK contains the minimum SDK version on which the application will run Target SDK contains the desired SDK version on which the application will run Compile with contains the SDK version that will be used to compile the application Theme defines basic UI characteristics

Slide 28 Configure Project Create activity

Slide 29 Configure Icons Configuring the icons Just use the defaults

Slide 30 Create Blank Activity Create the default activity This gives you a blank screen (form) (Blank Activity)

Slide 31 Name the Activity and Layout Choose the default values

Slide 32 Application Anatomy (1) The file MainActivity.java contains the java code for the application’s activity (screen) Default methods are created too (onCreate, …)

Slide 33 Application Anatomy (4) The file activity_main.xml contains the XML code that describes the user interface layout

Slide 34 Setting up the Emulator (1) We can run programs via an emulator or directly attached to a physical device Using windows, you might need the driver from the device manufacturer

Slide 35 Setting up the Emulator (2) Click Window, Android Device Manager Click Create to create the new device I suggest the following settings

Slide 36 Setting up the Emulator (3) Under Windows set the memory to no more than 512MB

Slide 37 Setting up the Emulator (3)

Slide 38 Starting the Emulator Set the display characteristics Note that it takes a while to start the emulator

Slide 39 Running Hello World The emulator should start and be rendered Again, it takes a while to start

Slide 40 Running Hello World (5) Now run the application

Slide 41 Guidelines for Running on a Native Host (1) First, plug the device in If running Windows, you will likely need a device driver

Slide 42 References m-usb.html m-usb.html