XML Tutorial. NOTE: This course is for basic concepts of XML in line with our existing Android Studio project.

Similar documents
CS 403X Mobile and Ubiquitous Computing Lecture 3: Introduction to Android Programming Emmanuel Agu

Programming Concepts and Skills. Creating an Android Project

Introduction To Android

(Refer Slide Time: 0:48)

Getting Started with Android Development Zebra Android Link-OS SDK Android Studio

CPET 565 Mobile Computing Systems CPET/ITC 499 Mobile Computing. Lab & Demo 2 (Part 1-2) Hello-Goodbye App Tutorial

ECOM 5341 Mobile Computing(Android) Eng.Ruba A. Salamah

Building MyFirstApp Android Application Step by Step. Sang Shin Learn with Passion!

Configuring the Android Manifest File

CPET 565 Mobile Computing Systems CPET/ITC 499 Mobile Computing. Lab & Demo 2 (1 &2 of 3) Hello-Goodbye App Tutorial

Introduction To JAVA Programming Language

Chapter 2 Welcome App

Fig. 2.2 New Android Application dialog. 2.3 Creating an App 41

Save and Restore Backups using itunes File Sharing

Hello World. Lesson 1. Create your first Android. Android Developer Fundamentals. Android Developer Fundamentals

This document providesanoverview ofthestepsrequired to implement an android app which will call the ACH android SDK.

Tutorial on OpenCV for Android Setup

Questions and Answers. Q.1) Which of the following is the most ^aeuroeresource hungry ^aeuroepart of dealing with activities on android?

Android Application Development using Kotlin

(Refer Slide Time: 1:12)

Dreamweaver CS6. Table of Contents. Setting up a site in Dreamweaver! 2. Templates! 3. Using a Template! 3. Save the template! 4. Views!

BrainStorm Quick Start Card for Microsoft OneDrive for Business

Lab 3: Using Worklight Server and Environment Optimization Lab Exercise

Dreamweaver MX The Basics

Electronic Portfolios with Google Sites Create Your Site

CS 4518 Mobile and Ubiquitous Computing Lecture 2: Introduction to Android. Emmanuel Agu

University of Stirling Computing Science Telecommunications Systems and Services CSCU9YH: Android Practical 1 Hello World

ANDROID SYLLABUS. Advanced Android

Google Maps Troubleshooting

Tutorial for Importing Open Green Map Sites into Google Earth

Getting Started with Digital File Pro 2

CS 528 Mobile and Ubiquitous Computing Lecture 2a: Android UI Design in XML + Examples. Emmanuel Agu

OneNote 2016 Tutorial

MOBILOUS INC, All rights reserved

Android development. Outline. Android Studio. Setting up Android Studio. 1. Set up Android Studio. Tiberiu Vilcu. 2.

ANDROID APPS (NOW WITH JELLY BEANS!) Jordan Jozwiak November 11, 2012

Introduction to Android

INTRODUCTION TO ANDROID

Evoq 9 Content Managers Training Manual

CMSC 436 Lab 10. App Widgets and Supporting Different Devices

MyNIC Team Site - Document Sharing

Choose OS and click on it

Android Studio is google's official IDE(Integrated Development Environment) for Android Developers.

FrontPage Help Center. Topic: FrontPage Basics

OneDrive for Business

CS 4518 Mobile and Ubiquitous Computing Lecture 3: Android UI Design in XML + Examples. Emmanuel Agu

HCA Tech Note 120. Configuring the Control UI Home Page. Option 1: HCA constructs the home page

Understand applications and their components. activity service broadcast receiver content provider intent AndroidManifest.xml

USER GUIDE MADCAP CAPTURE 7. Getting Started

An Introduction to Google Blogger

'phred dist acd.tar.z'

Group B: Assignment No 8. Title of Assignment: To verify the operating system name and version of Mobile devices.

CSE 101 Introduction to Computers Development / Tutorial / Lab Environment Setup

The Python Mini-Degree Development Environment Guide

BlackBerry Developer Global Tour. Android. Table of Contents

Assistant Professor Computer Science. Introduction to Human-Computer Interaction

JSN ImageShow Configuration Manual Introduction

Creating a Website with Dreamweaver 4

OneDrive for Business

Introduction to PowerPoint 2007

USER GUIDES OWNCLOUD WEB USER GUIDE. INTRODUCTION: This guide provides details on how to use owncloud via the web.

Mobile Programming Lecture 1. Getting Started

THEMES CREATION TUTORIAL

28 JANUARY, Updating appearances. WordPress. Kristine Aa. Kristoffersen, based on slides by Tuva Solstad and Anne Tjørhom Frick

THE LAUNCHER. Patcher, updater, launcher for Unity. Documentation file. - assetstore.unity.com/publishers/19358

MAIL MERGE LABELS USE THE MAIL MERGE WIZARD

Jumping into GEMstudio. User guide 2013

Collage II Tips and Tricks

Nextiva Drive The Setup Process Mobility & Storage Option

Getting Started 1. Open the Hootsuite app directory and install the Google Drive for Hootsuite app

HR-Lite Database & Web Service Setup Guide

Remote Workspace. Nubo End User Guide. Version: 1.3 Date: June, Copyright 2017 by Nubo Inc. All rights reserved. Page 1

More on . More on

Iconasys Advanced 360 Product View Creator. User Guide (Mac OSX)

Agenda. Overview of Xamarin and Xamarin.Android Xamarin.Android fundamentals Creating a detail screen

Introduction to IBM Rational HATS For IBM System i (5250)

Mobile Print Guide for Brother iprint&label (Android )

Google Sites Training

IMPORTING AND EXPORTING ITEMS IN eportfolio

Managing System Administration Settings

Mumbai Android Bootcamp -Course Content

Android HelloWorld - Example. Tushar B. Kute,

1. Implementation of Inheritance with objects, methods. 2. Implementing Interface in a simple java class. 3. To create java class with polymorphism

About Customizing a SharePoint Server 2007 Site

Microsoft FrontPage Practical Session

Uploading Files. Creating Files

IBM Mobile Portal Accelerator Enablement

Android Development Tools = Eclipse + ADT + SDK

National Training and Education Resource. Authoring Course. Participant Guide

Café Soylent Green Chapter 12

Introduction to Android development

Upon completion of the second part of the lab the students will have:

Siteforce Pilot: Best Practices

Unifer Documentation. Release V1.0. Matthew S

How to Control and Override CSS by Including a CSS Link

A quick guide to installing the SpesCoin Wallet for Windows and MacOS users SPESCOIN WALLET. Installation Guide

Getting Started With Android Feature Flags

Syllabus- Java + Android. Java Fundamentals

CMS Shado 9. Quick Start Guide

Chapter 1 Introduction to Dreamweaver CS3 1. About Dreamweaver CS3 Interface...4. Creating New Webpages...10

Transcription:

XML Tutorial XML stands for extensible Markup Language. XML is a markup language much like HTML used to describe data. XML tags are not predefined in XML. We should define our own Tags. Xml is well readable both by human and machine. Also, it is scalable and simple to develop. In Android we use xml for designing our layouts because xml is a lightweight language so it doesn t make our layout heavy. NOTE: This course is for basic concepts of XML in line with our existing Android Studio project. 1 First, let s look at the project structure created and maintained in Android studio for XML. The image above is known as the module directory, in Android studio our application is a module that is simply named app by default. The app directory shows manifest directory, java directory, res (which stands for resources) directory and there is a separate directory named Gradle Script. For this course we will be looking at only the XML related directories. Let s take a look at the XML files in these directories and their uses. Manifest Directory: this contains a single file called AndroidManifest.xml. It is used to define all the components of an application. It includes the names of our application packages, our Activities, services and the permissions that our application needs.

res directory: this contains a number of sub-directories, which are: 2 Drawable: this is where we put our graphics. It includes xml files that are used to provide various graphics to the elements or views of application. Layout: this is where we put xml files that define the appearance of our screen or it can also be describe as xml files are used to define the actual UI (User interface) of our application. It holds all the elements (views) or the tools that we want to use in our application. Menu: this where we put other xml files that defines menus. Mipmap: this contains a number of png files known as launcher icons.

3 Values: this contains a bunch of xml files that defines colors, dimension, strings and styles. Let s look deeper into the Android manifest file. The Android manifest file is an xml file that describes the app to the operating system and the application framework. Let s take a look at the

4 file. The file s root element is always named manifest, and there is a required name space declaration that is then used prefix is then used in all the attributes throughout the file. Within the manifest there is an application child element and it has a number of properties that controls the

appearance and behavior of the app for the user. 5 The allowbackup attribute turns on or off the back-up feature of the app. This allows certain data files to be uploaded to Google servers and then restored when an application is re-installed (e.g whatsapp messages and media restore). The icon attributes points to a graphic. This is something called a resource id. The prefix starting with the @ points to the mipmap folder in the res directory. Which is sometimes shown as the label attributes use a string resource. It starts with a resource prefix: @string, that points to file that are in the values directory and specifically the values that are defined in the string.xml file. this is defined in the style.xml file. Within the application, there is an activity that is defined. Each activity must be registered in the application manifest.

6 the name refers to the Java class that implements the activity. The dot(.) is a shorthand code that means the base package. the label refers to the string resource app_name. in the application. the theme here can be used to override whatever theme that was set this is used to control how this activity can be used and each application should have one activity that is marked as the launcher activity. Let s put some of this knowledge to practice. The exercise for this class is to change our application name and icon. How to change the application name, we change the application name using the label attribute. Notice that the label attribute appears twice: in the application element and in the activity element.

7 The activity label overrides the application label. Let s proceed to changing the app name. Hold down ctrl key and then click on the hello world in the label attribute of the activity element. It takes you to the string resource definition, in a file named strings.xml Or you can navigate this file by clicking on the res directory, then click on values folder and click on strings.xml file. Change the name from Hello World to MyApp To confirm the changes let s run our app. Click from the menu bar, it shows your virtual device.

Click Ok 8 This will run our virtual device (it will take a few minutes to launch, please be patient). When it finishes, we should see this

Also you can confirm this by clicking on the back arrow in our virtual device 9

It will take you to the home menu of your device. 10

Then you click on the menu, to see the application on our device. 11

This will show the apps on the device. 12

13 You will notice that our app has been renamed. The icon on the app is the default android icon for applications. Let s proceed to change the icon. Copy this image and paste it to your desktop

14 This will be the image we will use as our new app icon and we will navigate to it on our Desktop. Let s proceed. Go to your app menu Right click, choose new then image asset It takes you to this screen called the image asset studio. This is where we will change our icon.

Click on the icon circled in the image above to navigate to the image we want to use as our app icon. It shows the select path menu 15

Navigate to your desktop and select the image you pasted there. 16

Click OK and notice the icon has changed 17

18 Click next and Click Finish Our icon has been successfully changed. To confirm, click on the res directory, then click

19 mipmap Then double click on the any of the ic_launcher.png file to preview the launcher image Finally let s run our app to confirm the change on our device Click on the run icon It shows that our virtual device is connected, then click

OK Our app will re-launch 20

21 Click the back icon It shows the apps on the device and you will notice that the icon has changed.

Congratulations, you have successfully changed the app name and icon image, which brings us to the end of the XML class. Thank you 22