现在的位置: 首页 > 综合 > 正文

Study Android Chapter 1 Reading

2013年08月11日 ⁄ 综合 ⁄ 共 3645字 ⁄ 字号 评论关闭

Chapter 1 Reading

Web Apps versus Native Apps

First Web Apps

 

The defining characteristics of a web app are that the user interface (UI) is built with web standard technologies, it is available at a
URL (public, private, or perhaps behind a log in), and it is optimized for the characteristics of a mobile device.

 

Second
Native Apps

 

In contrast, native appsare installed on the Android phone, they have access to the hardware (speakers,accelerometer, camera, etc.), and
they are written with Java.

 

Here are the pros of native app development:

• Millions of registeredcredit card owners are one click away

• You can access all thecool hardware features of the device

 

Here are the cons of native app development:

• You have to pay tobecome an Android developer

• Your app will run onlyon Android phones

• You have to developusing Java

• The development cycleis slow (develop, compile, deploy, repeat)

 

Here are the pros of web app development:

• Web developers can usetheir current authoring tools

• You can use yourcurrent web design and development skills

• Your app will run onany device that has a web browser

• You can fix bugs inreal time

• The development cycle is fast

 

Here are the cons of web app development:

• You cannot access theall cool hardware features of the phone

• You have to roll yourown payment system if you want to charge for the app

• It can be difficult toachieve sophisticated UI effects

 

Web Programming CrashCourse

The three maintechnologies we will use to build web apps are HTML, CSS, and Java-

Script.

 

Introductionto HTML:

 

Different HTML tagsallow different attributes. You can add multiple attributes to an open tag byseparating them with spaces. You never add
attributes to a closing tag. Thereare hundreds of possible combinations of attributes and tags

 

An HTML document is madeup of two sections: the head and the body.

The body is where youput all the content that you want users to see. The head contains informationabout the page, most of which is invisible
to the user.

 

 

Ps: I use Notepad++ as my always editor

 

Introduction to CSS:

 

To go beyond this simplestructure-based rendering, you use Cascading Style Sheets

(CSS). CSS is astylesheet language that you use to define the visual presentation of an

HTML document. You canuse CSS to define simple things like the text color, size, and style (bold,italic, etc.), or complex things like page
layout, gradients, opacity, and muchmore.

 

There are differencesbetween class and id. Use class attributes when you have more than one item onthe page with the same class value. Conversely,
id values have to be unique toa page.

 

The time to use IDrather than class:

Selecting elements by IDis much faster than by class, so you can hurt your performance by overusingclass selectors.

 

The way to apply a stylesheet:

It’s worth pointing out that you can link to stylesheets that are hosted on domains other than the one hosting the HTML document. However,
it’s considered very rude to link to someone else’s stylesheets without permission, so please only link to your own.

 

Introductionto JavaScript:

 

JavaScript is ascripting language that you can add to an HTML page to make it more interactiveand convenient for the user.

 

Here are some pointsabout JavaScript’s syntax that are worth noting:

• Statements areterminated with semicolons (;)

• Code blocks areenclosed in curly braces ({})

• Variables are declaredusing the
var keyword

• Array elements can beaccessed with square bracket notation ([])

• Array keys areassigned beginning at 0

• The single equals sign(=) is the assignment operator (assigns a value to a variable)

• The double equals sign(==) is the equivalence logical operator (compares two values and evaluates totrue if they are equivalent)

• The plus sign (+) isthe string concatenation operator (combines two strings together)

 

For our purposes, the most important feature of JavaScript is that it can interact with the elements of an HTML page (the cool kids call
this “manipulating the DOM”).

 

DOM stands for DocumentObject Model and in this context it represents the browser’s understanding ofan HTML page.

 

jQuery:

 

JQuery is a relatively small JavaScript library that allows you to write your JavaScript code in a way that will work the same in a wide
variety of browsers. What’s more, it greatly simplifies a number of common web development tasks.

 

 

 

抱歉!评论已关闭.