11
\$\begingroup\$

I am fairly new to Unity3D experience , but I have a very good knowledge of Java and Android development. I am really confused that if Java is at all needed for developing android applications? I read somewhere in Unity documentation that adding behaviour to objects in Unity requires use of scripts, and that unity only supports C# , .Net , and Boo scripts. Is there no use of Java at all?

\$\endgroup\$
  • 15
    \$\begingroup\$ When you know Java, you already know 90% of C#. \$\endgroup\$ – Philipp May 8 '14 at 13:24
  • \$\begingroup\$ jMonkeyEngine as noted in SilverTiger's answer now supports both iOS and Android development in addition to desktop development. jMonkeyEngine is free and uses Java. I use it for creating my games. \$\endgroup\$ – Jason Crosby May 8 '14 at 18:33
  • \$\begingroup\$ @Philipp and what's about C#? I already know the C# then same as I know 90% of Java? \$\endgroup\$ – Asif Mushtaq Jun 17 '16 at 12:59
  • \$\begingroup\$ @Philipp well, no. You could as well say "When you know ALGOL, you already know 90% of C" or "When you know x86 assembler, you already know 90% of any assembler", or "when you know how to drive a bike, you already know how to drive a truck"... your analogy is faulty on so many levels sigh. The only thing you can say is that "when you know Java, you already know 90% of the syntax of C#". I assure you, I know of no person knowing only Java and having no access to docs that would be able to write working C# code without prior experience. \$\endgroup\$ – vaxquis Jun 27 '16 at 17:38
  • 4
    \$\begingroup\$ I'm voting to close this question as off-topic because it's about Does product X supports feature Y. \$\endgroup\$ – Vaillancourt Aug 7 '17 at 10:53
8
\$\begingroup\$

Java is not supported by Unity. You should check out C#, however; it's a very similar language that takes a lot of influence from Java while arguably smoothing out some of the rougher edges of the language. It should also be noted that you will need both Unity Pro and Unity Android Pro in order to create Android games using Unity. As jhocking and ashes999 note in the comments, you don't need Unity Pro and Unity Android Pro top release commercial Unity games on Android.

\$\endgroup\$
  • 3
    \$\begingroup\$ It's not exactly true that you need Android Pro in order to create Android games. You can deploy to Android from the free version of Unity, but you'll have a few restrictions on the resulting app (most visibly, it will have the Unity splashscreen, rather than a custom splashscreen of your own). If you want the additional features of Android Pro then you have to spring for both Unity Pro and Unity Android Pro. \$\endgroup\$ – jhocking May 8 '14 at 8:56
  • \$\begingroup\$ Will you be able to commercially sell the application? \$\endgroup\$ – Eagle-Eye May 8 '14 at 8:59
  • 3
    \$\begingroup\$ @Eagle-Eye yes, I believe you will. Unity free version is for businesses with under $100K annual revenue. \$\endgroup\$ – ashes999 May 8 '14 at 9:52
  • \$\begingroup\$ It's very similar but it's ALOT more verbose and it's missing thousands libraries that make coding in Java easy. Example, ProGuard anyone? Runnable? SocketIO.. list goes on \$\endgroup\$ – Oliver Dixon Jun 26 '16 at 12:52
3
\$\begingroup\$

Unity supports only C#, JavaScript and BooScript for scripting. However as Philipp mentioned, if you know Java then you know 90% of C#. I still know only Java and C++ and its easier for me to translate my logic into C# (Given that I didn't know much about C# even after coding for a year in Unity).

You can however write plugins in Java for any native feature not provided by Unity or to implement some third party SDK such as ads made specifically for Android platform. Same is true for Objective-C for iOS platform.

\$\endgroup\$
  • \$\begingroup\$ 1) Unity doesn't support Boo for some time, 2) it was actually UnityScript, not JavaScript, which Unity used, 3) UnityScript also got deprecated. As such, this answer is a bit dated nowadays. \$\endgroup\$ – vaxquis Jun 10 '18 at 1:20
2
\$\begingroup\$

Actually, you can use cross-compiled Java (i.e. Java source compiled to e.g. managed .NET code) with Unity3D - it has some caveats and problems, but it is definitely possible, at least on a proof-of-concept level; it also doesn't have to be done through the plugin system, as IKVM generates a managed code automagically, and managed libs can be attached directly:

http://answers.unity3d.com/questions/15308/can-i-access-java-code-from-unity.html

http://www.mono-project.com/docs/about-mono/languages/java/

so yeah, the other two answers are actually wrong.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.