2012年3月28日学习记录

一、设计模式


1,桥接模式:在于突出聚集和合成的关系。类似于有手机的硬件、软件之分的时候,可以通过是用桥接模式,可以很好的处理硬件和软件的使用问题,而需要注意的是当我们写面向对象的程序的时候,需要判断继承的关系是不是(IS-A)的关系,如果不是就尽量不要是用继承的关系,可以考虑是用聚集和组成关系。

二、Android中的category

1.description:为过滤器增加一个说明,类似一个附加信息
    Adds a category name to an intent filter. See Intents and Intent Filters for details on intent filters and the role of category specifications within a filter.


三、Intent的小结:

1.action代表android客户端所需要进行的操作(可以是调用系统的调用或者是自己定义的action)
2.category是针对action的一个修饰其中需要在( Intent Filters)中
3.data是传递action动作所需要的数据(比如调用网页则需要告诉网址是多少)

实现:
1.打电话:
data = "tel:11111111";
uri = Uri.parse(data);
intent.setAction(Intent.ACTION_CALL);
intent.setData(uri);
startActivity(intent);
2.打电话:
// intent.setAction(Intent.ACTION_GET_CONTENT);
// intent.setType("vnd.android.cursor.item/phone");
3,回到主界面:
intent.setAction(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
startActivity(intent)
4,在android的配置文件中进行书写
  <activity 
            android:name="MyActivity">
            <intent-filter>
                <action android:name="android.intent.action.VIEW"/>
<data android:scheme="http" android:path="www.google.com">
            </intent-filter>
        </activity>


四、service学习

1.本地调用
a.了解service的使用地方:
自己了解到的使用点:action的操作

b.service的生命周期

c.service的调用方法:
startservice(intent)方法
绑定方法:bindService(intent, connection, BIND_AUTO_CREATE);
ServiceConnection是处理开始连接和关闭链接的操作


2.远程调用:RPC(还需要深入学习)
a.RPC的使用地方:



 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值