【正文】
我希望通過(guò)這次的課程設(shè)計(jì),能讓自己把這方面的知識(shí)把握的更加的到位。 } public InputStream getErrorStream() { return null。 // HttpHost proxy = new HttpHost(, 9090)。import 。 if (rd == 1) break。// (Connection, close)。import .*。 } public void setTime(String time) { = time。基于Android 操作系統(tǒng)的天氣實(shí)況預(yù)報(bào)系統(tǒng)設(shè)計(jì)的核心是通過(guò)調(diào)用通信協(xié)議SOAP(Simple Object AccessProtocol)的接口,從Web Service 提供商中提取天氣預(yù)報(bào)的數(shù)據(jù)信息,為客戶(hù)端服務(wù)。 (氣壓:+body+\n)。 (body)。 ( new EndTextElementListener() { public void end(String body) { (prop: + body)。 final StringBuffer sb = new StringBuffer()。import 。 } private void callWeatherResultActivity(String cityName){ (cityName, cityName)。 } })。 setContentView()。import 。public static final String URL=。 文件中主要是添加一些界面的布局設(shè)置,例如如下代碼: android:orientation=horizontal android:layout_width=fill_parent android:layout_height=wrap_content android:layout_width=wrap_content android:layout_height=wrap_content android:text=string/cityText/ android:layout_width=wrap_content android:layout_height=wrap_content android:text=string/searchBtn/ 上述代碼生成了一個(gè)Linearlayout,定義了一個(gè)EditText 和Button,并且設(shè)置了相關(guān)的參數(shù)?;蚴褂靡恍├^承自View Group 的Layout 管理器來(lái)組織Android UI中的單個(gè)元素到屏幕上。圖41基于Android 平臺(tái)的智能手機(jī)訪問(wèn)服務(wù)器的主要技術(shù)是數(shù)據(jù)交互方法。:定位和相關(guān)服務(wù)的類(lèi): 提供幫助網(wǎng)絡(luò)訪問(wèn)類(lèi),*接口。除了增強(qiáng)的免提電話體驗(yàn),Android還支持立體藍(lán)牙(A2Dphe和AVCRP),并有自動(dòng)配對(duì)功能。應(yīng)用程序可以輕松地嵌入網(wǎng)絡(luò)。當(dāng)連接到一個(gè)Service 之后,還可以利用Service 提供的接口與它通信。每一個(gè)Activity 都被實(shí)現(xiàn)為一個(gè)獨(dú)立的類(lèi),并且從Activity 基類(lèi)中繼承而來(lái)。 圖21系統(tǒng)構(gòu)架圖 圖21系統(tǒng)構(gòu)架圖第三章 系統(tǒng)開(kāi)發(fā)環(huán)境及相關(guān)技術(shù) Android開(kāi)發(fā)環(huán)境介紹Android的上層應(yīng)用程序是用Java語(yǔ)言開(kāi)發(fā),同時(shí)還需要基于Dalvik虛擬機(jī),所以,Google公司推薦使用主流的Java繼承開(kāi)發(fā)環(huán)境Eclipse。谷歌表示目前安卓手機(jī)每日平均激活量為20萬(wàn)部,銷(xiāo)售速度加速上漲。本文就在分析討論Android手機(jī)軟件開(kāi)發(fā)技術(shù)原理的基礎(chǔ)上,開(kāi)發(fā)出能為用戶(hù)提供更好的基于Android平臺(tái)的3G手機(jī)氣象軟件。關(guān)鍵詞:Android 手機(jī)天氣預(yù)報(bào)軟件系統(tǒng) Based on the Android system of mobile phone weather forecasting softwareAbstractWith intelligent the rapid spread of the mobile phone, intelligent mobile phone operating system market wind. In order to make intelligent mobile phone users to anytime inquires the services provided by the Internet, a highly efficient way is the function of the application system will be expanded to the mobile phone terminal, keep the cell phone and Internet access to YiDongWang through Web site and to handle all sorts of business. Therefore, smartphone applications software and its need to service will have broad development prospects.Now in the smart phone system at the strife in 2008, Google launched a new Android smart phone called the open source operating system, it USES Linux kernel, open mobile phone alliance (OHA) members can use any and modify SDK bag, the system of open source sex make its have the expansion of good sex. This software, including the operating system, the user interface and application, namely intelligent mobile phones need all the software. Android is the biggest characteristic of the open architecture, not only has the very good development, debugging environment, but also support various scalable user experience, including rich graphics ponents, multimedia support functions and strong browser. So, for software professionals for, Android platform with an infinite appeal.In this paper the analysis about Android mobile phone software development based on the principle of technology, to develop a user can provide better based on the Android platform 3 G mobile phone weather software.Keywords: Android mobile phone weather forecasting software system第一章 緒 論 6 研究?jī)?nèi)容 6 研究意義 6 研究現(xiàn)狀和發(fā)展趨勢(shì) 6第二章 系統(tǒng)分析 8 研究目標(biāo) 8 需求分析 8 性能分析 8 系統(tǒng)研究?jī)?nèi)容 8 項(xiàng)目需求分析 9 系統(tǒng)構(gòu)架圖 9第三章 系統(tǒng)開(kāi)發(fā)環(huán)境及相關(guān)技術(shù) 11 Android開(kāi)發(fā)環(huán)境介紹 11 Android開(kāi)發(fā)平臺(tái)搭建 11 Android應(yīng)用程序設(shè)計(jì)原理 12第四章 Google android移動(dòng)平臺(tái)的相關(guān)理論 14 Goolge android 移動(dòng)平臺(tái)的概述 14 Android系統(tǒng)的特點(diǎn): 14 Android的功能: 14 Google android移動(dòng)平臺(tái)開(kāi)發(fā)過(guò)程研究 15 Google android移動(dòng)平臺(tái)下的應(yīng)用研究 16 小結(jié) 16第五章 android手機(jī)天氣預(yù)報(bào)系統(tǒng)程序設(shè)計(jì) 18 用戶(hù)界面設(shè)計(jì) 18 天氣實(shí)況預(yù)報(bào)系統(tǒng)的具體實(shí)現(xiàn) 19 Android平臺(tái)的用戶(hù)界面實(shí)現(xiàn) 20 主要代碼介紹 21 主界面代碼(用戶(hù)界面) 21 天氣結(jié)果界面(詳細(xì)界面) 24 城市天氣詳情代碼 28 Androidtransport方法 30 Androidserviceconnection方法 32第六章 系統(tǒng)測(cè)試 35第七章 結(jié)論 39致 謝: 40參考文獻(xiàn) 41第一章 緒 論 研究?jī)?nèi)容Android平臺(tái)3G手機(jī)氣象軟件是基于Android手機(jī)平臺(tái),運(yùn)用Java語(yǔ)言,從Google上獲取天氣預(yù)報(bào)信息,開(kāi)發(fā)出針對(duì)使用Android平臺(tái)的手機(jī)天氣預(yù)報(bào)系統(tǒng)。我們認(rèn)為,安卓在全球市場(chǎng)的成長(zhǎng)壯大,塞班市場(chǎng)份額不斷下跌已成不爭(zhēng)事實(shí)。只有Eclipse還不夠,因?yàn)槭鞘褂肑ava語(yǔ)言進(jìn)行開(kāi)發(fā),還應(yīng)該有由SUN公司提供的Java SDK(其中包括JRE:Java Runtime Environment)。Activity 類(lèi)將會(huì)顯示由視圖控件組成的用戶(hù)接口,并對(duì)事件做出響應(yīng)。就媒體播放器來(lái)說(shuō),還可以進(jìn)行暫停、重播等操作。應(yīng)用程序可以輕松地嵌入HTML,javascript和樣式表,還可以通過(guò)Webview顯示內(nèi)容。,我們可以很輕松地獲得設(shè)備當(dāng)前的位置等信息,讓導(dǎo)航等功能更加完善。: 提供一些類(lèi)管理多種音頻,視頻的媒體接口。基于Android 操作系統(tǒng)的天氣實(shí)況預(yù)報(bào)系統(tǒng)設(shè)計(jì)的核心是通過(guò)調(diào)用通信協(xié)議SOAP(Simple Object AccessProtocol)的接口,從Web Service 提供商中提取天氣預(yù)報(bào)的數(shù)據(jù)信息,為客戶(hù)端服務(wù)。 Android 應(yīng)用中,用戶(hù)界面由View 和View Group對(duì)象構(gòu)建。在Android 中,控件最重要的大小屬性是width/height,開(kāi)發(fā)者可以指明控件的大小,控件的寬、高以及在屏幕中的顯示位置等,可以設(shè)定成為fill_parent ,還可以設(shè)置相應(yīng)的文本信息,并可通過(guò)android:text=string/cityText/進(jìn)行引用(string 文件存放在工程的res/values 中)。 中實(shí)例化一個(gè)SoapSerializationEnvelope對(duì)象,設(shè)置SoapObject 的命名空間、方法名、參數(shù)等;并通過(guò)實(shí)例化一個(gè)AndroidHttpTransport 對(duì)象來(lái)調(diào)用WebService,并獲得xml 字符串?dāng)?shù)據(jù),其代碼段如下:AndroidHttpTransport androidHttpTransport=new AndroidHttpTransport ();try {(soapAction, envelope);Object result=();xmlStr=();} catch(Exception e) {();}[2] 解析數(shù)據(jù)列表Android 操作系統(tǒng)對(duì)xml 字符串?dāng)?shù)據(jù)的操作功能很強(qiáng),提供了dom、sax 以及xmlpul 3 種方式。import 。 Button btn = (Button) ()。 // create the factory SAXParserFactory factory = ()。 Intent i = new Intent(getApplicationContext(), )。import 。 Intent queryIntent = getIntent()。 (body)。 (氣溫:+body+\n)。 } })。其基本功能是當(dāng)用戶(hù)運(yùn)行天氣預(yù)報(bào)系統(tǒng)程序時(shí),在手機(jī)屏幕上顯示出中國(guó)的城市名稱(chēng),用戶(hù)單擊任意一個(gè)城市名,可獲得該城市的天氣實(shí)況預(yù)報(bào)信息。 } public String getWind() { return wind。import .*。// (ContentLength, + )。 (buf, 0, rd)。import 。 // ().setParameter(, proxy)。 } }第六章