【正文】
I 基于 Android 系統(tǒng)的手機(jī)地圖應(yīng)用軟件開發(fā) 摘 要 隨著日異月新的科技發(fā)展,人們的生活越來越豐富多彩。我們已經(jīng)身處信息爆炸以及知識經(jīng)濟(jì)繁榮的世界 。 這樣的潮流同時帶動了移動設(shè)備的迅猛發(fā)展,其中智能手機(jī)大有作為。而安卓操作系統(tǒng)正是現(xiàn)今智能手機(jī)上最為流行,最為開放,最有可能統(tǒng)治智能手機(jī)市場的一種功能強(qiáng)大的系統(tǒng)。 本文通過介紹安卓系統(tǒng)的歷史淵源,體系結(jié)構(gòu)以及同各大主流手機(jī)操作系統(tǒng)的對比,指出安卓系統(tǒng)能獨樹一幟,統(tǒng)領(lǐng)手機(jī)市場的必然性 。 本文還全面展示了用 Eclipse 開發(fā)工具開發(fā)手機(jī)應(yīng)用軟件的方法,介紹了例如Activity, Intent, Service 以及 Content Provider 等基礎(chǔ)概念,分析了安卓應(yīng)用程序的目錄結(jié)構(gòu),基本組件以及數(shù)據(jù)存取等。在這些基本概念的理解之上,本文還詳盡介紹了手機(jī)地圖開發(fā)的步驟和實現(xiàn)機(jī)制。通過百度公司提供的 API,獲取其地圖密鑰,結(jié)合幫助文檔,實現(xiàn)了地圖的定位,路線繪制以及標(biāo)記等基本 功能。 文章最后全面展示了此款手機(jī)地圖應(yīng)用軟件的系統(tǒng)界面,調(diào)試結(jié)果以及各大功能,從而說明前期設(shè)計理念和方法的正確性和可行性。 關(guān)鍵詞: 安卓,智能手機(jī),定位 ,地圖 II The Development of Mobile Phone Map Based on Android Operating System ABSTRACT With the development of changeable science and technology, people’s life has bee more and more colorful. We have lived in the world that information explosion and knowledge economy flourishing. At the same time, the tide put in motion on the mobile devices which has developed rapidly. In these devices, the smart phone is making itself the best one. Nowadays, Android System which is the most popular and open, has bee the most dominated intelligent handset operating systems, and its powerful function will make itself the leader among the smart phone market. This article has introduced the history and structure of Android, and made a contrastive with the present main intelligent handset operating systems, through which we can acknowledge the reason and inevitability why Android can be unique and dominate the handset phone market. This article also entirely demonstrated the method of developing phone application with the Eclipse development tool, and introduced the basic conception such as “Activity”, “Intent”, “Service” and “Content Provider”, and made analysis on architecture, basic modules and data storage operation of Android application. After understood all these basic conception, this article also detailed demonstrated the procedure and realization mechanism of mobile phone map development. Through the Baidu Corporation’s API and obtained the map key and bined with relative help document, it can realize the basic function such as positioning, route drawing and marking. At the end of this article, the interface of the mobile phone map application as well as the debugging results and essential function has been totally demonstrated, which strongly proved that the design philosophy and method are right and feasible. KEY WORDS: Android, smart phone, positioning, map III 目 錄 摘要 ???????????????????????????????? Ⅰ ABSTRACT ???????????????????????????????? Ⅱ 1 緒論 ????????????????????????????????? 1 選題背景和意義 ????????????????????????? 1 安卓發(fā)展歷史 ?????????????????????????? 2 安卓與主流手機(jī)系統(tǒng) ??????????????????????? 3 本文主體結(jié)構(gòu) ?????????????????????????? 4 2 安卓系統(tǒng)簡介 ????????????????????????????? 6 安卓 SDK ???????????????????????????? 6 Android SDK 內(nèi)容 ?????????????????????? 6 Android API 核心包分析 ??????????????????? 6 Android SDK 提供的工具包 ?????????????????? 7 安卓系統(tǒng)的應(yīng)用程序組成 ????????????????????? 8 Activity ????????????????????????? 8 Broadcast Intent Receiver ???????????????? 8 Service ?????????????????????????? 8 Content Provider ?????????????????????? 8 安卓系統(tǒng)的應(yīng)用程序體系結(jié)構(gòu) ??????????????????? 9 3 開發(fā)工具及系統(tǒng)環(huán)境搭建 ???????????????????????? 10 開發(fā)工具簡介 ?????????????????????????? 10 開發(fā)環(huán)境搭建 ?????????????????????????? 10 虛擬機(jī)簡介 ??????????????????????????? 11 4 安卓系統(tǒng)手機(jī)地圖設(shè)計 ????????????????????????? 13 開發(fā)方法及步驟 ????????????????????????? 13 設(shè)計理念 ???????????????????????????? 13 功能需求分析 ?????????????????????????? 14 系統(tǒng)模塊分析 ?????????????????????????? 14 程序流程圖 ??????????????????????????? 15 應(yīng)用程序流程跳轉(zhuǎn) ????????????????????? 16 應(yīng)用程序流程跳轉(zhuǎn)及 Activity 分析 ????????????? 16 5 手機(jī)地圖應(yīng)用軟件的實現(xiàn) ???????????????????????? 18 程序 主 界面 ??????????????????????????? 19 IV 程序主界面的實現(xiàn) ???????????????????????? 19 我的地圖 功能 實現(xiàn) ???????????????????????? 22 實時 定位功能實現(xiàn) ???????????????????????? 25 繪制圖形功能實現(xiàn) ???????????????????????? 27 地圖標(biāo)記功能實現(xiàn) ???????????????????????? 28 地點搜索 功能實現(xiàn) ???????????????????????? 29 公交查詢功能實現(xiàn) ???????????????????????? 31 離線地圖功能實現(xiàn) ???????????????????????? 32 6 結(jié)束語 ???????????????????????????????? 34 總結(jié) ?????????????????????????????? 34 展望 ?????????????????????????????? 34 致謝 ?????????????????????????????????? 35 參考文獻(xiàn) ???????????????????????????????? 36 附錄 ?????????????????????????????????? 37 基于 Android 系統(tǒng)的手機(jī)地圖應(yīng)用軟件開發(fā) 1 1 緒論 選題背景和意義 萊特發(fā)明飛機(jī)的前 200 年,人們都說那種在天上飛翔的機(jī)械根本不可能實現(xiàn),同樣,人們也無法想象貝爾發(fā)明的電話最終會演變成現(xiàn)在的移動電話 。 進(jìn)入 3G 時代的人們,早就不能滿足于用手機(jī)打電話或者發(fā)短信,現(xiàn)在的手機(jī)已經(jīng)成為我們不可缺少的娛樂工具,閑暇之余,我們用手機(jī)看電影,聽音樂,看電子書,和家人視頻聊天,我們甚至用手機(jī)網(wǎng)上購物,把手機(jī)充當(dāng)支付工具。這些強(qiáng)大的功能是一般手機(jī)系統(tǒng)或是非智能手機(jī)所不能實現(xiàn)的。 軟件的實現(xiàn)需要硬件的支持才能完成,所以要實現(xiàn)以上功能,必須是以硬件同等發(fā)展為前提的。而近些年,人們就可以切身體會到硬件的變化,手機(jī)內(nèi)存卡容量的不斷增大,電阻屏向多點式電容屏的轉(zhuǎn)變,還有各種芯片運算速率的不斷加快,攝像頭像素的不斷細(xì)化,使得上述需求得到更有利的滿足。 正是在這樣的背景之下,谷歌公司在 2020 年推出了第一代安卓智能手機(jī)操作系統(tǒng)。經(jīng)過 8 年的發(fā)展,我們驚奇的發(fā)現(xiàn),如今在電腦上流行的社交,娛樂等應(yīng)用程序,可以同樣的在安卓手機(jī)上運行,所以,當(dāng)電腦上的應(yīng)用軟件更新的時候,也意味著你的手機(jī)應(yīng)用軟件需要更新了 。于是,人們終于感受到“ PC 機(jī)最終會手機(jī)化,而手機(jī)終將會 PC機(jī)化”這種預(yù)言,這并不是一種矛盾,而是信息革命前行之路上的必然,只有更滿足人們使用習(xí)慣,使用快捷方便的形式和工具才能不被淘汰,繼續(xù)發(fā)展,“優(yōu)勝劣汰”在這里同樣適用。 手機(jī)地圖應(yīng)用軟件正是一款滿足人們需求的軟件,通過它,人們不僅能隨時隨地知道自己的位置,還能方便的查詢附近的餐館,商店以及汽車站等信息,大大地改善了我們的生活質(zhì)量。而在幾十年前,對于個人開發(fā)者來說,要開發(fā)一款手機(jī)地圖幾乎不太現(xiàn)實,因為在當(dāng)時,手機(jī)開發(fā)者要實現(xiàn)地圖服務(wù),大多數(shù)需要 GPS 傳感 器支持,與此同時還要支付某些地圖所有者相關(guān)費用。 而如今,只需要申請簡單的密鑰,程序員就可以輕松免費地調(diào)用谷歌或者百度等大型公司的地圖服務(wù),而在安卓系統(tǒng)上,開發(fā)地圖也不再需要直接控制 GPS,而是基于Web 上的開發(fā)。這樣,不僅省去了和地圖開發(fā)商溝通的人力物力,而且使程序員能更有效、更集中在軟件開發(fā)本身。 因此,基于安卓系統(tǒng)的手機(jī)地圖應(yīng)用軟件開發(fā)是十分有意義的,它不僅能讓初學(xué)者更好的了解安卓系統(tǒng),熟悉安卓 開發(fā)的完整過程,還能培養(yǎng)我們面對用戶需求,分析并解決問題的能力,加強(qiáng)我們分析市場,并根據(jù)市場導(dǎo)向及時有效地制 定方案的洞察力,為我們不如社會,走向工作崗位提供強(qiáng)有力的實踐基礎(chǔ)。 陜西科技大學(xué)畢業(yè)論文(設(shè)計說明書) 2 安卓發(fā)展歷史 ( 1) 2020 年 Google 收購了剛剛成立了 22 個月的 Android 公司。 ( 2) 2020 年 11 月 5 日,以 Google 為首的 34 家公司宣布成立開放手機(jī)聯(lián)盟( Open Handset Alliance,簡稱 OHA)。 ( 3) 2020 年 9 月 22 日,美國運營商 TMobile USA 在紐約正式發(fā)布第一款 Google手機(jī) —— TMobile G1。 下面,將用表格的形式來說明安卓不同版本的相關(guān)變化 。 表 11 Android 各 大版本功能及相關(guān)變化 Android 版本號 相關(guān)功能