android studio for android learning (二)
来源:互联网 发布:相片日期修改软件 编辑:程序博客网 时间:2024/06/14 13:10
1.为什么要考虑设备的兼容性?
android可以用在不同的设备上,如手机,手表,电视等,不同的设备有不同的尺寸,需要我们去适用。你可以用一个静态的xml文件来设置设备的配置,这样你就可以用一个APK来通过android来配置不同的尺寸,用来支持不同的平台。
2. 兼容性包括两类,1是设备兼容,2是软件兼容(APP)。
3. 你写的APP要放到google play store上必需要满足下面几点
1. Device features
2. Platform version
3. Screen configuration
例如:你的APP需要的compass,如果没有,google play store 将会阻止它的安装。
<manifest ... > <uses-feature android:name="android.hardware.sensor.compass" android:required="true" /> ...</manifest>
4. 平台兼容性,这里是指google平台,如果android4.0 和android4.4 不同的平台有不同的API,新的平台中的API可能是旧版本中没有的,所以,在平台兼容性上可以设置最低兼容平台,其中android1.0的API level=1,而android 4.4 is api level 14,minSdkVersion是指最小的兼容等级,targetSdkVersion指你会优化支持的等级。
<manifest ... > <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19" /> ...</manifest>
5.系统权限(权限许可组和相应权限)
6. 消息对像:intents and intent filters,主要的应用组件在activity,service,broadcast,包括显式的消息对像(explicit intents),隐式的消息对象(implicit intents),隐式的就是没有指定Intent的组件名字,需要Android根据Intent中的Action、data、Category等来解析匹配。而目标组件(Activity、Service、Broadcast Receiver)怎通过设置他们的Intent Filter来界定其处理的Intent。如果一个组件没有定义Intent Filter,那么它只能接受处理显示的Intent,只有定义了Intent Filter的组件才能同时处理隐式和显示的Intent。
6.1为了确保你的APP安全,总是用一个显式的消息对象来启动一个服务,而且不声明intent filters。
6.2 if you want your activity to receive implicit intents, it must include a category for “android.intent.category.DEFAULT”
6.3 URI(Uniform Resource Identifier)
For example:
格式:< scheme >://< host >:< port >/< path >
content://com.example.project:200/folder/subfolder/etc
In this URI, the scheme is content, the host is com.example.project, the port is 200, and the path is folder/subfolder/etc
0 0
- android studio for android learning (二)
- android studio for android learning (二十八) android基础知识
- android studio for android learning (二十四 )bitmap and bitmapFactory
- android studio for android learning (一)
- android studio for android learning (四) 兼容性问题
- android studio for android learning (二十五 )activity的启动模式详解与标志位简析
- android studio for android learning (二十六 )自定义控件理解与浅析(1)
- android studio for android learning (二十七) UI控件动态加载机制浅析
- android studio for android learning (七) Android Log类全解
- android studio for android learning (九) android之Adapter用法
- android studio for android learning (二十 )android中this、context等关键概念理解全解
- android studio for android learning (二十三 )Android Orientation Sensor(方向传感器)与指南针实战(新方法替代orientation)
- android studio for android learning (八)开机启动界面splashActivity
- android studio for android learning (十六) support-annotations简介
- android studio for android learning (十七) Toast使用详解
- android studio for android learning (二十一 )异步任务AsyncTask加载美女图片攻略及AsyncTask源码详解
- android studio for android learning (十) android之activity的启动和关闭
- android studio for android learning (十四) android的数据的存储sharedPreferences
- java+jsp导出excel
- javascript学习——基本包装类型总结
- 大型游戏的设计
- tabview cell
- 数据结构-时间复杂度
- android studio for android learning (二)
- Android 插件化的 过去 现在 未来
- 通过IMAP方式迁移U-Mail邮件到Exchange 2013之将邮件从exchange 2007迁移到Exchage 2013!
- 使用PowerDesigner设计数据库
- Android指南针应用
- 后缀数组求最长重复子串
- springMVC学习笔记之DispatcherServelet
- iOSUIView是否包含,相交
- Android WebView 缓存处理