【正文】
// TODO 每次成功打開數(shù)據(jù)庫后首先被執(zhí)行 } } 附 錄 全文共 45 頁,第 32 頁 。 onCreate(db)。 (CREATE TABLE bus_line(id integer primary key autoincrement,line varchar(20),station varcahr(500)))。 public Database(Context context) { super(context, NAME, null, version)。 // TODO Autogenerated constructor stub } private static final String NAME=。 import 。 import 。 } } 附 錄 全文共 45 頁,第 31 頁 package 。 public class AndActivity extends Activity { /** Called when the activity is first created. */ Override public void onCreate(Bundle savedInstanceState) { (savedInstanceState)。 import 。 return true。 //得到一個 MenuInflater MenuInflater inflater = getMenuInflater()。 (0, ABOUT, 0, 退出 )。 Override //當點擊 Menu鍵時會打開菜單,當菜單第一次被打開 時,框架回掉該方法 public boolean onCreateOptionsMenu(Menu menu){ //為菜單添加一個 id為 1,標題為 “開始 ”的元素 (0, OK, 0, 幫助 )。 private static final int CANCLE = 2。 } } } })。 ()1){ (())。 !() amp。 }else{ if(busstation != null amp。 bus = null。//所有線路連接在一起 }else{ bus = null。 附 錄 全文共 45 頁,第 29 頁 (續(xù) ) ((2))。 ((1))。, null)。 !()){ cursor = (select id,line,station from bus_line where line like 39。 } }else if(busline != null amp。 } (())。 (*)。 if(()){ while(()){//迭代記錄集 (((id)))。%+busstation+%39。amp。amp。 //boolean flag = (ddd).matches([09]*)。 StringBuffer lines= new StringBuffer()。 //Bus bus = (ddd)。 //搜索按鈕監(jiān)聽 (new () { Override public void onClick(View v) { // TODO Autogenerated method stub String busline = ().toString()。 return false。 database = ( + / + , null)。 final TextView result = (TextView) ()。 final EditText station = (EditText) ()。 setContentView()。 ()。 Override public void onCreate(Bundle savedInstanceState) { //導入數(shù)據(jù)庫 dbfile = new ImportDBFile(this)。 public ImportDBFile dbfile。 import 。 import 。 import 。 import 。 import 。 import 。 import 。 import 。 public final class BuildConfig { public final static boolean DEBUG = true。 public static final int station=0x7f060005。 public static final int result=0x7f060007。 public static final int line=0x7f060002。 public static final int hello=0x7f060000。 } public static final class raw { public static final int android=0x7f040000。 public static final int station=0x7f070001。 public static final int result=0x7f070003。 public static final int icon=0x7f020213。 public static final int hefei=0x7f020211。 public final class R { public static final class attr { } public static final class color { public static final int red=0x7f050000。java。SQLITE。 [4]. Mark (pbk):9781430224198. [5]. 張帥 基于 ITS 的智能乘客信息系統(tǒng)研究 —河北工業(yè)大學碩士論文 [6]. 蓋索林 王世江 . 《 Google android 開發(fā)入門指南》 人民郵電出版社 [7]. 于志龍 《 Anaroid SDK 開發(fā)大全》 人民郵電出版社 [8]. 彭小偉、胡 子祥 城市公交服務質(zhì)量乘客評價的實證研究 . 西南交大學報 [9]. 李剛 瘋狂 android 講義 電子工業(yè)出版社 [10]. 王貴彬 劉家蘭 《 JAVA 大學教程》 清華大學出版社 Abstract 全文共 45 頁,第 24 頁 Abstract In the exsiting system of public transportation query,there are still some problems, such as slow updating and inaccurate data. The beijing bus offline query system based on the Android is not being popularized to a molding software now. After analysing and summurizing several problems,the bus offline query system based on Android is designed as well as ,running on the Android platform, using Google maps and SQLite database, mainly use JAVA language programing to achieve its function,which includes current location,searching any position quick ly,trips inquiries,station inquiries,site transfer inquiries and so on. To make the system more intuitive and convenient,the public transportation inquiry system achieves the show of the text result and electronic map at the same time, In the entire query process,only Google Maps function needs to work online to get work data,while the other functions can be performed offline. Keyword:Bus query。 參考文獻 全文共 45 頁,第 23 頁 參考文獻 [1].陶佩楓 城市公交查詢系統(tǒng)的設計與實現(xiàn),萬方中文數(shù)據(jù)庫。 在 安徽農(nóng)業(yè)大學 學 習的 四年 中 結(jié)識的各位摯友 ,是 我人生 中 最大的一筆財富。同時,對理學院的所有老師致以衷心的感謝和崇高的敬意。同時得益于胡老師所帶的 《操作系統(tǒng)》、 《計算機網(wǎng)絡》、《 Java 程序設計》和《數(shù)據(jù)結(jié)構(gòu)》,使得我的論文能順利的 完成。 基于 Android的北京公交離線查詢系統(tǒng) 全文共 45 頁,第 22 頁 致 謝 論文完成之際 ,首先向我的指導老師胡哲老師致以深深的敬意和由衷的感謝。 點擊 menu 按鈕會有“幫助”“聯(lián)系我”“退出”按鈕。 基于 Android的北京公交離線查詢系統(tǒng) 全文共 45 頁,第 19 頁 軟件安裝 圖 63 軟件安裝后系統(tǒng)菜單 軟件安裝之后會在模擬手機 的軟件菜單中發(fā)現(xiàn)北京 公交離線查詢 的快捷方式,跟電腦中的軟件一樣,點擊這個快捷方式就會運行該軟件,而且為該虛擬手機安裝的搜狗輸入法可以協(xié)助公交查詢系統(tǒng)實現(xiàn)站點查詢功能,輸入一個北京公交數(shù)據(jù)庫中存在的站點名稱,就會出現(xiàn)經(jīng)過該站點的所有公交。公交車的活動類主要在 程序中,軟件界面設計主 要在 文檔中。 軟件組成 如圖 61: 圖 61 軟件組成 在 eclipse 集成環(huán)境下創(chuàng)建一個 android 的應用軟件并命名為“ and”,會生成幾個文件夾。 ② :在某一路公交車的每個途徑站點畫藍色的圓圈,相鄰兩個站點之間畫藍色的線。 這個模塊實現(xiàn)的類: OverLay,MyOverLay 類,兩個類均繼承 Overlay,Overlay 是android 提供的存在地圖上添加圖層的基類,只要重載其中的 draw 函數(shù)就可以在地圖()從服務器下載 選擇用戶要下載的公交數(shù)據(jù) DevideToItem( fileName) addEvent()向數(shù)據(jù)庫中 add 添加完成,得到 基于 Android的北京公交離線查詢系統(tǒng) 全文共 45 頁,第 17 頁 上畫出不同的標志。 ( 6)公交數(shù)據(jù)下載模塊流程邏輯 流程邏輯如圖 58 所示: 圖 58 公交數(shù)據(jù)下載模塊流程邏輯 數(shù)據(jù)更新模塊 模塊描述 服務器端公交數(shù)據(jù)以文本形式存在,當數(shù)據(jù)需要更新管理員只需要更新文件就可以了。 ( 4)輸入項 要下載公交數(shù)據(jù)的城市名。 ③ :數(shù)據(jù)庫操作類,將文件中的內(nèi)容分段,然后存入數(shù)據(jù)庫。 ( 2)具體實現(xiàn) 用戶點擊更新公交數(shù)據(jù)時,彈出選擇城市對話框,用戶點擊確定后連接 Tomcat服務器,調(diào)用 DownLoad 類中的函數(shù) start()開始下載公交數(shù)據(jù)文件,下載同時保存選擇的城市名,傳