- 4 Free Ways to Run Android Apps on Your PC
- Mirror Your Phone With Windows
- Run Your Favorite Apps With BlueStacks
- Emulate Full Android Experience With Genymotion
- Run Android Directly on Your PC With Android-x86
- Overview of Android development on Windows
- Native Android
- Cross-platform
- Choosing a cross-platform framework
- Game development
- Начало работы с собственными разработками Android в Windows Get started with native Android development on Windows
- Установка Android Studio Install Android Studio
- Создание нового проекта Create a new project
- Java или Котлин Java or Kotlin
- Минимальный уровень API Minimum API Level
- Мгновенная поддержка приложений и артефакты Андроидкс Instant app support and Androidx artifacts
- Файлы проекта Project files
- Использование C или C++ для разработки игр Android Use C or C++ for Android game development
- Рекомендации по проектированию Design guidelines
- Система разработки Fluent для Android Fluent Design System for Android
4 Free Ways to Run Android Apps on Your PC
Want to use Android apps on a PC? There are plenty of good, free ways to emulate Android right on your computer, including the Your Phone app, BlueStacks, Genymotion, and Android-x86. Let’s take a look.
Ever wish you could run an Android app or game on your PC so you weren’t relegated to a tiny phone screen? Or maybe you need to test a feature on Android, but don’t have an Android device handy. Here are four free ways to run Android (and its apps) on your computer.
Mirror Your Phone With Windows
For apps installed on your phone, you don’t need anything fancy to get Android on your PC. The Windows Your Phone app provides the ability to mirror the screen of many Samsung phones to your PC, with access to most of your apps through a simple desktop window. Just follow our instructions on connecting your phone to Windows, then choose the Phone Screen option in the sidebar to mirror your device.
Microsoft is working on expanding this feature even further, with the ability to pin Android apps on your taskbar and launch them individually, as long as your phone and computer are connected. At the time of writing, this feature is available in Windows 10’s Insider Previews and is slowly rolling out to the general public.
This isn’t always the ideal solution. If you’re looking to play games, this may come with some delay and graphical blurriness, and you won’t be able to easily share files from your PC directly to an app in Android. But for quick access to Android apps you already have installed, it definitely works in a pinch.
Run Your Favorite Apps With BlueStacks
If you’re just looking to run a couple apps and don’t need the emulator to look like Android, you should try BlueStacks. Over the years, it’s become the best Android app emulator around, and it’s packed with features that ensure your apps and games run smoothly. Since it uses virtualization to emulate Android, you’ll want to jump into your computer’s BIOS and enable Intel VT-x or AMD-V, if your computer supports it, for best performance.
Download and install BlueStacks as you would any other Windows or Mac application. It’ll take up about 2GB of space on your computer (plus any apps you download), and when it launches, you’ll be greeted with its customized home screen. It doesn’t mimic a traditional Android launcher, but you do get access to the Play Store to download any apps you want—they’ll appear on BlueStacks’ home screen and on your Windows desktop as their own shortcuts. Just double-click an icon to run the app in question.
BlueStacks is great for apps that don’t have corresponding desktop apps, but the emulator really shines when it comes to games. BlueStacks comes with built-in mappings for your mouse and keyboard, which you can customize to the touch controls you find on different Android games.
You can also adjust the resolution, DPI, FPS, and amount of CPU or RAM allocated to the emulator, ensuring you get the best balance between speed and graphical fidelity. (This is particularly useful given that BlueStacks is fairly resource-intensive, as many virtual machines are.)
BlueStacks does, unfortunately, come with some ads and clutter, but it’s not as intrusive as it once was, and it’s a small price to pay for the functionality you get—especially considering it uses Android 7.1 as its base, which is higher than most alternatives on the market.
Emulate Full Android Experience With Genymotion
If you’re looking to explore the Android operating system itself—rather than individual apps—Genymotion is a decent emulator. Its main product is designed for developers and costs money to use, but there is a free version of the software you can download for personal use; you just need to create an account on the website first.
Genymotion uses VirtualBox to emulate Android, so you’ll either need to have VirtualBox installed on your PC or download the version with VirtualBox bundled. Install it like you would any other Windows program, ensuring you select the version for «Personal Use» during the wizard. (And like BlueStacks, you’ll want to enable Intel VT-x or AMD-V from your computer’s BIOS if you have it.)
When you start Genymotion, it’ll present you with a list of device templates you can install—this determines the screen resolution, Android version, and resources allotted to the emulator. Install the template you want and double-click it to enter Android. You’ll be able to navigate around the home screen, launch apps, and emulate certain events like GPS location.
Note that you’ll start with a very barebones version of Android that doesn’t even come with many of Google’s apps or modern features, though you can add the Play Store by clicking the «Open Gapps» icon in the sidebar to install it. Also, no matter which template you choose, you won’t get any custom versions of Android—picking the Samsung Galaxy S10 template, for example, won’t get you Samsung’s One UI. It just determines the resolution and specs of the virtual machine. (Genymotion does support Android versions from 4.4 all the way up to 10.0, though.)
Genymotion works well for exploring Android’s settings and other built-in features, though I wouldn’t necessarily use it to run individual apps, as it just doesn’t integrate as well with your PC as something like BlueStacks. If Genymotion doesn’t suit your needs, Google’s official Android software development kit also comes with an Android emulator, though setup is a bit more complex, so I wouldn’t recommend it for most users.
Run Android Directly on Your PC With Android-x86
If you’re looking for something a bit more full-featured, the Android-x86 project gets you as close as you can get to true Android on your PC. Android-x86 is an open-source project that ports Android to the x86 platform, allowing you to run it on your computer instead of an ARM-based phone or tablet.
To run Android-x86, you have a couple of options. If you want to run Android on its own, as a desktop operating system for your PC, you can download it as an ISO disc image and burn it to a USB drive with a program like Rufus. Then, insert that USB drive into the PC in question, reboot, and enter the boot menu (usually by pressing a key like F12 during the boot process).
By booting from your Android-x86 USB drive, you’ll either be able to run Android in a live environment—without having any effect on your PC—or install it to your PC’s hard drive for permanent usage (and better performance).
Alternatively, if you want to run Android-x86 on top of your existing operating system, you can download the disc image and run it inside VirtualBox. This is, again, a bit more advanced if you aren’t familiar with VirtualBox, but our guide to running Windows on a Mac can get you acquainted with the process.
The official site has some tips for getting Android-x86 up and running in a virtual machine as well. It’s more work than using something like BlueStacks, but it’s also closer to pure Android, which is a nice perk.
Overview of Android development on Windows
There are multiple paths for developing an Android device app using the Windows operating system. These paths fall into three main types: Native Android development, Cross-platform development, and Android game development. This overview will help you decide which development path to follow for developing an Android app and then provide next steps to help you get started using Windows to develop with:
In addition, this guide will provide tips on using Windows to:
Native Android
Native Android development on Windows means that your app is targeting only Android (not iOS or Windows devices). You can use Android Studio or Visual Studio to develop within the ecosystem designed specifically for the Android operating system. Performance will be optimized for Android devices, the user-interface look and feel will be consistent with other native apps on the device, and any features or capabilities of the user’s device will be straight-forward to access and utilize. Developing your app in a native format will help it to just ‘feel right’ because it follows all of the interaction patterns and user experience standards established specifically for Android devices.
Cross-platform
Cross-platform frameworks provide a single codebase that can (mostly) be shared between Android, iOS, and Windows devices. Using a cross-platform framework can help your app to maintain the same look, feel, and experience across device platforms, as well as benefiting from the automatic rollout of updates and fixes. Instead of needing to understand a variety of device-specific code languages, the app is developed in a shared codebase, typically in one language.
While cross-platform frameworks aim to look and feel as close to native apps as possible, they will never be as seamlessly integrated as a natively developed app and may suffer from reduced speed and degraded performance. Additionally, the tools used to build cross-platform apps may not have all of the features offered by each different device platform, potentially requiring workarounds.
A codebase is typically made up of UI code, for creating the user interface like pages, buttons controls, labels, lists, etc., and logic code, for calling web services, accessing a database, invoking hardware capabilities and managing state. On average, 90% of this can be reused, though there is typically some need to customize code for each device platform. This generalization largely depends on the type of app you’re building, but provides a bit of context that hopefully will help with your decision-making.
Choosing a cross-platform framework
- UI code: XML with Android Designer, and Material Theme
- Logic code: C# or F#
- Still able to tap into some native Android elements, but good for reuse of the code base for other platforms (iOS, Windows).
- Only logic code is shared across platforms, not UI code.
- Great for more complex apps with a device-specific user interface.
- UI code: XAML and .NET (with Visual Studio)
- Logic code: C#
- Shares around 60–90% of the logic and UI code across Android, iOS, and Windows device apps.
- Uses common user controls like Button, Label, Entry, ListView, StackLayout, Calendar, TabbedPage, etc. Create a Button and Xamarin Forms will figure out how to call the native button for each platform using the Binding Library to call Java or Swift code from C#.
- Great for simple apps, like internal or Line Of Business (LOB) apps, prototypes or MVPs. Any app that can look somewhat standard or generic, utilizing a simple user interface.
- UI code: JavaScript
- Logic code: JavaScript
- The goal of React Native isn’t to write the code once and run it on any platform, rather to learn-once (the React way) and write-anywhere.
- The community has added tools such asВ ExpoВ andВ Create React Native AppВ to help those wanting to build apps without using Xcode or Android Studio.
- Similar to Xamarin (C#), React Native (JavaScript) calls native UI elements (without the need for writing Java/Kotlin or Swift).
- UI code: HTML, CSS, JavaScript
- Logic code: JavaScript
- PWAs are web apps built with standard patterns to allow them to take advantage of both web and native app features. They can be built without a framework, but a couple of popular frameworks to consider are Ionic and PhoneGap.
- PWAs can be installed on a device (Android, iOS, or Windows) and can work offline thanks to the incorporation of a service-worker.
- PWAs can be distributed and installed without an app store using only a web URL. The Microsoft Store and Google Play Store allow PWAs to be listed, the Apple Store currently does not, though they can still be installed on any iOS device running 12.2 or later.
- To learn more, check out this introduction to PWAs on MDN.
Game development
Game development for Android is often unique from developing a standard Android app since games typically use custom rendering logic, often written in OpenGL or Vulkan. For this reason, and because of the many C libraries available that support game development, it’s common for developers to use C/C++ with Visual Studio, along with the Android Native Development Kit (NDK), to create games for Android. Get started with C/C++ for game development.
Начало работы с собственными разработками Android в Windows Get started with native Android development on Windows
Это руководство поможет вам приступить к работе с Windows для создания собственных приложений Android. This guide will get you started using Windows to create native Android applications. Если вы предпочитаете межплатформенное решение, см. Краткие сведения о некоторых вариантах в разделе Обзор разработки Android в Windows . If you would prefer a cross-platform solution, see Overview of Android development on Windows for a brief summary of some options.
Самым прямым способом создания собственного приложения Android является использование Android Studio с Java или Котлин, хотя можно использовать C или C++ для разработки Android , если у вас есть конкретная цель. The most straight-forward way to create a native Android app is using Android Studio with either Java or Kotlin, though it is also possible to use C or C++ for Android development if you have a specific purpose. Средства Android Studio SDK компилируют файлы кода, данных и ресурсов в архивный пакет Android с расширением apk. The Android Studio SDK tools compile your code, data, and resource files into an archive Android package, .apk file. Один файл APK содержит все содержимое приложения Android, а — файл, с помощью которого устройства на платформе Android используют для установки приложения. One APK file contains all the contents of an Android app and is the file that Android-powered devices use to install the app.
Установка Android Studio Install Android Studio
Android Studio является официальной интегрированной средой разработки для операционной системы Android под управлением Google. Android Studio is the official integrated development environment for Google’s Android operating system. Скачайте последнюю версию Android Studio для Windows. Download the latest version of Android Studio for Windows.
- Если вы скачали EXE-файл (рекомендуется), дважды щелкните его, чтобы запустить. If you downloaded an .exe file (recommended), double-click to launch it.
- Если вы загрузили ZIP-файл, распакуйте его, скопируйте папку Android-Studio в папку Program Files, а затем откройте для Android-Studio > папку bin и запустите studio64.exe (для 64-разрядных компьютеров) или studio.exe (для 32-разрядных компьютеров). If you downloaded a .zip file, unpack the ZIP, copy the android-studio folder into your Program Files folder, and then open the android-studio > bin folder and launch studio64.exe (for 64-bit machines) or studio.exe (for 32-bit machines).
Следуйте указаниям мастера установки в Android Studio и установите все рекомендуемые пакеты SDK. Follow the setup wizard in Android Studio and install any SDK packages that it recommends. По мере того как становятся доступными новые средства и другие API-интерфейсы, Android Studio уведомляет вас о наличии всплывающего окна или проверку наличия обновлений, выбрав пункт Справка > Проверка обновления. As new tools and other APIs become available, Android Studio will notify you with a pop-up, or check for updates by selecting Help > Check for Update.
Создание нового проекта Create a new project
Выберите файл > создать > Новый проект. Select File > New > New Project.
В окне Выбор проекта вы сможете выбрать один из следующих шаблонов: In the Choose your project window, you will be able to choose between these templates:
Основные действия: создает простое приложение с панелью приложений, плавающей кнопкой действия и двумя файлами макета: один для действия и один для разделения текстового содержимого. Basic Activity: Creates a simple app with an app bar, a floating action button and two layout files: one for the activity and one to separate out text content.
Пустое действие: создает пустое действие и один файл макета с примером текстового содержимого. Empty Activity: Creates an empty activity and a single layout file with sample text content.
Действие «Нижняя область навигации«: создает стандартную нижнюю панель навигации для действия. Bottom Navigation Activity: Creates a standard bottom navigation bar for an activity. Ознакомьтесь с нижним компонентом навигации в руководстве по проектированию материалов Google. See the Bottom Navigation Component in Google’s material design guidelines.
Дополнительные сведения о выборе шаблона действия в документах Android Studio. Learn more about selecting an activity template in the Android Studio docs.
Шаблоны обычно используются для добавления действий в новые и существующие модули приложений. Templates are commonly used to add activities to new and existing app modules. Например, чтобы создать экран входа для пользователей приложения, добавьте действие с шаблоном действия входа. For example, to create a login screen for your app’s users, add an activity with the Login Activity template.
Операционная система Android основана на идее компонентов и использует термины действие и назначение для определения взаимодействий. The Android operating system is based on the idea of components and uses the terms activity and intent to define interactions. Действие представляет отдельную задачу, которая может быть сделана пользователем. An activity represents a single, focused task that a user can do. Действие предоставляет окно для создания пользовательского интерфейса с помощью классов, основанных на классе представления . An activity provides a window for building the user interface using classes based on the View class. Существует жизненный цикл действий в операционной системе Android, определяемый набором шести обратных вызовов: onCreate() , onStart() , onResume() ,, onPause() onStop() и onDestroy() . There is a lifecycle for activities in the Android operating system, defined by a set of six callbacks: onCreate() , onStart() , onResume() , onPause() , onStop() , and onDestroy() . Компоненты действия взаимодействуют друг с другом с помощью объектов намерения . The activity components interact with one another using intent objects. Намерение определяет, какое действие следует запустить, или описывает тип выполняемого действия (и система выбирает подходящее действие, которое может быть даже из другого приложения). Intent either defines the activity to start or describes the type of action to perform (and the system selects the appropriate activity for you, which can even be from a different application). Дополнительные сведения о действиях, жизненном цикле действий и способах их работы см. в документах Android. Learn more about Activities, the Activity Lifecycle, and Intents in the Android docs.
Java или Котлин Java or Kotlin
Java стал языком в 1991, разработанным корпорацией Sun Microsystems, но который теперь принадлежит Oracle. Java became a language in 1991, developed by what was then Sun Microsystems, but which is now owned by Oracle. Она стала одним из самых популярных и мощных языков программирования с одним из самых крупных сообществ поддержки в мире. It has become one of the most popular and powerful programming languages with one of the largest support communities in the world. Язык Java основан на классах и объектно-ориентированной среде, предназначенный для того, чтобы иметь как можно меньше зависимостей реализации. Java is class-based and object-oriented, designed to have as few implementation dependencies as possible. Синтаксис похож на C и C++, но он имеет меньше низкоуровневых средств, чем любой из них. The syntax is similar to C and C++, but it has fewer low-level facilities than either of them.
Котлин был впервые объявлен как новый язык с открытым кодом JetBrains в 2011 и был включен в качестве альтернативы Java в Android Studio с 2017. Kotlin was first announced as a new open-source language by JetBrains in 2011 and has been included as an alternative to Java in Android Studio since 2017. В 2019 мая, Google объявил о Котлин в качестве предпочтительного языка для разработчиков приложений Android, поэтому, несмотря на более новый язык, он также имеет сообщество поддержки и был идентифицирован как один из самых быстрых растущех языков программирования. In May 2019, Google announced Kotlin as it’s preferred language for Android app developers, so despite being a newer language, it also has a strong support community and has been identified as one of the fastest growing programming languages. Котлин является межплатформенным, статически типизированным и предназначен для полноценного взаимодействия с Java. Kotlin is cross-platform, statically typed, and designed to interoperate fully with Java.
Java более широко используется для более широкого спектра приложений и предлагает некоторые функции, которые не Котлин, такие как проверенные исключения, простые типы, не являющиеся классами, статические элементы, незакрытые поля, подстановочные знаки и операторы ternary. Java is more widely used for a broader range of applications and offers some features that Kotlin does not, such as checked exceptions, primitive types that are not classes, static members, non-private fields, wildcard-types, and ternary-operators. Котлин специально разработана для и рекомендуется для Android. Kotlin is specifically designed for and recommended by Android. Он также предлагает некоторые функции, которые не поддерживаются в Java, такие как ссылки null, контролируемые системой типов, необработанные типы, инвариантные массивы, правильные типы функций (в отличие от SAM-преобразований Java), Использование вариативности сайта без подстановочных знаков, смарт-приведение и многое другое. It also offers some features that Java does not, such as null references controlled by the type system, no raw types, invariant arrays, proper function types (as opposed to Java’s SAM-conversions), use-site variance without wildcards, smart casts, and more. В документации по Котлин более подробно рассматривается сравнение с Java. The Kotlin documentation offers a more in-depth look at the comparison to Java.
Минимальный уровень API Minimum API Level
Вам потребуется выбрать минимальный уровень API для приложения. You will need to decide the minimum API level for your application. Это определяет версию Android, которую будет поддерживать ваше приложение. This determines which version of Android your application will support. Более низкие уровни API устарели и, следовательно, поддерживают больше устройств, но более высокие уровни API более новые и таким образом предоставляют больше возможностей. Lower API levels are older and therefore generally support more devices, but higher API levels are newer and therefor provide more features.
Выберите ссылку » помогите мне выбрать «, чтобы открыть диаграмму сравнения, показывающую распределение поддержки устройств и основные функции, связанные с выпуском версии платформы. Select the Help me choose link to open a comparison chart showing the device support distribution and key features associated with the platform version release.
Мгновенная поддержка приложений и артефакты Андроидкс Instant app support and Androidx artifacts
Можно заметить, что флажок для поддержки мгновенных приложений и другой для использования артефактов андроидкс в параметрах создания проекта. You may notice a checkbox to Support instant apps and another to Use androidx artifacts in your project creation options. Поддержка мгновенных приложений не проверяется, и андроидкс проверяется как рекомендуемое по умолчанию. The instant apps support is not checked and the androidx is checked as the recommended default.
Google Play мгновенные приложения предоставляют пользователям возможность опробовать приложение или игру, не устанавливая их первыми. Google Play Instant apps provide a way for people to try an app or game without installing it first. Эти мгновенные приложения могут быть распределены по Магазин Google Play, поиску Google, социальным сетям и в любом месте, где вы делитесь ссылкой. These instant apps can be surfaced across the Play Store, Google Search, social networks, and anywhere you share a link. Установив флажок поддерживать мгновенные приложения , вы запрашиваете Android Studio включить в проект пакет SDK для мгновенной разработки Google Play. By checking the Support instant apps box, you are asking Android Studio to include the Google Play Instant Development SDK with your project. Дополнительные сведения о Google Play мгновенных приложениях и о создании пакета приложений с поддержкой мгновенного включениясм. в документации по Android. To learn more about Google Play Instant apps and how to create an instant-enabled app bundle, see the Android documentation.
Артефакты андроидкс представляют новую версию библиотеки поддержки Android и обеспечивает обратную совместимость между выпусками Android. AndroidX artifacts represents the new version of the Android support library and provides backwards-compatibility across Android releases. Андроидкс предоставляет соответствующее пространство имен, начиная со строки андроидкс для всех доступных пакетов. AndroidX provides a consistent namespace starting with the string androidx for all available packages.
Андроидкс теперь является библиотекой по умолчанию. AndroidX is now the default library. Чтобы снять этот флажок и использовать предыдущую библиотеку поддержки, необходимо удалить последний пакет SDK для Android Q. To uncheck this box and use the previous support library requires removing the lastest Android Q SDK. Инструкции см. в разделе использование артефактов андроидкс в StackOverflow для получения инструкций, но сначала обратите внимание, что самые старые пакеты библиотек поддержки были сопоставлены с соответствующими пакетами андроидкс. *. See Uncheck use Androidx artifacts on StackOverflow for instructions, but first note that the former Support Library packages have been mapped into corresponding androidx.* packages. Полное сопоставление всех старых классов и создание артефактов для новых версий см. в разделе Миграция в андроидкс. For a full mapping of all the old classes and build artifacts to the new ones, see Migrating to AndroidX.
Файлы проекта Project files
Окно проекта Android Studio содержит следующие файлы (убедитесь, что в раскрывающемся меню выбрано представление Android): The Android Studio Project window, contains the following files (be sure that the Android view is selected from the drop-down menu):
приложение > Java > com. example. мифирстапп > MainActivity app > java > com.example.myfirstapp > MainActivity
Основное действие и точка входа для приложения. The main activity and entry point for your app. При сборке и запуске приложения система запускает экземпляр этого действия и загружает его макет. When you build and run your app, the system launches an instance of this Activity and loads its layout.
> макета > > приложений activity_main.xml app > res > layout > activity_main.xml
XML-файл, определяющий макет пользовательского интерфейса действия. The XML file defining the layout for the activity’s user interface (UI). Он содержит элемент TextView с текстом «Hello World» It contains a TextView element with the text «Hello World»
манифесты > приложений > AndroidManifest.xml app > manifests > AndroidManifest.xml
Файл манифеста, описывающий фундаментальные характеристики приложения и всех его компонентов. The manifest file describing the fundamental characteristics of the app and each of its components.
Gradle скрипты > сборка. Gradle Gradle Scripts > build.gradle
Существует два файла с таким именем: «проект: мое первое приложение», для всего проекта и «модуль: приложение» для каждого модуля приложения. There are two files with this name: «Project: My First App», for the entire project, and «Module: app», for each app module. В новом проекте изначально будет только один модуль. A new project will initially only have one module. Используйте файл build. File модуля, чтобы управлять тем, как подключаемый модуль Gradle создает приложение. Use the module’s build.file to control how the Gradle plugin builds your app. Дополнительные сведения см. в документации по Android, настройте статью о сборке . Learn more in the Android docs, Configure your build article.
Использование C или C++ для разработки игр Android Use C or C++ for Android game development
Операционная система Android разработана для поддержки приложений, написанных на Java или Котлин, с помощью инструментов, внедренных в архитектуру системы. The Android operating system is designed to support applications written in Java or Kotlin, benefiting from tooling embedded in the system’s architecture. Многие системные функции, такие как интерфейс Android и обработка намерений, доступны только через интерфейсы Java. Many system features, like Android UI and Intent handling, are only exposed through Java interfaces. Существует несколько экземпляров, в которых может потребоваться использовать код C или C++ через пакет Android Native Development Kit (NDK) , несмотря на некоторые связанные с ним проблемы. There are a few instances where you may want to use C or C++ code via the Android Native Development Kit (NDK) despite some of the associated challenges. Примером является разработка игр, так как игры обычно используют собственную логику отрисовки, написанную на OpenGL или вулкан, и преимущества обширных библиотек C, ориентированных на разработку игр. Game development is an example, since games typically use custom rendering logic written in OpenGL or Vulkan and benefit from a wealth of C libraries focused on game development. Использование C или C++ может также помочь в сжатии дополнительной производительности устройства для достижения низкой задержки или выполнения ресурсоемких вычислительных приложений, таких как физические модели. Using C or C++ might also help you squeeze extra performance out of a device to achieve low latency or run computationally intensive applications, such as physics simulations. Однако в большинстве новичков программистов Android не подходит NDK. The NDK is not appropriate for most novice Android programmers however. Если у вас нет конкретной цели для использования NDK, мы рекомендуем придерживаться Java, Котлин или одной из межплатформенных платформ. Unless you have a specific purpose for using the NDK, we recommend sticking with Java, Kotlin, or one of the cross-platform frameworks.
Чтобы создать новый проект с поддержкой C/C++, выполните следующие действия. To create a new project with C/C++ support:
В разделе Выбор проекта мастера Android Studio выберите тип проекта » *машинный код C++**». In the Choose your project section of the Android Studio wizard, select the Native C++* project type. Нажмите кнопку Далее, заполните оставшиеся поля, а затем нажмите кнопку Далее еще раз. Select Next, complete the remaining fields, then select Next again.
В разделе Настройка поддержки c++ мастера можно настроить проект с помощью стандартного поля C++ . In the Customize C++ Support section of the wizard, you can customize your project with the C++ Standard field. Используйте раскрывающийся список, чтобы выбрать, какую стандартизацию C++ следует использовать. Use the drop-down list to select which standardization of C++ you want to use. При выборе значения цепочки инструментов по умолчанию используется параметр CMAK по умолчанию. Selecting Toolchain Default uses the default CMake setting. Нажмите кнопку Готово. Select Finish.
После Android Studio создает новый проект, на панели проекта можно найти папку cpp , которая содержит собственные исходные файлы, заголовки, скрипты сборки для CMAK или NDK-Build, а также предварительно созданные библиотеки, которые являются частью проекта. Once Android Studio creates your new project, you can find a cpp folder in the Project pane that contains the native source files, headers, build scripts for CMake or ndk-build, and prebuilt libraries that are a part of your project. Вы также можете найти образец исходного файла C++, native-lib.cpp в src/main/cpp/ папке, предоставляющей простую функцию, stringFromJNI() возвращающую строку «Hello from C++». You can also find a sample C++ source file, native-lib.cpp , in the src/main/cpp/ folder which provides a simple stringFromJNI() function returning the string «Hello from C++». Кроме того, вы найдете сценарий сборки CMak, CMakeLists.txt в корневом каталоге вашего модуля, необходимый для создания собственной библиотеки. Additionally, you will find a CMake build script, CMakeLists.txt , in your module’s root directory required for building your native library.
Дополнительные сведения см. в разделе Документация по Android: Добавление кода C и C++ в проект. To learn more, see the Android docs topic: Add C and C++ code to your project. Примеры см. в разделе примеры для Android NDK с репозиторием интеграции с Android Studio C++ на сайте GitHub. For samples, see the Android NDK samples with Android Studio C++ integration repo on GitHub. Чтобы скомпилировать и запустить игру на C++ в Android, используйте API Google Play Game Services. To compile and run a C++ game on Android, use the Google Play Game services API.
Рекомендации по проектированию Design guidelines
Пользователи устройств хотят, чтобы приложения выглядели и обвели себя определенным образом. будь то прокрутка или касание или использование элементов управления голоса, пользователи будут иметь определенные ожидания для того, как должно выглядеть приложение и как его использовать. Device users expect applications to look and behave a certain way. whether swiping or tapping or using voice-controls, users will hold specific expectations for what your application should look like and how to use it. Эти ожидания должны оставаться согласованными, чтобы сократить путаницу и недовольство. These expectations should remain consistent in order to reduce confusion and frustration. Android предлагает руководство по этим платформам и ожиданиям устройств, объединяющее конструкцию Google материала для визуальных элементов и шаблонов навигации, а также рекомендации по качеству совместимости, производительности и безопасности. Android offers a guide to these platform and device expectations that combines the Google Material Design foundation for visual and navigational patterns, along with quality guidelines for compatibility, performance, and security.
Система разработки Fluent для Android Fluent Design System for Android
Кроме того, корпорация Майкрософт предлагает рекомендации по проектированию с целью обеспечения бесперебойной работы по всему портфелю мобильных приложений Майкрософт. Microsoft also offers design guidance with the goal of providing a seamless experience across the entire portfolio of Microsoft’s mobile apps.
Система разработки для Android — это разработка и создание собственных приложений Android, которые по-прежнему уникальны. Fluent Design System for Android design and build custom apps that are natively Android while still uniquely Fluent.