阅读笔记1
来源:互联网 发布:windows窗口样式 编辑:程序博客网 时间:2024/05/20 11:32
1:每个android app相当于一个linux用户,拥有自己独一无二的user id,每个进程都有自己独立的VM(虚拟机,每个app有一个或者多个进程组成),所以每个APP都能独立运行
2:每个android 厂商的设备必须通过CTS的测试
3.If necessary, you can prevent users from installing your app when their devices don't provide a given feature by declaring it with a <uses-feature>
element in your app's manifest file.(如果有必要的话,当用户的设备不提供你在manifest 文件里声明的uses-feature元素时,那么该用户将不能安装你的app)
4. you can query whether a feature is available by calling hasSystemFeature()
like this:
PackageManager pm = getPackageManager();if (!pm.hasSystemFeature(PackageManager.FEATURE_SENSOR_COMPASS)) { // This device does not have a compass, turn off the compass feature disableCompassFeature();}
sharedUserId
attribute in the AndroidManifest.xml
's manifest
tag of each package to have them assigned the same user ID. (可以通过在xml里设置sharedUserId来保证每个包都有同样的user id,相同的user id 会运行在同一个进程下,数据共享)Often times a permission failure will result in a SecurityException
being thrown back to the application. However, this is not guaranteed to occur everywhere. For example, the sendBroadcast(Intent)
method checks permissions as data is being delivered to each receiver, after the method call has returned, so you will not receive an exception if there are permission failures. In almost all cases, however, a permission failure will be printed to the system log.(通常情况下,权限错误将会导致SecurityException,但是不保证在任何地方都发生,比如发送广播的时候。尽管如此,权限错误将会打印出log)
7.
<permission android:name="com.me.app.myapp.permission.DEADLY_ACTIVITY" android:label="@string/permlab_deadlyActivity" android:description="@string/permdesc_deadlyActivity" android:permissionGroup="android.permission-group.COST_MONEY" android:protectionLevel="dangerous" />
The <protectionLevel>
attribute is required, telling the system how the user is to be informed of applications requiring the permission, or who is allowed to hold that permission, as described in the linked documentation.
The <permissionGroup>
attribute is optional, and only used to help the system display permissions to the user. You will usually want to set this to either a standard system group (listed inandroid.Manifest.permission_group
) or in more rare cases to one defined by yourself. It is preferred to use an existing group, as this simplifies the permission UI shown to the user.(level是必须的,通知系统,用户是怎么样被告知需要哪些权限的,或者谁被允许持有这些权限,group是可选的,仅仅用户帮助系统显示权限给用户)
8.
To show the chooser, create an Intent
using createChooser()
and pass it to startActivity()
. For example:
Intent sendIntent = new Intent(Intent.ACTION_SEND);...// Always use string resources for UI text.// This says something like "Share this photo with"String title = getResources().getString(R.string.chooser_title);// Create intent to show the chooser dialogIntent chooser = Intent.createChooser(sendIntent, title);// Verify the original intent will resolve to at least one activityif (sendIntent.resolveActivity(getPackageManager()) != null) { startActivity(chooser);}
This displays a dialog with a list of apps that respond to the intent passed to the createChooser()
method and uses the supplied text as the dialog title.
当你的隐式意图有多个app与之对应时,用户能够选择具体哪一个app来响应该意图,可以通过createChooser方法来显示选择的title,app顺序由系统决定,不可控。
- tcpl 阅读笔记 1
- X264阅读笔记1
- 论文阅读笔记1
- 阅读笔记(1)
- 论文阅读笔记---1
- gtd阅读笔记1
- Dive_Into_Python阅读笔记(1)
- 阅读笔记1
- Veloview阅读笔记1
- 阅读笔记1
- pandas阅读笔记<1>
- Metasploit阅读笔记1
- 论文阅读笔记1
- [笔记]论文阅读笔记(1)
- C++ FAQ阅读笔记[1]
- x264源码阅读笔记1
- DA9034驱动程序阅读笔记(1)
- DA9034驱动程序阅读笔记(1)
- ios中UI控件的继承关系
- 唐巧的博客地址
- iOS中的模糊效果
- IOS开发网络篇之──ASIHTTPRequest详解
- OnInitUpdate、OnUpdate、OnDraw与OnPaint!
- 阅读笔记1
- 超级牛B编码王(二):Sublime2之Zencoding快速上手 (转)
- Machine Learning on Spark——第三节 统计基础(一)
- HDU 3037 Saving Beans (Lucas定理)
- 《Linux内核完全剖析——基于0.12内核》第3章P31 引导扇区源代码boot.s
- Oracle新建用户并指定默认表空间
- NSAttributedString UIKit Additions 参考
- 点击区域是否在某个范围内
- 同步容器真的是安全的吗?