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. Dismiss Notice

UnitySendMessage() - Any Limit?

Discussion in 'iOS and tvOS' started by Ekki, Nov 22, 2012.

  1. Ekki

    Ekki

    Joined:
    Jun 12, 2011
    Posts:
    50
    Hi,

    is there any limit for the size of the UnitySendMessage() parameters? Want to pass JSON content up to 1 KB... Will that work?

    Thx,

    Ekki
     
  2. Soumya-Basheer

    Soumya-Basheer

    Joined:
    Jul 22, 2015
    Posts:
    8
    Hi Ekki,
    I am also checking whether any limitation for UnitySendMessage() parameters. Did you have any information on this?
    Thanks,
    Soumya
     
  3. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,637
    There are no well defined limitations.
     
  4. Soumya-Basheer

    Soumya-Basheer

    Joined:
    Jul 22, 2015
    Posts:
    8
    Hi
    UnitySendMessage() allows only strings right? any other mechanism for communication from java to UnityLibrary?
    Thanks,
    Soumya
     
  5. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,637
  6. Soumya-Basheer

    Soumya-Basheer

    Joined:
    Jul 22, 2015
    Posts:
    8
    Thank you Aurimas-Cernius.
    This from Unity to Java and the callback. Right? I hope there is also no size limitations. It would be great if you have any sample project link that includes java part also.
    Thanks in Advance
    Soumya
     
    Last edited: Jan 13, 2021
  7. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,637
    Have a look at code sample provided in documentation. It contains AndroidJavaClass and AndroidJavaObject which let you create Java objects and call methods on them, while AndroidJavaProxy lets you implement Java interface in C#, giving ability to call back.
     
  8. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,637
  9. Soumya-Basheer

    Soumya-Basheer

    Joined:
    Jul 22, 2015
    Posts:
    8
  10. Soumya-Basheer

    Soumya-Basheer

    Joined:
    Jul 22, 2015
    Posts:
    8
    Hi
    Can I pass more than one parameter using UnitySendMessage from android to unity