概述 Google宣称Maps用户启用无痕模式后,Google不会储存浏览/搜寻纪录以及传送通知,另一方面,由于系统不会取得位置纪录/地点资讯,用户也就无法获得个人化地图服务 ?...Google于上周宣布,Android版的Google Maps已经开始支援无痕模式(Incognito Mode),在启用了该模式之后,不论是搜寻地点或是执行导航功能,都不会再储存在使用者的Google...在Android手机上启用Google Maps之后,使用者只要点选自己的档案照片,就能选择进入无痕模式,之后Google即不会储存使用者的浏览或搜寻纪录,也不会传送通知,亦无法更新位置历史纪录或所分享的地点...除了Android版之外,iOS的Google Maps也会很快就支援无痕模式。...,以Chrome浏览器为例,2017年的统计显示只有34.5%的使用者启用了该模式。
-ktx 软件包会包含 Kotlin 的扩展: // 获取最新 Lifecycle 库的版本信息 // https://developer.android.google.cn/jetpack/androidx...core-ktx 为来自 Android 平台的 API 提供了常用的 Kotlin 功能。...其他 KTX 模块 不仅仅是 AndroidX,其他一些模块也提供了对 KTX 的支持: Firebase 创建了一些通用 Kotlin 扩展; Google Maps 提供了 Maps 和 Places...通用 Kotlin 扩展 https://firebase.google.cn/docs/reference/kotlin/packages Maps https://developers.google.cn.../maps/documentation/android-sdk/ktx Places https://developers.google.cn/maps/documentation/places/android-sdk
-ktx 软件包会包含 Kotlin 的扩展: // 获取最新 Lifecycle 库的版本信息 // https://developer.android.google.cn/jetpack/androidx...// 获取最新 Core 库的版本信息 // https://developer.android.google.cn/jetpack/androidx/releases/core3def corektx_version...平台 API — core-ktx core-ktx 为来自 Android 平台的 API 提供了常用的 Kotlin 功能。...// 来源 https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:core/core-ktx/src/main...其他 KTX 模块 不仅仅是 AndroidX,其他一些模块也提供了对 KTX 的支持: Firebase 创建了一些 通用 Kotlin 扩展; Google Maps 提供了 Maps 和 Places
完整配置 如果想要使用 腾讯地图 的 完整功能 , 推荐配置如下依赖库 : dependencies { // JSON 字符串解析库 ( 可不用 ) implementation 'com.google.code.gson...content/groups/public" } maven { url "http://maven.aliyun.com/nexus/content/groups/public" } google...; 3、地图显示 Activity 类设置 Map 的基本显示 参考 腾讯地图 官方 示例代码中的 如下类 : import androidx.appcompat.app.AppCompatActivity...; import android.os.Bundle; import androidx.fragment.app.FragmentManager; import com.tencent.map.vector.demo.R...自定义的 地图 , 覆盖到 腾讯地图上 ; LatLngBounds 设置的第一个坐标是 地图东北角 坐标 , 第二个坐标是 地图西南角坐标 ; alpha 函数设置 覆盖图片 的透明度 , 一般设置为
本文实例为大家分享了Android实现扫描二维码的具体代码,供大家参考,具体内容如下 1.效果图: ?...2.引用公共库:builder.radle,在app目录下 implementation 'com.google.android.gms:play-services-maps:17.0.0' implementation...'com.google.android.gms:play-services-vision:19.0.0' implementation 'com.google.android.gms:auth-api-impl...; import com.google.android.gms.vision.Detector; import com.google.android.gms.vision.barcode.Barcode...; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import androidx.core.app.ActivityCompat
二、在新建的项目中导入外部模块时报错 报错信息为“错误: 程序包android.support.v7.app不存在”,错误截图如下所示: ?...举个例子 原来导入appcompat-v7的写法是下面这样: implementation 'com.android.support:appcompat-v7:28.0.0' 启用AndroidX...com.android.support:cardview-v7 androidx.cardview:cardview:1.0.0 com.android.support:design com.google.android.material...:material:1.0.0-rc01 com.android.support:multidex androidx.multidex:multidex:2.0.0 com.android.support...; 启用AndroidX之后,导入AppCompatActivity的代码要改成下面这样: import androidx.appcompat.app.AppCompatActivity; 详细的support
一、开启资源压缩 ---- 缩减、混淆处理和优化应用 ( 官方文档 ) : https://developer.android.google.cn/studio/build/shrink-code 资源压缩...> <resources xmlns:tools="http://schemas.<em>android</em>.com/tools" tools:shrinkMode="strict" /> 这样就启用了应用资源的严格压缩模式...:appcompat:1.2.0' implementation 'com.google.android.material:material:1.3.0' implementation...'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.espresso:espresso-core:...3.3.0' } 六、参考资料 ---- 参考官方文档 : 缩减、混淆处理和优化应用 : https://developer.android.google.cn/studio/build/shrink-code
一、RecyclerView 数据绑定核心要点 1、启用数据绑定 / 导入依赖 在 RecyclerView 中 , 如果要使用 DataBinding 架构组件进行数据绑定 , 首先要 启用 DataBinding..., 并 导入 RecyclerView 依赖 , 在 Module 模块下的 build.gradle 构建脚本 中 , 配置如下内容 : android { // 启用 DataBinding 数据绑定.../ 导入依赖 ) 在 Module 模块下的 build.gradle 构建脚本 中 , 主要是 启用 DataBinding ; RecyclerView 不需要单独导入依赖 , 在 引入的 'androidx.appcompat...:core-ktx:1.7.0' implementation 'androidx.appcompat:appcompat:1.4.1' implementation 'com.google.android.material...import android.view.View import android.view.ViewGroup import androidx.databinding.DataBindingUtil import
文章目录 一、报错信息 二、解决方案 一、报错信息 ---- 在 Android Studio 工程中 , 启用了 " android # buildTypes # debug " 中的 testCoverageEnabled...配置 , 设置为 true , 目的是为了生成测试覆盖率报告 ; kim.hsl.svg.ExampleInstrumentedTest > useAppContext[Pixel 2 - 9] FAILED...{ release { // 是否开启优化混淆 minifyEnabled true // 是否启用资源压缩 ,...:appcompat:1.2.0' implementation 'com.google.android.material:material:1.3.0' implementation...屏蔽这两个后缀即可正确生成 " 测试覆盖率报告 " ; 再次执行 gradlew :app:createDebugCoverageReport 命令 , 生成 " 测试覆盖率报告 " 成功 , 生成路径为
你仍然可以使用 AndroidX vectors,但你需要对代码作如下更改: /* Copyright 2018 Google LLC....-- Copyright 2018 Google LLC....当你调用 AppCompatResources.getDrawable,它用给定的 id 查看资源,如果它是一个向量(即根元素是 ),它就会手动地为你加载它。...因此,如果你只需要一个可以使用 AndroidX 来扩充子向量的 StateListDrawable,那么你可以使用:
# 如果想要启用优化 , 不能只在 ProGuard 项目配置中将优化标志设为 true ; # 相反还要在 build.gradle 中指向 "proguard-android-optimize.txt...-keep public class com.android.vending.licensing.ILicensingService -keep public class com.google.android.vending.licensing.ILicensingService...-dontnote com.google.android.vending.licensing.ILicensingService # 不混淆 Native 函数 # http://proguard.sourceforge.net...-dontnote android.support.** -dontnote androidx.** -dontwarn android.support.** -dontwarn androidx.**...-keep class androidx.annotation.Keep # 保留被 @android.support.annotation 注解声明的类 -keep @android.support.annotation.Keep
ViewModel 中使用了 LiveData 变量 , 则变成了 DataBinding + ViewModel + LiveData 组合用法 ; DataBinding 使用核心要点 : 首先 , 启用...DataBinding , 在 build.gradle 构建脚本 中的 " android / defaultConfig " 配置块 中 , 配置如下内容以 启用 DataBinding ;...在 build.gradle 构建脚本 中的 " android / defaultConfig " 配置块 中 , 配置如下内容以 启用 DataBinding ; 配置内容 : plugins {...:core-ktx:1.7.0' implementation 'androidx.appcompat:appcompat:1.4.1' implementation 'com.google.android.material...import android.os.Bundle import androidx.databinding.DataBindingUtil import androidx.lifecycle.ViewModelProvider
defaultConfig " 配置块中 , 配置如下内容 , 启用 DataBinding ; // 启用 DataBinding dataBinding {...:core-ktx:1.7.0' implementation 'androidx.appcompat:appcompat:1.4.1' implementation 'com.google.android.material...> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk...name="student" type="kim.hsl.databinding_demo.Student" /> 在 布局文件 中 , 为组件设置...ActivityMainBinding = DataBindingUtil.setContentView(this, R.layout.activity_main) // 为布局
该功能将自动在运行 Android 6.0 (API 级别 23) 或更高版本的使用 Google Play 服务 的设备上启用。...系统将默认为面向 Android 11 (API 级别 30) 或更高版本的应用启用该功能。不过,用户可以为面向 API 级别 23 到 29 的应用手动启用权限自动重置功能。...如果应用的 targetSDK 为 API 29 或更低版本,则开发者无需进行任何更改。...() 调用 androidx.core.content.PackageManagerCompat.getUnusedAppRestrictionsStatus() 请求用户为您的应用停用自动重置 发送带操作的...2021 年 12 月 - 权限自动重置功能将开始在由 Google Play 服务提供支持并运行 Android 6.0 到 Android 10 之间版本的设备上逐步推广。
文章目录 一、错误记录 二、解决方案 一、错误记录 ---- 在 Android Studio 中编译执行 Android 工程 , 报如下错误 : e: Unknown JVM target version...15, 16, 17, 18 在 Settings 设置中 , 设置的 JDK 版本是 11 版本的 ; 在 build.gradle 中 , 发现有 如下设置 , 其中设置了 jvmTarget 为..." // 启用 DataBinding dataBinding { enabled = true } } buildTypes...:core-ktx:1.7.0' implementation 'androidx.appcompat:appcompat:1.4.1' implementation 'com.google.android.material...'androidx.test.espresso:espresso-core:3.4.0' }
17 4.2 Jelly Bean 2012-12-13 新时钟程序,屏幕保护程序,锁屏改进 18 4.3 Jelly Bean 2013-07-24 支持OpenGL ES 3.0,SELinux默认启用...数据来源于官方网站 特别注意 Android 支持库的最新版本是28.0.0,这是最后一个google发布的支持库版本,现在google已将所有support包下的库都迁移至androidx包下面,...androidx.fragment.app: 1.2.0 fragment支持库 androidx.cardview:cardview: 1.0.0 卡片式视图 androidx.constraintlayout...:2.6 内存泄露检测工具 Glide com.github.bumptech.glide:glide:4.11.0 google御用图片加载工具 ZXing com.google.zxing:core...3.0.9 使用可观测的序列来组成异步的、基于事件的程序的库 AndroidUtilCode com.blankj:utilcode:1.30.0 一个包含众多实用工具类的库 Dragger com.google.dagger
要恢复为旧的文本字段可以在布局中添加样式 <com.google.android.material.textfield.TextInputLayout ... + style="@style...并且还启用了新的属性,虽然可以不使用,但是我们建议还是采用新的 MDC 样式!...并且支持启用 Material Theming 和其他功能。...SPDX-License-Identifier: Apache-2.0 --> -<androidx.cardview.widget.CardView + + -<androidx.appcompat.widget.SwitchCompat
感谢为 canary 和 beta 版提供早期反馈的开发者们。您们的反馈帮我们改进了 Android Studio 3.2 的质量和功能。...开发 Slices 支持 - Slices 是一种接入内置 Android AI 功能的新方式,能够在 Google 搜索和 Google 智能助理中呈现应用内容。...AndroidX 重构支持 - Android Jetpack 的组件之一是引入了 Android 扩展库(AndroidX)替换了 Android 支持库。...利用最新的 Android 模拟器 (v28.0.+) 您将不再受此限制。此外,还内置了转换器,支持输出为 GIF 和 WebM。...Android 模拟器的虚拟场景摄像头 - Android 模拟器的新虚拟场景摄像头,能够帮您为 Google 构建虚拟现实体验的平台 ARCore 进行开发。
Plugin DSL Reference 参考文档 : 文档主页 : https://google.github.io/android-gradle-dsl/2.3/ BaseExtension...Android 测试相关文档 : https://developer.android.google.cn/training/testing UnitTestOptions ( build.gradle...TestNG 支持 , 也就是启用 单元测试 , 默认的单元测试类型是 JUnit 单元测试 ; useTestNG() 3、设置 JVM 系统属性 为测试的 Java 虚拟机 ( JVM ) 设置系统属性...:appcompat:1.2.0' implementation 'com.google.android.material:material:1.3.0' implementation...'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.espresso:espresso-core:
android.view.View import android.view.ViewGroup import android.widget.Button import androidx.navigation.Navigation...android.view.View import android.view.ViewGroup import android.widget.Button import androidx.navigation.Navigation...两种传参方式的完整代码示例 ---- 1、Gradle 构建脚本 I、根目录下 settings.gradle 构建脚本 该构建脚本中 , pluginManagement 是最新的 Gradle 配置 , 但是本项目中没有启用...:core-ktx:1.7.0' implementation 'androidx.appcompat:appcompat:1.4.1' implementation 'com.google.android.material...import android.widget.Button import androidx.fragment.app.Fragment import androidx.navigation.Navigation
领取专属 10元无门槛券
手把手带您无忧上云