1. Trang chủ
  2. » Công Nghệ Thông Tin

1 - giới thiệu môi trường phát triển điện thoại di động

130 813 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 130
Dung lượng 8,67 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Advantages:  It gives you access to other Android development tools from inside the Eclipse IDE: take screenshots, Debug / set breakpoints, and view thread and process information dir

Trang 1

5 Using Android OS / Devices

4 Introduction to Android OS

3 Software Installation

2 Mobile / Tablet OSs

6 Eclipse debug with Android app

7 Components of the Android Application

8 Units of measurement

Trang 5

Intents, Receivers, Adapters

Explicit Intents

Implicit Intents

Event Broadcasting with Intents

Event Reception with Broadcast Receivers

Adapters and DataBinding

Trang 6

Files, Content Providers, Databases

Saving and Loading Files

SQLite Databases

Providers

Content Provider Registration

Native Content Providers

Trang 7

Common Android APIs

Trang 8

Have an appreciation of the Android OS

Know how to develop basic UIs

Know how to broadcast and receive events

Know how to manage data storage through files,

databases, and content providers

Know how to implement basic location-based

services

Know how to use audio and video utilities

Trang 9

Know how to access the Internet

Know how to process URL data encoded in

HTML/XML

Know how to capture touch screen events and

recognize touch screen gestures

Become exposed to Android online resources and

Trang 10

[1] Unlocking Android

[2] The Busy Coders Guide to Android Development

[3]Beginning Android Application Development –

Trang 11

Attendance

Mid term lab test

Final lab test

Homework

assignments in every week

Final Project

Final project will require technical writing (project

proposal submission, source documentation, description)

Code in java (Eclipse)

There will be reading suggestions

Final test

Trang 12

All assignments will be submitted via Hotmail sharing

All assignments using namespace

vn.edu.hui.fit.Studentname.ID labNo

vn.edu.hui.fit.lethihoa.0891233.Lab32

Grades will be submitted via Hotmail sharing

Late submission will not be accepted

Trang 13

- Attendance 75%

- Do homework

- Do lab project

- Research on internet

Trang 14

MeeGo

IOS WebOS

Android

Trang 15

Samsung Closed source

Trang 16

C/C++ J2EM

Trang 17

Phone C#

VB.net XAML

Trang 18

from HP open sourced running on the Linux kernel Visual Studio

C/C++

Java

Trang 19

IOS

Apple derived from Mac OS X

Objective C – iPhone SDk

Trang 20

BlackBerry

Trang 21

Google Inc free and open source Linux-derived OS

Java (Android SDK)

Trang 22

Professional Ubuntu Mobile Development

Trang 23

open source

Trang 24

Not much room

Reuse of common component is impotant

Phone functionality always highest priority

Always on

Trang 25

3.1 Introdution to software tools

3.2 Install Android SDK

Trang 26

 The Android Development Tools (ADT) adds extensions to the Eclipse IDE It allows: create and debug Android applications easier and faster

Advantages:

 It gives you access to other Android development tools from inside the Eclipse IDE: take screenshots, Debug / set breakpoints, and view thread and process information directly from Eclipse

 It provides a New Project Wizard (you quickly create and set up all

of the basic files you'll need for a new Android application.)

 It automates and simplifies the process of building your Android application

 It provides an Android code editor that helps you write valid XML for your Android manifest and resource files

export project into a signed APK, which can be distributed to users

Trang 27

Tools that help you develop mobile applications on the Android platform

 Android Development Tools (ADT) Plugin

 Android Emulator

Device

 emulation tool that you can use to design, debug, and test your applications in an actual Android run-time environment without an actual phone

 Android Virtual Devices(AVDs)

Trang 28

OS: Windows (XP or later), Linux (Ubuntu10.10), Mac

Trang 29

Java Development Kit (JDK)

 Required to develop applications in Java

 Contains a Java compiler, debugger, documentation tools, and other tools

Java Runtime Environment (JRE)

 Allows you to run a Java application

Trang 30

Integrated development environment (IDE)

Similar to Microsoft Visual Studio

Not required for Android development

Alternatives include

 Command-line based tools only

 Other IDEs, e.g., NetBeans

Google documentation refers to Eclipse extensively

Trang 32

Step 1: Install Java Development Kit

 download the JDK from

Step 2: Install Eclipse IDE

 To download and install Eclipse IDE visit http

 The Android SDK Starter Package includes the core SDK tools

 This helps in downloading and installing the rest of SDK

components

 download the Starter Package from http://

developer.android.com/sdk/index.html

 Unpack the downloaded zip file to any suitable location on your

computer (ex: c:\android-sdk-windows)

Trang 33

Step 4: Install ADT Plugin for Eclipse

 To work with Eclipse IDE you need to install Android

Development Tool (ADT)

 To install this plugin Start Eclipse and select Help -> Install New Software-> Click Add button -> Type URL

 In the Available Softwares dialog, select the Developer

Tools to install the Android DDMS and Android development Tools

Trang 34

Step 5: Set Android Preferences

 In Eclipse IDE, select Window -> Preferences Select

Android and browse to the location where Android SDK

was unpacked Press OK button

Trang 35

Step 6: Add SDK Components and APIs

 Android SDK and AVD Manager is used to add or update

the SDK Components and APIs

 In Eclipse IDE, select Window -> Android SDK Manager -> Available Packages

Select the APIs you need to

develop your applications

Trang 36

Step 6: Add SDK Components and APIs

Trang 37

Step 7: Create Virtual Devices

 To run the emulator to run applications, you need to create Virtual Devices You can create multiple devices each with

different configurations as per your need

 To define an AVD, in Eclipse IDE,

select Window ->

Android Virtual Devices Manager

Press New button and define the

configuration for your new virtual device

Trang 38

Step 7: Create Virtual Devices

Trang 39

http:// developer.android.com/sdk/installing/index.html

Read more

Trang 40

4.1 Reasons to go mobile application development

Trang 42

Open software platform for mobile development

created by Google and the Open Handset Alliance

A complete stack – OS, Middleware, Applications, a

large market

Powered by Linux operating system

Fast application development in Java

Open source under the Apache 2 license

Trang 43

There exists a great variety of mobile operating

systems: Symbian OS, MS Windows Mobile, Mobile

Linux, iPhone OS, Moblin…

Great market fragmentation

So far no single OS has become the defact to standard (there will ever be one mobile OS; more likely two or

three major mobile OS's and a few minor ones)

Trang 44

In 2005, Google acquires the startup company

Android, Inc

In 2005, the work begins on the Dalvik VM and other

components of the Android Platform

In 2007, the Open Handset Alliance is formed by a

group of companies(Sprint, Motorola, Samsung, Sony Ericsson, Google, Intel, Texas Instruments, etc…)

Trang 45

The Open Handset Alliance releases a lot of IP through the Apache License, Version2.0

In Nov.2007, the first version of the Android SDK is

released

In Sept.2008, T-Mobile G1 becomes the 1st smartphone with the Android platform (ver 1.0)

In Feb.2009, Android 1.1 is released

In Apr.2009, Android 1.5 Cupcake is released

Trang 46

In May.2010, Android 2.2.x Froyo is released

In Dec.2010, Android 2.3.x Gingerbread is released

In Feb.2011, Android 3.x Honeycomb Froyo is released

In Oct.2011, Android 4.0.x Ice Cream Sandwich

is released

In Jul.2012, Android 4.1 Jelly Bean is released

In Nov.2012, Android 4.2 Jelly Bean is released

Trang 48

Oct.2011

Jul.2012

http:// en.wikipedia.org/wiki/Android_version_history

Trang 49

a group of 47 (Maybe now >47) technology and mobile

companies have come together to accelerate innovation

in mobile and offer consumers a richer, less expensive,

and better mobile experience

developed Android™, the first complete, open, and free mobile platform

commercial deploy handsets and services using the

Android Platform

Trang 50

http:// en.wikipedia.org/wiki/Open_Handset_Alliance

Open Handset Alliance Members

Trang 51

Android Iphone

Operating Systems:

Android apps can be developed on Windows

,Linux ,and MacOS iPhone apps only on a Mac

Programming Languages:

Android apps can be developed in Java, C/C+

+, and increasingly in Python and Perl Objective C is the only choice for serious iPhone development for now

Source Code Availability:

Android is mostly open source iPhone is 100% proprietary

Third-party Software Distribution:

There is a small entry fee for publishing

Android apps on the Android market there is an Apple-centered certification process to make your apps available in the

AppStore

Trang 52

Hardware Choices: Dual-Core CPU, Camera, Audio

device, Bigger Screens…

Pricing

Java for developers

Accessibility: Your Choice of Carriers several

different devices manufacturers like HTC, Motorola and

Samsung They are also available with a choice of

carriers and different plans to suit different users' needs

So, why Android?

Trang 53

Application framework enabling reuse and replacement of components

Dalvik virtual machine optimized for mobile devices

Integrated browser based on the open source WebKit engine

Optimized graphics powered by a custom 2D graphics library; 3D graphics

based on the OpenGL ES specification (hardware acceleration optional)

SQLite for structured data storage

Media support for common audio, video, and still image formats (MPEG4,

H.264, MP3, AAC, AMR, JPG, PNG, GIF)

GSM Telephony (hardware dependent)

Bluetooth, EDGE, 3G, 4G, and Wi-Fi (hardware dependent)

Camera, GPS, compass, and accelerometer (hardware dependent)

Trang 54

Android Software Stack

Trang 55

Linux kernel is a proven core platform

Reliability is more important than performance when it

comes to a mobile phone, because voice communication

is the primary use of a phone

Linux provides a hardware abstraction layer, letting the

upper levels remain unchanged despite changes in the

underlying hardware

Why use Linux for a phone?

Trang 58

•C/C++ libraries

•Interface through Java

•Surface manager – Handling UI Windows

•2D and 3D graphics

•Media codecs, SQLite, Browser engine

Trang 59

Android Runtime

•Dalvik VM

–Dex files

–Compact and efficient than class files

–Limited memory and battery power

•Core Libraries

–Java 5 Std edition

–Collections, I/O etc…

Trang 60

Application Framework

•API interface

•Activity manager – manages application life cycle

Trang 61

•Built in and user apps

•Can replace built in apps

Trang 62

Dalvik Virtual Machine

Dalvik is the name of a town in Iceland

 Dalvik VM is written by Daniel Bornstein

Dalvik VM takes the generated class files and

combines them in to one or more dex files (Dalvik

executables)

It reuses the information from class files to reduce the

size of the footprint

Dalvik VM uses the registers as the primary source of

data storage in stead of the stack (JVM)

Trang 63

Android applications are compiled to Dalvik bytecode

Trang 64

The Dalvik runtime is optimised for mobile applications

Trang 65

5.1 Creating Android device without Buying a Phone

5.2 Using Android device

5.3 Using Android virtual device

5.4 Connect and debug on real device

Trang 66

Creating Android Virtual Device

Setup account: contact, email

Using market from AVD

Trang 68

 Android Desktops

 Call, SMS, Contact, Calendar, Email

 Gallery, play audio, video file

 Change desktop, add widget, copy shortcut to desktop

 Using button: home, back, menu

 Copy/Paste text between apps

 Setting

 Using web browser

 Application: Install /Uninstall/Move to SD card

Trang 70

Ver 1.6

Trang 71

Ver 4.0

Trang 72

http:// developer.android.com/tools/help/emulator.html

Trang 73

Change Android emulator skin

 Copy folder in to flatform

Emulator vs Simulator

 VirtualPC or Vmware?

Trang 74

Emulator looks for the disk

images in the private storage

area of the AVD in use

Trang 75

The default storage location for AVDs is in

Users\<user>\.android\avd\

Trang 76

android list targets (android-skd\tools)

android list avd

emulator -avd<avd_name>

adb devices

adb shell

 Log in AVD shell (1)

adb –s emulator-5554 shell

telnet localhost 5554

 smssend <Sender’s phone number> <text message>

 gsmcall <caller’s phone number>

You must setup Environment variables to use adb command line

Trang 77

accepts a number of Linux shell commands in Android Emulator:

Trang 78

DDMS – Emulator Control

Trang 79

DDMS-File Explorer

Trang 80

 3G icon on AVD

 Path data/data (permission) on File Explorer in DDMS

 Send sms from 2 AVDs

 Copy image/media file to AVD

Trang 81

Install from unknown source

Setting debug mode

ADB driver

Debug in eclipse

Trang 82

< application

android:icon ="@drawable/ic_launcher"

android:label ="@string/app_name"

android:debuggable = "true">

Trang 84

A View is a UI building block: a text field, a label, a

button, …

Views are hierarchical objects that know how to draw

themselves

In MS GUI lingo, views are controls

Trang 85

An Activity is a single screen in an application

An Activity typically contains at least one view

An application may have several activities

Trang 86

A Message object that announces an intention

An Intent can broadcast a message

An Intent can start a service

An Intent can launch an activity

Intents are initiated by applications

 Intent

Trang 87

 IntentFilters

An Intent is a declaration of need

An Intent is made up of various pieces including:

–desired action or service,

–data, and

–category of component that should handle the intent

and instructions on how to launch a target activity

An IntentFilter is a trigger, a declaration of capability

Trang 88

A Mechanism (essentially, an API) for applications to

share data without exposing the underlying storage

details

The underlying data can be stored in a file or a database

Trang 89

A Background process

 not interacting with the user

 for an indefinite period of time

 like other application objects, run in the main thread of their hosting process

 Example: an email application that polls for new message

 Local services are services accessible to the hosting

application

 Remote services are services that can be used by other

Trang 90

If an application wants to receive and respond to a global event, such as the phone ringing or an incoming text

message, it must register as a BroadcastReceiver

 An application may register at runtime

 Or register at the AndroidManfest.xml file

it does not have to be running

When the global event occurs, the application is started automatically upon notification of the triggering event All

of this housekeeping is managed by the Android OS

itself

do not have a UI

Trang 91

An XML file that defines the contents and behavior of

the application

It names the Java package for the application (unique

identifier for the application.)

It declares the minimum level of the Android API that

the application requires

It contains the list of activities in the application

It describes the components of the application —the

Trang 92

It declares IntentFilter

It declares which permissions the application must

have in order to access protected parts of the API and

interact with other applications

It also declares the permissions that others are

required to have in order to interact with the

application's components

It lists the libraries that the application must be linked

against

…

Trang 93

Go Here Auto gen

Android libs

Resource

Layout

Ngày đăng: 06/07/2014, 18:29

TỪ KHÓA LIÊN QUAN

🧩 Sản phẩm bạn có thể quan tâm

w