Is possible to call a Unity3D function from a Java Android Class?

Hi,

I´ve integrated Unity with Eclipse to do a Android project following this tutorial

http://unity3d.com/support/documentation/Manual/Android-Integrating%20Unity%20With%20Eclipse.html

Integration is working OK, I can call Java methods from Unity but i can´t call Unity Methods from Java Classes…It would be wonderfull if somebody could help me…

Thanks a lot and sorry for my poor english.

Pedro Almagro

You can do something like this in Java once you have integrated with eclipse using the SendMessage function.

public class myawesomeanroidapp extends UnityPlayerActivity
{

/** Called when the activity is first created. */

@Override
public void onCreate(Bundle savedInstanceState) 
{
	super.onCreate(savedInstanceState);
}

public void SendMessageToUnity()
{
	UnityPlayer.UnitySendMessage("Main Camera","foo",Integer.toString(fooint));
}

}

See this page under example 3 of the Android section. You do it very similarly to how you do it on iOS except that you have to create a JavaObject.