Showing posts with label xml. Show all posts
Showing posts with label xml. Show all posts

Thursday, June 19, 2014

Week 2: Lesson 3: Editing XML, and Viewing it in the Graphical Layout

Lesson 3: Editing XML, and Viewing it in the Graphical Layout
INTRODUCTION
In this lesson you will develop good habits as a beginning programmer by testing what each piece of code does, and seeing and experimenting with how it works. Through a trial-and-error approach, you will understand how to change certain parts of the code to see how it comes out in the Graphic Layout of Eclipse. You will also learn how to clean a Java project of errors and debug it as well.
LESSON OBJECTIVES
By the end of this lesson, you will be able to:
Section #1: Establishing Good Programming Habits
1.     Review expert tips, tools and suggestions to develop your programming skills
2.     Describe the benefits of “cleaning” a Java For Android Project
Section #2: Describe the changes that happen when you edit the XML
1.     Identify the components of the XML and how it works with the Java language to define views.
2.     Determine how to manipulate XML to produce desired results.
Section #3: Understanding the Importance of the GUI
1.     Describe the benefits of using a graphic user interface (GUI) in the development process.
Section #4: Video Demonstration of How to Clean Your Project
1.     Learning how to 'Clean' your project
2.     How to change code in the XML
3.     How to view changes in Graphical Layout
LEARNING SEQUENCE

Required Reading
Read the following:
·      Section #1:



·      Section #2:

·      Section #3:
Resources
View the following: 
·      Sample Code
·      Video Transcripts
Assignments
Complete the following:
·      What Do Beginning Programmers Need to Know about Android?
·      What’s in a GUI?


INSTRUCTION

Section #1: Establishing Good Programming Habits

In this section, you will develop an understanding of what it is like to work as an Android developer and programmer.

Step 1.
In this interview with Tony Hillerson, an Android developer at Effective UI, you will read about the skills and tools you’ll need to become an Android developer. Hillerson also discusses a variety of topics related to programming for Android with Java, including understanding how Android's XML-defined views translate onto the screen. Information about the mobile marketplace is also discussed.
Step 2.
This article presents useful information you can use to better understand the power of Eclipse with Android plugin. You will also review information presented on the many editors Eclipse uses and understand how to best configure them. The topic of version control is also touched upon at the end of this tip sheet.
Step 3.
In this short tutorial you will be provided an overview of the process of “cleaning” an Android project in the Eclipse IDE. This will be beneficial as you begin the development process. In the process of Android programming you will need to be able to “clean” your project and also check for errors in development.
Step 4.
Complete Assignment #1: What Do Beginning Programmers Need to Know about Android?

Section #2: Describe the changes that happen when you edit the XML
In this section you will be introduced to XML layouts and the options for using them in the development of a layout for an Android application.

Step 1.
Read: Layouts
In this resource you are introduced to the user interface components of Android through the process of editing the XML code for the layout. On this web page view the area titled Write The XML. In this area you are provided a section of sample code for the layout described. Review this page and read the areas titled Load The XML Resource, Attributes, ID and Layout Parameters. These sections will provide you with an overview of the components of the XML and how it works with the Java language to define the views.
Section #3: Understanding the Importance of the GUI
An important part of most applications is the Graphical User Interface, or GUI. In this section you will explore how to use the Graphical Layout Editor to develop your Android application.

Step 1.
This reading will assist you in describing the benefits of using a graphic user interface (GUI) in the development process. You will review all of the main features of the editor including the canvas, outline, palette and configuration chooser. Viewing video segments provided in links in the reading will allow you to see how these features work.
Step 2.
Complete Assignment #2: What’s in a GUI?

Section #4: Video Demonstration of How to Clean Your Project 

Cleaning your project is when Eclipse scans your app of any false errors, and cleans it. This video demonstration will walk you through the process of how to clean your project. This is an important step that programmers must use throughout the development process to make certain that there are no errors in their code and that their applications run seamlessly. You will also practice how to change code in the XML and then learn how to view changes in Graphical Layout. Please pause and review the video, as necessary, to complete tasks. Transcripts are provided.
Step 1.
View & Practice: Lesson 3 [10:10]

SUMMARY
In this lesson you gained exposure to XML and experimented and tested various changes to your code. You also used Eclipse to clean your project and to identify any potential errors, a necessary step and best practice for all programmers. Through demonstration, trial and error with XML and your code, you explored various graphical layout options with manipulations to the code. In the next lesson you will expand on your knowledge of the Java language as you work more in-depth with the Eclipse IDE.

ASSIGNMENTS
·      What Do Beginning Programmers Need to Know about Android?
·      What’s in a GUI?


Week 1: Lesson 2: Learning & Understanding XML Layout-Introduction To Java For Android Course Blog



Lesson 2: Learning and Understanding XML Layout


INTRODUCTION
In this lesson you will be introduced to the folder structure of the IDE Eclipse environment and understand the difference between Relative and Linear Layouts using XML with Java for Android applications. You will also be introduced to the process for changing, viewing and manipulating the text in various XML layouts.


Lesson Objectives
By the end of this lesson you will be able to:
Section #1: What Is XML?
  1. Identify the XML language and how you may use it to develop your app
  2. Determine the best way to complete design and development tasks while working within the structure of the IDE Eclipse environment
Section #2: What Can XML Layouts Do for Android?
  1. Examine XML Layouts in Android Development
Section #3: Differentiating between Relative and Linear Layouts in XML
  1. Discern the difference between Relative and Linear Layouts using XML with Android
Section #4: Video Demonstration
  1. Demonstrate how to edit and change XML code
  2. Use XML code to develop the desired layout for your app project


LEARNING SEQUENCE


Required Reading
Reading the following:
Resources
View and follow the steps to the following:
1.  Eclipse (Integrated Development Environment)
2.  Android Development Tools (ADT)
3.  Video Tutorial: XML Video Tutorial: https://www.youtube.com/watch?v=91K25FRKScA
Assignments
Complete the following:
  • Video Tutorial: Java For Android 1




INSTRUCTION


Section #1: What Is XML?
In this section you will be introduced to the XML language and understand its power to support Android development.


In this reading you will be provided a definition of XML as a language and its main purpose with programming. There is a sample of the code included with descriptions for how the language is formatted. At the conclusion of reading, you will understand the benefits of using XML language and how to write it.


Section #2: What Can XML Layouts Do for Android?
In this section you will be introduced to XML layouts and the options for using them in the development of a layout for an Android application.


Read: Describe the XML for layouts used in Android Applications using Java.


Section #3: Differentiating between Relative and Linear Layouts in XML








Section #4: Lesson Project Tutorial (video) XML Video Tutorials
In this video demonstration and tutorial, you will learn what the default XML code is, how to edit it, and how changing the code will impact your project. Please pause and review the video, as necessary, to complete tasks and meet these objectives:
  • Recognize default code in XML
  • Create your own code for the XML
  • Understand what the new code does in the XML


Complete Section #4: The video will lead you through the following steps:


  1. You’ll than want to begin typing what is on screen, starting with the xml version and then continuing downwards
  2. The LinearLayout is the home of how your app will be set up. ‘android:orientation’ tells the device that the application will be vertical, meaning it locks the accelerometer, you can change this to being horizontal for future apps
  3. ‘android:layout_width’ and ‘android:layout_height’ both control where your app is positioned. ‘Fill_parent’ describes that the app will fill the whole screen, not leaving any space on the outside of the app
  4. ‘TextView’ is the code for displaying what the text in the app shows. ‘wrap_content’ describes that the text will expand to as big as the text will be, so it leaves space for the other parts of your app
  5. ‘android:textSize’ describes how big you want the text to be. For this you
  6. can type out px for pixel or dp for density independent pixels which is a ratio for the pixels to the screen size of the phone. Allowing the text to scale up or down depending on if you have a big size phone
  7. the ‘layout_gravity’ and ‘gravity’ refer to the position of the app. The ‘layout_gravity’ tells the text where it is located on screen, it defaults to being at the top of the app, and centering it will make it in the center of the top of the app. ‘gravity’ describes that the text will be centered in the middle of it’s home in the app, which is at the top of the screen.
  8. ‘id’ describes the identification of the ‘TextView’ in the Java, allowing it to be used and changed in the Java
  9. The coding in the button portion of the app is the same as the ‘TextView’, just changing the ‘Button:Text’ and the ‘Button:id’ to distinguish which is adding and which is subracting
  10. You have just successfully created the layout of your app. Congratulations.


SUMMARY
Additional Information Discussed In Class
JQuery Layouts
Responsive Web Apps
HTML5
Phonegap
API's

Questions for Posting on this blog: