Choose Unity level from within a Android Application

I am quite new to Unity and is having some small problems. I have been looking for a way to start Unity from a Android application. The problem I have is that when Unity starts a blue screen is commenced, I assume this is due to the fact that no scen has been loaded (how is this solved?). I would also like to be able to choose what level to use from the Android application.

I have added the library to eclipse as described in the manual. A scen has been created (compiled and tested on a phone). The code for starting Unity from the application looks like:

import android.os.Bundle;
import com.unity3d.player.UnityPlayerActivity;

public class UnityPlay extends UnityPlayerActivity{
    /** Called when the activity is first created. */
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        
    }
}

The code is located in: myproject\src and the scene is located in myproject\assets\Scens

I would appreciate any advice! Thanks

You have to add the scenes to the build. Open the File → Build Settings… dialog and select ‘add current’ to add the currently open scene to the build.

You can call Application.LoadLevel to load a scene from script.

I have added the scenes to the build. I use two scenes, one blank with a script loading level 1 using Application.LoadLevel (thought this might be the problem). The problem seems to be that the scenes are not loaded into the application when compiled in Eclipse.

How do I use Application.LoadLevel in java?

I haven’t tried using eclipse so I’m afraid I cannot help with that. I just build from the Unity editor and everything works fine for me. You can test the level loading logic in the editor, that should tell you if there are any errors in your script.

Can I use my present Android code and build it all in Unity? I started out creating a Android application without Unity and do not have time to recreate what I have done so far.

Where do I find the level loading logic (tried google but couldn’t find anything)?