您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 企业文化 > Android应用基础实验指导书
实验一:搭建Android平台和创建HelloWorld...................................................-2-实验目的...........................................................................................................-2-实验要求...........................................................................................................-2-实验内容...........................................................................................................-2-实验二:UI设计..........................................................................................................4实验目的................................................................................................................4实验要求................................................................................................................4实验内容................................................................................................................4实验三:Intent、Activity应用..................................................................................12一、实验目的......................................................................................................12二、实验要求......................................................................................................12三、实验步骤......................................................................................................12实验四XML文件序列化..........................................................................................17实验5ContentProvider应用.....................................................................................249.1实验目的.......................................................................................................249.2实验内容.......................................................................................................249.3实验原理.......................................................................................................249.4实验步骤.......................................................................................................25实验6广播事件处理BroadcastReceiver................................................................2611.1实验目的...................................................................................................2611.2实验内容...................................................................................................2611.3实验原理...................................................................................................2611.4实验步骤...................................................................................................28实验7SQLite和SQLiteDatabase应用....................................................................318.1实验目的.......................................................................................................318.2实验内容.......................................................................................................318.3实验原理.......................................................................................................318.4实验步骤.......................................................................................................31实验8网络访问与服务.............................................................................................39【实验要求】..............................................................................................................39【实验过程】..............................................................................................................39实验一:搭建Android平台和创建HelloWorld实验目的本次实验的目的是让大家熟悉搭建智能手机开发平台的过程,了解Andorid开发项目的基本文件目录结构,并实现HelloWorld小例程。实验要求1.完成Android开发平台的搭建及相关配置2.创建项目并熟悉文件目录结构3.实现例程HelloWorld实验内容一、安装JavaJDK下载所需版本的JDK,点击安装到C盘JavaSEDevelopmentKit8u102YoumustaccepttheOracleBinaryCodeLicenseAgreementforJavaSEtodownloadthissoftware.AcceptLicenseAgreementDeclineLicenseAgreementProduct/FileDescriptionFileSizeDownloadWindowsx86189.2MBjdk-8u102-windows-i586.exeWindowsx64194.68MBjdk-8u102-windows-x64.exe二、安装Androidstudio从安卓中文社区()下载最新版本的安装包,安装软件开发平台。对软件进行个性化设置。三、建立新项目HelloWorld步骤。。。。四、运行调试程序步骤。。。。。实验二:UI设计实验目的本次实验的目的是让大家熟悉Android开发中的UI设计,包括了解和熟悉常用控件的使用、界面布局和事件处理等内容。实验要求1.熟悉和掌握界面控件设计2.了解Android界面布局3.掌握控件的事件处理实验内容一、常用控件1.常用控件介绍Android中有许多常用控件(简单分类):文本框:TextView、EditText按钮:Button、RadioButton、RadioGroup、CheckBox、ImageButton列表:List、ExpandableListView、Spinner、AutoCompleteTextView、GridView、ImageView进度条:ProgressBar、ProgressDialog、SeekBar、RatingBar选择器:DatePicker、TimePicker菜单:Menu、ContentMenu对话框:Dialog、ProgressDialog常用的控件有文本框、按钮和列表等。2.控件的实现在上一个实验中,我们用TextView实现了在界面显示一句“HelloTheAndroidWorld!”。publicvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);TextViewtextView=newTextView(this);textView.setText(HelloTheAndroidWorld!);setContentView(textView);}现在我们来看一看.xml文件和编码的相互关系。在HelloWorld.java中敲入如下代码:packagetju.scs.android.test;importandroid.app.Activity;importandroid.os.Bundle;importandroid.widget.Button;importandroid.widget.TextView;publicclassHelloWorldextendsActivity{/**Calledwhentheactivityisfirstcreated.*/@OverridepublicvoidonCreate(BundlesavedInstanceState){super.onCreate(savedIns
本文标题:Android应用基础实验指导书
链接地址:https://www.777doc.com/doc-4906455 .html