android 5.1 API简介

简介: android 5.1介绍: http://developer.android.com/about/versions/android-5.1.html?utm_campaign=lollipop-51-315&utm_source=dac&utm_medium=blog 5.

android 5.1介绍:

http://developer.android.com/about/versions/android-5.1.html?utm_campaign=lollipop-51-315&utm_source=dac&utm_medium=blog

5.1的targetSdkVersion 为 "22"

 

看下新特新:

1

Multiple SIM Card Support

Android 5.1 adds support for using more than one cellular carrier SIM card at a time. This feature lets users activate and use additional SIMs on devices that have two or more SIM card slots.

You can access information about the currently active SIM through the SubscriptionManager class, including whether or not the device is considered to be roaming on the current network. This information is useful for developers who want to throttle their apps' data access down or off for device users who are sensitive to data access charges. Your app can be alerted to changes in a device's current network connection by requesting the READ_PHONE_STATE permission and settingSubscriptionManager.OnSubscriptionsChangedListener on the SubscriptionManager object.

多个SIM卡的支持

你可以通过访问subscriptionmanager类激活SIM卡的信息,包括该设备是否是在当前的网络。可以有效控制应用的网络访问。

可以通过设置READ_PHONE_STATE配合SubscriptionManager.OnSubscriptionsChangedListener来对网络连接进行有效控制。

 

-----------------------------------------------------------------------------------

Deprecated HTTP Classes

The org.apache.http classes and the AndroidHttpClient class have been deprecated in Android 5.1. These classes are no longer being maintained and you should migrate any app code using these APIs to the URLConnection classes as soon as possible.

 

httpclient 在android 5.1不建议使用,不就将会被废弃,强力建议使用HttpUrlConnection

----------------------------------------------------------------------------------

Carrier Services

Android 5.1 provides support for telecommunication service providers to create apps that can perform carrier provisioning tasks on an Android device. These APIs provide a secure and flexible way for carrier-developed apps to perform these tasks and be distributed through Google Play. Apps that use these functions must be signed by a certificate that matches the certificate in the device's Universal Integrated Circuit Card (UICC).

The carrier service APIs have been added to the TelephonyManager class, the SmsManager class, and the newCarrierMessagingService class. Apps can check for access to these APIs by calling the hasCarrierPrivileges() method. Apps that call these APIs without access receive a SecurityException.

 

Android 5.1提供了对电信服务提供商创建的应用程序,可以在Android上实现载波配置任务支持。这些API提供了一个安全和灵活的方式为载体开发的应用程序来执行这些任务和分布在google市场。应用程序使用这些功能必须由证书匹配的证书在设备的通用集成电路卡(UICC)签署。

承运人服务API被添加到telephonymanager类,该类和类newcarriermessagingservice smsmanager。应用程序可以通过调用hascarrierprivileges()方法访问这些API检查。应用程序调用这些API没有收到SecurityException。

 

相关文章
|
7月前
|
存储 机器学习/深度学习 API
Android API Level 到底是什么?和安卓什么关系?应用发布如何知道自己的版本?优雅草卓伊凡
Android API Level 到底是什么?和安卓什么关系?应用发布如何知道自己的版本?优雅草卓伊凡
1131 31
Android API Level 到底是什么?和安卓什么关系?应用发布如何知道自己的版本?优雅草卓伊凡
|
编译器 API Android开发
Android经典实战之Kotlin Multiplatform 中,如何处理不同平台的 API 调用
本文介绍Kotlin Multiplatform (KMP) 中使用 `expect` 和 `actual` 关键字处理多平台API调用的方法。通过共通代码集定义预期API,各平台提供具体实现,编译器确保正确匹配,支持依赖注入、枚举类处理等,实现跨平台代码重用与原生性能。附带示例展示如何定义跨平台函数与类。
555 0
|
SQL Java 程序员
Java 8中的Stream API:简介与实用案例
【5月更文挑战第23天】本文将深入探讨Java 8中的Stream API,这是一种能够极大提升Java程序员生产力的新特性。我们将从基础概念开始,然后通过一些实用的案例来展示如何使用Stream API进行数据处理和操作。无论你是Java的初学者还是经验丰富的开发者,本文都将为你提供有价值的信息。
|
API Android开发 开发者
`RecyclerView`是Android API 21引入的UI组件,用于替代ListView和GridView
【6月更文挑战第26天】`RecyclerView`是Android API 21引入的UI组件,用于替代ListView和GridView。它提供高效的数据视图复用,优化的布局管理,支持多种布局(如线性、网格),并解耦数据、适配器和视图。RecyclerView的灵活性、性能(如局部刷新和动画支持)和扩展性使其成为现代Android开发的首选,特别是在处理大规模数据集时。
402 2
|
安全 Java API
Java 8中的Stream API:简介与实用指南深入理解Java并发编程:线程安全与锁优化
【5月更文挑战第29天】本文旨在介绍Java 8中引入的Stream API,这是一种用于处理集合的新方法。我们将探讨Stream API的基本概念,以及如何使用它来简化集合操作,提高代码的可读性和效率。 【5月更文挑战第29天】 在Java并发编程中,线程安全和性能优化是两个核心议题。本文将深入探讨如何通过不同的锁机制和同步策略来保证多线程环境下的数据一致性,同时避免常见的并发问题如死锁和竞态条件。文章还将介绍现代Java虚拟机(JVM)针对锁的优化技术,包括锁粗化、锁消除以及轻量级锁等概念,并指导开发者如何合理选择和使用这些技术以提升应用的性能。
|
SQL API Android开发
Android API:Activity.managedQuery()
Android API:Activity.managedQuery()
175 2
|
API Android开发
Android Framework增加API 报错 Missing nullability on parameter
Android Framework增加API 报错 Missing nullability on parameter
800 1
|
Java Linux API
微信API:探究Android平台下Hook技术的比较与应用场景分析
微信API:探究Android平台下Hook技术的比较与应用场景分析
|
Java API 数据处理
Java 8中的Stream API简介及其在数据处理中的应用
【5月更文挑战第30天】 本文旨在介绍Java 8中引入的Stream API,它是一种用于处理集合的新方法。与传统的循环和迭代器相比,Stream API提供了一种更简洁、高效的方式来处理数据。文章将详细介绍Stream API的基本概念、常用操作以及在实际项目中的应用场景。
|
存储 编解码 API
Android Media Framework(一)OpenMAX 框架简介
OpenMAX IL是Khronos Group为嵌入式和移动设备设计的低层级接口,用于统一调用音频、视频和图像编解码器,确保跨平台兼容性。它包括Core API(管理组件加载和方法调用)和Component API(组件实现,如源、接收器、编解码器等)。组件通过端口进行数据交互,客户端使用Core API加载和控制组件。Android引入OMX IL以支持不同芯片上的编解码器。组件状态包括Loaded、Idle、Executing和Invalid。组件架构涉及参数配置、命令处理和缓冲区管理,数据交换通过回调函数完成,端口持有预分配或组件自分配的缓冲区。
503 0