Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Moem · Jun 05, 2014 at 10:32 AM · unity plugin

Use Java library in Unity

Hi everybody,

I made a Java library and I would like to be able to use it in Unity 3D, and not only for Android devices, but for iOS as well.

I saw there are some tutorials on the Internet about doing a plugin for Android, but no one on how to use Java library in Unity.

I tried by converting my .jar in a .dll file. I can access my library methods, but it only works when I export my game for Windows devices. So, is there any other way to access my library methods on every device?

Thanks!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Jeff-Kesselman · Jun 05, 2014 at 02:50 PM

The other approach to cross platform is to do your Android and IOS coding in C# using Xamarin.

As long as you keep your library to the limits of what Unity knows, it will work in Unity or native on PC/OSX/Linux/Android/IOS and Unity.

To see an example of a cross platform project done this way, see: http://unseenu.wikispaces.com/AnyGUI

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image HarshadK · Jun 05, 2014 at 02:58 PM 0
Share

+1. Yeah. But while using Xamarin, staying in the limits is the main thing you need to remember. And this is one of the reasons why libgdx shifted to libgdx RoboV$$anonymous$$ backend from Xamarin. Plus there is also the reason of cost involved with Xamarin since not everyone can afford that cost. ;-)

avatar image
0

Answer by HarshadK · Jun 05, 2014 at 11:00 AM

You might find this question on SO of some help: Can I access Java code from Unity?

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Moem · Jun 05, 2014 at 02:34 PM 0
Share

O$$anonymous$$, thank you. But do you know if it's going to work on iOS as well? I have tested it on my Android device, and it works, I can access my classes and methods. I can't test it on iOS devices for now...

Thanks! :)

avatar image HarshadK · Jun 05, 2014 at 02:35 PM 0
Share

I'm not sure if it will work or not and I also don't have an iOS device. If you get to try it let us know the outcome for sure. :-)

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

22 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Quiz game using unity or ngui 1 Answer

How to import *just* the IAP plugin? 1 Answer

Need best solution to read .db file in android unity app and perform functions 0 Answers

Is there support for x86_64 only plugins 0 Answers

RageTools plugin question 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges