【正文】
is the mobile device operating system, Android. (For more information about the Open Handset Alliance, see) With the release of Android, Google made available a host of development tools and tutorials to aid wouldbe developers onto the new system. Help files, the platform software development kit (SDK), and even a developers’ munity can be found at Google’s Android website, , and I highly encourage you to visit the site.While cell phones running Linux, Windows, and even PalmOS are easy to find, as of this writing, no hardware platforms have been announced for Android to run on. HTC, LGElectronics, Motorola, and Samsung are members of the Open Handset Alliance, under which Android has been released, so we can only hope that they have plans for a few Androidbased devices in the near future. With its release in November 2007, the system itself is still in a softwareonly beta. This is good news for developers because it gives us a rare advance look at a future system and a chance to begin developing applications that will run as soon as the hardware is released. Android, as a system, is a Javabased operating system that runs on the Linux kernel. The system is very lightweight and full featured. Figure 11 shows the unmodified Android home screen.Figure 11 The current Android home screen as seen on the Android EmulatorAndroid applications are developed using Java and can be ported rather easily to the new platform. If you have not yet downloaded Java or are unsure about which version you need, I detail the installation of the development environment in Chapter 2. Other features of Android include an accelerated 3D graphics engine (based on hardware support), database support powered by SQLite, and an integrated web browser.If you are familiar with Java programming or are an OOP developer of any sort, you are likely used to programmatic user interface (UI) development—that is, UI placement which is handled directly within the program code. Android, while recognizing and allowing for programmatic UI development, also supports the newer, XMLbased UI layout. XMLUI layout is a fairly new concept to the average desktop developer. I will cover both the XML UI layout and the programmatic UI development in the supporting chapters of this book.One of the more exciting and pelling features of Android is that, because of its architecture, thirdparty applications—including those that are “home grown”—are executed with the same system priority as those that are bundled with the core system.This is a major departure from most systems, which give embedded system apps a greater execution priority than the thread priority available to apps created by thirdparty developers. Also, each application is executed within its own thread using a very lightweight virtual machine.Aside from the very generous SDK and the wellformed libraries that are available to us to develop with, the most exciting feature for Android developers is that we now have access to anything the operating system has access to. In other words, if you want to create an application that dials the phone, you have access to the phone’s dialer。 if you want to create an application that utilizes the phone’s internal GPS (if equipped), you have access to it. The potential for developers to create dynamic and intriguing applications is now wide open.On top of all the features that are available from the Android side of the equation, Google has thrown in some very tantalizing features of its own. Developers of Android applications will be able to tie their applications into existing Google offerings such as Google Maps and the omnipresent Google Search. Suppose you want to write an application that pulls up a Google map of where an ining call is emanating from, or you want to be able to store mon search results with your contacts。 the doors of possibility have been flung wide open with Android. Ask the ExpertQ: What is the difference between Google and the Open Handset Alliance?A: Google is a member of the Open Handset Alliance. Google, after purchasing the original developer of Android, released the operating system under the Open Handset Alliance.Q: Is Android capable of running any Linux software?A: Not necessarily. While I am sure that there will be ways to get around most any open source system, applications need to be piled using the Android SDK to run on Android. The main reason for this is that Android applications execute files in a specific format。 this will be discussed in later chapters.Reference:[1]Hello Android. Introducing Google’s Mobile Developmeng Platform ,Ed Burnette,The Pragmatic Bookshelf[2] Building Applications with the Android SDK,James Steele Nelson,AddisonWesley[3] Pro Android Media. Developing Graphics,Music,Video and Rich Media Apps for Smartphones and Tablets,Shawn Van Every,Apress[4] .(Wrox,.2010,.0470565527)附錄2:外文譯文什么是 Android?可以說,于此同時(shí),傳統(tǒng)的桌面應(yīng)用程序開發(fā)人員已經(jīng)被寵壞了。當(dāng)然這并不是說,傳統(tǒng)的桌面應(yīng)用程序開發(fā)比??其他形式的開發(fā)更簡(jiǎn)單。然而,作為傳統(tǒng)的桌面應(yīng)用程序開發(fā)人員,我們有能力創(chuàng)建幾乎任何類型的應(yīng)用程序,我們可以想像。包括我自己在內(nèi),因?yàn)槲乙郧熬烷_始桌面編程。一方面,我們已經(jīng)有足夠的能力去和桌面操作系統(tǒng)互動(dòng),已經(jīng)使桌面編程開發(fā)更易接受,從而與任何底層的硬件交互。相當(dāng)自由(或者一最小的例外)。這種自由、獨(dú)立地編程,已經(jīng)不再是那些敢于冒險(xiǎn)跳進(jìn)手機(jī)開發(fā)黑水中的小數(shù)量的開發(fā)者能夠獲得的。很長一段時(shí)間,手機(jī)開發(fā)者構(gòu)成了一個(gè)認(rèn)作是嵌入式設(shè)備開發(fā)者的小的稍微大點(diǎn)的派別。理解成一個(gè)小的具有魅力的桌面家族成員后來的網(wǎng)絡(luò)Web開發(fā),嵌入式設(shè)備開發(fā)代表性地得到聞名的短的結(jié)局,遠(yuǎn)至硬件和操作系統(tǒng)特色,因?yàn)榍度胧皆O(shè)備制造業(yè)在特色支持方面惡名昭彰地吝嗇。嵌入式設(shè)備制造廠商典型地需要封閉地保護(hù)他們硬件的機(jī)密,因此,當(dāng)嵌入式設(shè)備開發(fā)者試著去與特殊的設(shè)備互動(dòng)時(shí)嵌入式設(shè)備制造廠商給他們很少的函數(shù)庫去調(diào)用。嵌入式設(shè)備不同于桌面系統(tǒng)是一個(gè)嵌入式設(shè)備是一個(gè)典型的“片上計(jì)算機(jī)”。例如:考慮你的標(biāo)準(zhǔn)電視機(jī)的遠(yuǎn)程控制。它不是真正看上去像一個(gè)無法實(shí)現(xiàn)的復(fù)雜技術(shù)的實(shí)現(xiàn)。當(dāng)任何一個(gè)按鈕按下,芯片以一種方法解釋信號(hào)(已經(jīng)編程嵌入到設(shè)備中)。這允許設(shè)備從輸入設(shè)備(鍵盤)知道用戶期望干什么,和如何對(duì)這些命令響應(yīng)(例如,打開電視機(jī))。這是一個(gè)來自嵌入式設(shè)備的編程例子。然而,信或不信,諸如這些簡(jiǎn)單的設(shè)備被明確涉及到早期手機(jī)設(shè)備和開發(fā)的根源。大多數(shù)嵌入式設(shè)備運(yùn)行(在一些情況仍然運(yùn)行)在專有的操作系統(tǒng)上。選擇創(chuàng)建一個(gè)專有的操作系統(tǒng)而不是使用任何消費(fèi)者系統(tǒng)的理由是:這是一個(gè)產(chǎn)品正真必需的。簡(jiǎn)單的設(shè)備不需要很耐用、完善的操作系統(tǒng)。作為一種設(shè)備產(chǎn)品的發(fā)展,大約2年前左右,許多復(fù)雜的嵌入式設(shè)備,例如早期的PDAs,家庭安全系統(tǒng),和和GPSs,被移植到有點(diǎn)標(biāo)準(zhǔn)化的操作系統(tǒng)平臺(tái)上。小體積的操作系統(tǒng)如Linux,或甚至嵌入式版本的MicrosoftWindows,已經(jīng)是在許多嵌入式設(shè)備上很流行了。圍繞這個(gè)時(shí)間段的設(shè)備發(fā)展,手機(jī)從其他的嵌入式設(shè)備分支成他們己的路線。當(dāng)你查看他們的業(yè)績時(shí),這個(gè)分支顯得很明顯。幾乎從他們起初,當(dāng)運(yùn)行專有的軟件(被制造廠商擁有和控制,幾乎也總是被考慮是“封閉”系統(tǒng))時(shí),手機(jī)