Close
Advertise Here
Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1
    Administrator James Andrew Coote's Avatar
    Join Date
    Oct 2012
    Location
    Nottingham
    Posts
    1,667


    1 members found this post helpful.

    OUYA Emulator for Windows 7 and intel x86 / x64

    I managed to get the emulator to run the Ouya OS. Here is how to do it:

    1. Download java SDK and install, set Java home path, download eclipse, download the android SDK and get them all talking together, so that you can make bog-standard android jellybeans apps and run them in any old android emulator.

    2. Download intel x86 HAX (hardware acceleration) emulator from intel http://software.intel.com/en-us/arti...he-android-sdk (make sure to download it for API level 16, not 10 as shown in the picture in that guide)

    Note: Clearly if you have an AMD machine, rather than an intel machine, you're a bit stuck. Intel x64 machines can emulate x86 machines, so no need to worry there

    Note: I've already done steps 1 and 2, and there is loads of info on how to get this stuff set up on the web, so just skimming over it really

    3. Set up an emulator to the OUYA 1080p specifications in the ODK docs:

    Emulator

    If using the emulator, configure the Android virtual device as follows:
    • Resolution: 1920x1080 or 1280x720, as desired
    • Hardware Back/Home keys: yes (you will need to add this to the hardware parameters)
    • DPad support: yes (you will need to add this to the hardware parameters)
    • Target: Android 4.1 - API Level 16
    • CPU/ABI: Intel Atom x86
    • Device ram size: 1024


    .....

    Screen Resolution Handing

    The OUYA console supports 720P or 1080P output only.

    For OpenGL-based games, we recommend creating a render buffer that's 1920x1080 if targeting 1080P...

    For games using the Android UI Framework, follow the Android best practices for developing applications for xhdpi-large and tvdpi-large displays
    There are two steps to achieve all this:

    3a). Create a device definition



    (Note: this is one I created earlier, hence the "Edit Device" screen. But the "New Device" screen looks identical)

    3b). Create emulator

    Create a new emulator using the device definition you just created:



    This will auto-fill in some information that is incorrect for our purposes. Firstly, we need to change the Target:



    Next, we need to pick the CPU/ABI. If you find the drop-down list is greyed out on ARM, you've not correctly set up the intel x86 emulator for android API lvl 16. (Note: you can't use Google API's lvl 16, has to be Android API Level 16):



    In memory options, change RAM to 512. This is because intel x86 HAX usually fails to allocate memory when it is as high as 1024 Mb for me at least.
    Note: This deviates from the suggestions of the ODK documentation, which recommends 1024Mb RAM. This is just a workaround for a bug I've yet to pin down. (Probably something to do with not allowing java VM enough system RAM??)

    Also give the SD card a size (I usually go with 512Mb), and importantly, check/tick the box saying "Use Host GPU"

    You should end up looking like this:



    4). Launch the new Emulator



    It isn't as fast to start as intel would have you believe. Typically, it takes about a minute or two to get to looking something like this:



    5). Download and install ODK!

    Download the ODK from here: https://devs.ouya.tv/developers/odk and unzip it somewhere sensible

    According to the OUYA docs, we need to do the following:

    Software

    The OUYA console hardware already includes the OUYA launcher, but when using an emulator or Android tablet you will need to install the launcher manually. This file is included in the OUYA ODK package.

    To install the launcher run:

    adb install -r ouya-framework.apk
    adb install -r ouya-launcher.apk

    If the OUYA launcher is not installed, some ODK features will not work correctly.
    For anyone who has not done this before, you need to first find ouya-framework.apk and ouya-launch.apk in the files you just downloaded / unzipped from the odk. Copy them.

    Now find the folder where you unzipped / installed the android sdk, go to platform-tools sub folder, and paste in the two files you just copied:



    Now open the command console, and navigate to the folder you just pasted the two apk's into:



    Finally, make sure the emulator we just set up is still running, and that NO OTHER ANDROID DEVICES are attached to your computer (or no other emulators running). Otherwise, you have to do some funky extra stuff in the command console to do with selecting which device to install on. Now you can type the commands as above:

    adb install -r ouya-framework.apk
    adb install -r ouya-launcher.apk
    @JamesACoote
    Executive Star now available on OUYA Discover

  2. #2
    Administrator James Andrew Coote's Avatar
    Join Date
    Oct 2012
    Location
    Nottingham
    Posts
    1,667


    6). Set up a game for OUYA

    Firstly create a new android project with a blank activity and using Android API lvl 16. Again there is plenty of stuff on the web to help you set this up if you're a also an android first-timer.

    DO NOT use an existing project. If things go horribly wrong, you can't blame me for losing all your precious code (you should have it backed up some other place anyway).

    According to the Ouya docs, there are two things we need to do next:

    6a). Add Ouya Library JARs:

    Developing with the ODK

    Use the Android API Level 16 (Android 4.1 "Jelly Bean") when Developing for the OUYA Console.

    In order to use the OUYA APIs you will need to include ouya-sdk.jar in your project libraries, as well as guava-r09.jar and commons-lang-2.6.jar. These can be found in the libs directory.
    (Note: There are two ways to import JARs into an android project. The other way is through build path, but I believe importing them into libs is the correct way in this case)

    To import JAR files into your project as libraries, right click on libs folder in project explorer in eclipse and select import from the menu. (If you don't have a libs folder already, just right click on the project and select "new folder" and call it libs):



    Select General -> File System:



    Find the "libs" folder in the ODK folder you downloaded earlier:



    Select "ouya-sdk.jar" "guava-r09.jar" and "commons-lang-2.6.jar" :



    6b). Add extra line to the manifest file:

    According to the ODK docs:

    For your app or game to be recognized as made for OUYA, you will need to include an OUYA intent category on the manifest entry of your main activity. Use “ouya.intent.category.GAME” or “ouya.intent.category.APP”.

    Code:
    <activity android:name=".GameActivity" android:label="@string/app_name">
      <intent-filter>
        <action android:name="android.intent.action.MAIN"/>
        <category android:name="android.intent.category.LAUNCHER"/>
        <category android:name="ouya.intent.category.GAME"/>
      </intent-filter>
    </activity>
    To do this, open the AndroidManifest.xml file in the project and go to the xml section. Add the code above, as so:



    Note: I've not actually tested any of the ODK specific features yet (nor the sample app), so I'll update this guide with an extra section on the sample app later

    7). Run the project as an android app. Select the emulator set up earlier as the device.

    Your app should launch correctly. When you press the home button, you will get the option of going to the OUYA homepage or the underlying android emulator homepage. If you pick the OUYA home, you should be rewarded with a welcome video recorded by Julie.

    After the video, you'll be asked to set up the controller. Since this is the emulator, you can skip this and use the mouse instead. I didn't work out how to use my USB controller with the emulator yet. If I do, I'll also add that to the guide

    There also seem to be some problems with the emulator at time of writing with accounts and with it trying to update over wifi. Again, going to have a play to see if I can solve these and will post any updates
    @JamesACoote
    Executive Star now available on OUYA Discover

  3. #3
    Administrator James Andrew Coote's Avatar
    Join Date
    Oct 2012
    Location
    Nottingham
    Posts
    1,667


    Just found out, you can log into your account by going into devs -> builds. Not found out a way to log out yet, so kinda hard to test
    @JamesACoote
    Executive Star now available on OUYA Discover

  4. #4


    May I install the Launcher to my Nexus 7?

  5. #5


    Wow, nice info. I tried out the steps and had some issues that may already be known about. When starting the emulator I still get the message

    emulator: Failed to open the HAX device!
    HAX is not working and emulator runs in emulation mode
    emulator: Open HAX device failed

    Even though the SDK manager shows under Extras that Intel x86 Emulator Accelerator (HAXM) is installed.

    After starting I ran the adb install commands but it seemed to get stuck on the launcher. Turns out it took 341 seconds to load. After which there was no change in the emulator, but upon restart I was asked to select the action to complete with and ouya launcher was one and I appear to be at a OUYA pair a controller screen so I'm claiming success.

    Don't know if I should try the HAXM install myself, outside of the SDK manager,
    http://software.intel.com/en-us/articles/intel-hardware-accelerated-execution-manager/ but the comments there do not seem hopeful.

    Thanks again for these instructions. Going to try the app now.

  6. #6


    I got the app to work. I also discovered that the SDK manager HAXM installation just installs an installer. And installs it to the extras directory instead of the tools directory like intel's documentation said. After verify I had a processor with the correct abilities, then going out to BIOS and enabling the virtualization technology, I ran the installer and now starting an adroid app reports

    [2013-01-15 14:39:48 - Emulator] HAX is working and emulator runs in fast virt mode

    Everything seems to be cool except after restart it complained that my adb.exe wasn't where it really was. I had made a copy of the ouya framework and launcher apks to the android sdk platform tools where adb.exe. I had put that in my path so I went out to the ouya sdk directory and ran the two adb installs and everything is working again. I am wondering how much of this has to be done each time and what the timing should be. I usually fire up the emulator for the first time by running the application from within eclipse. And I also wonder if I will have to start up the HAXM every time I reboot, or close the emulator, and how to automate all this stuff. But at least I know how to get functional.

    This is instructions on installing the HAXM http://software.intel.com/en-us/arti...anager-windows But like I said, it installs the installer to the extras directory, not the tools like it says. But you can see the install path when you accept the license in the sdk manager. Must check processor compatibility for HAXM

  7. #7
    Administrator James Andrew Coote's Avatar
    Join Date
    Oct 2012
    Location
    Nottingham
    Posts
    1,667


    You should only have to install the HAXM emulator once, and it shouldn't affect where the adb.exe is located.

    They changed adb.exe from being in tools to being in platform-tools, so it may be you have an out-of-date android-sdk folder.

    Edit: @ Hobbit, yes, but you probably won't be able to get the controller to work with it
    @JamesACoote
    Executive Star now available on OUYA Discover

  8. #8
    OUYA Devotee SamJ's Avatar
    Join Date
    Aug 2012
    Posts
    220


    Very nice James, I shall use this in the new couple of days
    Follow me on Twitter! - @Sam_Jessop

  9. #9


    When you use the SDK manager to install HAXM it is only installing IntelHaxm.exe, which is the real installer you still have to run. For me this installed to

    ...{androidsdkdirectory}/extras/intel/Hardware_Accelerated_Execution_Manager/

    This is explained in the Intel link in my previous post. All except their documentation says the 'tools' directory but it is actually the 'extras' directory. Which makes sense because the SDK manager has this listed under the Extras gui tree branch.

  10. #10
    OUYA Devotee SamJ's Avatar
    Join Date
    Aug 2012
    Posts
    220


    Hey all, just seeing if anyone else is having trouble at the login screen? Seems when I try to login it just flashing from one screen to the next and doesn't actually get anywhere. Anyone else have this issue?

    Great tutorial btw, worked a treat
    Follow me on Twitter! - @Sam_Jessop

Bookmarks

Bookmarks
  • Submit to Digg Digg
  • Submit to del.icio.us del.icio.us
  • Submit to StumbleUpon StumbleUpon
  • Submit to Google Google

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •