Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807 1 Introduction to Android (Part.

Slides:



Advertisements
Similar presentations
Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Advertisements

Ando-it-yourself droid Praveen Kumar Pendyala. Outline Brief intro to the Droid developement Setting up the Life saviors - Development tools Hello Droid.
Chapter 3 – Web Design Tables & Page Layout
Programming with Android: SDK install and initial setup Luca Bedogni Marco Di Felice Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna.
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,
Eclipse Introduction Dwight Deugo Nesa Matic
1 of 5 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
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 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.
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.
Getting Started with Dreamweaver
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 9: Customize! Navigating with a Master/Detail.
1 Chapter One A First Program Using C#. 2 Objectives Learn about programming tasks Learn object-oriented programming concepts Learn about the C# programming.
A First Program Using C#
Chapter 3 Navigating a Project Goals & Objectives 1.Get familiar with the navigation of the project. How is everything structured? What settings can you.
Lesson 11: Maximizing Site Design Introduction to Adobe Dreamweaver CS6 Adobe Certified Associate: Web Communication using Adobe Dreamweaver CS6.
Computer Literacy BASICS: A Comprehensive Guide to IC 3, 5 th Edition Lesson 3 Windows File Management 1 Morrison / Wells / Ruffolo.
Copyright © Texas Education Agency, All rights reserved. 1 Web Technologies Website Development with Dreamweaver.
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.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 2 - Welcome Application: Introduction to C++
The NetBeans IDE CSIS 3701: Advanced Object Oriented Programming.
Eclipse Overview Introduction to Web Programming Kirkwood Continuing Education Fred McClurg © Copyright 2015, Fred McClurg, All Rights Reserved.
Web Technologies Website Development Trade & Industrial Education
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
Copyright© Jeffrey Jongko, Ateneo de Manila University Android.
Tip Calculator App Building an Android App with Java © by Pearson Education, Inc. All Rights Reserved.
IE 411/511: Visual Programming for Industrial Applications
Basic Android Tutorial USF’s Association for Computing Machinery.
Website Development with Dreamweaver
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Using Android XML Resources.
© 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
Configuring Android Development Environment Nilesh Singh.
Android 3: Exploring Apps and the Development Environment Kirk Scott 1.
Unit 1: Java and Eclipse The Eclipse Development Environment.
Creating an Example Android App in Android Studio Activity lifecycle & UI Resources.
Topic Java EE installation (Eclipse, glassfish, etc.) Eclipse configuration for EE Creating a Java Web Dynamic Project Creating your first servlet.
Android 3: Exploring Apps and the Development Environment Kirk Scott 1.
First Venture into the Android World Chapter 1 Part 2.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 5.1 Test-Driving the Inventory Application.
ANDROID APPLICATION DEVELOPMENT. ANDROID DEVELOPMENT DEVELOPER.ANDROID.COM/INDEX.HTML THE OFFICIAL SITE FOR ANDROID DEVELOPERS. PROVIDES THE ANDROID SDK.
Computer Literacy BASICS: A Comprehensive Guide to IC 3, 5 th Edition Lesson 3 Windows File Management 1 Morrison / Wells / Ruffolo.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files 8/10/ :35 PM.
Intoduction to Andriod studio Environment With a hello world program.
Flag Quiz Game App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
1 1 1 Introduction to Java. 2 History of Java Java – Originally for intelligent consumer-electronic devices – Then used for creating Web pages with dynamic.
INTRODUCTION TO ANDROID. Slide 2 Introduction I take a top-down approach to describing an application’s anatomy.
Android apps development - Eclipse, Android SDK, and ADT plugin Introduction of.
C Copyright © 2009, Oracle. All rights reserved. Using SQL Developer.
Android 3: Exploring Apps and the Development Environment
Android 3: Exploring Apps and the Development Environment
The eclipse IDE IDE = “Integrated Development Environment”
Anatomy of an Android Application
Mobile Computing With Android ACST 4550 Android Logs and Gestures
CS5103 Software Engineering
Android Developer Fundamentals V2 Lesson 1
Mobile Programming Dr. Mohsin Ali Memon.
Presentation transcript:

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Introduction to Android (Part 4) Folders, XML, Editors, Logs

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved An Android project is composed of a number of parts. Folders are used to organize most of the files created by the developer and created by the Android tools. The Package Explorer View (on right) presents a logical view of the folders that is close to the physical arrangement. 1 1 Folders

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved The src folder contains Java source code. When an Android project is initially created, a single Activity class is created. Java packages are seen as subfolders inside the src folder. Certain source files in an Android application must be contained in a two level package hierarchy. In this example, the package is cs2302.firstproject. Folders: src

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved The gen folder contains specially generated files that are used and accessed by your application, such as the ‘R.java’ file that contains Java source representations of identifiers in the various resource files. You should never edit the files in the gen folder. Folders: gen

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved The res folder contains resources used by the application. These resources are files in a variety of formats including bitmap images such as JPEG and PNG. One common format is text files in XML. There are several subfolders of the res folder. Folders: res

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved The various ‘drawable’ folders contain images in various formats. The different folders are intended to contain parallel sets of images suitable for different device resolutions. A folder with the name drawable alone, though not provided by the IDE, will hold resources to be used on any platform. Folders: drawable

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved The layout folder contains files that describe the various views used by an application. When a new project is created using the ADT, the folder contains a single xml view file named main.xml, or activity_…xml if you change your default activity name. This view is used by the initial application. If an application only has one view, it would be sufficient to edit this default view. Folders: layout

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved The values folder contains files that define named constants. This includes strings and colors, for example. The IDE provides a single value file strings.xml when creating a project. It is important to use strings.xml to define string constants rather than include literal strings directly in views and code to support multiple languages. Folders: values

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved The assets folder is initially empty. You can use it to store raw asset files. Files that you save here are compiled into an.apk file as-is, and the original filename is preserved. You can navigate this directory in the same way as a typical file system using URIs and read files as a stream of bytes using the AssetManager. Folders: assets

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved The bin folder is the output directory of the build. This is where you can find the final.apk file and other compiled resources.. Folders: bin

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved It will be helpful to understand a little of the format used in the resource files, at least the ones in text format. These all use a language scheme called XML. This looks very much like HTML, if you are familiar with that important web language. Here is a short example from the HelloName application: HelloName Hello world! Settings Hello There Enter Your Name! Click This Button XML

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved XML is built around tags.These are the pieces of text surrounded by ‘ ’. A start tag begins with a word, after the opening ‘ ’: HelloName Hello world! Settings Hello There Enter Your Name! Click This Button XML

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Note that each start tag is matched with an end tag having the same name. The part of the document from one start tag to its matching end tag is called an element. As can be seen below, an element may contain plain text between the two tags, as is the case with all the ‘string’ tags. But, other elements may be contained between a start and end tag, such as with the ‘resources’ tag. HelloName Hello world! Settings Hello There Enter Your Name! Click This Button XML

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved There are several rules for the arrangements of tags in all XML documents: As mentioned above, each start tag must have a matching end tag. If a start tag appears inside an element, then its matching end tag must also be inside the element. There is one element that contains all the other elements in the document. This is called the root element. HelloName Hello world! Settings Hello There Enter Your Name! Click This Button XML

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved There is one exception to the first rule, the so-called empty tags. This is used for tags where there will never be any other content between the start and the end tag. For example, the tag in HTML indicates a line break. It would make no sense to put anything between and. So, XMl allows a shortcut:. This empty tag takes the place of the combination of start and end tags. <RelativeLayout xmlns:android=" xmlns:tools=" <Button android:layout_width="65dp" android:layout_height="50dp" /> XML

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Editors are the tool used to modify and add to an application. Different editors are provided for different types of files. Java Editor This editor will be familiar to most developers who have used the Eclipse environment before. As the name implies, it is used to edit Java source code. GUI Editor This is the editor used to edit views, such as activity_main.xml. found in the layout folder. These views are created from descriptions in XML files. One approach to creating and changing these views is to edit the XML directly. Editors

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Resources Editor This editor is used to edit files in the ‘values’ subfolder of the ‘res’ folder, such as strings.xml or styles.xml. XML Editor This is the editor used to edit XML code: Editors

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved AndroidManifest Editor This editor is used to edit the manifest file editor. It is similar to the properties editor, though there are extra fields that identify important Package, Version and Installation details. Editors

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved When your Android App is running on a connected device or an emulator you can capture real-time log messages in the LogCat (for Log Catalog) window. The messages are itemized in the LogCat window by Log Level, TimeStamp, Process ID, Task ID, Application Name (if not generated by the OS), Tag String and Text Message String. The messages are color-coded in the LogCat window like so: Logs

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Initially, you will probably need to open the LogCat window for the first time by going to the Windows menu, then selecting “Show View” and then “Other” and then “Android” and then “LogCat”. There are 5 standard Levels of Logs being generated continuously by the runtime environment, each with their own color. And for your own debugging purposes you can generate your own Logs with your own Tag strings and Message strings with the following commands: Debug – Blue – Command: Log.d(TagString, MessageString); Error Logs – Red – Command: Log.e(TagString, MessageString); Info Logs – Green – Command: Log.i(TagString, MessageString); Verbose Logs – Black – Command: Log.v(TagString, MessageString); Warning Logs – Orange – Command: Log.w(TagString, MessageString); Logs