Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
OUYA - The new (upcoming) Android console - Page 5 — Gideros Forum

OUYA - The new (upcoming) Android console

1235711

Comments

  • ar2rsawseenar2rsawseen Maintainer
    edited July 2013
    @SinisterSoft Wow you're fast.
    will be waiting for feedback

    @TheOddLinguist thats completely ok ;)

    Likes: SinisterSoft

    +1 -1 (+1 / -0 )Share on Facebook
  • SinisterSoftSinisterSoft Maintainer
    It was pretty easy - did most of it within the first hour or so. It took more time figuring out how to side load the player on to the device - in the end I used dropbox.

    Repositioning everything took 2 or 3 hours to get it right - I currently have to press a button on my monitor to swap between the PC and the Ouya - so it took ages.

    Four players and IAP shouldn't take that long - but busy during the day today (and all week during the day) supporting my school reports program.
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • MellsMells Guru
    edited July 2013
    Is that how you all feel about Ouya?
    Consensus on Ouya $99 Android Game Console: It Stinks (via daringfireball.net)
    twitter@TheWindApps Artful applications : The Wind Forest. #art #japan #apps
  • SinisterSoftSinisterSoft Maintainer
    It's not that bad, it's not that good either. It's worth $99 though and is a good machine to get things ready for more of the same type of console, Android built into TV's etc...

    The same game ideas/code for Ouya should work fine with virtually no changes (apart from control key codes) on things like GameStick, etc...
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • apart from the Controller, isn't the Raspberry Pi capable of similar or more? Oh, it does not run Android as yet (only the newer higher RAM models do)
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • SinisterSoftSinisterSoft Maintainer
    edited July 2013
    It's a lot better than the Pi (I have 2 pi model b computers). Not seen the Pi (first hand) running Android though, seen the videos but that was a long time ago and possibly vapourware.
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • bowerandybowerandy Guru
    edited July 2013
    To my mind the Ouya's greatest strength is also its greatest weakness. The strength is the openness and the ability for anyone to join the party and actually *write* games rather than just consume them. The problem with this is that it results in a marketplace of very variable quality. This was the comment made in the @Mells link above and, most likely it will only get worse.

    I see the same thing with the (various) Android marketplaces. I suppose this quality range hasn't killed Android but it might do with Ouya. The question is, how can one continue with the "democratization" of programming and still achieve the feel of quality that one senses in Apple's app store?

    I think Ouya (and Gideros) or some of the cheap Android tablets (and Gideros) could well be great educational tools for teaching kids to program; much more so than the R-Pi, which to my mind is just too "geeky". Not only can one learn to create stuff (games) with these tools but they have built-in braggability. What kids wouldn't want to show off the results of their computer studies by showing off the results to their mates?

    best regards
    +1 -1 (+2 / -0 )Share on Facebook
  • SinisterSoftSinisterSoft Maintainer
    edited July 2013
    What do I do with key.der for Ouya IAP ? The ouya docs say to include it, but the plugin docs don't say how.
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • ar2rsawseenar2rsawseen Maintainer
    @SinisterSoft can you point me to the OUYA docs about it, and I'll check :)

    Likes: SinisterSoft

    +1 -1 (+1 / -0 )Share on Facebook
  • SinisterSoftSinisterSoft Maintainer
    Here is a link were some are as clueless about it as me:

    http://forums.ouya.tv/discussion/1612/how-to-use-key-der-file

    Here is the text from the ODK docs:

    "Making a Purchase

    The first thing you will need to do is ensure that your application key is included in your application. You can down load the DER representation of your application key from the games area of the developer portal. To create a Java representation of the key you should use the following code:

    // Create a PublicKey object from the key data downloaded from the developer portal.
    try {
    X509EncodedKeySpec keySpec = new X509EncodedKeySpec(APPLICATION_KEY);
    KeyFactory keyFactory = KeyFactory.getInstance("RSA");
    mPublicKey = keyFactory.generatePublic(keySpec);
    } catch (Exception e) {
    Log.e(LOG_TAG, "Unable to create encryption key", e);
    }
    Once you have your key embedded you will need to create a purchase listener which handles responses from the server. Each purchase will have a unique purchase ID. In this example we use a Map of these IDs to the Product being purchased to allow us to determine what has been purchased :"

    It also doesn't say where this key should be placed in the directory of files.
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • SinisterSoftSinisterSoft Maintainer
    Without this calling the IAP stuff just stops the app and exist - no error code, nothing - at least that's what I think is causing it. If the IAP code is skipped then no exit and all works fine.
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • MobAmuseMobAmuse Member
    edited July 2013
    Ah I thought the key.der file you download can go anywhere in your exported gideros project and I didn't know you had to do anything with it as such it either.

    Edit: I just read those IAP docs it's seems perhaps not then - bugger.
  • SinisterSoftSinisterSoft Maintainer
    edited July 2013
    Maybe that's all that needs to be done - so should I just shove it into the resources?

    The Ouya docs are not very clear about all this.
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • SinisterSoftSinisterSoft Maintainer
    Here is a clip from somewhere else:

    "I used a free program called Hexplorer (http://sourceforge.net/projects/hexplorer/)

    You can use that to open key.der (which you download after uploading your game to ouya.tv) and see the hex values - go to the Edit menu, Select All, Copy As-> C Data, and then you can ctrl-v it into TestOuyaFacade to get the table data. Put a (byte) in front of each value, make sure you end the last value with a comma, and you're gold!"


    Then in the Ouya ODK, in the 'IapSampleActivity.java' source code you see:

    "private static final byte[] APPLICATION_KEY = {
    (byte) 0x30,(byte) 0x81,(byte) 0x9f,(byte) 0x30,(byte) 0x0d,(byte) 0x06,(byte) 0x09,(byte) 0x2a,
    (byte) 0x86,(byte) 0x48,(byte) 0x86,(byte) 0xf7,(byte) 0x0d,(byte) 0x01,(byte) 0x01,(byte) 0x01,
    .
    .
    .
    (byte) 0xfe,(byte) 0xbe,(byte) 0x34,(byte) 0xc6,(byte) 0xc3,(byte) 0x02,(byte) 0x03,(byte) 0x01,
    (byte) 0x00,(byte) 0x01,
    };
    "

    If so I can use Hexplorer to input the keydata, or the ouya init should load in the key (into APPLICATION_KEY) at init? (with the file being put in a specific place) ???
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • SinisterSoftSinisterSoft Maintainer
    I put the key (java 'ised) ( private static final byte[] APPLICATION_KEY = {(byte) 0x30,.... ) into the BacteriaOuyaActivity.java file. Then tried running it again:

    This crashes out the app:
    ouya:requestReceipts()

    This doesn't do anything (like it's ignored):
    ouya:requestPurchase("BacteriaUnlimitedPlay")
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • ar2rsawseenar2rsawseen Maintainer
    edited July 2013
    @SinisterSoft ah I was not aware that could only be provided in bytes.
    in init function I imagined, there should be provided a developer ID an an app key like:
    ouya:init(devId, appKey)
    and I imagined app key would be String format, which I convert to bytes on Java part.
    Let me read more on this.
    In the mean time well app key somehow needs to be passed to ouya:init as second parameter or you can check and modify GOuya.java adding app key there and using it inside
    static public void setUp(String devId, String appId)
  • ar2rsawseenar2rsawseen Maintainer
    edited July 2013
    Ok from what I've read der file is only needed to get app key and for iap to work only app key is needed. The process of getting app key from der file for now is unknown to me, but what @SinisterSoft has seems to be correct. Only problem is passing it to ouya plugin from lua.
    @SinisterSoft is it possible to get string representation of app key?
    Like
    String str = new String(bytes);
    And then pass it to ouya:init method

    I don't know how comfortable it is to pass byte from lua to Java? :D
  • SinisterSoftSinisterSoft Maintainer
    Ahh, before you replied this is what I assumed:

    ouya:init(devId, appKey)

    I put my devid in eg "xxx.xxx.xxx..xxx" then for the appKey I used "com.sinistersoft.bacteria" as I was unsure what to put and it expected a string of some kind.

    Now it looks like for appkey you meant the contents of the key.der file.

    Maybe if there is a way of entering string bytes written as hex into lua then I can feed them in as a string to ouya:init(devId,appkey) ?

    Anyone have any ideas on how to do this?



    Likes: MobAmuse

    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
    +1 -1 (+1 / -0 )Share on Facebook
  • Haha I just finished all the key input stuff and testing of my next (and first paid) Ouya app and wanted to add Ouya IAP on Friday to finish it off, but now I'm really confused.com LOL. When/if this is fixed can somebody write up how exactly you add Ouya IAP to a gideros app as I am clueless. This key.der file seems a right PITA. Other than that all good.
    +1 -1 (+2 / -0 )Share on Facebook
  • SinisterSoftSinisterSoft Maintainer
    It's easy to make into a string that can be entered in Java - but I have no idea on what to do with Lua - shouldn't be hard though. If I figure it out I'll let you know.

    Likes: MobAmuse

    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
    +1 -1 (+1 / -0 )Share on Facebook
  • MobAmuseMobAmuse Member
    edited July 2013
    I'm probably going to trigger Ouya IAP from a level or score counter in the current app so when player reaches level 3 or scores 100,000 for example the IAP boots in. Whilst this sounds easy in practice you have to bear in mind a) I've never used IAP before in any app ever ...and b) an extra layer of confuddlement is hitting me hard now via Lua/Gideros. Almost fried my brains converting my app form touch to buttons in last few days with all the art changes etc. My brain/eyes hurt LOL :P Can somebody make a simple gideros example template project so IAP can be picked out of it or something? All this key and receipt stuff is not my bag at all.
  • SinisterSoftSinisterSoft Maintainer
    Strings in LUA are unicode, so maybe passing the binary data in a string isn't such a good idea.

    Maybe a byte array that could be pointed to and the initOuya routine sorts this out?

    Then all we have to do is make a byte array of the hex data, a simple util could be written to do this in a few minutes.
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • ar2rsawseenar2rsawseen Maintainer
    edited July 2013
    Most probably I will have to write a Java program to generate string from key.der which can be passed to Lua, can anyone share any test.der file they might have? :)

    Edit:
    Or I should consult @atilim on this one :)
  • SinisterSoftSinisterSoft Maintainer
    Go to the Ouya.tv website. Create a developer account (it's free). Add a program. You will then see a download link for your very own key.der file. :)
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • ar2rsawseenar2rsawseen Maintainer
    edited July 2013
    Ok @SinisterSoft
    in the meantime can you
    1. add that key file to the Gideros project
    and read it into a string
    local file = io.open("key.der", "rb")
    local appKey = file:read( "*a" )
    io.close( file )
    and pass that string to ouya:init()
  • atilimatilim Maintainer
    edited July 2013
    (because Lua strings can hold any binary data including embedded zeros in it.)
  • SinisterSoftSinisterSoft Maintainer
    Same result as before - the receipts call causes a crash, the purchase call does nothing.

    Likes: MobAmuse

    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
    +1 -1 (+1 / -0 )Share on Facebook
  • SinisterSoftSinisterSoft Maintainer
    I've tried it both as a full apk and as apk with no assets folder - same result.

    Likes: MobAmuse

    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
    +1 -1 (+1 / -0 )Share on Facebook
  • ar2rsawseenar2rsawseen Maintainer
    edited July 2013
    well that might not be a appkey problem but also plugin problem :)
    and requestProducts?
    or requestUserId?

    will have to start imagining what might be the problem there
  • SinisterSoftSinisterSoft Maintainer
    Not tried requestproducts or requestuserid

    Will give them a go later. :)

    Likes: MobAmuse

    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
    +1 -1 (+1 / -0 )Share on Facebook
Sign In or Register to comment.