android ios wp7

37
So sánh phát triển ứng dụng trên iOS, Android và Windows Phone 7 [email protected]

Upload: techmaster-vietnam

Post on 07-Dec-2014

2.086 views

Category:

Technology


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Android ios wp7

So sánh phát triểnứng dụng trên iOS, Android

và Windows Phone 7

[email protected]

Page 2: Android ios wp7

Tại sao không viết một app để chạy được trên cả nhiều hệ điều hành: iOS, Android và Windows Phone 7, …

Page 3: Android ios wp7

Lợi:- Tăng xác suất tải về trên cả 3 hệ điều hành.- Tăng mức độ phổ biến – khả năng tương thích. Hài lòng

các fan của iOS lẫn Android lẫn Windows Phone.- Tận dụng lại ý tưởng hay, tài nguyên (hình ảnh, video,

âm thanh, mã logic…)

Khó khăn:- Cần thành thạo cả 3 OS- Time to market có thể giảm- Tối ưu cho từng OS là khác nhau

Page 4: Android ios wp7

Có bao nhiêu cách ?

1. HTML 5- CSS3-JavaScript: PhoneGap, jQueryMobile, jQTouch, Sencha Touch,….

2. Appcelerator’s Titanium Mobile: converts JavaScript to symbolic files then compile to native apps

3. Porting apps: reuse code/ resource , modify code to adapt to each platform.

Page 5: Android ios wp7
Page 6: Android ios wp7

Source : PhoneGap

Page 7: Android ios wp7

JavaScriptJavaScriptHTML,

JavaScript, CSS

UI + Logic

UI API Phone API

JavaScript to Objective-C bridge

Native iOS App

iOS Objective-C

UI + Logic

UI API Phone API

JavaScript to Java bridge

Native Android App

Android Java

UI API maps to native UI components: NavBar, Tabbar, Toolbar, Menu, Dialogs, Alert, Button, List…

Phone API maps to phone features: Geo, Accelerometer, Maps, Sound, Video, Database, File IO, Network…

Page 8: Android ios wp7

Cách cổ điển porting app vẫn cần thiết bởi vì:

1- Tối ưu cao nhất cho từng hệ điều hành – thiết bị cụ thể.

2- Cần tối ưu tốc độ ứng dụng.

3- Cần nâng cao trải nghiệm giao diện người dùng.

Page 9: Android ios wp7

Nắm vững lập trình trên một

hệ OS

Tìm ra điểm chung với các hệ OS còn lại

Quy trình phát triển ReusablePorting

Optimize và test trên từng

OS

Page 10: Android ios wp7

TRƯỚC KHI SO SÁNH IOS, ANDROID VÀ WINDOWS PHONE 7….

HÃY XEM WINDOWS PHONE 7 NHƯ THẾ NÀO.

Page 11: Android ios wp7

Cấu hình phần cứng

Phân giải màn hình480x800 QVGA320x480 HVGA

Cảm ứng đa điểm4 or more contact points

Chụp ảnh5 mega pixels or moreDedicated camera button

Nút bấm vật lýStart, Search, Back

Cảm biếnA-GPS, Accelerometer, Compass

GPUDirectX 9 acceleration

CPUARMv7 Cortex/Scorpion or better1G

Bộ nhớ256MB RAM or more8GB Flash or more

MultimediaCommon detailed specsCodec acceleration

Page 12: Android ios wp7

800

480

Consistent Platform

Windows Phone

Hardware

Common Hardware Elements

Quality Focus

Microsoft chuẩn hoá yêu cầu phần cứng:1- Tăng chất lượng ứng dụng

2- Giảm tối đa lỗi không tương thích và thời gian kiểm thử

Phiên bản Windows Phone 7.5 “Mango” kế tiếp có thể khác !

Page 13: Android ios wp7
Page 14: Android ios wp7

Phát triển ứng dụng cho WP7

High performance game framework

Rapid creation of multi-screen 2D and 3D games

Rich content pipeline

Mature, robust, widely adopted technology

Xbox 360, Windows, and Zune

Modern application UI framework

Rapid creation of visually stunning apps

Metro-themed UI controls

HTML/JavaScript

500,000 developers spanning Windows and web

Page 15: Android ios wp7

IOS, ANDROID VÀ WINDOWS PHONE 7

Page 16: Android ios wp7

Hardware Closed Open Standardized

Brother devices IPad / IPad2 Honey Comb

Tablet XBox360

Market AppStore Android Market MarketPlace

Program Language Objective C / C Java C#, VB.net, VB

Virtual Machine None Dalvik .NET CLR

Browser Engine

Mobile SafariWebKit

ChromeWebKit

Internet ExplorerTrident

UI Framework Cocoa Touch Java App

Framework SilverLight

Page 17: Android ios wp7

CORE OS kernel, file, network, security, power, device drivers

CORE Services string, collection, network, contact, GPS, compass, accelerometer, gyroscope

MEDIA CoreGraphics, Text, OpenGL ES, Core Animation, AVFoundation, Core Audio, video

Cocoa Touch UIKit, Animation, Multitasking, Gesture Recognizers, PushNotification

Objective-C Apps HTML 5, CSS, JavaScript Apps

Page 18: Android ios wp7
Page 19: Android ios wp7

Customed UI No Yes, HTC Sense… Yes, Sense UI, …

Keyboard Virtual Virtual + Physical Virtual + Physical

Flash No Yes No

SilverLight No No SilverLight 3.0 mobile

Music Stores Itunes 3rd parties Zune

Games AppStore 3rd parties XBoxLive

Default Search SpotLight Search in OS. Google for Web Google Bing

Threadedmail Mail App Gmail Outlook mobile

Copy & Paste Yes Yes No Do Update

Page 20: Android ios wp7

Dev tools XCode Ecllipse Visual Studio 2010

Dev enviroment Leopard Snow on Apple or Intel

Windows, Linux, Mac Windows

Debug real time Yes Yes Yes

3D OpenGL ES OpenGL ES DirectX

Garbage collection

Optional. Need to enable by compiling directive

By default By default

Game Library Cocos2D AndEngine XNA

Push Notification Yes Yes Yes

Local Storage File I/O + Preference File I/O + Preference

Isolated Storage + Preference

Local Database SQLite SQLite SQLite porting

Page 21: Android ios wp7

Dev tools XCode Ecllipse Visual Studio 2010

Dev enviroment Leopard Snow Windows, Linux, Mac Windows

Debug real time Yes Yes Yes

3D OpenGL ES OpenGL ES DirectX

Garbage collection

Optional. Need to enable by compiling directive

By default By default

Game Library Quartz, Cocos2D AndEngine, … XNA, …

XML Yes Yes Yes + LINQ

Page 22: Android ios wp7

Local Storage File I/O + PreferenceSQLite

File I/O + Preference

Isolated Storage + Preference

Local Database Default SQLite Default SQLite NA but can use ported SQLite

Multithread NSThread Async Task Yes

Multitasking From iOS4 Yes for internal services. Mango

Push Notification Yes Yes Yes

RESTful service Yes Yes Yes + Odata API

Cloud Ready Unknown Google Aps Windows Azure

Location based Google Map Google Map Bing (Google Map)

Page 23: Android ios wp7

Multi-tasking on single core

Operating System

CPU Core

Internal Service 1 Internal Service 2 App 1App Service

Background Foreground

Page 24: Android ios wp7

Multi-tasking on dual core

Operating System

CPU Core 1

Internal Service 1 Internal Service 2 App 1App Service

CPU Core 2

Background Foreground

Page 25: Android ios wp7

Multi-threading

Operating System

CPU Core 1

Internal Service 1 Internal Service 2

CPU Core 2

Background

Foreground

Data Processing

Complextask

User Interface

Page 26: Android ios wp7

Windows Phone 7 (2010) không hỗ trợ ứng dụng hãng thứ 3 multi tasking.

Windows Phone 7 (Mango) hỗ trợ multi tasking.

Page 27: Android ios wp7

Garbage Collection

• Disable by default

• Enable by compiler switch

• When GC is not available alloc/release/aurorelease

• CFRetain/CFRelease

• Automatic by default

• Rely too much on GC will deperformance your app

Page 28: Android ios wp7

http://wp7mapping.interoperabilitybridges.com

API API

Page 29: Android ios wp7

Lập trình UI Android khá giống WP7

• Vẽ giao diện bằng XML hoặc tạo động bằng code.

• Hứng sự kiện trong XML hoặc trong code

• Di chuyển giữa các trang• Menu bar – Application bar• Cách kích hoạt các tác vụ và nhận giá

trị trả về

Page 30: Android ios wp7

App.xaml

Frame / Page

Launcher Chooser

Controls

Notification

XML, LINQ, OData

Page 31: Android ios wp7
Page 32: Android ios wp7

System Tray (title, progress bar)

Application Bar (menu button)

Page

Standard Controls

Customed Controls

3rd Party Controls

Page 33: Android ios wp7

DEMO MỘT SỐ ỨNG DỤNG WP7

Page 35: Android ios wp7

Communication Service

• Location aware service• Push notification• SOAP / REST / WCF / OData

Page 36: Android ios wp7

Odata – WCF Client

Page 37: Android ios wp7

Tham khảo• http://blog.radvision.com/voipsurvivor/2010/10/07/ios-android-windows-phone-7

-and-the-great-changes-in-the-operating-systems-market/

• http://www.slideshare.net/dtmilano/android-development-tutorial-v3

• http://msdn.microsoft.com/en-us/library/ff431744(v=vs.92).aspx (WP7 Code Example)

• http://create.msdn.com/en-US/education/catalog/ (WP7 Content Example)

• http://www.pcworld.com.vn/articles/san-pham/phan-mem/2011/03/1224409/cuoc-chien-he-dieu-hanh-di-dong-android-ios-va-windows-phone/ (Cuộc chiến hệ điều hành di động: Android, iOS và Windows Phone)

• http://windowsphone.interoperabilitybridges.com/ (WP7 cho iPhone developers)

• http://channel9.msdn.com/posts/Minh-Tran-TranCreative-Experience-developing-for-Windows-Phone-7

• http://www.msdev.com/Default.aspx