• 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
1
Question by luke5542 · Sep 06, 2012 at 08:51 PM · pluginsandroidplugin

Will Unity 4.0 support sending complex data from Android or iOS to the Unity scripts?

Im trying to develop a plugin for Unity starting with the Android side of things. I have found the AndroidJavaClass and AndroidJavaObject to be very helpful, but I am having problems when i try to send information to the Unity Scripts that is coming from a call-back in the Android Java code. I have found this line of code to be sufficient for sending Strings:

 UnityPlayer.UnitySendMessage("UnityObject", "MethodName", "Message");

but i am unable to find any way to send the complex information to Unity. This is a performance sensitive operation and needs the information to be sent to the scripts.

I have read elsewhere that this is just not possible in Unity 3.x.x, so I am hoping that this will be improved inside Unity 4.x.x

Does anyone have any information about this or if there is any work-around that i could use?

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by FatWednesday · Sep 07, 2012 at 10:08 PM

not sure what will happen with UnitySendMessage. but with a bit of reading and work, it is possible to ignore UnitySendMessage all together and just make calls to the functions in your scripts yourself (meaning you can send all sorts across).

I had to do this for a plugin i wrote for iOS before, this page walks you through how to go about sorting it all out. hope its of use to you.

http://www.tinytimgames.com/2010/01/10/the-unityobjective-c-divide/

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 miningold · Sep 08, 2012 at 12:12 AM 0
Share

I am working with @luke5542 on this project. We are developing an android app, correct me if I am wrong, but it is my understanding that we would not be able to use NSString *assemblyPath = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"Data/Assembly - CSharp.dll"] to find the assembly path. Do you know of an alternative way to find the path using C or Java?

avatar image FatWednesday · Sep 10, 2012 at 09:34 AM 0
Share

Ah with android I'm afraid I can't really comment, not done any unity + android work yet. But i've no doubt there will be android equivalents. you'll just have to do some googling for them.

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

9 People are following this question.

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

Related Questions

How to release global references created when passing strings from java to c# via AndroidJavaProxy interface 0 Answers

android time cheat plugin problem with broadcastreceiver 1 Answer

Is Application.persistentDataPath changed when I add Android permission WRITE_EXTERNAL_STORAGE? 2 Answers

Change Plugin platforms by scripting 4 Answers

Launching an Android application from within unity without extending UnityPlayerActivity? 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