how to connect unity 3d to eclips + android?

hi friends i am developed one game that ios platform now i am trying to port android.But i am get some issues to connect unity to android using eclipse?i followed installation steps also i mean file:///Applications/Unity/Unity.app/Contents/Documentation/Documentation/Manual/Android-Integrating%20Unity%20With%20Eclipse.html and http://developer.android.com/sdk/eclipse-adt.html#installing also but i get some issues in that eclipse project properties ->JavaBuild → AddExternalJar → i am adding unity exe in that in instruction bin in that classes.jar, classes.dex and also.only add classes.jar.i am not getting only classes.jar
anybody help me how install please.if you don’t understand my English send me reply i will send clearly.
thank you…

I don’t think you read the instructions carefully enough or skipped some steps. There is not a single line in http://unity3d.com/support/documentation/Manual/Android-Integrating%20Unity%20With%20Eclipse.html which suggest adding an .exe file, wont work anyways since java & Linux cant read .exe files anyway.

But you need to have TWO Projects in your Eclipse Workspace!

The first is the library. You create an empty android project and copy the files from your “Staging Area” in your Unity3d Temp folder. Call it “MyGame Library”

  • Create a new empty unity project and build it for android. It does not matter at this point if the unity project contains any code or other assets. This part of the process is in no way future proof and will be subject to change with future release of unity android.
  • Navigate to your new project folder and then into the Temp folder. In there is a folder called staging area.
  • Copy the staging area folder and place it somewhere in your file system that you can use as a holding area. This holding area should not be in your eclipse workspace as it will lead to errors.
  • Open Eclipse and create a new Android Project using File → New → Project.
  • Select Android Project then click next.
  • This will be the library part of your project so name the project accordingly to avoid any confusion.
  • You will also want to select the option to create project from an existing source. This source being the files you copied to the folder you are using as a holding area. If you select the Staging Area folder then click OK you will see that eclipse has filled in the relevant fields for you.
  • click finish on the project creation wizard.
  • Finally right click the root folder in the Package explorer tab in Eclipse and select the Properties option then the android tab. Check the “Is Library” check box, click Apply and then OK.

Only when this is done, you can go with the next step and create the real project and call it “MyGame”

  • Create another new android project.
  • Name the project and select the Build Target and Min SDK Version to be the same as the Library project that you created.
  • Make sure that the package name is the same as the bundle identifier in your unity project otherwise you can get problems with conflicting files in the generated java files in your project.
  • Now the library you created needs to be added to the project, you do this by right clicking the JavaProject and selecting properties.
  • You then need to Select Android and click add. A window should then popup select the library project that was created and click ok. Once you are back in the main window click apply.
  • Now select Java Build Path from the list on the left and click add external jar. A window will now popup you need to navigate to your unity install directory and in Unity\Editor\Data\PlaybackEngines\androidplayer\bin there will be a file called classes.jar. Double click that and then click on ok.

Both are copied from the actual documentation. You only have to add the classes.jar file. Nothing else.

Now, if you want that your Java Code (i.e. extended with ads, or google analytics) build when you hit “Build & Run”, your java project (the second one you created) to be inside of Plugins\Android folder within your Unity3d Project. Also you need to export your project (right click > Export… > JAR File) or the compiled Java classes won’t be built into the game and you will get “ClassNotFound” exceptions

Hi Tseng i followed your guide point.i exported .jar file also.but i am asking one thing how to test is connected to eclipse.I mean i wrote a java code in eclipe also.How to import that plugins into my project. I followed file:///Applications/Unity/Unity.app/Contents/Documentation/Documentation/Manual/Plugins.html#AndroidPlugins these steps also but i struck at Using Java Plugins

The Android plugin mechanism also allows Java to be used to enable interaction with the Android OS. Java code can not be called directly from C#, so you’d need to write a native plugin to ‘translate’ the calls between C# and Java.
how to write a pulgin for c# in unity3d.i am the beginner to unityandroid. please send it me how to import the pulgins in c#(Unity3d).
Thanks you