CHAPTER 1 part 1 Introduction. Chapter objectives: Understand Android Learn the differences between Java and Android Java Examine the Android project.

Slides:



Advertisements
Similar presentations
Programming Mobile Applications with Android
Advertisements

ANDROID PROGRAMMING MODULE 1 – GETTING STARTED
INTERNATIONAL SUMMER ACADEMIC COURSE UNIVESITY OF NIS ISAC – Android programming.
Android Application Development CSE 5520/4520 Wireless Networks.
Emerging Platform#4: Android Bina Ramamurthy.  Android is an Operating system.  Android is an emerging platform for mobile devices.  Initially developed.
Android Programming. Outline Preparation Create new project Build and Run a project Debug a project Deploy on devices.
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.
Chapter 3 Navigating a Project Goals & Objectives 1.Get familiar with the navigation of the project. How is everything structured? What settings can you.
Android: versions Note that: Honeycomb (Android v3.0) A tablet-only release Jelly Bean (Android v4.1) Released on July 09, 2012.
CS5103 Software Engineering Lecture 08 Android Development II.
Android Programming By Mohsen Biglari Android Programming, Part1: Introduction 1 Part1: Introduction By Mohsen Biglari.
Chapter 2: Simplify! The Android User Interface
Copyright© Jeffrey Jongko, Ateneo de Manila University Android.
Basic Android Tutorial USF’s Association for Computing Machinery.
Android for Java Developers Denver Java Users Group Jan 11, Mike
© 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.
Presented By: Muhammad Tariq Software Engineer Android Training course.
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.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Introduction to Android (Part.
Creating an Example Android App in Android Studio Activity lifecycle & UI Resources.
First Venture into the Android World Chapter 1 Part 2.
ANDROID AND MODEL / VIEW / CONTROLLER. Slide 2 Design Patters Common solutions to programming problems are called design patterns Design patterns are.
ANDROID APPLICATION DEVELOPMENT. ANDROID DEVELOPMENT DEVELOPER.ANDROID.COM/INDEX.HTML THE OFFICIAL SITE FOR ANDROID DEVELOPERS. PROVIDES THE ANDROID SDK.
CHAPTER 1 Introduction. Chapter objectives: Understand what Android is Learn the differences between Java and Android Java Examine the Android project.
TODAY Android Studio Installation Getting started Creating your 1 st App Beginning to understanding Intents.
Intoduction to Andriod studio Environment With a hello world program.
Resources & Android Manifest Калин Кадиев Astea Solutions AD.
Mobile Software Development for Android - I397 IT COLLEGE, ANDRES KÄVER, WEB:
INTRODUCTION TO ANDROID. Slide 2 Introduction I take a top-down approach to describing an application’s anatomy.
CHAPTER 1 Part 2 Android Programming. Chapter objectives: Understand how to create a simple Android project Understand how to create a manifest file Understand.
Why Learn Android? Largest installation base of any operating system Over 20,000 Android devices exist Businesses will likely move more to device-based.
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.
Presenter Sudhanshu Gupta
Chapter 2: Simplify! The Android User Interface
Mobile Applications (Android Programming)
Mobile Applications (Android Programming)
Android Mobile Application Development
Android 01: Fundamentals
Open Handset Alliance.
Mobile Application Development BSCS-7 Lecture # 2
Obtaining the Required Tools
Chapter 2 Starting a Project
Android Runtime – Dalvik VM
Mobile Application Development Chapter 3 [Using Eclipse Android Studio for Android Development] IT448-Fall 2017 IT448- Fall2017.
Android Studio, Android System Basics and Git
Android.
MAD.
Development-Introduction
Mobile Device Development
Anatomy of an Android Application
Android SDK & App Development
CS5103 Software Engineering
Android Developer Fundamentals V2 Lesson 1
CHAPTER 1 Introduction Chapter objectives: Understand what Android is
Android Developer Fundamentals V2
Android Application Development
Android Platform, Android App Basic Components
Emerging Platform#3 Android & Programming an App
Mobile Programming Dr. Mohsin Ali Memon.
Introduction to Android
CMPE419 Mobile Application Development
CA16R405 - Mobile Application Development (Theory)
Presentation transcript:

CHAPTER 1 part 1 Introduction

Chapter objectives: Understand Android Learn the differences between Java and Android Java Examine the Android project structure Build a basic application using Android Studio Learn about the Model-View-Controller design

1.1Android Platforms Introduced in Android applications include – fluid animations, – sophisticated multitasking menus – voice interactions Current version as of Sept 2016 is Android 7 Nougat – Not on many devices yet – Previous version was Android 6 Marshmellow

Table 1-1 shows the evolution of Android

1.2 Java vs. Android Java A large number of Java libraries are available in the Android platform The SDK includes – a debugger, – software libraries, and – an emulator for an Android device

differences between the Java API and the Android API Java is run in a virtual machine (VM) – There is no Java virtual machine in the Android platform – Instead uses a specialized virtual machine called Dalvik Compiling apps – Java compiled into bytecode by the Java compiler, – Java bytecode compiled again into a Dalvik bytecode – uses the Dalvik dx tool Dalvik bytecode – not Java bytecode – is a compact executable format designed for Android systems

1.3 Android Studio IDE Android Studio is the official IDE for building Android applications – Can also develop on Eclipse; we won’t Developed by Google, Only for Android development comes bundled with the Android Software Development Kit, SDK The SDK provides – developer tools and – API libraries for building complete applications, – testing them on virtual devices, and – performing debugging and optimization

1.4 The Basics of App Design The process for building an application

Creating a project Starting a project – File -> New -> New Project – Must specify the minimum SDK. More devices vs more features – Choose template Creates a type of activity Note that the book asks for a different type of activity (Blank) that you may see (Basic) Do not choose “Empty”; this does not have a layout – Name the activity

Creating a project There are default activity and layout names – You can change to whatever you want – The tutorials use the default Do not use a fragment yet. Click finish May run into various problems – Filesystem case-sensitivity problem (easy to fix) – Missing styles on layout (fix automatically) – Failed to find toolbarStyle can ignore

1.5 The Anatomy of an Android Project A project built in Android Studio, will be structured similar to Figure 1-6 Project structure is organized by source code, the application’s resources, manifest settings, and build files All of these files are eventually packaged into an apk file, which represents the final app

Java Editor Layout Editor Android SDK Android SDK Archive AVD Gradle

1.5.1 Android Manifest File An AndroidManifest.xml, is required for every Android application This file uses XML code to define specific application information This information can include general application-wide settings such as the application’s style and launch icon.

1.5.1 Android Manifest File Supplies system attributes used with Android apps The package you created

1.5.1 Android Manifest File Sets the icon that will appear on the home screen to be an image that is in the mipmap folder Sets the background Only one application node An application can have many actvities but only one main activitiy

1.5.1 Android Manifest File <uses-feature android:name=“android.hardware.Camera”/> andoid:required=“true” /> <uses-permission android:name=“android.permission.Camera”/> <uses-permission android:name=“android.permission.WRITE_EXTERNAL_S TORAGE”/> The device must have a camera Can also set hardware requirements and require permissions (location services, SMS, access to external storage, etc.) App will request permission to use camera App will request permission to use external storage.

1.5.2 Java Source Code and Activity class files The Java source code of an application is placed in the java directory A main file is auto-generated when the project is first built: MainActivity or MyActivity, Name varies, depending on the Android Studio version Controls behavior of app when it first loads

1.5.2 Java Source Code and Activity class files An activity class corresponds to a single action that the user can perform Apps have one or more activities – Must have exactly one main activity Each activity is represented by a user interface called a layout Activities defined by two files: – Java class determines behavior – Layout determines visual representation

1.5.3 Resources All application resources are located in the res directory This directory contains subdirectories – drawable All drawable resources (images) – layout Defines the placement of visual objects including buttons, text, and images on the canvas that represents the activity. XML. – menu Defines the application menu bar. We’ll discuss this later. – mipmap The mipmap folders are only for placing your app/launcher icons (which are shown on the homescreen). – values Contains literal strings, colors, etc. that are referenced in the application

1.5.3 Drawable Resources The drawable folder is located in the res directory res contains the application resources Drawable resources are image files, such as application icons, buttons, and background textures – There is a default launch icon ic_launcher.png Recommend PNG format, non-interlaced, 24- bits. Do not have to be web-safe.

Android runs on a variety of devices. low-density small screens to high-density large screens dp = density-independent pixel Virtual pixel unit that is equivalent to one physical pixel on a 160-dpi screen. Conversion of dp to screen pixels (px): px = dp X (dpi/160) E.g., on a 240-dpi screen 1 dp = 1.5 px

generalized screen sizes: xlarge screens are at least 960dp x 720dp large screens are at least 640dp x 480dp normal screens are at least 470dp x 320dp small screens are at least 426dp x 320dp Developers often include 3-5 bit-mapped versions of an image for different generalized density buckets: low, medium, high, extra-high.

images Creating images – Start with raw resource in vector format – Generate images for each density using scale: xxhdpi:3.0 xhdpi:2.0 hdpi:1.5 mdpi:1.0 (baseline) – Android automatically chooses correct sized image e.g., a 300x300 image for xxhdpi device must be 200x200 for xhdpi, 150x150 for hdpi and 100x100 for mdpi

1.5.4 Layout XML files User interface screens are visually designed and coded as XML layout files Layout is managed by an activity Layouts can be arranged to account for different screen sizes (see chapter 2) Files are stored in the directory res/layout

1.5.4 Layout XML files

Value Resources Value resources: strings, colors, dimensions, styles Stored in res/values directory Implemented in XML Act as constants that can be used in the Java code. Value resources organized by type – strings.xml – colors.xml

Gradle Scripts Grade scripts are build files Stored in Gradle Scripts directory Set things like the minimum API level, target SDK version. – If SDK version different than API level app will run on the min API level device but source code must only use APIs from that level. Build system can generate multiple apk files with different build configurations so that different versions of app can be built.