- Обзор Support Library Android SDK v26
- Поддержка шрифтов в XML
- Скачиваемые шрифты
- Совместимость с эмодзи
- Скачиваемая
- Пакетная
- Эмодзи виджеты
- Автоматический выбор размера TextView
- Степень разбивки
- Задание размеров
- Динамическая анимация
- AnimatedVectorDrawableCompat (бонус)
- Выводы
- Download
- Terms and Conditions
- 1. Introduction
- 2. Accepting this License Agreement
- 3. SDK License from Google
- 4. Use of the SDK by You
- 5. Your Developer Credentials
- 6. Privacy and Information
- 7. Third Party Applications
- 8. Using Android APIs
- 9. Terminating this License Agreement
- 10. DISCLAIMER OF WARRANTIES
- 11. LIMITATION OF LIABILITY
- 12. Indemnification
- 13. Changes to the License Agreement
- 14. General Legal Terms
- Android Studio
- Intelligent code editor
- Code templates and GitHub integration
- Multi-screen app development
- Virtual devices for all shapes and sizes
- Android builds evolved, with Gradle
- More about Android Studio
- System Requirements
- Windows
- Mac OS X
- Linux
- Download
- Terms and Conditions
- 1. Introduction
- 2. Accepting this License Agreement
- 3. SDK License from Google
- 4. Use of the SDK by You
- 5. Your Developer Credentials
- 6. Privacy and Information
- 7. Third Party Applications
- 8. Using Android APIs
- 9. Terminating this License Agreement
- 10. DISCLAIMER OF WARRANTIES
- 11. LIMITATION OF LIABILITY
- 12. Indemnification
- 13. Changes to the License Agreement
- 14. General Legal Terms
- Android Studio
- Intelligent code editor
- Code templates and GitHub integration
- Multi-screen app development
- Virtual devices for all shapes and sizes
- Android builds evolved, with Gradle
- More about Android Studio
- System Requirements
- Windows
- Mac OS X
- Linux
- Other Download Options
- SDK Tools Only
- All Android Studio Packages
Обзор Support Library Android SDK v26
26 версия Android SDK принесла новые возможности в наши Андроид приложения, включая шрифты как ресурсы, загружаемые шрифты, поддержка эмоджи, автоматические размеры TextView, управляемые физикой анимации через Spring and Fling, обратная совместимость для векторных анимаций, и уменьшения библиотеки при помощи повышения минимальной версии sdk до 14.
Если вы не знакомы с Android Support Library, то знайте, что вам нужно компилировать приложение на том же уровне Android API, что и последняя версия Android Support Library. Другими словами, убедитесь, что тег TargetFramework установлен на 8.0 (API 26). В таком случае приложения скомпилируется при помощи последней версии Android Support Library(V26).
Поддержка шрифтов в XML
Теперь вы можете помещать шрифты в новую папку ресурсов шрифта font. Используйте Resources.GetFont или ResourcesCompat.GetFont, чтобы скачать ресурсы шрифта в ваше приложение.
Пример: определение шрифта в XML в папке Resourcesfont:
Использование ресурса шрифта в View:
Скачиваемые шрифты
Есть новый класс FontsContractCompat, который позволит вам запрашивать шрифты у провайдера шрифтов вместо пакетирования их внутри вашего приложения. Вы можете использовать провайдер шрифтов из Google Fonts (800+шрифтов).
Чтобы использовать его, сначала создайте FontRequest:
Во-вторых, вам нужно зарегистрировать FontRequestCallback, который внедряет OnTypefaceRetrieved(Android.Graphics.Typeface typeface) и OnTypefaceRequestFailed(int reason). Мы создали один, который вы можете использовать, в этом примере:
Наконец, вам нужно запросить шрифт:
FontsContractCompat.RequestFont(this, request, callback, GetHandlerThreadHandler());
Вы можете также запросить шрифт непосредственно в XML:
Совместимость с эмодзи
Вспомогательная библиотека EmojiCompat позволит вашим устройствам пользоваться самыми новыми эмодзи, не требуя обновления Android OS. Это помогает избежать изображения надоевших пустых квадратиков (□)!
EmojiCompat имеет две основных библиотеки: скачиваемую или пакетную.
Скачиваемая
Как было отмечено выше в разделе «Скачиваемые шрифты» этого поста, сначала вам нужно сформировать FontRequest, чтобы создать FontRequestEmojiCompatConfig.
Пакетная
Пакетная библиотека делает жизнь немного легче примерно за 7 Мбит пакетного шрифта. Все, что вам нужно, это создать BundledEmojiCompatConfig:
Эмодзи виджеты
Библиотека EmojiCompat обеспечивает нас тремя основными элементами для отображения эмодзи:
EmojiTextView, EmojiEditTExt, и EmojiButton
Автоматический выбор размера TextView
Ваш TextView теперь автоматически увеличивает размер текста, когда увеличивается контейнер. Есть три способа, которыми вы можете задать автоматический выбор размера TextView, и они объяснены ниже.
Начните с описания android:autoSizeTextType как uniform.
Степень разбивки
Вы можете также определить диапазон между минимальным и максимальным размером текста для вашего TextView. Он может также увеличиваться пошагово согласно заданной вами степени разбивки.
Задание размеров
Наконец, вы можете указать все значения, которые TextView может использовать при автоматическом выборе размера. Вы можете указать ресурс массива ранее заданных размеров:
Теперь вам нужно только указать значение android:autoSizePresetSizes для массива, который мы уже создали:
Динамическая анимация
Теперь вы можете использовать анимацию на основе скорости вместо анимации на основе длительности. Такая анимация выглядит более натурально, с движениями, которые имитируют резкое движение или пружину.
Чтобы создать нашу первую динамическую анимацию, создайте новый объект SpringAnimation, используя View, ViewProperty и finalPosition.
SpringAnimation animX = new SpringAnimation(box, DynamicAnimation.TranslationX, 0);
Есть две основных концепции, которые вы можете задать для пружины: Stiffness и DampingRatio.
Stiffness определяет, как быстро пружина возвращается в исходное состояние, а DampingRatio определяет, насколько пружина упругая.
Затем вы можете задать вашу скорость StartVelocity и запустить(Start) анимацию!
AnimatedVectorDrawableCompat (бонус)
Если вы не знаете о AnimatedVectorDrawableCompat, то это красивая стильная библиотека для переходов между путями и интерполяции вдоль пути с целью создания ошеломляющих анимаций, трансформации логотипов и многого другого. Все они теперь привязаны к API 14, который позволяет этим красивым анимационным векторам работать с более старыми устройствами.
Вы можете создать ваши собственные красивые анимации в векторной графике с помощью XML, создав элемент animated-vector и приложив pathInterpolators к определенному objectAnimator. Если вы не лучший аниматор на свете, вы можете начать здесь с помощью инструмента Алекса Локвуда:
Выводы
Есть много хороших характеристик, которые Android предоставляет в пределах своих вспомогательных библиотек, которые вы можете использовать при разработке приложений на Xamarin. Эти характеристики обычно совместимы с предыдущими версиями minSdkVersion, которые определяются вспомогательной библиотекой. Теперь у вас есть шанс исследовать, что вспомогательные библиотеки могут дать вашим приложениям!
Источник
Download
Before installing Android Studio or the standalone SDK tools, you must agree to the following terms and conditions.
Terms and Conditions
1. Introduction
2. Accepting this License Agreement
3. SDK License from Google
4. Use of the SDK by You
5. Your Developer Credentials
6. Privacy and Information
7. Third Party Applications
8. Using Android APIs
9. Terminating this License Agreement
10. DISCLAIMER OF WARRANTIES
11. LIMITATION OF LIABILITY
12. Indemnification
13. Changes to the License Agreement
14. General Legal Terms
You’re just a few steps away from building apps for Android!
In a moment, you’ll be redirected to Installing the Android SDK.
I have read and agree with the above terms and conditions
Android Studio
The official Android IDE
- Android Studio IDE
- Android SDK tools
- Android 5.0 (Lollipop) Platform
- Android 5.0 emulator system image with Google APIs
Download Android Studio
To get Android Studio or stand-alone SDK tools, visit developer.android.com/sdk/
Intelligent code editor
At the core of Android Studio is an intelligent code editor capable of advanced code completion, refactoring, and code analysis.
The powerful code editor helps you be a more productive Android app developer.
Code templates and GitHub integration
New project wizards make it easier than ever to start a new project.
Start projects using template code for patterns such as navigation drawer and view pagers, and even import Google code samples from GitHub.
Multi-screen app development
Build apps for Android phones, tablets, Android Wear, Android TV, Android Auto and Google Glass.
With the new Android Project View and module support in Android Studio, it’s easier to manage app projects and resources.
Virtual devices for all shapes and sizes
Android Studio comes pre-configured with an optimized emulator image.
The updated and streamlined Virtual Device Manager provides pre-defined device profiles for common Android devices.
Android builds evolved, with Gradle
Create multiple APKs for your Android app with different features using the same project.
Manage app dependencies with Maven.
Build APKs from Android Studio or the command line.
More about Android Studio
For more details about features available in Android Studio, read the overview at Android Studio.
If you have been using Eclipse with ADT, be aware that Android Studio is now the official IDE for Android, so you should migrate to Android Studio to receive all the latest IDE updates. For help moving projects, see Migrating to Android Studio.
System Requirements
Windows
- Microsoft® Windows® 8/7/Vista/2003 (32 or 64-bit)
- 2 GB RAM minimum, 4 GB RAM recommended
- 400 MB hard disk space
- At least 1 GB for Android SDK, emulator system images, and caches
- 1280 x 800 minimum screen resolution
- Java Development Kit (JDK) 7
- Optional for accelerated emulator: Intel® processor with support for Intel® VT-x, Intel® EM64T (Intel® 64), and Execute Disable (XD) Bit functionality
Mac OS X
- Mac® OS X® 10.8.5 or higher, up to 10.9 (Mavericks)
- 2 GB RAM minimum, 4 GB RAM recommended
- 400 MB hard disk space
- At least 1 GB for Android SDK, emulator system images, and caches
- 1280 x 800 minimum screen resolution
- Java Runtime Environment (JRE) 6
- Java Development Kit (JDK) 7
- Optional for accelerated emulator: Intel® processor with support for Intel® VT-x, Intel® EM64T (Intel® 64), and Execute Disable (XD) Bit functionality
On Mac OS, run Android Studio with Java Runtime Environment (JRE) 6 for optimized font rendering. You can then configure your project to use Java Development Kit (JDK) 6 or JDK 7.
Linux
- GNOME or KDE desktop
- GNU C Library (glibc) 2.15 or later
- 2 GB RAM minimum, 4 GB RAM recommended
- 400 MB hard disk space
- At least 1 GB for Android SDK, emulator system images, and caches
- 1280 x 800 minimum screen resolution
- Oracle® Java Development Kit (JDK) 7
Tested on Ubuntu® 14.04, Trusty Tahr (64-bit distribution capable of running 32-bit applications).
Источник
Download
Before installing Android Studio or the standalone SDK tools, you must agree to the following terms and conditions.
Terms and Conditions
1. Introduction
2. Accepting this License Agreement
3. SDK License from Google
4. Use of the SDK by You
5. Your Developer Credentials
6. Privacy and Information
7. Third Party Applications
8. Using Android APIs
9. Terminating this License Agreement
10. DISCLAIMER OF WARRANTIES
11. LIMITATION OF LIABILITY
12. Indemnification
13. Changes to the License Agreement
14. General Legal Terms
You’re just a few steps away from building apps for Android!
In a moment, you’ll be redirected to Installing the Android SDK.
I have read and agree with the above terms and conditions
Android Studio
The official Android IDE
- Android Studio IDE
- Android SDK tools
- Android 5.0 (Lollipop) Platform
- Android 5.0 emulator system image with Google APIs
Download Android Studio
To get Android Studio or stand-alone SDK tools, visit developer.android.com/sdk/
Intelligent code editor
At the core of Android Studio is an intelligent code editor capable of advanced code completion, refactoring, and code analysis.
The powerful code editor helps you be a more productive Android app developer.
Code templates and GitHub integration
New project wizards make it easier than ever to start a new project.
Start projects using template code for patterns such as navigation drawer and view pagers, and even import Google code samples from GitHub.
Multi-screen app development
Build apps for Android phones, tablets, Android Wear, Android TV, Android Auto and Google Glass.
With the new Android Project View and module support in Android Studio, it’s easier to manage app projects and resources.
Virtual devices for all shapes and sizes
Android Studio comes pre-configured with an optimized emulator image.
The updated and streamlined Virtual Device Manager provides pre-defined device profiles for common Android devices.
Android builds evolved, with Gradle
Create multiple APKs for your Android app with different features using the same project.
Manage app dependencies with Maven.
Build APKs from Android Studio or the command line.
More about Android Studio
For more details about features available in Android Studio, read the guide to Android Studio Basics.
If you have been using Eclipse with ADT, be aware that Android Studio is now the official IDE for Android, so you should migrate to Android Studio to receive all the latest IDE updates. For help moving projects, see Migrating to Android Studio.
System Requirements
Windows
- Microsoft® Windows® 8/7/Vista/2003 (32 or 64-bit)
- 2 GB RAM minimum, 4 GB RAM recommended
- 400 MB hard disk space + at least 1 G for Android SDK, emulator system images, and caches
- 1280 x 800 minimum screen resolution
- Java Development Kit (JDK) 7
- Optional for accelerated emulator: Intel® processor with support for Intel® VT-x, Intel® EM64T (Intel® 64), and Execute Disable (XD) Bit functionality
Mac OS X
- Mac® OS X® 10.8.5 or higher, up to 10.9 (Mavericks)
- 2 GB RAM minimum, 4 GB RAM recommended
- 400 MB hard disk space
- At least 1 GB for Android SDK, emulator system images, and caches
- 1280 x 800 minimum screen resolution
- Java Runtime Environment (JRE) 6
- Java Development Kit (JDK) 7
- Optional for accelerated emulator: Intel® processor with support for Intel® VT-x, Intel® EM64T (Intel® 64), and Execute Disable (XD) Bit functionality
On Mac OS, run Android Studio with Java Runtime Environment (JRE) 6 for optimized font rendering. You can then configure your project to use Java Development Kit (JDK) 6 or JDK 7.
Linux
- GNOME or KDE desktop
- GNU C Library (glibc) 2.11 or later
- 2 GB RAM minimum, 4 GB RAM recommended
- 400 MB hard disk space
- At least 1 GB for Android SDK, emulator system images, and caches
- 1280 x 800 minimum screen resolution
- Oracle® Java Development Kit (JDK) 7
Tested on Ubuntu® 12.04, Precise Pangolin (64-bit distribution capable of running 32-bit applications.
Other Download Options
SDK Tools Only
If you prefer to use a different IDE or run the tools from the command line or with build scripts, you can instead download the stand-alone Android SDK Tools. These packages provide the basic SDK tools for app development, without an IDE. Also see the SDK tools release notes.
Platform | Package | Size | SHA-1 Checksum |
---|---|---|---|
Windows | installer_r24.0.2-windows.exe (Recommended) | 91428280 bytes | edac14e1541e97d68821fa3a709b4ea8c659e676 |
android-sdk_r24.0.2-windows.zip | 139473113 bytes | 51269c8336f936fc9b9538f9b9ca236b78fb4e4b | |
android-sdk_r24.0.2-macosx.zip | 87262823 bytes | 3ab5e0ab0db5e7c45de9da7ff525dee6cfa97455 | |
Linux | android-sdk_r24.0.2-linux.tgz | 140097024 bytes | b6fd75e8b06b0028c2427e6da7d8a09d8f956a86 |
All Android Studio Packages
Select a specific Android Studio package for your platform. Also see the Android Studio release notes.
Источник