hi, i want to konw about overlay..

i built my project in Unity3D and intergrated with Eclipse. however, i don't know how to add my button at this environment. please, i want to detaily know the process thanks! -JD


Sun, 05/01/2011 - 14:21

always thanks to u , Kim Actually, if i press my button that it has a intent() method , i want to change to my other Activity so i should use java code. already i intergrated my Unity project with Eclipse how can i do that?

Here are two possible solutions, with sample code: 1) Create your buttons in Unity and call Java methods directly on button press (using AndroidJavaClass/AndroidJavaObject). 2) Create and handle your buttons in Java.


Fri, 05/06/2011 - 05:07

hi, i did that Unity C# script i clicked the button in Unity3D project and then appear this message in the Unity console JNI: Unable to find method id for 'switchActivity' UnityEngine.AndroidJavaObject:Call(String, Object[]) JavaButtonHandler:OnGUI() (at Assets/Qualcomm Augmented Reality/Scrip

The switchActivity method was in my sample Java class. You will have to write some Java code as well for this to work. I chose to extend the main Activity, but you could also write a separate class with static methods.

You're building and running an Eclipse project now, right? You place your Java class files and xml layouts in this project like any other Android project.

I'm not sure, can you show us the Java class as well? Are you extending the main activity at all? If so, be sure to change the AndroidManifest.xml file to use your package and class name. - Kim


Mon, 06/20/2011 - 08:58

Hi, I'm sorry but I don't understand how to import Java source code in Unity. I understand that I must to copy the content of Temp/StagingArea and create a new Android project in Eclipse with this content (http://foru


Mon, 06/20/2011 - 21:05

Hi Kim, Thank you for your help. However I don't understand how to import my java code on Unity : I managed to set up my project on Eclipse with the ADT and it's working fine when I run it from my Android device. But now I don't know how to import this code on Unity.

The set of instructions you have been following are specifically designed to allow you to run the application from Eclipse once everything is set up. If you want to run the project from Unity, you will need to create a jar file with your code and put it in the Plugins/Android folder.


Tue, 06/21/2011 - 16:12

Hi Kim, I folowed your advices but I couldn't make it to work. When I launch my application on my Android device from Eclipse, Unity works but 3D object doesn't appear and there is no reaction when I detect a marker. I import my java code on Unity (by a .jar file) and when I launch it I have alway


Wed, 06/22/2011 - 08:14

Yes, I create a variable called currentActivity, like this (MyPlayer.java): [CODE" />package com.Romain.RA_Unity; import android.os.Bundle; import android.util.Log; import com.qualcomm.QCARUnityPlayer.PlayerActivity; public class MyPlayer extends com.qualcomm.QCARUnityPlayer.PlayerActivity {

You should be able to run the application in Eclipse with full tracking and functionality. There should be more to the log than the screenshot you captured, such as log lines as to whether or not tracker initialization succeeded.

Egads, please save the log as a text file, those pictures are tough to follow! You can click on a line in the log, hold the shift key, then click on a line at the end of the log to select a section. Or just press CTRL-A to select the whole log. Press CTRL-C to copy, paste in a text file.