#Github android ndk samples
Explore tagged Tumblr posts
Link
GitHub is a top-rated programming resource for sharing code. Let's Check the GitHub Features for Odoo 16 Developers. 👇👇
#odoo#github#ERP Software#erpsoftware#erpintegration#odoodevelopment#erp development company#erpservices#erp integration#github desktop windows#github android ndk samples#erp consultant#Odoo16
0 notes
Text
Github android ndk samples

#Github android ndk samples android
#Github android ndk samples download
#Github android ndk samples free
If you’d like to request that Google maintain and publish an open source library in Prefab, use the “Package request” bug template on.
#Github android ndk samples free
If that’s a fit for the library you want, feel free to use ndkports for it, and consider sending us the patch!
#Github android ndk samples android
This is a good fit if the library you’re building is a typical Linux or cross-platform project that doesn’t fit naturally into a typical Android build.
:openssl:1.1.1d-alpha-1įor an up to date list, search for “”.įor the libraries we currently distribute, we wrote ndkports.
We’ve already published the following libraries: The selected library will match your build’s ABI, minSdkVersion, STL choice, and be the best fit for the version of the NDK that you’re using. If the prefab directory is found in an AAR dependency, the Android Gradle Plugin automatically runs Prefab to generate build system scripts from the contained information.Įach AAR might contain a large number of prebuilts for different configurations, so Prefab will perform a number of compatibility checks to find a suitable library for your build configuration. Each AAR that exposes C++ libraries to its consumers packages their libraries, headers, and a small amount of metadata into the prefab directory in the AAR. The tool that facilitates all of this is called Prefab. While not explicitly mentioned in the build scripts above, the curl package itself depends on OpenSSL so this support is available automatically.įor the complete example, see the curl-ssl sample. In app.cpp you can now do the following:Ī very common issue that people have is building OpenSSL to use with curl. Target_link_libraries(app curl::curl jsoncpp::jsoncpp)Īnd here’s the same example with ndk-build:Īnd that’s it. All you need to do is import and use them. Fortunately, the necessary CMake package config or ndk-build module will be automatically generated on your behalf.
#Github android ndk samples download
# 4.0.0 canary 9 defaults to Prefab 1.0.0-alpha3, which is not the latest.ĭeclaring the dependencies in your adle will cause Gradle to download those dependencies from Maven, but you must still instruct CMake or ndk-build how those dependencies should be used. Note: With AGP 4.0 this is still experimental, so to enable this functionality you must set the following properties in your project's gradle.properties file: Here’s how you’d use curl and jsoncpp for example (and automatically pull in the implicit OpenSSL dependency that curl has): With version 4.0 of the Android Gradle Plugin, we’ve addressed these issues by adding support for distributing and exposing native libraries through the same mechanism that you do for Java libraries: Android Archives (AARs).
Libraries often depend on other libraries, leaving users to chase them down and start the process again.
For example, Unix shell scripts won’t run on Windows.
Libraries may not build on the user’s machine.
Libraries are sometimes built by a build system that Android doesn’t support.
Android-specific build scripts are often out of date and no longer work.
Libraries don’t always distribute prebuilt binaries for Android, so users must either build the library themselves or rely on (potentially untrustworthy) prebuilt binaries found elsewhere on the web.
Library authors need to maintain support for both ndk-build and CMake (and hope that their users are using one of those two options and not something else).
One thing that NDK users struggle with is managing native dependencies:

0 notes
Text
Android ndk dev guide

#ANDROID NDK DEV GUIDE FOR ANDROID#
#ANDROID NDK DEV GUIDE ANDROID#
#ANDROID NDK DEV GUIDE SOFTWARE#
#ANDROID NDK DEV GUIDE SERIES#
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. For further into the future, see the NDK Roadmap. For what we're working on, see the milestones.
#ANDROID NDK DEV GUIDE ANDROID#
Unless required by applicable law or agreed to in writing, softwareĭistributed under the License is distributed on an "AS IS" BASIS, WITHOUT Android Native Development Kit (NDK) The NDK allows Android application developers to include native code in their Android application packages, compiled as JNI shared libraries. Use this file except in compliance with the License. The ASF licenses thisįile to you under the Apache License, Version 2.0 (the "License") you may not See the NOTICE file distributed with this work forĪdditional information regarding copyright ownership.
#ANDROID NDK DEV GUIDE SOFTWARE#
Licensed to the Apache Software Foundation (ASF) under one or more contributor LicenseĬopyright 2015 The Android Open Source Project, Inc.
#ANDROID NDK DEV GUIDE FOR ANDROID#
Please see CONTRIBUTING.md for more details. Cloud Anchors developer guide for Android NDK (C) On this page Prerequisites Enable the ARCore API Authorize your app to call the ARCore Cloud Anchor API Host a Cloud Anchor Check the mapping. Submitting a pull request through GitHub. Patches and new samples are encouraged, and may be submitted by forking this project and If you've found an error in these samples, please file an issue. On Command Line/Terminal: make sure set up ANDROID_HOME and ANDROID_NDK_HOME to local installation of SDK and NDK, then go to individual sample dir, and use "gradlew assembleDebug".With Android Studio: use "Import Project(Eclipse ADT, Gradle, etc)" or "File" > "Import Project" option.Some are documented at Android Studio pageįor samples using Android.mk build system with ndk-build see the android-mk branch.Google Play Game Samples with Android Studio.Note that gradle-experimental does not work with unified headers yet: use NDK version up to r15 and Android Studio up to version 2.3 for gradle-experimental plugin, refer to directory other-builds/experimental.for ndk-build with Android Studio, refer to directory other-builds/ndkbuild.Samples could also be built with other build systems: These samples uses the new CMake Android plugin with C++ support. Describe the DragonBoard™ 410c peripherals, I/O expansion capabilities, Compute (CPU and Graphics) capabilities, and Connectivity capabilities.This repository contains Android NDK samples with Android Studio C++ integration. Create, compile and run a Hello World program.ĥ. Install Android 5.1 (Lollipop) and Linux based on Ubuntu.Ĥ. In Module 7, will give you a general introduction and brief overview of Android Studios Native Development Kit (NDK). Make use of git, adb and fastboot to flash multiple OS and repair bricked boards.ģ. Configure at least one integrated development environment (IDE) for developing software.Ģ. You are an entrepreneur, innovator or member of a DIY communityĪfter completing this course, you will be able to:ġ.You want to pivot your career towards the design and development of Internet of Things enabled products.You want to develop hands-on experience with mobile technologies and the Internet.This course is suitable for a broad range of learners.
#ANDROID NDK DEV GUIDE SERIES#
This is the first in a series of courses where you will learn both the theory and get the hands-on development practice needed to prototype Internet of Things products. We will use the DragonBoard™ 410c single board computer (SBC). Do you want to develop skills to prototype mobile-enabled products using state-of-the-art technologies? In this course you will build a hardware and software development environment to guide your journey through the Internet of Things specialization courses.

0 notes
Text
Android Studio
Android Studio
Android Studio is the official Integrated Development Environment (IDE) for Android app development, based on IntelliJ IDEA . On top of IntelliJ’s powerful code editor and developer tools, Android Studio offers even more features that enhance your productivity when building Android apps, such as:
A flexible Gradle-based build system
A fast and feature-rich emulator
A unified environment where you can develop for all Android devices
Apply Changes to push code and resource changes to your running app without restarting your app
Code templates and GitHub integration to help you build common app features and import sample code
Extensive testing tools and frameworks
Lint tools to catch performance, usability, version compatibility, and other problems
C++ and NDK support
Built-in support for Google Cloud Platform, making it easy to integrate Google Cloud Messaging and App Engine
Read More
This page provides an introduction to basic Android Studio features. For a summary of the latest changes, see Android Studio release notes.
Project structure
Each project in Android Studio contains one or more modules with source code files and resource files. Types of modules include:
Android app modules
Library modules
Google App Engine modules
By default, Android Studio displays your project files in the Android project view, as shown in figure 1. This view is organized by modules to provide quick access to your project’s key source files.
All the build files are visible at the top level under Gradle Scripts and each app module contains the following folders:
manifests: Contains the AndroidManifest.xml file.
java: Contains the Java source code files, including JUnit test code.
res: Contains all non-code resources, such as XML layouts, UI strings, and bitmap images.
The Android project structure on disk differs from this flattened representation. To see the actual file structure of the project, select Project from the Project dropdown (in figure 1, it’s showing as Android).
Read More
You can also customize the view of the project files to focus on specific aspects of your app development. For example, selecting the Problems view of your project displays links to the source files containing any recognized coding and syntax errors, such as a missing XML element closing tag in a layout file.
The user interface
The toolbar lets you carry out a wide range of actions, including running your app and launching Android tools.
The navigation bar helps you navigate through your project and open files for editing. It provides a more compact view of the structure visible in the Project window.
The editor window is where you create and modify code. Depending on the current file type, the editor can change. For example, when viewing a layout file, the editor displays the Layout Editor.
The tool window bar runs around the outside of the IDE window and contains the buttons that allow you to expand or collapse individual tool windows.
The tool windows give you access to specific tasks like project management, search, version control, and more. You can expand them and collapse them.
The status bar displays the status of your project and the IDE itself, as well as any warnings or messages.
You can organize the main window to give yourself more screen space by hiding or moving toolbars and tool windows. You can also use keyboard shortcuts to access most IDE features.
Read More
At any time, you can search across your source code, databases, actions, elements of the user interface, and so on, by double-pressing the Shift key, or clicking the magnifying glass in the upper right-hand corner of the Android Studio window. This can be very useful if, for example, you are trying to locate a particular IDE action that you have forgotten how to trigger.
Tool windows
Instead of using preset perspectives, Android Studio follows your context and automatically brings up relevant tool windows as you work. By default, the most commonly used tool windows are pinned to the tool window bar at the edges of the application window.
To expand or collapse a tool window, click the tool’s name in the tool window bar. You can also drag, pin, unpin, attach, and detach tool windows.
To return to the current default tool window layout, click Window > Restore Default Layout or customize your default layout by clicking Window > Store Current Layout as Default.
To show or hide the entire tool window bar, click the window icon in the bottom left-hand corner of the Android Studio window.
To locate a specific tool window, hover over the window icon and select the tool window from the menu.
You can also use keyboard shortcuts to open tool windows. Table 1 lists the shortcuts for the most common windows.
If you want to hide all toolbars, tool windows, and editor tabs, click View > Enter Distraction Free Mode. This enables Distraction Free Mode. To exit Distraction Free Mode, click View > Exit Distraction Free Mode.
You can use Speed Search to search and filter within most tool windows in Android Studio. To use Speed Search, select the tool window and then type your search query.
Navigation
Here are some tips to help you move around Android Studio.
Switch between your recently accessed files using the Recent Files action. Press Control+E (Command+E on a Mac) to bring up the Recent Files action. By default, the last accessed file is selected. You can also access any tool window through the left column in this action.
View the structure of the current file using the File Structure action. Bring up the File Structure action by pressing Control+F12 (Command+F12 on a Mac). Using this action, you can quickly navigate to any part of your current file.
Search for and navigate to a specific class in your project using the Navigate to Class action. Bring up the action by pressing Control+N (Command+O on a Mac). Navigate to Class supports sophisticated expressions, including camel humps, paths, line navigate to, middle name matching, and many more. If you call it twice in a row, it shows you the results out of the project classes.
Navigate to a file or folder using the Navigate to File action. Bring up the Navigate to File action by pressing Control+Shift+N (Command+Shift+O on a Mac). To search for folders rather than files, add a / at the end of your expression.
Navigate to a method or field by name using the Navigate to Symbol action. Bring up the Navigate to Symbol action by pressing Control+Shift+Alt+N (Command+Option+O on a Mac).
Find all the pieces of code referencing the class, method, field, parameter, or statement at the current cursor position by pressing Alt+F7 (Option+F7 on a Mac).
Style and formatting
Read More
As you edit, Android Studio automatically applies formatting and styles as specified in your code style settings. You can customize the code style settings by programming language, including specifying conventions for tabs and indents, spaces, wrapping and braces, and blank lines. To customize your code style settings, click File > Settings > Editor > Code Style (Android Studio > Preferences > Editor > Code Style on a Mac.)
Although the IDE automatically applies formatting as you work, you can also explicitly call the Reformat Code action by pressing Control+Alt+L (Opt+Command+L on a Mac), or auto-indent all lines by pressing Control+Alt+I (Control+Option+I on a Mac).
Version control basics
Android Studio supports a variety of version control systems (VCS’s), including Git, GitHub, CVS, Mercurial, Subversion, and Google Cloud Source Repositories.
After importing your app into Android Studio, use the Android Studio VCS menu options to enable VCS support for the desired version control system, create a repository, import the new files into version control, and perform other version control operations:
From the Android Studio VCS menu, click Enable Version Control Integration.
From the drop-down menu, select a version control system to associate with the project root, and then click OK.
Gradle build system
Android Studio uses Gradle as the foundation of the build system, with more Android-specific capabilities provided by the Android plugin for Gradle. This build system runs as an integrated tool from the Android Studio menu, and independently from the command line. You can use the features of the build system to do the following:
Customize, configure, and extend the build process.
Create multiple APKs for your app, with different features using the same project and modules.
Reuse code and resources across sourcesets.
By employing the flexibility of Gradle, you can achieve all of this without modifying your app’s core source files. Android Studio build files are named build.gradle. They are plain text files that use Groovy syntax to configure the build with elements provided by the Android plugin for Gradle. Each project has one top-level build file for the entire project and separate module-level build files for each module. When you import an existing project, Android Studio automatically generates the necessary build files.
To learn more about the build system and how to configure, see Configure your build.
Build variants
The build system can help you create different versions of the same application from a single project. This is useful when you have both a free version and a paid version of your app, or if you want to distribute multiple APKs for different device configurations on Google Play.
For more information about configuring build variants, see Configure build variants.
Multiple APK support
Read More
Multiple APK support allows you to efficiently create multiple APKs based on screen density or ABI. For example, you can create separate APKs of an app for the hdpi and mdpi screen densities, while still considering them a single variant and allowing them to share test APK, javac, dx, and ProGuard settings.
For more information about multiple APK support, read Build multiple APKs.
Resource shrinking
Resource shrinking in Android Studio automatically removes unused resources from your packaged app and library dependencies. For example, if your application is using Google Play services to access Google Drive functionality, and you are not currently using Google Sign-In, then resource shrinking can remove the various drawable assets for theSignInButton buttons.
Managing dependencies
Dependencies for your project are specified by name in the build.gradle file. Gradle takes care of finding your dependencies and making them available in your build. You can declare module dependencies, remote binary dependencies, and local binary dependencies in your build.gradle file. Android Studio configures projects to use the Maven Central Repository by default. (This configuration is included in the top-level build file for the project.) For more information about configuring dependencies, read Add build dependencies.
Debug and profile tools
Android Studio assists you in debugging and improving the performance of your code, including inline debugging and performance analysis tools.
Inline debugging
Use inline debugging to enhance your code walk-throughs in the debugger view with inline verification of references, expressions, and variable values. Inline debug information includes:
Inline variable values
Referring objects that reference a selected object
Method return values
Lambda and operator expressions
Tooltip values
To enable inline debugging, in the Debug window, click Settings and select the checkbox for Show Values Inline.
Performance profilers
Android Studio provides performance profilers so you can more easily track your app’s memory and CPU usage, find deallocated objects, locate memory leaks, optimize graphics performance, and analyze network requests. With your app running on a device or emulator, open the Android Profiler tab.
For more information about performance profilers, see Performance profiling tools.
Heap dump
When you’re profiling memory usage in Android Studio, you can simultaneously initiate garbage collection and dump the Java heap to a heap snapshot in an Android-specific HPROF binary format file. The HPROF viewer displays classes, instances of each class, and a reference tree to help you track memory usage and find memory leaks.
For more information about working with heap dumps, see Inspect the heap and allocations.
Memory Profiler
Read More
You can use Memory Profiler to track memory allocation and watch where objects are being allocated when you perform certain actions. Knowing these allocations enables you to optimize your app’s performance and memory use by adjusting the method calls related to those actions.
For information about tracking and analyzing allocations, see Inspect the heap and allocations.
Data file access
The Android SDK tools, such as Systrace, and logcat, generate performance and debugging data for detailed app analysis.
To view the available generated data files, open the Captures tool window. In the list of the generated files, double-click a file to view the data. Right-click any .hprof files to convert them to the standard Investigate your RAM usage file format.
Code inspections
Read More
Whenever you compile your program, Android Studio automatically runs configured Lint and other IDE inspections to help you easily identify and correct problems with the structural quality of your code.
The Lint tool checks your Android project source files for potential bugs and optimization improvements for correctness, security, performance, usability, accessibility, and internationalization.
Annotations in Android Studio
Android Studio supports annotations for variables, parameters, and return values to help you catch bugs, such as null pointer exceptions and resource type conflicts. The Android SDK Manager packages the Support-Annotations library in the Android Support Repository for use with Android Studio. Android Studio validates the configured annotations during code inspection.
For more details about Android annotations, see Improve code inspection with annotations.
Log messages
When you build and run your app with Android Studio, you can view adb output and device log messages in the Logcat window.
Performance profiling
If you want to profile your app’s CPU, memory, and network performance, open the Android Profiler, by clicking View > Tool Windows > Android Profiler.
Sign in to your developer account
You can sign in to your developer account in Android Studio to access additional tools that requires authentication, such as Cloud Tools for Android Studio and the App Actions test tool. By signing in, you give those tools permission to view and manage your data across Google services.
After you open a project in Android Studio, you can sign in to your developer account or switch developer accounts, as follows:
Read More
1. Click the profile icon at the end of the toolbar.
2. In the window that appears, do one of the following:
If you’re not yet signed in, click Sign In and allow Android Studio to access the listed services.
If you’re already signed in, click Add Account to sign in with another Google account. Alternatively, you can click Sign Out and repeat the previous steps to sign in to a different account.
1 note
·
View note
Text
Android Studio
Android Studio
Android Studio is the official Integrated Development Environment (IDE) for Android app development, based on IntelliJ IDEA . On top of IntelliJ's powerful code editor and developer tools, Android Studio offers even more features that enhance your productivity when building Android apps, such as:
A flexible Gradle-based build system
A fast and feature-rich emulator
A unified environment where you can develop for all Android devices
Apply Changes to push code and resource changes to your running app without restarting your app
Code templates and GitHub integration to help you build common app features and import sample code
Extensive testing tools and frameworks
Lint tools to catch performance, usability, version compatibility, and other problems
C++ and NDK support
Built-in support for Google Cloud Platform, making it easy to integrate Google Cloud Messaging and App Engine
Read More
This page provides an introduction to basic Android Studio features. For a summary of the latest changes, see Android Studio release notes.
Project structure
Each project in Android Studio contains one or more modules with source code files and resource files. Types of modules include:
Android app modules
Library modules
Google App Engine modules
By default, Android Studio displays your project files in the Android project view, as shown in figure 1. This view is organized by modules to provide quick access to your project's key source files.
All the build files are visible at the top level under Gradle Scripts and each app module contains the following folders:
manifests: Contains the AndroidManifest.xml file.
java: Contains the Java source code files, including JUnit test code.
res: Contains all non-code resources, such as XML layouts, UI strings, and bitmap images.
The Android project structure on disk differs from this flattened representation. To see the actual file structure of the project, select Project from the Project dropdown (in figure 1, it's showing as Android).
Read More
You can also customize the view of the project files to focus on specific aspects of your app development. For example, selecting the Problems view of your project displays links to the source files containing any recognized coding and syntax errors, such as a missing XML element closing tag in a layout file.
The user interface
The toolbar lets you carry out a wide range of actions, including running your app and launching Android tools.
The navigation bar helps you navigate through your project and open files for editing. It provides a more compact view of the structure visible in the Project window.
The editor window is where you create and modify code. Depending on the current file type, the editor can change. For example, when viewing a layout file, the editor displays the Layout Editor.
The tool window bar runs around the outside of the IDE window and contains the buttons that allow you to expand or collapse individual tool windows.
The tool windows give you access to specific tasks like project management, search, version control, and more. You can expand them and collapse them.
The status bar displays the status of your project and the IDE itself, as well as any warnings or messages.
You can organize the main window to give yourself more screen space by hiding or moving toolbars and tool windows. You can also use keyboard shortcuts to access most IDE features.
Read More
At any time, you can search across your source code, databases, actions, elements of the user interface, and so on, by double-pressing the Shift key, or clicking the magnifying glass in the upper right-hand corner of the Android Studio window. This can be very useful if, for example, you are trying to locate a particular IDE action that you have forgotten how to trigger.
Tool windows
Instead of using preset perspectives, Android Studio follows your context and automatically brings up relevant tool windows as you work. By default, the most commonly used tool windows are pinned to the tool window bar at the edges of the application window.
To expand or collapse a tool window, click the tool’s name in the tool window bar. You can also drag, pin, unpin, attach, and detach tool windows.
To return to the current default tool window layout, click Window > Restore Default Layout or customize your default layout by clicking Window > Store Current Layout as Default.
To show or hide the entire tool window bar, click the window icon in the bottom left-hand corner of the Android Studio window.
To locate a specific tool window, hover over the window icon and select the tool window from the menu.
You can also use keyboard shortcuts to open tool windows. Table 1 lists the shortcuts for the most common windows.
If you want to hide all toolbars, tool windows, and editor tabs, click View > Enter Distraction Free Mode. This enables Distraction Free Mode. To exit Distraction Free Mode, click View > Exit Distraction Free Mode.
You can use Speed Search to search and filter within most tool windows in Android Studio. To use Speed Search, select the tool window and then type your search query.
Navigation
Here are some tips to help you move around Android Studio.
Switch between your recently accessed files using the Recent Files action. Press Control+E (Command+E on a Mac) to bring up the Recent Files action. By default, the last accessed file is selected. You can also access any tool window through the left column in this action.
View the structure of the current file using the File Structure action. Bring up the File Structure action by pressing Control+F12 (Command+F12 on a Mac). Using this action, you can quickly navigate to any part of your current file.
Search for and navigate to a specific class in your project using the Navigate to Class action. Bring up the action by pressing Control+N (Command+O on a Mac). Navigate to Class supports sophisticated expressions, including camel humps, paths, line navigate to, middle name matching, and many more. If you call it twice in a row, it shows you the results out of the project classes.
Navigate to a file or folder using the Navigate to File action. Bring up the Navigate to File action by pressing Control+Shift+N (Command+Shift+O on a Mac). To search for folders rather than files, add a / at the end of your expression.
Navigate to a method or field by name using the Navigate to Symbol action. Bring up the Navigate to Symbol action by pressing Control+Shift+Alt+N (Command+Option+O on a Mac).
Find all the pieces of code referencing the class, method, field, parameter, or statement at the current cursor position by pressing Alt+F7 (Option+F7 on a Mac).
Style and formatting
Read More
As you edit, Android Studio automatically applies formatting and styles as specified in your code style settings. You can customize the code style settings by programming language, including specifying conventions for tabs and indents, spaces, wrapping and braces, and blank lines. To customize your code style settings, click File > Settings > Editor > Code Style (Android Studio > Preferences > Editor > Code Style on a Mac.)
Although the IDE automatically applies formatting as you work, you can also explicitly call the Reformat Code action by pressing Control+Alt+L (Opt+Command+L on a Mac), or auto-indent all lines by pressing Control+Alt+I (Control+Option+I on a Mac).
Version control basics
Android Studio supports a variety of version control systems (VCS’s), including Git, GitHub, CVS, Mercurial, Subversion, and Google Cloud Source Repositories.
After importing your app into Android Studio, use the Android Studio VCS menu options to enable VCS support for the desired version control system, create a repository, import the new files into version control, and perform other version control operations:
From the Android Studio VCS menu, click Enable Version Control Integration.
From the drop-down menu, select a version control system to associate with the project root, and then click OK.
Gradle build system
Android Studio uses Gradle as the foundation of the build system, with more Android-specific capabilities provided by the Android plugin for Gradle. This build system runs as an integrated tool from the Android Studio menu, and independently from the command line. You can use the features of the build system to do the following:
Customize, configure, and extend the build process.
Create multiple APKs for your app, with different features using the same project and modules.
Reuse code and resources across sourcesets.
By employing the flexibility of Gradle, you can achieve all of this without modifying your app's core source files. Android Studio build files are named build.gradle. They are plain text files that use Groovy syntax to configure the build with elements provided by the Android plugin for Gradle. Each project has one top-level build file for the entire project and separate module-level build files for each module. When you import an existing project, Android Studio automatically generates the necessary build files.
To learn more about the build system and how to configure, see Configure your build.
Build variants
The build system can help you create different versions of the same application from a single project. This is useful when you have both a free version and a paid version of your app, or if you want to distribute multiple APKs for different device configurations on Google Play.
For more information about configuring build variants, see Configure build variants.
Multiple APK support
Read More
Multiple APK support allows you to efficiently create multiple APKs based on screen density or ABI. For example, you can create separate APKs of an app for the hdpi and mdpi screen densities, while still considering them a single variant and allowing them to share test APK, javac, dx, and ProGuard settings.
For more information about multiple APK support, read Build multiple APKs.
Resource shrinking
Resource shrinking in Android Studio automatically removes unused resources from your packaged app and library dependencies. For example, if your application is using Google Play services to access Google Drive functionality, and you are not currently using Google Sign-In, then resource shrinking can remove the various drawable assets for theSignInButton buttons.
Managing dependencies
Dependencies for your project are specified by name in the build.gradle file. Gradle takes care of finding your dependencies and making them available in your build. You can declare module dependencies, remote binary dependencies, and local binary dependencies in your build.gradle file. Android Studio configures projects to use the Maven Central Repository by default. (This configuration is included in the top-level build file for the project.) For more information about configuring dependencies, read Add build dependencies.
Debug and profile tools
Android Studio assists you in debugging and improving the performance of your code, including inline debugging and performance analysis tools.
Inline debugging
Use inline debugging to enhance your code walk-throughs in the debugger view with inline verification of references, expressions, and variable values. Inline debug information includes:
Inline variable values
Referring objects that reference a selected object
Method return values
Lambda and operator expressions
Tooltip values
To enable inline debugging, in the Debug window, click Settings and select the checkbox for Show Values Inline.
Performance profilers
Android Studio provides performance profilers so you can more easily track your app’s memory and CPU usage, find deallocated objects, locate memory leaks, optimize graphics performance, and analyze network requests. With your app running on a device or emulator, open the Android Profiler tab.
For more information about performance profilers, see Performance profiling tools.
Heap dump
When you’re profiling memory usage in Android Studio, you can simultaneously initiate garbage collection and dump the Java heap to a heap snapshot in an Android-specific HPROF binary format file. The HPROF viewer displays classes, instances of each class, and a reference tree to help you track memory usage and find memory leaks.
For more information about working with heap dumps, see Inspect the heap and allocations.
Memory Profiler
Read More
You can use Memory Profiler to track memory allocation and watch where objects are being allocated when you perform certain actions. Knowing these allocations enables you to optimize your app’s performance and memory use by adjusting the method calls related to those actions.
For information about tracking and analyzing allocations, see Inspect the heap and allocations.
Data file access
The Android SDK tools, such as Systrace, and logcat, generate performance and debugging data for detailed app analysis.
To view the available generated data files, open the Captures tool window. In the list of the generated files, double-click a file to view the data. Right-click any .hprof files to convert them to the standard Investigate your RAM usage file format.
Code inspections
Whenever you compile your program, Android Studio automatically runs configured Lint and other IDE inspections to help you easily identify and correct problems with the structural quality of your code.
The Lint tool checks your Android project source files for potential bugs and optimization improvements for correctness, security, performance, usability, accessibility, and internationalization.
Annotations in Android Studio
Android Studio supports annotations for variables, parameters, and return values to help you catch bugs, such as null pointer exceptions and resource type conflicts. The Android SDK Manager packages the Support-Annotations library in the Android Support Repository for use with Android Studio. Android Studio validates the configured annotations during code inspection.
For more details about Android annotations, see Improve code inspection with annotations.
Log messages
When you build and run your app with Android Studio, you can view adb output and device log messages in the Logcat window.
Performance profiling
If you want to profile your app's CPU, memory, and network performance, open the Android Profiler, by clicking View > Tool Windows > Android Profiler.
Sign in to your developer account
You can sign in to your developer account in Android Studio to access additional tools that requires authentication, such as Cloud Tools for Android Studio and the App Actions test tool. By signing in, you give those tools permission to view and manage your data across Google services.
After you open a project in Android Studio, you can sign in to your developer account or switch developer accounts, as follows:
Read More
1. Click the profile icon at the end of the toolbar.
2. In the window that appears, do one of the following:
If you're not yet signed in, click Sign In and allow Android Studio to access the listed services.
If you're already signed in, click Add Account to sign in with another Google account. Alternatively, you can click Sign Out and repeat the previous steps to sign in to a different account.
1 note
·
View note
Text
Android Studio
20 August 2020
Android Studio is the official Integrated Development Environment (IDE) for Android app development, based on IntelliJ IDEA. On top of IntelliJ's powerful code editor and developer tools, Android Studio offers even more features that enhance your productivity when building Android apps, such as:
· A flexible Gradle-based build system
· A fast and feature-rich emulator
· A unified environment where you can develop for all Android devices
· Instant Run to push changes to your running app without building a new APK
· Code templates and GitHub integration to help you build common app features and import sample code
· Extensive testing tools and frameworks
· Lint tools to catch performance, usability, version compatibility, and other problems
· C++ and NDK support
· Built-in support for Google Cloud Platform, making it easy to integrate Google Cloud Messaging and App Engine.
0 notes
Photo
Getting Started with the React Native Navigation Library
One of the most important aspects of React Native app development is the navigation. It’s what allows users to get to the pages they’re looking for. That’s why it’s important to choose the best navigation library to suit your needs.
If your app has a lot of screens with relatively complex UI, it might be worth exploring React Native Navigation instead of React Navigation. This is because there will always be performance bottlenecks with React Navigation, since it works off the same JavaScript thread as the rest of the app. The more complex your UI, the more data has to be passed to that bridge, which can potentially slow it down.
In this tutorial, we’ll be looking at the React Native Navigation library by Wix, an alternative navigation library for those who are looking for a smoother navigation performance for their React Native apps.
Prerequisites
Knowledge of React and React Native is required to follow this tutorial. Prior experience with a navigation library such as React Navigation is optional.
App Overview
In order to demonstrate how to use the library, we’ll be creating a simple app that uses it. The app will have five screens in total:
Initialization: this serves as the initial screen for the app. If the user is logged in, it will automatically navigate to the home screen. If not, the user is navigated to the login screen.
Login: this allows the user to log in so they can view the home, gallery, and feed. To simplify things, the login will just be mocked; no actual authentication code will be involved. From this screen, the user can also go to the forgot-password screen.
ForgotPassword: a filler screen, which asks for the user’s email address. This will simply be used to demonstrate stack navigation.
Home: the initial screen that the user will see when they log in. From here, they can also navigate to either the gallery or feed screens via a bottom tab navigation.
Gallery: a filler screen which shows a photo gallery UI.
Feed: a filler screen which shows a news feed UI.
Here’s what the app will look like:
You can find the source code of the sample app on this GitHub repo.
Bootstrapping the App
Let’s start by generating a new React Native project:
react-native init RNNavigation --version [email protected]
Note: we’re using a slightly older version of React Native, because React Native Navigation doesn’t work well with later versions of React Native. React Native Navigation hasn’t really kept up with the changes in the core of React Native since version 0.58. The only version known to work flawlessly with React Native is the version we’re going to use. If you check the issues on their repo, you’ll see various issues on version 0.58 and 0.59. There might be workarounds on those two versions, but the safest bet is still version 0.57.
As for React Native version 0.60, the core team has made a lot of changes. One of them is the migration to AndroidX, which aims to make it clearer which packages are bundled with the Android operating system. This essentially means that if a native module uses any of the old packages that got migrated to the new androidx.* package hierarchy, it will break. There are tools such as jetifier, which allows for migration to AndroidX. But this doesn’t ensure React Native Navigation will work.
Next, install the dependencies of the app:
react-native-navigation — the navigation library that we’re going to use.
@react-native-community/async-storage — for saving data to the app’s local storage.
react-native-vector-icons — for showing icons for the bottom tab navigation.
yarn add react-native-navigation @react-native-community/async-storage react-native-vector-icons
In the next few sections, we’ll be setting up the packages we just installed.
Setting up React Native Navigation
First, we’ll set up the React Native Navigation library. The instructions that we’ll be covering here are also in the official documentation. Unfortunately, it’s not written in a very friendly way for beginners, so we’ll be covering it in more detail.
Note: the demo project includes an Android and iOS folders as well. You can use those as a reference if you encounter any issues with setting things up.
Since the name of the library is very long, I’ll simply refer to it as RNN from now on.
Android Setup
In this section, we’ll take a look at how you can set up RNN for Android. Before you proceed, it’s important to update all the SDK packages to the latest versions. You can do that via the Android SDK Manager.
settings.gradle
Add the following to your android/settings.gradle file:
include ':react-native-navigation' project(':react-native-navigation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-navigation/lib/android/app/')
Gradle Wrapper Properties
In your android/gradle/wrapper/gradle-wrapper.properties, update Gradle’s distributionUrl to use version 4.4 if it’s not already using it:
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
build.gradle
Next, in your android/build.gradle file, add mavenLocal() and mavenCentral() under buildscript -> repositories:
buildscript { repositories { google() jcenter() // add these: mavenLocal() mavenCentral() } }
Next, update the classpath under the buildscript -> dependencies to point out to the Gradle version that we need:
buildscript { repositories { ... } dependencies { classpath 'com.android.tools.build:gradle:3.0.1' } }
Under allprojects -> repositories, add mavenCentral() and JitPack. This allows us to pull the data from React Native Navigation’s JitPack repository:
allprojects { allprojects { repositories { mavenLocal() google() jcenter() mavenCentral() // add this maven { url 'https://jitpack.io' } // add this } }
Next, add the global config for setting the build tools and SDK versions for Android:
allprojects { ... } ext { buildToolsVersion = "27.0.3" minSdkVersion = 19 compileSdkVersion = 26 targetSdkVersion = 26 supportLibVersion = "26.1.0" }
Lastly, we’d still want to keep the default react-native run-android command when compiling the app, so we have to set Gradle to ignore other flavors of React Native Navigation except the one we’re currently using (reactNative57_5). Ignoring them ensures that we only compile the specific version we’re depending on:
ext { ... } subprojects { subproject -> afterEvaluate { if ((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) { android { variantFilter { variant -> def names = variant.flavors*.name if (names.contains("reactNative51") || names.contains("reactNative55") || names.contains("reactNative56") || names.contains("reactNative57")) { setIgnore(true) } } } } } }
Note: there are four other flavors of RNN that currently exist. These are the ones we’re ignoring above:
reactNative51
reactNative55
reactNative56
reactNative57
android/app/build.gradle
On your android/app/build.gradle file, under android -> compileOptions, make sure that the source and target compatibility version is 1.8:
android { defaultConfig { ... } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } }
Then, in your dependencies, include react-native-navigation as a dependency:
dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}" implementation "com.facebook.react:react-native:+" implementation project(':react-native-navigation') // add this }
Lastly, under android -> defaultConfig, set the missingDimensionStrategy to reactNative57_5. This is the version of RNN that’s compatible with React Native 0.57.8:
defaultConfig { applicationId "com.rnnavigation" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion missingDimensionStrategy "RNN.reactNativeVersion", "reactNative57_5" // add this versionCode 1 versionName "1.0" ndk { abiFilters "armeabi-v7a", "x86" } }
The post Getting Started with the React Native Navigation Library appeared first on SitePoint.
by Wern Ancheta via SitePoint https://ift.tt/34ZFDci
0 notes
Text
Native Dependencies in Android Studio 4.0
By Dan Albert, Software Engineer
One thing that NDK users struggle with is managing native dependencies:
Library authors need to maintain support for both ndk-build and CMake (and hope that their users are using one of those two options and not something else).
Libraries don’t always distribute prebuilt binaries for Android, so users must either build the library themselves or rely on (potentially untrustworthy) prebuilt binaries found elsewhere on the web.
Android-specific build scripts are often out of date and no longer work.
Libraries are sometimes built by a build system that Android doesn’t support.
Libraries may not build on the user’s machine. For example, Unix shell scripts won’t run on Windows.
Libraries often depend on other libraries, leaving users to chase them down and start the process again.
With version 4.0 of the Android Gradle Plugin, we’ve addressed these issues by adding support for distributing and exposing native libraries through the same mechanism that you do for Java libraries: Android Archives (AARs).
Here’s how you’d use curl and jsoncpp for example (and automatically pull in the implicit OpenSSL dependency that curl has):
// build.gradle dependencies { implementation 'com.android.ndk.thirdparty:curl:7.68.0-alpha-1' implementation 'com.android.ndk.thirdparty:jsoncpp:1.8.4-alpha-1' }
Note: With AGP 4.0 this is still experimental, so to enable this functionality you must set the following properties in your project's gradle.properties file:
# Enables Prefab android.enablePrefab=true # Work around https://issuetracker.google.com/149575364 android.enableParallelJsonGen=false # 4.0.0 canary 9 defaults to Prefab 1.0.0-alpha3, which is not the latest. android.prefabVersion=1.0.0-alpha5
Importing packages into your build
Declaring the dependencies in your build.gradle will cause Gradle to download those dependencies from Maven, but you must still instruct CMake or ndk-build how those dependencies should be used. Fortunately, the necessary CMake package config or ndk-build module will be automatically generated on your behalf. All you need to do is import and use them.
Here’s an example with CMake:
cmake_minimum_required(VERSION 3.6) project(app VERSION 1.0.0 LANGUAGES CXX) find_package(curl REQUIRED CONFIG) find_package(jsoncpp REQUIRED CONFIG) add_library(app SHARED app.cpp) target_link_libraries(app curl::curl jsoncpp::jsoncpp)
And here’s the same example with ndk-build:
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := libapp LOCAL_SRC_FILES := app.cpp LOCAL_SHARED_LIBRARIES := jsoncpp curl include $(BUILD_SHARED_LIBRARY) $(call import-module,prefab/curl) $(call import-module,prefab/jsoncpp)
And that’s it. In app.cpp you can now do the following:
#include "curl/curl.h" #include "json/json.h"
A very common issue that people have is building OpenSSL to use with curl. While not explicitly mentioned in the build scripts above, the curl package itself depends on OpenSSL so this support is available automatically.
For the complete example, see the curl-ssl sample.
Prefab
The tool that facilitates all of this is called Prefab. Each AAR that exposes C++ libraries to its consumers packages their libraries, headers, and a small amount of metadata into the prefab directory in the AAR. If the prefab directory is found in an AAR dependency, the Android Gradle Plugin automatically runs Prefab to generate build system scripts from the contained information.
Each AAR might contain a large number of prebuilts for different configurations, so Prefab will perform a number of compatibility checks to find a suitable library for your build configuration. The selected library will match your build’s ABI, minSdkVersion, STL choice, and be the best fit for the version of the NDK that you’re using.
What libraries are available?
We’ve already published the following libraries:
com.android.ndk.thirdparty:curl:7.68.0-alpha-1
com.android.ndk.thirdparty:jsoncpp:1.8.4-alpha-1
com.android.ndk.thirdparty:openssl:1.1.1d-alpha-1
com.google.oboe:oboe:1.3.0
For an up to date list, search https://maven.google.com/web/index.html for “com.android.ndk.thirdparty”.
How can I distribute my own libraries?
For the libraries we currently distribute, we wrote ndkports. This is a good fit if the library you’re building is a typical Linux or cross-platform project that doesn’t fit naturally into a typical Android build. If that’s a fit for the library you want, feel free to use ndkports for it, and consider sending us the patch!
If you’d like to request that Google maintain and publish an open source library in Prefab, use the “Package request” bug template on https://github.com/google/prefab/issues. Please keep in mind that each package does come with an ongoing cost, and we will be adding support on a limited basis so we will not be able to support everything.
Coming next is support for exposing your libraries in AARs using the existing Android Library publishing workflow.
Links
For more information about using native dependencies with the Android Gradle Plugin, see the documentation. For more examples, see the NDK samples.
If you’d like to learn more about Prefab itself, see its documentation on GitHub.
If you encounter any issues, file bugs in our Issue Tracker.
Native Dependencies in Android Studio 4.0 published first on https://phonetracking.tumblr.com/
0 notes
Text
Native Dependencies in Android Studio 4.0
By Dan Albert, Software Engineer
One thing that NDK users struggle with is managing native dependencies:
Library authors need to maintain support for both ndk-build and CMake (and hope that their users are using one of those two options and not something else).
Libraries don’t always distribute prebuilt binaries for Android, so users must either build the library themselves or rely on (potentially untrustworthy) prebuilt binaries found elsewhere on the web.
Android-specific build scripts are often out of date and no longer work.
Libraries are sometimes built by a build system that Android doesn’t support.
Libraries may not build on the user’s machine. For example, Unix shell scripts won’t run on Windows.
Libraries often depend on other libraries, leaving users to chase them down and start the process again.
With version 4.0 of the Android Gradle Plugin, we’ve addressed these issues by adding support for distributing and exposing native libraries through the same mechanism that you do for Java libraries: Android Archives (AARs).
Here’s how you’d use curl and jsoncpp for example (and automatically pull in the implicit OpenSSL dependency that curl has):
// build.gradle dependencies { implementation 'com.android.ndk.thirdparty:curl:7.68.0-alpha-1' implementation 'com.android.ndk.thirdparty:jsoncpp:1.8.4-alpha-1' }
Note: With AGP 4.0 this is still experimental, so to enable this functionality you must set the following properties in your project's gradle.properties file:
# Enables Prefab android.enablePrefab=true # Work around https://issuetracker.google.com/149575364 android.enableParallelJsonGen=false # 4.0.0 canary 9 defaults to Prefab 1.0.0-alpha3, which is not the latest. android.prefabVersion=1.0.0-alpha5
Importing packages into your build
Declaring the dependencies in your build.gradle will cause Gradle to download those dependencies from Maven, but you must still instruct CMake or ndk-build how those dependencies should be used. Fortunately, the necessary CMake package config or ndk-build module will be automatically generated on your behalf. All you need to do is import and use them.
Here’s an example with CMake:
cmake_minimum_required(VERSION 3.6) project(app VERSION 1.0.0 LANGUAGES CXX) find_package(curl REQUIRED CONFIG) find_package(jsoncpp REQUIRED CONFIG) add_library(app SHARED app.cpp) target_link_libraries(app curl::curl jsoncpp::jsoncpp)
And here’s the same example with ndk-build:
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := libapp LOCAL_SRC_FILES := app.cpp LOCAL_SHARED_LIBRARIES := jsoncpp curl include $(BUILD_SHARED_LIBRARY) $(call import-module,prefab/curl) $(call import-module,prefab/jsoncpp)
And that’s it. In app.cpp you can now do the following:
#include "curl/curl.h" #include "json/json.h"
A very common issue that people have is building OpenSSL to use with curl. While not explicitly mentioned in the build scripts above, the curl package itself depends on OpenSSL so this support is available automatically.
For the complete example, see the curl-ssl sample.
Prefab
The tool that facilitates all of this is called Prefab. Each AAR that exposes C++ libraries to its consumers packages their libraries, headers, and a small amount of metadata into the prefab directory in the AAR. If the prefab directory is found in an AAR dependency, the Android Gradle Plugin automatically runs Prefab to generate build system scripts from the contained information.
Each AAR might contain a large number of prebuilts for different configurations, so Prefab will perform a number of compatibility checks to find a suitable library for your build configuration. The selected library will match your build’s ABI, minSdkVersion, STL choice, and be the best fit for the version of the NDK that you’re using.
What libraries are available?
We’ve already published the following libraries:
com.android.ndk.thirdparty:curl:7.68.0-alpha-1
com.android.ndk.thirdparty:jsoncpp:1.8.4-alpha-1
com.android.ndk.thirdparty:openssl:1.1.1d-alpha-1
com.google.oboe:oboe:1.3.0
For an up to date list, search https://maven.google.com/web/index.html for “com.android.ndk.thirdparty”.
How can I distribute my own libraries?
For the libraries we currently distribute, we wrote ndkports. This is a good fit if the library you’re building is a typical Linux or cross-platform project that doesn’t fit naturally into a typical Android build. If that’s a fit for the library you want, feel free to use ndkports for it, and consider sending us the patch!
If you’d like to request that Google maintain and publish an open source library in Prefab, use the “Package request” bug template on https://github.com/google/prefab/issues. Please keep in mind that each package does come with an ongoing cost, and we will be adding support on a limited basis so we will not be able to support everything.
Coming next is support for exposing your libraries in AARs using the existing Android Library publishing workflow.
Links
For more information about using native dependencies with the Android Gradle Plugin, see the documentation. For more examples, see the NDK samples.
If you’d like to learn more about Prefab itself, see its documentation on GitHub.
If you encounter any issues, file bugs in our Issue Tracker.
Native Dependencies in Android Studio 4.0 published first on https://phonetracking.tumblr.com/
0 notes
Text
Why Android Studio is Awesome ?
Android Studio came out as a replacement to Eclipse. Android Studio is an official IDE(Integrated Development Environment) that is used to create an app for the Android Platform. Android Studio was first announced in 2013 although the stable build for the IDE came the next year in December. It is the first choice for any developer to create an Android App. This is often considered whenever there is a need for a native Android App. Although, why is it so? Therefore, let’s just know why Android Studio is Awesome.
Faster Coding
Instant Run: It picks the changes in the code as soon as there is one. This change is seen without restarting the app or without rebuilding your app. This makes development faster if you are to create an app.
Intelligent Code Editor: With the Intelligent Code Editor, the development is a lot faster. The time you are writing code, the editor is recommending advanced code compilation and code analysis. One can easily check the recommendation by the dropdown list. All you have to do is press the tab to insert that code.
Great Emulator: The Emulator on the Android Studio lets you emulate a variety of things. It allows you to test your code with a variety of device configuration such as Smartphone, Tablet, Wearables, and Android TV Devices. Many other great features can be simulated such as GPS Location, motion sensors, network latency, and multi-touch input. This is an effective medium if we are looking forward to create an app.
Coding Confidence
Templates and Sample Apps: There are a variety of pre-made templates and samples that comes with the IDE. All these can be used for reference and even a piece of code can be injected from them. Therefore, it is going to be helpful in case if you are to create an app.
Lintelligence: This features can help to figure a variety of issues such as Performance, Security, and Correctness with a single click. There are almost 280 lint checks that can help you to create a perfect app.
Testing Tools and Framework: It comes with JUnit 4 and functional UI test frameworks. One can also record the testing using the Espresso Test Recorder. There are a variety of testing options and also you can do that in Firebase.
Make Builds without Limit:
Great Build System: The Android Studio Build system is very flexible for anyone who is using it. The IDE offers you automation dependency management and customizable build configurations. The code in Android can be used to include local libraries and builds. This makes the creation of an app easy.
Easily used by Teams: This allows you to integrate tools like GitHub Subversion. One can also keep his team in complete sync. The system enables developers to create an environment of their own for development. It can be used with tools such as Jenkins. This makes the task to create an app easier.
All Android Devices are Optimized: The IDE has been optimized for all sorts of devices. Also, the structured approach in the IDE lets you design the code for a particular design specifically.
Rich and Connected Apps
C++ and NDK Support: Just like any other language, this one supports C/C++ development. It can also check the syntax and refactor for C/C++. It is also capable of executing CMake and ndk-build scripts without making any changes to the IDE.
Firebase and Cloud Integration: It comes with a Firebase Assistant. This assistant will help you connect Firebase with the app. By using it, one can get features like Authentication, Notification, and much step-by-step procedure inside Android Studio. It also comes with Google Cloud integration. It is a complete solution to create an app.
Easy to Use
Editor for Layout: When you are developing in XML, a drag and drop editor is provided so that the process of development becomes easy.
Apk Analysis: The Apk Analyzer provided is capable of checking every all the contents inside your apk. It also reveals the size of each component. One can easily troubleshoot the DEX files for indexing issues, this will also compare the two apks.
Vector Asset Studio: With this one can use the wide variety of images. A specific directory for keeping image is provided. One can also integrate an SVD or PSD file. If you are to create an app then the images it wouldn’t be creating a hassle.
Translation Editor: This one is used to provide the translation for all the resources that are in use. Therefore, no need to check all those XML files for the effect of resources.
So these were of the great features that Android Studio has for us to Offer. In case if you are looking for an app development company then maybe we can help. We are Agicent Technologies and we have been making great Android applications for our clients. In case if you wish to read similar articles such as these then check out our blog. We hope this article may have been of some help to you. Also, thank you for reading the article until the end.
0 notes
Link
The following blog post, unless otherwise noted, was written by a member of Gamasutra’s community. The thoughts and opinions expressed are those of the writer and not Gamasutra or its parent company.
MonoGame (for those of you not yet aware) is a Game Building Framework / API born from the ashes that was the Microsoft XNA Framework that provides a very easy to use API to build games. (or 3D Apps)
What makes MonoGame far better than its XNA heritage, is that MonoGame is built from the ground up to be multi-platform, supporting many of today’s modern platforms, including:
Android
iOS / MacOS
Windows 8 / Windows 10
Linux
Even Consoles
And many more (still growing)
MonoGame has even extended the Content pipeline that XNA introduces (an asset management system) to also make assets like Art, Textures, Models and so on, work for every platform from a single configuration / building platform.
Check out the MonoGame Framework on their awesome site with an even more awesome URL: http://MonoGame.Rocks (Sooo cool)
They truly believe in the “Build it once, Ship everywhere” moto.
As of March 2017, Microsoft has now released their next generation development management suite called Visual Studio 2017 (actually I’m running out of different things to call Visual Studio with all the hats it wears). Visual Studio enables developers to Build / Manage / Deploy and maintain almost any software solution, especially on the Cloud.
With this new big release, the Monogame also kept pace and released the latest version of the framework, MonoGame 3.6, which includes full support for Visual Studio 2017.
You can check out the full details on the 3.6 release on http://MonoGame.Rocks
MonoGame 3.6 March 1, 2017 by Tom Spilman in News, Releases We are happy to say that MonoGame 3.6 is now available for download. Thanks as always to all the hard work from the MG developer community that made this release possible! You can read about the major fixes and features in our new change log.
Like its predecessor Visual 2015, Visual Studio 2017 has full free support (thanks to Microsoft’s acquisition of Xamarin) for deploying to all of these platforms now. So it makes this open source FREE framework even better to pick up and start building with.
When you are picking the Game Development framework or engine to start with (or jump to), it’s important to choose what you want to build your game / project in using something that suits your development style.
Unity and Unreal have a great editor / GUI experience with some coding required, so it’s a good fit if you like drag and drop.
Scratch / Game maker and others offer a much more stripped down and basic experience meant to wet your appetite. Although I have seen some serious projects built with these
XNA / FNA / MonoGame on the other hand, are a full coded experience. So if you prefer to control all the bits of your game and not rely on things being done for you, it’s a better fit.
There are those who then also like to go even lower but we shall not mention such things so as not to scare the birds, lest they fly away.
My advice (as ever) has always been to choose what is the right fit for YOU and go with it. If you end up getting lost, then try something else until you find the right home for YOU.
Game Development is a very personal thing and the tool you choose should be your choice!
Now I get many questions or queries are posted on the MonoGame GitHub site and its accompanying Community forums about how to get started with MonoGame, how to build for platform X or where the nearest coffee shop is where I can start coding. Sadly, the last I usually struggle with as I down my 5th latte for the day and it’s only 10am . All of this prompted me to pick up the recording devices and record two video sessions, which you can check out below:
[embedded content][embedded content]
Each video has links to the source slides in the comments and walks through:
What platforms are supported out of the box with each version
What you need to get running with Android
What you need to get running with iOS / MacOS
What you need to get running with Windows 8 / Windows 10
Each also including hints/tips and gotcha's for each platform (that relate to MonoGame, not how to setup an Apple ID)
When I record such videos (as above), I also like to follow up with the slightly longer text version (just because some prefer not to watch videos). It’s a bit more work and sometimes when it’s written down it’s easier to refer to. So I’ll run through here a summation of the videos.
Getting Started with Visual Studio 2015
(Slides for reference, can be found here on SlideShare)
1. Clean Visual Studio 2015 Install
When you install Visual Studio 2015 using the default options, you have a fully working .NET development environment, with MonoGame installed you get access to the following platforms:
Windows Desktop DX (classic)
Cross-Platform OpenGL (Linux / Windows / Etc)
Content Pipeline Extensions
With these projects, you have enough to get you “up and running” and start building your first game using MonoGame. Each template includes all the necessary setup and boiler plate, including your first Game class “Game.cs”, which includes the all important game loop in which your game runs.
Following any of the many tutorials or samples using these templates will set you on a nice easy to follow course for your first few projects. You can even ship titles on these platforms via Steam or your distribution option of choice. Either way there is a lot of help to get started.
If you are intending to build a true “multi-platform” project, then I also recommend checking out one of my other videos for how to setup your project in the best way: http://bit.ly/monogamemulti-platform
If you are just starting out or want to “test” a new project, then you don’t need the above. Just start your new project, roll up your sleeves, brew a fresh pot of your favourite cup and start coding.
2. Building for Android
When you want to start tackling Android as your target platform, then you will need a few extra bits installed with your Visual Studio 2015 setup, namely:
The Xamarin Core module (C#/.NET Xamarin)
Android SDK for target builds
Android NDK (native dev kit) for target builds
Optionally, you can also install the Microsoft Visual Studio Android emulator
This will give you all the components you need for getting up and running with Android using the MonoGame Android template. However, Android is a very fragmented platform and in all likelihood, you may need several projects or deployments in order to meet your distribution goals, such is the world of Android today.
My best advice is to survey the markets you want to deploy your game in to, gather the different API types and versions you will need to support those (as well as the capabilities of each device) and plan from there. Having too few supported device types likely will mean too few installs to be profitable. Too many will mean you have a huge headache to maintain your game. If you follow the earlier advice for setting up a multi-platform project, this overall overhead will be greatly reduced, but it will always be a battle to keep up to date.
P.S. if you can, avoid the Google device emulator and you will keep some sanity in reserve for when you desperately need it. That thing is just a nightmare sadly. Use the Microsoft Android emulator instead, provided your machine can support running it (min 8GB memory required), else use physical devices for test.
Another service to also think about using is either the Xamarin Test Cloud or the recently announced Azure Mobile test (http://mobile.azure.com). These platforms will test your android project on as many devices as you with and give you a full range of stats for how well it runs and what issues the devices may have. The new Azure solution is currently in preview so it’s free to use for now, so check it out while it’s free.
3. Building for iOS / MacOS
The setup for iOS is a little easier, as you only need the Xamarin Core module (C#/.NET Xamarin) installed with Visual Studio 2015. If you have already setup for Android, then you have everything you need ON YOUR WINDOWS MACHINE!
However, to build for any Apple development platform you are going to need a MAC (in fact if you want to build for MacOS with MonoGame, you can ONLY do it from a Mac. No Widows dev for you. You’ll need either Xamarin or the new Visual Studio for Mac there, ON YOUR MAC). This is required in order to build your code for deployment to a device or the Apple Store, part of the locked in culture of Apple development.
You can pick up a Mac Mini quite cheaply (I paid £50 for mine) provided it can support the following criteria:
It supports the latest version of the iOS SDK.
The latest version of Xcode.
Has Mac OS X Yosemite(10.10) & above installed.
You will also need an Apple Dev Center account registered and assigned to your device.
If your prospective device does not support the above, don’t buy it as you will just be wasting your money to use it for development
If you want to use Xamarin’s extended capabilities with the Mac Build host or the Mac development environment, you’ll likely need to fork out for either a Xamarin License or use your MSDN subscription, either will do. For more details on setting up your Mac so that Visual Studio can build against it, see this post: http://ift.tt/2dJ0SEC
4. Building for Windows 8.1 / Windows Mobile 8.1
To build for Windows 8.1, you still need a few extra bits. Mainly the development SDKs for Windows 8.1 and if you wish, the Phone emulators:
You will also need a Windows Store account to publish your game to the Windows Store as well, however, this is now a onetime low fee and then you have it for LIFE. Not a bad investment since it also gives you access to publish UWP games as well (see below).
5. Building for Windows 10 UWP
To build for Windows 10, like with Windows 8, you simply need the SDK’s for the versions of the Windows 10 UWP framework you intend to use, for MonoGame the minimum SDK’s you need are: 10240 & 10586. As newer SDK versions come out, grab them. Thankfully everything you need is installed by simply selecting the “Universal Windows App Development Tools” node in the Visual Studio Installer:
You will also need to configure your Windows 10 machine in “Developer Mode” in order to side deploy and debug new UWP games on your machine. When you first try to create a new UWP project or open an existing gone, Visual Studio with prompt you and take you to the settings page, which can be found here:
Settings -> Update & Security -> For Developers
Getting Started with Visual Studio 2017
(Slides for reference, can be found here on SlideShare)
The new Visual Studio 2017 installer is a lot more lightweight than what we had in 2015. It’s a lot more streamlined and very similar to the Web Platform Installer for web solutions (if you have used that).
By default, NOTHING is selected and all you will install is the Core Visual Studio framework and editor. All you can do with this is inspect existing projects and create new blank solutions, functional but you can’t do much. TO get going you will need to explore some of the additional components / modules.
1. Clean Visual Studio 2017 Install
If you install just the Core Visual Studio 2017 and MonoGame, you won’t be able to do anything, the templates will not even show up. To get started you will need a minimum of the .NET desktop development module:
With this you have pretty much the same as in the default install of 2015, namely the ability to create projects in:
Windows Desktop DX (classic)
Cross-Platform OpenGL (Linux / Windows / Etc)
Content Pipeline Extensions
As before, if you are just “playing” or testing, then fire up a new project and play. If you are starting a new “proper” project, then I recommend you setup the project right from the beginning, as highlighted in my Multi-Platform solution setup video: http://bit.ly/monogamemulti-platform
2. Building for Android
To build for Android you need to check the “Mobile Development with .NET” module:
In this module you will need to check the additional properties pane on the right-hand side of the installer to ensure you have the additional components selected that you require for MonoGame development, as shown here:
Just check you have the current Android NDK and SDK’s selected and you will be fine. There is one thing to take note of though, that the Microsoft Android Emulator is NOT available from this module (as well as other optional Android NDK/SDK libraries). If you want these additional features, then you will also have to check out the “Mobile Development Kit with C++” as shown here:
3. Building for iOS
As with 2015, if you have installed an Android development setup, then you already have the necessary bits for iOS development in Visual Studio 2017, namely the “Mobile Development with .NET” module
You���ll still have to get a MAC as a build host to build your projects (and a Mac to develop on for Mac development). Check the section for 2015 for more details, it’s exactly the same.
4. Building for Windows 10 UWP
Windows 10 development with Visual Studio 2017 has its own module as shown here:
However, as with Android, you will need to inspect the Properties panel on the right-hand side of the installer to ensure you have all the necessary components needed for MonoGame, specifically the SDK’s.
By default, only the Anniversary SDK (14393) is installed, for MonoGame you will also need 10240 & 10586, so be sure to select them. This will ensure you have the widest coverage of Windows 10 devices out there.
You can leave them out if you wish but you will have to Edit your project definition or be very careful with your Minimum and Target Platform selections when you create your project, else you’ll get lots of “errors”!!
*NOTE, a late reported issue was fixed in MonoGame for standalone installs of Visual Studio 2017! It was discovered that if Visual Studio 2017 was installed on top of / alongside Visual Studio 2015, it behaved differently and “just worked”. However, when Visual Studio 2017 was install on its own or on a clean machine, the templates would simply not work.
A fix has already been delivered but it was after the MonoGame 3.6 release. To use Visual Studio 2017 on its own, use the current “Development” release of MonoGame until a point release is submitted. There is currently very little difference between 3.6 and the development release, so it’s completely fine.
With Visual Studio setup correctly and with the latest version 3.6 release of MonoGame installed, you should have everything you need to start building your game in MonoGame.
Feel free to check out the other videos on my channel or the full list of “Recommended” MonoGame tutorials listed on the site to get going. (although to be honest, almost any XNA 4.0 tutorial will do) I’ll be doing some more beginner sessions soon, so stay tuned.
0 notes