Android Studio Unity3d Plugin

At the moment of writing this, I’m using Android Studio 3.4.1 and Unity 2019.1.7f1. Exporting the Unity project as an aar library The Unity project used in this example is a simple spinning cube. Google is pushing Android Studio as main development IDE for all android application. Android Studio provides better interface for Android Application development. In my earlier post, I explained how to create a plugin using Eclipse. Now I will share how the same thing can be done in Android studio. First create an Android Studio.

  • Today marks the release of the first version of Android Studio Arctic Fox (2020.3.1) on the canary channel, together with Android Gradle plugin (AGP) version 7.0.0-alpha01. With this release, we are adjusting the version numbering of Android Studio and our Gradle plugin.
  • Fig 1: Android Plugin For Unity using Android Studio - New Android Studio Project Create a New Android Studio Project and specify the details as in Fig 1. Press Next and it should ask you to select the Form Factors the app will run on.
  • Android Studio is a fully-featured development environment built by JetBrains that has everything you need to build awesome Android applications. With the power-packed features in the IntelliJ IDEA based IDE comes an endless list of plugins. Android Studio Plugins. The right plugins can help make your work more efficient, smarter, and faster.

This last couple days, I try to integrate my program in unity with android studio. I am not an expert in both platform but I try to learn it for my class project. To be honest, I have experience working with android studio, for me it is a really good tool to build your android apps, however if you want to develop a games app, it will be little difficult working in this platform. That is why, I try to work with unity, but this is really unfamiliar environment for me, so to make my project can be done, I try to combine both this two tools.

I don`t know this is a stupid idea or not, but maybe some of you want to use this method, then I will help you.

1. Install both android studio and unity in your PC (Don`t worry both are free)

Android Studio Plugin Development

2. Build your apps in both platforms, in my case I build spotify like program in android studio and the game apps in unity.

3. If you done with the design in both platforms. Go to unity and go to Edit -> Preferences ->External Tools. You must locate the SDK and JDK location in your computer. If you don´t know the location of SDK, just open your android studio and click SDK manager button, and new windows will open, and see SDK android location in that windows.

For JDK, if you don´t have one, just download it in and choose the new java development kit provide by oracle, after that just install it in your laptop and don´t forget to remember the location of that file.

4. After you located both those file, right know you able to build your android program from unity. To make sure you can combine your unity program with android studio, copy your android manifest.xml file from android studio than in unity in assets folder make new folder name plugins, and inside plugins make new folder name android. After that paste the manifest.xml in this folder.

5. if you already copied the manifest.xml, then in unity go to file -> build settings. In platform choose android, and choose this settings.

6. After that you will get new file that have same type with android studio. Open that file you already build from unity in android studio.

Android studio plugin development

7. After open the unity file in android studio it will build gradle. Then the gradle build finish, move the java and res file from your android studio project you want to combine with unity. Because you already copied the manifest file so, in this unity project android studio will follow that manifest file. If there is no folder like raw, or drawable in unity android studio, just crate one.

8. Don`t forget to change the package name in your java folder, it must follow the unity package name, you can see the example in UnityPlayerActivity.java file

9. Don`t forget to create button and intent that will open this file UnityPlayerActivity.java, to go to Unity layout game

10 At the end, go to manifest.xml in unity android studio project. And put UnityPlayerActivity.java activity in that mainfest or copy this script below, with some change in android:name part Then build your program in Android studio

After that just build the file in android studio.

The result below:

Related

[Total: 3 Average: 5/5]

There are hundreds of plugins out-there for Android Studio and the number grows daily. This is mainly due to two reasons. The first is the fact that Android Studio is the industry accepted go-to IDE for creating Android apps. The second is Intellij IDEA, the platform upon which Android Studio is based, that allows for the development and easy installation of (mostly) useful plugins that are compatible with both IDEs. But which do you install, if at all?

Of course, you can go ahead and start coding on a clean installation of Android Studio, with just the necessary libraries installed and zero plugins added. But you’re smarter than that. You’re looking to install the Android Studio plugins to make your work more efficient, intelligent, and (when possible) fun. Worry not, as we’re here to direct you to the current top of the crop of Android Studio plugins that are bound to (at the very least) triple your productivity.

In our list of the top Android Studio plugins we included some must-have basic tools, as well as a number of little-known gems recommended by seasoned Android app devs in the Codota user community. So following our list of best IntelliJ plugins, here’s our favorite AS plugins:

1. String Manipulation

Pretty much what the name suggests, this plugin can save you hours of tedious manual work. Among others, it offers style toggling (camelCase, kebab-lowercase, KEBAB-UPPERCASE, snake_case, SCREAMING_SNAKE_CASE, dot.case, words lowercase, Words Capitalized, PascalCase), Un/Escape, Encode/Decode, Increment/Decrement, natural order sorting, filtering and alignment.

😎 2. Codota

A bit of a shameless plug(in). The Codota plugin uses machine learning to crowdsource code-completions from millions of Java programs, combined with your own unique context. Used by both beginner and senior Java developers, Codota makes development faster and helps eliminate those irritating errors that pop up in your code.

In addition to the plugin, Codota also offers an extensive library of commonly used Java code snippets to copy and paste where you need it.

3. CPU Usage Indicator

This simple UI plugin is more handy than one might initially think. As your code and app get more complex to compile and run, this will take a toll on your CPU. One of the most useful things about CPU Usage Indicator is the ability to generates a thread dump to show you what it is the IDE might be doing in the background to clog up the CPU.

🌈 4. Rainbow Brackets

Nested brackets and parentheses have been a source of headaches for programmers as far back as this coder can remember (highschool). Many hours were lost looking for that missing bracket than is mucking up compilation. No more!

Instead of sitting there for what seems like eternity trying to remember which number bracket you’re staring at? Add some color to your brackets and parentheses with the Rainbow Brackets plugin!

It supports Java, Scala, Clojure, Kotlin, Python, Haskell, Agda, Rust, JavaScript, TypeScript, Erlang, Go, Groovy, Ruby, Elixir, ObjectiveC, PHP, HTML, XML, SQL, Apex language, C#, Dart and others, most of which you really don’t need for Android development.

5. Project Lombok

Android Studio Unity3d Plugin

Complex Java code for Android applications can often contain a lot of boilerplate code (constructors, getters, setters, etc). This can lead to lengthy, difficult to read, and tedious to maintain methods. Project Lombok is a Java library that plugs into your IDE and generates those boilerplate code, keeping your code short and readable. The difference between pre and post Lombok code can be quite staggering.

It’s worth noting that being a compile-time only library, Lombok will not make your app any heavier. In addition, the Project Lombok website offers a lot on helpful resources for plugin users and developers.

6. Android Drawable Importer

If you’re going to be working with drawable in your Android development, and there’s a very good chance you are, this is the first plugin you need to get to know.

To adapt to all Android screen sizes and resolutions, every Android project contains a drawable folder. If you’ve been blessed with a designer from heaven who provides the assets already in the correct folder with the correct naming, we’re jealous. Odds are, you’re not that blessed and have already found yourself manually renaming and moving the PNG files to the correct folders.

Unless you find this activity to have therapeutic value, Android Drawable Importer is the plugin that is going to save you a ton of time. It lets you import single assets to be adjusted for necessary sizes and resolutions, whole zip files to sort automatically to their folders, and batch-processing of multiple assets to integrate smoothly into the project.

7. Vector Drawable Thumbnails

To preview a vector drawable xml file you would normally need to build your app. To save you the trouble, Vector Drawable Thumbnails displays all Android vector drawables in the entire project with one click.

8. Android Drawable Preview Plugin

Plugin

When you have a lot of drawable components in your project, remembering which is which can get hard. Wouldn’t it be nice if you had a quick preview of the image in your IDE? With Android Drawable Preview Plugin, you do.

This Android Studio plugin replaces the default icons with drawables previews inside the project view. Super-easy to access, but not an excuse to use ambiguous names for the drawable assets. Keep it descriptive, always.

9. Name That Color

Let me start by busting a myth. Not all women can tell the difference between turquoise and teal, or eggplant and plum. The very much female writer of these lines is one such example. And I am not even color-blind.

The existence and popularity of this plugin indicate that most developers don’t have that magical color-recognition skill either, so I am in good company.

The Name That Color plugin will name the color you have in your clipboard directly inside your color resource file in Android Studio, and give the name of the closest matching color. No more “lighter_light_pink” in your xml.

🤩 10. bundletool

bundletool is the underlying tool that Gradle, Android Studio, and Google Play use to build an Android App Bundle or convert an app bundle into the various APKs that are deployed to devices. This tool by Google is a must-have for more efficient APK packages.

11. Butterknife Zelezny

Android ButterKnife is a “View Injection Library for Android”. It generally improves code readability, letting you to focus on the logic rather than glue code for finding views or adding listeners.

Developing with ButterKnife allows you to perform injection on arbitrary objects, which can get pretty complicated and tedious once you need to perform more than one or two. At this point, you need to refer to all layout XMLs to write them in the source file. Or you can simply install ButterKnife Zelezny.

Android ButterKnife Zelezny is an Android Studio Plugin for generating ButterKnife injections from selected layout XMLs in activities, fragments or adapters. In fact, most ButterKnife coding tutorials and guides you’ll find recommend you install Zelezny.

12. Android Input

Android Input is a fairly simple but useful Android Studio plugin that allows to easily type text directly into your Android device or emulator. It remembers the last used device and last text entered.

13. ADB Idea

This plugin for both Intellij IDEA and Android Studio adds a number of useful shortcuts to various ADB tool commands directly in your IDE. While this seems like a small addition, developers say ADB Idea can speed up development and debugging of Android apps.

Android Studio Plugin Market

Tutorial

14. adb-enhanced

Dubbing itself “a Swiss-army knife for Android testing and development”, adb-enhanced is a command-line interface to trigger various scenarios. It lets you play around with many potentially buggy app behaviors like screen rotation, battery saver mode, data saver mode, doze mode, and permission granting/revocation.

15. ADB WIFI

This plugin simplifies connecting the device to the ADB through WiFi for debugging. Like many other small but handy plugins, this one is simply a shortcut to a series of commands you can execute in the command line. But why not be comfortable?

16. Here there be dragons

Android studio plugin manager

Here be dragons is an Intellij/Android Studio plugin that lets you annotate your impure Java methods with the @SideEffect annotation and shows a little dragon icon in the gutter when you call them.

In addition to visually isolating impure functions, this plugin is just too cute not to include in our list. Because dragons.

17. Power Mode 2

You know your code is epic. On some particularly long hyper-caffeinated coding sessions, you can feel your fingers spitting fire and shaking the world. You are a development God, and as such, deserve to code like one.

You might want to disable the shaking effect unless it syncs with the shakes from all the coffee. We won’t judge.

Android Studio Plugins Menu

One last thing…

Android Studio Unity3d Plugin Tutorial

Before you go ahead and batch-install all the plugins from the list, you should remember that more plugins usually means a slower IDE. Consider your coding habits and see what plugins will shave off time-consuming tasks without adding unnecessary extra weight to Android Studio.