2014年2月18日

BroadCastRecevier使用

摘要: 1.创建一个Intent ,发送出去1 Intent intent =new Intent();2 intent.setAction("123");3 intent.putExtra("msg","简单的消息");4 sendBroadcast(intent); 2.在manifes.xml中声明receiver 1 3 4 5 >6 ... 阅读全文

posted @ 2014-02-18 17:44 小白说我是2B 阅读(244) 评论(0) 推荐(0) 编辑

高德定位Sdk 使用sample

摘要: 1.LocationManagerProxy 获取当前Context 创建一个LocationManagerProxy 变量 mAMapLocManager = LocationManagerProxy.getInstance(this); 2.mAMapLocManager.requestLocationUpdates(LocationProviderProxy.AMapNetwork, 5000, 10, this); //设定 精度 5000m 监听器为当前Activity 所以当前Activiy需要继承AMapLocation... 阅读全文

posted @ 2014-02-18 10:10 小白说我是2B 阅读(896) 评论(0) 推荐(0) 编辑

2014年2月14日

android 模拟器安装apk

摘要: 将android sdk添加到环境配置 path中去了之后 启动cmd adb install “apk文件位置\文件名.apk” 即可安装 阅读全文

posted @ 2014-02-14 17:15 小白说我是2B 阅读(130) 评论(0) 推荐(0) 编辑

android 模拟器 上网 设置

摘要: http://my.eoe.cn/814017/archive/5166.html很多网友也问到为啥自己在家的PC机可以上网,而运行在PC机上面的android模拟器却不能上网呢?是因为家里的PC机的DNS一般为:192.168.1.1,这个只是一般而言,不是绝对,这个得自己使用ipconfig /all命令检查下;而模拟器默认的DNS为:10.0.2.3,那么模拟器跟自己的PC就不在同一个网段了,使用就导致自己的PC机可以上网,而模拟器不能上网,下面就简单介绍下如何设置才能让模拟器也可以上网:1 首先,如果没有配置sdk的环境变量的,那么在CMD命令下进入sdk安装路径的tools目录下,然 阅读全文

posted @ 2014-02-14 17:06 小白说我是2B 阅读(249) 评论(0) 推荐(0) 编辑

IntentService相关

摘要: IntentService可以在后台完成任务, 但是也有一些限制,例如, 1,不能直接和UI交互,我们只能将信息发送到Activity; 可以通过BroadCastRecevier 2,如果IntentService正在操作一个请求,那么会按照顺序进行, 3,向IntentService发送的Intent请求不能中断 IntentService的特性, 与Service不同,Service不会单独新建一个进程,Service也不是单独的一个线程,所以在要想在Service中执行耗时任务,必须在Service中新建线程去执行任务。... 阅读全文

posted @ 2014-02-14 16:03 小白说我是2B 阅读(185) 评论(0) 推荐(0) 编辑

2014年2月12日

在android编程中出现cannot be resolved or is not a field

摘要: 去除代码activity代码页面顶部中的 import android.R;这句就可以消除红色波浪线的main cannot be resolved or is not a field类似这个错误了 阅读全文

posted @ 2014-02-12 14:20 小白说我是2B 阅读(230) 评论(0) 推荐(0) 编辑

eclipse 使用技巧

摘要: ALT+/ 拼写提示 阅读全文

posted @ 2014-02-12 10:56 小白说我是2B 阅读(103) 评论(0) 推荐(0) 编辑

2014年2月11日

Local Bound Service Remote Bound Service

摘要: 首先创建子类 BoundService 继承 Service; 在BoundService 中创建子类 MyBinder 继承 Binder; Binder的作用就是进程内或进程之间 service 和client 交互的媒介(我现在暂时这么认为), MyBinder 中 实现 getService()的方法, 返回当前BoundService; 在要使用Service的Activity中 使用bindService (); 此时,你需要创建一个 ServiceConnection 去连接Activity 和 Service 。 改写ServiceConnection的2个方法public . 阅读全文

posted @ 2014-02-11 14:49 小白说我是2B 阅读(203) 评论(0) 推荐(0) 编辑

Activity之间切换 以及传值

摘要: Activity A 生成 Activity B 若A想得到B的数据,则B需要作为A的subActivity 则需要在 Activity A中调用startActivityForResult(Intent,int); //Intent int为标识码 requestCode 然后 在Activity A 中重写 onActivityResult(int requestCode,int resultCode,Intent data) 判断requestCode 与之前startActivityForResult()传入的标识码是否相同,再判断res... 阅读全文

posted @ 2014-02-11 10:49 小白说我是2B 阅读(206) 评论(0) 推荐(0) 编辑

自定义Fragment

摘要: 自定义Fragment 需要重写public View onCreateView(LayoutInflater inflater,ViewGroup container, Bundle savedInstanceState) ; http://www.techotopia.com //这个网站非常好,英语教学,有图有步骤,适合初学,有很多方面的知识。 阅读全文

posted @ 2014-02-11 09:37 小白说我是2B 阅读(153) 评论(0) 推荐(0) 编辑

导航