Chapter 2 Welcome App

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

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

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

CS 528 Mobile and Ubiquitous Computing Lecture 2a: Introduction to Android Programming. Emmanuel Agu

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

04. Learn the basic widget. DKU-MUST Mobile ICT Education Center

ConstraintLayouts in Android

(Refer Slide Time: 0:48)

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

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

Mobile Programming Lecture 1. Getting Started

PART 7. Formatting Pages

Reference Services Division Presents. Microsoft Word 2

Android UI Development

Programming Concepts and Skills. Creating an Android Project

Chapter 2 Welcome App

Let s take a display of HTC Desire smartphone as an example. Screen size = 3.7 inches, resolution = 800x480 pixels.

CS378 -Mobile Computing. User Interface Basics

< building websites with dreamweaver mx >

Android App Development. Mr. Michaud ICE Programs Georgia Institute of Technology

What can Word 2013 do?

P3e REPORT WRITER CREATING A BLANK REPORT

CMSC 436 Lab 10. App Widgets and Supporting Different Devices

Configuring the Android Manifest File

Basic Concepts. Launching MultiAd Creator. To Create an Alias. file://c:\documents and Settings\Gary Horrie\Local Settings\Temp\~hh81F9.

CS 528 Mobile and Ubiquitous Computing Lecture 2: Intro to Android Programming Emmanuel Agu

Create new Android project in Android Studio Add Button and TextView to layout Learn how to use buttons to call methods. Modify strings.

The Newsletter will contain a Title for the newsletter, a regular border, columns, Page numbers, Header and Footer and two images.

Lab Android Development Environment

Comparative Study on Layout and Drawable Resource Behavior in Android for Supporting Multi Screen

EDITOR GUIDE. Button Functions:...2 Inserting Text...4 Inserting Pictures...4 Inserting Tables...8 Inserting Styles...9

Content Creation and Management System. External User Guide 3 Question types in CCMS (an overview)

Hello World. Lesson 1. Android Developer Fundamentals. Android Developer Fundamentals. Layouts, and. NonCommercial

CS260 Intro to Java & Android 05.Android UI(Part I)

CS260 Intro to Java & Android 05.Android UI(Part I)

Reference Services Division Presents. Microsoft Word 2

Electronic Portfolios in the Classroom

(Refer Slide Time: 1:12)

Using Microsoft Office 2003 Intermediate Word Handout INFORMATION TECHNOLOGY SERVICES California State University, Los Angeles Version 1.

About Freeway. Freeway s Tools and Palettes

And program Office to FlipBook Pro is powerful enough to convert your DOCs to such kind of ebooks with ease.

a child-friendly word processor for children to write documents

Mobile Computing Professor Pushpedra Singh Indraprasth Institute of Information Technology Delhi Andriod Development Lecture 09

Android Programming Lecture 2 9/7/2011

Tutorial 3 - Welcome Application

Orientation & Localization

Excel Select a template category in the Office.com Templates section. 5. Click the Download button.

Orchard Book Maker. From the main menu you may select one of the following options:

Android UI: Overview

ANDROID USER INTERFACE

Android Development Crash Course

Sizing and Positioning

Creating Web Pages with SeaMonkey Composer

Android UI DateBasics

Introductory Android Development

Window Designer. Opening Screen: When you start Window Designer, you will see the Opening Screen. Here you will be choosing from 4 options:

User Interface: Layout. Asst. Prof. Dr. Kanda Runapongsa Saikaew Computer Engineering Khon Kaen University

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

Dreamweaver Tutorials Working with Tables

ADOBE DREAMWEAVER CS4 BASICS

Administrative Training Mura CMS Version 5.6

Skill Exam Objective Objective Number. Setting Page Layout Modify page setup

FLIP BOOK MAKER FOR EPUB. Flip Book Maker for epub Create Amazing Page-flipping ebooks with EPUB. User Documentation

GUI Design for Android Applications

My First iphone App (for Xcode version 6.4)

Lab 3. Accessing GSM Functions on an Android Smartphone

Dreamweaver CS 5.5. University Information Technology Services. Training, Outreach, Learning Technologies, and Video Production

Week 5 Creating a Calendar. About Tables. Making a Calendar From a Table Template. Week 5 Word 2010

Creating Interactive PDF Forms

File: SiteExecutive 2013 Core Modules User Guide.docx Printed September 30, 2013

Gloucester County Library System. Microsoft 2010 PowerPoint

-Using Excel- *The columns are marked by letters, the rows by numbers. For example, A1 designates row A, column 1.

Microsoft How to Series

Praktikum Entwicklung Mediensysteme. Implementing a User Interface

Mobile App Design Project Doodle App. Description:

Forms for Android Version Manual. Revision Date 12/7/2013. HanDBase is a Registered Trademark of DDH Software, Inc.

Contents. Launching Word

LinkMotion and CorelDraw 9, 10, 11, 12, X3, X4, X5, X6, X7 and X8:

Minfos Label Maintenance. User Guide

Cognos. Active Reports Development. Presented by: Craig Randell

Android Programming (5 Days)

Picture Talk App Directions (Version 2 of App Inventor) Description:

(Refer Slide Time: 1:07)

Assistant Professor Computer Science. Introduction to Human-Computer Interaction

Table of Contents. Page 2 of 72. High Impact 4.0 User Manual

Quick Reference Card Business Objects Toolbar Design Mode

MOBILOUS INC, All rights reserved

CS371m - Mobile Computing. User Interface Basics

Paragraph Formatting 4

EMBEDDED SYSTEMS PROGRAMMING UI and Android

Produced by. Mobile Application Development. David Drohan Department of Computing & Mathematics Waterford Institute of Technology

Programming in C# Project 1:

User's Guide Album Express 7

NORTH CAROLINA A&T STATE UNIVERSITY CMS USER GUIDE. A Manual for the Cascade Server Content Management System (CMS)

Dreamweaver MX Overview. Maintaining a Web Site

A view is a widget that has an appearance on screen. A view derives from the base class android.view.view.

Website Editor. User Guide - Table of Contents. Overview. Use Case(s) Accessing the Tool. Editor Tools. Quick Tab Toolbar. Menu Bar.

CLICKER DOCS Table of Contents

COMP4521 EMBEDDED SYSTEMS SOFTWARE

Desktop Studio: Charts. Version: 7.3

Transcription:

2.8 Internationalizing Your App 1 Chapter 2 Welcome App 2.1 Introduction a. Android Studio s layout editor enables you to build GUIs using drag-and-drop techniques. b. You can edit the GUI s XML directly. c. In portrait orientation the device s width is greater than its height. d. Android s Explore by Touch enables users to touch items on the screen and hear TalkBack speak the corresponding descriptive text. Answer: c. Actually, in portrait orientation the device s height is greater than its width. Q2. You can an app so that you can provide localized strings in different languages. a. translate. b. convert. c. transcribe. d. internationalize. Answer: d. internationalize. 2.2 Technologies Overview 2.2.1 Android Studio 2.2.2 LinearLayout, TextView and ImageView Q1. are views that contain and arrange other views. a. Layouts. b. TextViews. c. ImageViews. Answer: a. Layouts Q2. Which of the following statements is false? a. You can use a vertical LinearLayout to arrange an app s text and image with each occupying half the LinearLayout s vertical space. b. A LinearLayout also can arrange views horizontally. c. The default GUI created by Android Studio already contains an ImageView.

2 Chapter 2 Chapter 2 Welcome App d. You can use the layout editor s Palette of views to drag and drop an ImageView onto a GUI, then configure its properties. Answer: c. The default GUI created by Android Studio already contains an ImageView. Actually, the default GUI created by Android Studio already contains a TextView. Q3. Which of the following statements is true? a. Extensible Markup Language (XML) is a natural way to express GUIs. b. XML is human- and computer-readable text and, in the context of Android, helps you specify the layouts and components to use, as well as their attributes, such as size, position, color, text size, margins and padding. c.you use XML files to store app resources, such as strings, numbers and colors. d. All of the above are true. Answer: d. All of the above are true. 2.2.3 App Resources Q1. (True/False) It s considered good practice to define all strings, numeric values and other values in XML resource- files that are placed in the subfolders of a project s resources folder. Answer: False. Actually, it s the res folder. Q2. (True/False) For a TextView font color, you should typically create a color resource using a color selected from Google s Material Design color palette. Answer: True. 2.2.4 Accessibility Q1. Which of the first three statements below is false? a. Android provides accessibility features to help people with certain disabilities use their devices. b. People with visual impairments can use Android s TalkBack to allow a device to speak screen text or text that you provide to help them understand the purpose and contents of a view. c. Android s Explore by Touch enables the user to touch the screen to hear TalkBack speak what s on the screen near the touch. d. All of the above are true. Answer. d. All of the above are true. 2.2.5 Internationalization Q1. Which of the following statements is true? a. To reach the most users with your apps, you should consider customizing them for various locales and spoken languages. b. Configuring your app so that it can be customized for various locales is known as localization. c. Customizing your app for a specific locale is known as internationalization.

2.8 Internationalizing Your App 3 d. All of the above statements are false. Answer. a. To reach the most users with your apps, you should consider customizing them for various locales and spoken languages. 2.3 Creating an App 2.3.1 Launching Android Studio 2.3.2 Creating a New Project Q1. A is a group of related files, such as code files, resource files and images that make up an app. a. folder b. directory c. solution d. project Answer: d. project. 2.3.3 Create New Project Dialog a. The package name normally begins with your company s or institution s Company Domain in reverse. This is followed by a dot (.) and the app s name in all lowercase letters with any spaces removed. b. By convention, package names use only lowercase letters. c. The IDE sets the package name using the text you enter for Company Name and Company Domain. d. By default, Android Studio places new project folders in the subfolder AndroidStudioProjects in your user account directory. Answer: c. The IDE sets the package name using the text you enter for Company Name and Company Domain. Actually, the IDE sets the package name using the text you enter for Application Name and Company Domain. 2.3.4 Target Android Devices Step a. The Minimum SDK is the minimum Android API level that s required to run your app. This allows your app to execute on devices supporting that API level and higher. b. Lower Minimum SDK values enable your app to run on more devices. c. Generally you should target the highest API level on which your app can run. d. You must disable newer features that are not available on older platforms when your app is installed on those platforms. Answer: c. Generally you should target the highest API level on which your app can run. Actually, generally you should target the lowest API level on which

4 Chapter 2 Chapter 2 Welcome App your app can run, so your app can run on the largest possible number of devices. 2.3.5 Add an Activity to Mobile Step Q1. Which type of app template is described by: "Used for a single-screen app (similar to Blank Activity) that occupies the entire screen, but can toggle visibility of the device s status bar and the app s app bar." a. Empty Activity. b. Fullscreen Activity. c. Master/Detail Flow. Answer: b. Fullscreen Activity. 2.3.6 Customize the Activity Step 2.4 Android Studio Window 2.4.1 Project Window Q1. The window provides access to all of the project s files. a. Organizer b. Explorer c. Project Answer: c. Project Q2. (True/False) You can have only one project open in the IDE at once. Answer: False. Actually, you can have many projects open in the IDE at once each in its own window. Q3. The folder contains the files you ll edit to create your apps GUIs and logic. a. java b. res c. app d. manifests Answer: c. app 2.4.2 Editor Windows Q1. The code editors for Java and XML help you write code quickly and correctly via as you type, you can press Enter (or Return) to automatically finish a

2.8 Internationalizing Your App 5 Java code element or an XML element name, attribute name or value that is currently highlighted in the code-completion window. a. code-for-me b. code-completion c. automated coding Answer: b. code-completion 2.4.3 Component Tree Window Q1. When the layout editor is open in Design view, the appears at the right side of the IDE. This window shows the layouts and views (GUI components) that comprise the GUI and their parent-child relationships for example, a layout (the parent) might contain many nested views (the children), including other layouts. a. Project window b. Properties window c. Palette d. Component Tree Answer: d. Component Tree 2.4.4 App Resource Files Q1. Layout files like activity_main.xml are app and are stored in subfolders of the project s res folder. a. code b. descriptions c. resources Answer: Actually, it s the res folder. 2.4.5 Layout Editor 2.4.6 Default GUI Q1. With a you can, for example, specify that one view should appear below another and be centered horizontally within this layout. a. LinearLayout b. CenteredLayout c. RelativeLayout Answer: c. RelativeLayout 2.4.7 XML for the Default GUI Q1. In a layout XML file, attribute values that begin with @, such as

6 Chapter 2 Chapter 2 Welcome App @dimen/activity_vertical_margin are with values defined in other files. a. resources b. variables c. dimentions Answer: a. resources 2.5 Building the App s GUI with the Layout Editor Q1. Android Studio allows you to build your GUI by dragging and dropping views such as Text-Views, Image-Views and Buttons onto the. a. GUI designer b. layout designer c. GUI editor d. layout editor Answer: d. layout editor 2.5.1 Adding an Image to the Project a. Android devices have various screen sizes, resolutions and pixel densities (that is, dots per inch or DPI), so you typically provide images in various resolutions that the operating system chooses based on a device s pixel density. These are placed in drawable folders (in a project s res folder) that store images with different pixel densities. b. Android Studio displays only one drawable folder containing the app s drawable resources, even if your project contains resources for multiple densities. c. If Android cannot find an image in the drawable folder that most closely matches the device s pixel density, Android will display nothing for that image. d. Low-resolution images do not scale well. For images to render nicely, a high-pixel-density device needs higher-resolution images than a low-pixel-density device. Answer: c. If Android cannot find an image in the drawable folder that most closely matches the device s pixel density, Android will display nothing for that image. Actually, if Android cannot find an image in the drawable folder that most closely matches the device s pixel density, Android will scale the version from another drawable folder up or down as necessary. 2.5.2 Adding an App Icon Q1. When your app is installed on a device, its icon and name appear with all other installed apps in the. a. finder b. explorer c. launcher

2.8 Internationalizing Your App 7 Answer: c. launcher Q2. Which of the first three statements about uploading apps to Google Play is false? a. You can upload multiple versions of the app for various device- sizes and screen resolutions. b. All images in the mipmap folders are uploaded with every version of your app. c. You can remove extra drawable folders for specific pixel densities from a given app version to minimize the total installation size for a particular device. d. All of the above are true. Answer: d. All of the above are true. 2.5.3 Changing RelativeLayout to a LinearLayout Q1. When you open a layout XML file, the layout s design appears in the layout editor and the layout s views and their hierarchical relationships appear in the window. a. Outline b. Tree c. Layout Editor d. Component Tree Answer: d. Component Tree 2.5.4 Changing the LinearLayout s id and orientation a. When a GUI is displayed in the layout editor, you can use the Properties window below the Component Tree to configure the selected view s properties. b. You also can edit a view s most commonly used properties by double clicking the view in the canvas. The layout editor then displays a small dialog in which you can set the view s id property and other properties that depend on the specific view: c. For a LinearLayout, you can set the orientation to specify whether the layout s children are arranged in horizontal or vertical orientation. d. For an ImageView, you can set the src (source) of the image to display. Answer: c. For a LinearLayout, you can set the orientation to specify whether the layout s children are arranged in landscape or portrait orientation. Actually, for a LinearLayout, you can set the orientation to specify whether the layout s children are arranged in horizontal or vertical orientation. 2.5.5 Configuring the TextView s id and text Properties a. It s considered good practice to place strings, string arrays, images, colors, font sizes, dimensions and other app resources in XML files within the subfolders of the project s res folder, so these resources can be managed separately from your app s Java code. b. If you externalize color values, it becomes more difficult to update all components that use the same color.

8 Chapter 2 Chapter 2 Welcome App c. If you wish to localize your app in several languages, storing the strings separately from the app s code allows you to change them easily. d. In your project s res folder, the subfolder values contains a strings.xml file that s used to store the app s default language strings English for our apps. Answer: b. If you externalize color values, it becomes more difficult to update all components that use the same color. Actually, if you externalize color values, all components that use the same color can be updated to a new color simply by changing the color value in a central resource file. 2.5.6 Configuring the TextView s textsize Property Scaled Pixels and Density-Independent Pixels a. You should use density-independent pixels for font sizes, and scale-independent pixels for dimensions of views and other screen elements. b. Defining your GUIs with density-independent pixels enables the Android platform to scale the GUI, based on the pixel density of a given device s screen. c. One density-independent pixel is equivalent to one pixel on a 160-dpi screen. d. On a 240-dpi screen, each density-independent pixel will be scaled by a factor of 240/160 (i.e., 1.5). So, a component that s 100 density-independent pixels wide will be scaled to 150 actual pixels wide. Answer: a. You should use density-independent pixels for font sizes, and scale-independent pixels for dimensions of views and other screen elements. Actually, you should use density-independent pixels for dimensions of views and other screen elements, and scale-independent pixels for font sizes. 2.5.7 Setting the TextView s textcolor Property a. When you need custom colors in your apps, Google s Material Design guidelines recommend using colors from the Material Design color palette. b. Colors are specified as RGB (red-green-blue) or ARGB (alpha-red-green-blue) values. c. An RGB value consists of integer values in the range 1 100 that define the amounts of red, green and blue in the color, respectively. d. Custom colors are defined in hexadecimal format, so the RGB components are values in the range 00 (the hexadecimal value for 0) to FF (the hexadecimal value for 255). Answer: c. An RGB value consists of integer values in the range 1 100 that define the amounts of red, green and blue in the color, respectively. Actually, an RGB value consists of integer values in the range 0 255 that define the amounts of red, green and blue in the color, respectively. 2.5.8 Setting the TextView s gravity Property Q1. To center the text in the TextView if it wraps to multiple lines, you can set its property to center.

2.8 Internationalizing Your App 9 a. alignment b. weight c. gravity d. positioning Answer: c. gravity 2.5.9 Setting the TextView s layout:gravity Property 2.5.10 Setting the TextView s layout:weight Property Q1. A LinearLayout can proportionally size its children based on their, which specify the view s relative size with respect to the layout s other views. a. layout:widths b. layout:heights c. layout:gravity d. layout:weights Answer: d. layout:weights Q2. Android checks your project for common errors, and makes suggestions for better security-, enhanced performance, improved accessibility, internationalization- and more. Some checks occur as you build your apps and write code. a. Cleanser. b. Lint. c. Error Checker. Answer: b. Lint 2.5.11 Adding an ImageView to Display the Image Q1. Which of the following statements about adding an ImageView to the GUI by dragging it from the Palette s Widgets section onto the canvas is false? a. When you drag a view onto the canvas, the layout editor displays orange guide lines, green guide lines and a tooltip. b. The orange guide lines show the bounds of each existing view in the layout. c. The green guide lines indicate where the new view will be placed with respect to the existing views by default, new views are added at the top of a vertical Linear- Layout, unless you position the mouse below the orange box that bounds the layout s bottommost view. d. The tooltip displays how the view will be configured if you drop it at the current position. Answer: c. The green guide lines indicate where the new view will be placed with respect to the existing views by default, new views are added at the top of a vertical LinearLayout, unless you position the mouse below the orange box that bounds the layout s bottommost view. Actually, by default, new views are added

10 Chapter 2 Chapter 2 Welcome App at the bottom of a vertical LinearLayout, unless you position the mouse above the orange box that bounds the layout s topmost view. 2.5.12 Previewing the Design 2.6 Running the Welcome App 2.7 Making Your App Accessible a. For people with visual disabilities, Android s TalkBack can speak screen text or text that you provide (when designing your GUI or programmatically) to help the user understand the purpose of a view. b. Android also provides Explore by Touch, which enables the user to hear TalkBack speak what s on the screen where the user touches. c. Most standard Android views support accessibility. d. You enable TalkBack in the Settings app under Accessibility. From that page, you also can enable other Android accessibility features such as a larger default text size and the ability to use gestures that magnify areas of the screen. Answer: c. Most standard Android views support accessibility. Actually, all standard Android views support accessibility. Q2. For an ImageView there is no text for TalkBack to speak unless you provide it. It s considered good practice in Android to ensure that every view can be used with TalkBack by providing text for the property of any view that does not display text. a. talkback b. description c. hint d. contentdescription Answer: d. contentdescription 2.8 Internationalizing Your App a. To reach the largest possible audience, you should consider designing your apps so that they can be customized for various locales and spoken languages. b. You might also choose to use different colors, graphics and sounds based on the locale. c. When the user launches the app, Android automatically finds and loads the resources that match the device s locale settings.

2.8 Internationalizing Your App 11 d. Designing an app so it can be customized is known as localization. Customizing an app s resources for each locale is known as internationalization. Answer: d. Designing an app so it can be customized is known as localization. Customizing an app s resources for each locale is known as internationalization. Actually, designing an app so it can be customized is known as internationalization. Customizing an app s resources for each locale is known as localization. 2.8.1 Localization 2.8.2 Naming the Folders for Localized Resources Q1. Android uses a special folder-naming scheme to automatically choose the correct localized resources. You can name these folders with region information values-en-rus would contain a strings.xml file for United States English and would contain a strings.xml file for United Kingdom English. a. values-en-ruk b. values-en-ren c. values-en-rgb d. values-en-rbr Answer: c. values-en-rgb Q2. If localized resources are not provided for a given locale, Android uses the app s default resources that is, those in the res folder s subfolder. a. defaults b. english c. values d. strings Answer: c. values 2.8.3 Adding String Translations to the App s Project Q1. Android Studio provides a for quickly and easily adding translations for existing strings in your app. a. Translator b. Translations Editor c. Converter Answer: b. Translations Editor 2.8.4 Localizing Strings

12 Chapter 2 Chapter 2 Welcome App 2.8.5 Testing the App in Spanish on an AVD Q1. If Android cannot find a localized version of a string resource, it uses the default version in the file. a. res/values/defaults.xml b. res/values/english.xml c. res/values/values.xml d. res/values/strings.xml Answer: d. res/values/strings.xml 2.8.6 Testing the App in Spanish on a Device 2.8.7 TalkBack and Localization Q1. When you first switch your device to French and enable TalkBack, Android will automatically download the engine. a. English-to-French. b. Translations. c. French text-to-speech. d. French Transalation. Answer: c. French text-to-speech. 2.8.8 Localization Checklist 2.8.9 Professional Translation