ImageVerifierCode 换一换
格式:DOCX , 页数:25 ,大小:49.39KB ,
资源ID:5903623      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bingdoc.com/d-5903623.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(安卓实验报告Word文件下载.docx)为本站会员(b****1)主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(发送邮件至service@bingdoc.com或直接QQ联系客服),我们立即给予删除!

安卓实验报告Word文件下载.docx

1、 protected void onCreate(Bundle savedInstanceState) (savedInstanceState); setContentView (TAG,(1) onCreate(); Button button =(Button) findViewById (new OnClickListener() public void onClick(View view) oString().trim(); String str1 = ().toString().trim(); (+str);爱好:+str1); if (arg1 = (性别:+男 else if (

2、arg1 = (女 ); ); 五:运行结果截图:实验三:不同界面的切换掌握各种界面布局的特点和使用方法;掌握选项菜单,子菜单和快捷菜单的使用方法。二;三;实验内容:设计一个Tab标签页,实现LinearLayout,RelativeLayout,AbsoluteLayout三种分页面之间的切换,每个页面的内容包括用户名和确定,取消两个按钮实验核心代码:: .Tab2.Tab3public class MainActivity extends TabActivity setContentView TabHost tabHost=getTabHost(); (this).inflate (),t

3、rue); (TAB1). setIndicator(线性布局).setContent (绝对布局相对布局).setContent Tab1,javapublic class Tab1 extends Activity public void onCreate(Bundle savedInstanceState) (savedInstanceState); setContentView public class Tab2 extends Activity public void onCreate(Bundle savedInstanceState)public class Tab3 exten

4、ds Activity实验四:登陆界面和广播消息 了解使用Intent进行组件通信的原理; 了解Intent过滤器的原理与匹配机制; 掌握发送和接受广播消息的方法。先写一个登陆界面,包括用户名,密码,点击登陆时实现页面的跳转功能,在第二个页面使用Intent发送消息,并调用sendBroadcast()函数把Intent携带的消息传送出去,用BroadcastReceiver接受广播消息,在页面下方显示广播内容。四;public class MainActivity extends Activity private Button button; setContentView button=(B

5、utton) findViewById (new () public void onClick(View arg0) Intent intent=new Intent,; startActivity(intent); );public class Second extends Activity private Button button2; private EditText editText; setContentView Intent intent=getIntent(); editText=(EditText) findViewById button2=(Button) findViewB

6、yId (new () public void onClick(View arg0) Intent intent=new Intent( (message, ().toString(); sendBroadcast(intent);public class MyBroadcastReceiver extends BroadcastReceiver public void onReceive(Context context, Intent intent) String msg=( (context, msg, .show();.Secondreceiver android:.MyBroadcas

7、tReceiverintent-filteraction android:/intent-filter/receiver运行结果截图实验五:Service绑定实现数据运算 了解Service的原理和用途; 掌握本地服务的管理和方法; 掌握服务的隐式启动和显示启动方法; 掌握远程服务的绑定和调用方法。三:以绑定方式使用Service,获取Service实例,当点击绑定服务时可以实现两个数的求差和比较大小功能,并输出结果,当点击取消绑定服务时,则无法运算。public class MathService extends Service private final IBinder mBinder=n

8、ew LocalBinder(); public class LocalBinder extends Binder MathService getService() return ; public IBinder onBind(Intent intent) (this, 本地绑定:MathService,.show(); return mBinder;public boolean onUnbind(Intent intent)取消本地绑定:, .show(); return false;public long sub(long a,long b) return a-b;public int c

9、ompare(long a,long b) if(ab) return 1; else if(a=b) return 0; else return -1; private MathService mathService; private Button button1; private Button button3; private Button button4; private EditText editText1; private EditText editText2; private EditText editText3; private boolean isBound=false; se

10、tContentView editText1=(EditText) findViewById editText2=(EditText) findViewById editText3=(EditText) findViewById button1=(Button) findViewById button2=(Button) findViewById button3=(Button) findViewById button4=(Button) findViewById (new () public void onClick(View v) if(!isBound) final Intent ser

11、viceIntent=new Intent ( ,; bindService(serviceIntent, mConnection, ; isBound=true; (new () public void onClick(View v) if(isBound) isBound=false; unbindService(mConnection); mathService=null; if(mathService=null)未绑定服务 return ; String a = ().toString(); long a1 = (a); String b = ().toString(); long b

12、1 = (b); long result=(a1, b1); String msg=(a1)+-+(b)+ =+(result); (msg); if(result=1) (a+b); else if(result=0) (a+ else private ServiceConnection mConnection=new ServiceConnection() public void onServiceDisconnected(ComponentName arg0) mathService=null; public void onServiceConnected(ComponentName n

13、ame, IBinder service) mathService=(service).getService(); ;实验六:SQLite实现用户的增删改查 了解SQLite数据库的特点和体系及结构; 掌握SQLite数据库的建立和操作方法; 理解ContentProvide的用途和原理; 掌握ContentProvider的创建和使用方法。使用SQlite数据库实现用户(包括:姓名,年龄,身高)的添加数据,全部显示,清除显示,全部删除,ID删除,ID查询,ID更新的功能。public class MainActivity extends ActionBarActivity private E

14、ditText et_name; private EditText et_sex; private EditText et_department; private EditText et_id; private EditText et_salary; private MyOpenHelper oh; private SQLiteDatabase db; private TextView tv; private LinearLayout ll; setContentView oh = new MyOpenHelper, , null, 1); db = (); et_name = (EditTe

15、xt) findViewById et_sex = (EditText) findViewById et_department = (EditText) findViewById et_salary = (EditText) findViewById et_id = (EditText) findViewById ll = (LinearLayout) findViewById public void add(View v) String name=().toString(); String sex=().toString(); String department=().toString();

16、 String salary=().toString(); ContentValues values=new ContentValues(); (name,name );sex, sex);department,department);salary, salary);staff, null, values); tv=new TextView;添加成功 (); public void show(View v) Cursor cursor=(, null, null, null, null, null, null, null); while() String id=(_id); String na

17、me=( String sex=( String department=( String salary=( tv=new TextView; (ID:+id+ ;Name:+name+Sex:+sex+Department:+department+Salary+salary); (tv); public void clear(View v) public void deleteAll(View v), null, null);删除成功 public void deleteById(View v) String id=().toString();, _id=, new Stringid);ID删

18、除成功 public void findById(View v), null, , new Stringid, null, null, null, null); id=( (id+ID查询成功 public void updateById(View v),name);, values, 更新ID成功public class MyOpenHelper extends SQLiteOpenHelper public MyOpenHelper(Context context, String name, CursorFactory factory, int version) super(context

19、, name, factory, version); public void onCreate(SQLiteDatabase db) create table staff(_id integer primary key autoincrement,name text,sex text,department text,salary float) public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) 实验七:天气预报 了解位置服务的概念; 了解地图密钥的申请方法; 掌握获取地理信息的方法; 写一个项目,实现显

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2