Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Pass complex data (objects) from Android to Unity

Discussion in 'Android' started by nventimiglia, Jul 15, 2014.

  1. nventimiglia

    nventimiglia

    Joined:
    Sep 20, 2011
    Posts:
    153
    Hi, working on a plug in. Was wondering if there was a way to pass complex data from android to unity. I am aware of the UnityPlayer.UnitySendMessage static method, but it only allows for sending of strings. I guess I could serialize the data to json... but uugh. no.

    Moreover, while were on it, is there any way to register delegates / callbacks ? I really hate having to rely on a game object to act as a communication proxy.
     
  2. nventimiglia

    nventimiglia

    Joined:
    Sep 20, 2011
    Posts:
    153
    Just a follow up, It is possible.

    The trick is to write a native C plugin to arbitrate between java and c#.
     
  3. codebeans

    codebeans

    Joined:
    Apr 7, 2014
    Posts:
    79
    Hey I am stuck at a similar problem. Do you have any resources about the native c plugin route.
    JSON serialization just seems overkill.

    cheers!
     
  4. aximsat

    aximsat

    Joined:
    Oct 12, 2017
    Posts:
    8
    I am also stuck with the similar problem. could you please share any source about this? Thank you in advance.