随笔分类 - Android 适配移植
摘要:1.官方文档 https://developer.android.com/reference/androidx/constraintlayout/classes android系统中定义了一系列类,辅助ConstraintLayout 完成较复杂功能,如定边界线、分组、分层、排列等等。它们大多数都是
阅读全文
摘要:1.官方文档 https://developer.android.com/studio/build/shrink-code 当您使用 Android Studio 3.4 或 Android Gradle 插件 3.4.0 及更高版本时,R8 是默认编译器,用于将项目的 Java 字节码转换为在 A
阅读全文
摘要:1.官方文档 https://developer.android.com/studio/write/vector-asset-studio https://developer.android.com/studio/write/convert-webp https://developer.androi
阅读全文
摘要:1.官方文档 https://developer.android.com/studio/build/multidex 主要内容: 什么是64K限制 编码时如何避免64K 限制 拆分dex避免64K 限制 2.DEX DEX = Dalvik Executable , android Dalvik j
阅读全文
摘要:百分比布局让其中的控件在指定高度,宽度,margin时使用屏幕宽高的百分比,不使用dp,px。这样一套布局可以适应多个屏幕,方便适配。如: 1.效果 它们分别为 图1. 2.7''_240*320:ldpi 图2. 4.0''_480*800:hdpi 图3. 5.5''_1440*2560:560
阅读全文
摘要:1.官方教程 Android 7.0 以后安全系数提高,应用间文件共享要使用FileProvider。原来的 file:/// Uri 替换为 content://Uri https://developer.android.com/reference/android/support/v4/conte
阅读全文
摘要:1.官方文档 1.1 通知相关全部、详细文档 https://developer.android.com/guide/topics/ui/notifiers/notifications 1.2 通知官方示例 https://github.com/googlesamples/android-Notif
阅读全文
摘要:1.屏幕单位 名称 单位缩写 单位全拼 介绍 屏幕尺寸 '' 或 in inch 屏幕的大小,通常用屏幕对角线的长度表示.单位是寸 屏幕分辨率 px pixels 整个屏幕的像素数,一般用屏幕的像素宽度(水平像素数)乘以像素高度表示,形如1280x720, 反之分辨率为1280x720的屏幕,像素宽
阅读全文
摘要:Supporting Different Languages It’s always a good practice to extract UI strings from your app code and keep them in an external file. Android makes ...
阅读全文
摘要:Supporting Different Platform Versions While the latest versions of Android often provide great APIs for your app, you should continue to support old...
阅读全文
摘要:Implementing Adaptative UI Flows Depending on the layout that your application is currently showing, the UI flow may be different. For example, if yo...
阅读全文
摘要:1.基本思路 1,布局 多个layout目录,在layout下存放各种屏幕大小对应的布局文件,然后在values-sw600dp,values-xhdip等为各屏幕大小的布局文件生成相同的别名。注意是values-sw600dp不是layout-sw600dp 2,图片 .9图片 2.Support
阅读全文
摘要:Supporting Different Densities This lesson shows you how to support different screen densities by providing different resources and using resolution-i
阅读全文
摘要:1.官方文档 https://developer.android.com/guide/topics/display-cutout 从 Android 9 开始正式支持刘海屏。9以下的参考各厂商文档。 2.刘海屏要求 一条边缘最多只能包含一个刘海。 一台设备不能有两个以上的刘海。 设备的两条较长边缘上
阅读全文
摘要:1.官方文档 如何支持不同尺寸的屏幕: https://developer.android.com/training/multiscreen/screensizes 有哪些资源支持备用 https://developer.android.com/guide/topics/resources/prov
阅读全文
摘要:1. 官方教程 https://developer.android.com/studio/build/build-variants.html 2. 设置Build Types参数 打开 Project Sturcture --> Build Variatns --> Build Types 设置参数
阅读全文