摘要
为方便手机用户即时查询火车时刻信息,在Eclipse平台上,采用Java语言,设计实现基于Android平台的火车时刻表查询系统。设计包括三大部分:界面设计、Web Service请求和SQlite数据库访问。各界面使用Activity作为容器,部署Button等控件,并为控件设置监听器,使用Intent对象在各Activity之间传递信息;采用httpClient.execute()方法提出Web Service请求,对返回的XML通过Dom4j进行解析并显示在界面;最后将感兴趣的信息保存在本地数据库。该系统的功能包括按发车站-到达站查询,按车次查询,按本地查询。系统的特色是将从Internet上获得的信息进行本地化,即对查询得到信息进行重复利用。
To conveniently query the information of train time table,the Android-based query system of the train timetable was designed and implemented with Java language on Eclipse platform.The design includes three parts: interface design,WebService requests and SQLite access.Activity is adopted as a container for all the interfaces to arrange ActiveXs,set a monitoring apparatus for ActiveXs,and use Intent objects pass messages between Activities.httpClient.execute() method is adopted to request the WebService,resolve the response XML with Dom4j,and display the result on the interfaces.Finally,the interested information is storeed in the local database.The system's functions include the query according to startstation-arrivestation and traincode,and native query.The system's characteristic is to localize the information from Internet,that is to say that the information can be reused.
出处
《现代电子技术》
2012年第4期41-44,共4页
Modern Electronics Technique
基金
陕西省科技厅自然科学基础研究计划项目(SJ08ZT14)
陕西省教育厅资助项目(08JK481)