I haven't had to touch the file, but I use FDT. I deploy the exact same apk that I deploy on my nexus7.
I'll look in to it further and see what it's doing, or I can post the app.xml that I use. The only important bits for android stuff is the manifestadditions. The only line I have uncommented is "android.permission.INTERNET", as my game is online. @GaslightGames have you found something in the manifest we are lacking access to?
PS I'd support an AIR forum gladly, but I'm not sure it has much use. Pretty easy to find things so far.
Nope, I just click deploy or debug inside of FDT, the ouya spins in to action and the game launches. Same on both devices. I can't guarantee I have the right of it, as I've only just scratched the surface of my development, but it's running and appears fully functional (server connects and I'm getting my data and views just fine)
@IQpierce: In the ANE projects you can see the changes we made to the Manifest (*-app.xml) in order to have the AIR app a) appear as an OUYA game and b) include the ANE. You can do it with a generic <application> and <activity> tags and the <intent> is pretty simple too :-)
In some of the pure Java Android apps I've written, you need to specify more details on the target <application> when using Intents, but the generic way we've done it in the ANE demo projects works just fine :-)
@mfrasier: If you want your AIR app to appear in the OUYA UI, then yup, you'll need the OUYA-Specific stuff, too :-)
@WillzZz: I do this, too, but from Flash Builder instead. Although running Debug without updating the Manifest will mean the app doesn't appear in the OUYA UI... and if you do a "release build", you'll need the manifest updates!
This is something Adobe should help us out with me thinks. I just contacted Thibault Imbert who is the Senior Product Manager of Gaming at Adobe. Lets see if he can jump in and help us AIR developers out!
I don't suppose anyone could volunteer to write the Windows-x86 stub extension so we can test and debug on a windows machine without needing to write special condition compile code surrounding controller based things?
It doesn't need to do anything. As far as I can tell it just holds three files with stub methods, as that's all the default (osx) implementation required. So yes, I've made a default implementation, but that only works on my laptop, which is less than optimal. And I know less than zero about generating a dll :(
Well, I gave it a shot on my own. Everything compiles in the C project, I made the DLL and packaged the ANE. Still getting the following error, although I believe all of the extensions.xml stuff is set up properly:
The content cannot be loaded because there was a problem loading an extension: Error: Requested extension com.gaslightgames.OUYAControllerANE is not supported for Windows-x86.
Any thoughts or does anyone want to look at it? It sucks having to debug every time on the ouya instead of being able to make small changes on the desktop.
Well, I gave it a shot on my own. Everything compiles in the C project, I made the DLL and packaged the ANE. Still getting the following error, although I believe all of the extensions.xml stuff is set up properly:
The content cannot be loaded because there was a problem loading an extension: Error: Requested extension com.gaslightgames.OUYAControllerANE is not supported for Windows-x86.
Any thoughts or does anyone want to look at it? It sucks having to debug every time on the ouya instead of being able to make small changes on the desktop.
The ANE at it's base level uses a bunch of Android elements like Java, the Android SDK and the like, so it's probably throwing these errors because of those dependencies.
I'm thinking this is more about the nature of the ANE than anything else... mind you, one should be able to implement a simple "isSupported()" method in the SWC part of the ANE, that should at least allow you to compile on Windows, but nothing else work.
Hey, just wanted to hop in and say THANK YOU to mainly GaslightGames and Laboratory for helping AIR developers get their games on OUYA. :)
No worries :-)
Will be starting on an IAP ANE sometime next week. Reckon it'll take me a couple of days to get the basics running, but that should give us AIR devs the same level of access as everyone else :-)
Yeah, I spent a good half-hour/hour of valuable contest time disabling/enabling the Controller tests to get footage on my computer. :P
Following on the "isSupported()" idea, it might be nice to actually hook in a keyboard listener within the ANE SWC itself if it's not running on the OUYA, and that way it could fake the controller automatically without having to make everyone write a bunch of junky platform special-case stuff in their games. Just a thought. :)
@GasLightGames I did exactly that. It's just an isSupported() function. I tried a multitude of different ways but left it after wasting nearly an entire day on it. It all seems to be working properly except when I launch from FDT it immediately tells me it can't find the Windows-x86 implementation. It could just be my IDE, but that doesn't help me much.
@Laboratory I wrote a wrapper around the ANE and implement it differently using just AS3 code when I don't have the ANE imported. It's kind of a pain, although the code is simple. A better solution would be to map a controller from windows to send similar events. If I didn't epic fail the stub for the ANE I'd tackle that myself.
ANEs don't seem to be well thought-out, if I'm honest. Requiring a dll to be built to prevent an error from being handled gracefully isn't very elegant. If anyone has familiarity with implementation of a Windows-x86 ANE and wants to try tackling this, that'd be great.
OK, been off the ANE development front for some time - but ready to get back on it with a vengeance!
@WillzZz I'll take a look and see what I can come up with. Hopefully can get this going quickly.
And to everyone else who might be waiting: I'm starting the IAP ANE TODAY! :-)
Probably take me a couple of days to get the basics up and running and, as with the controller ANE, would really appreciate any support/feedback once I get it up and running. Also, just as before, there'll be another git repo where you can get the source along with some samples etc. But with this one looking like it'll be a little tougher to build, might take me a little longer than the Controller ANE.
@WillzZz We now have an isSupported method. BUT, due to the nature of ANEs and if, like me, your projects can use multiple ANEs, there's a flaw in the naming of methods called to the Extensions. If two ANEs share the same method name, like most will have an isSupported method, then whichever was the last loaded will take the name and the others wont call it... at least, that's my understanding of it.
So, to avoid any problems, there's an "isControllerSupported" method that will return true, if on the OUYA, or false if on anything else.
Getting it to work took more than just fiddling with the SWC, as I suspected. One must create another extension library (SWC), but this time with some "blank" methods that return the expected data/data-types but don't do anything.
For instance, the "default" platforms library returns false always, if you call "isControllerSupported" on Windows, for example.
Hopefully that'll help with the development you were trying to do!
As for the IAP Native Extension - the base ANE exists, we have typical comms and the Native side creates the OuyaFacade object. It doesn't do anything yet, as I was fixing the whole isSupported stuff. But it's coming along and, looking deeper at it, shouldn't take more than another day - if anyone is interested?
Right now you can initialize it with your Developer ID.
Add a listener for requesting products.
Send a request for a product - and receive information back to your handler event.
Set the "Test Mode", so that you don't spend real money while testing.
There are still a number of things left to do, but getting the basic communication was/is, as always, the most difficult part. Should be another day or so and you can purchase items, get receipts etc, all in the comfort of AIR :-)
Here to throw some support your way again. I'm extremely grateful to you and everyone that helped make these ANE's. I can't thank you enough! I'm a user interface artist at a game studio, so I'm an artist by trade. I program out of necessity, curiosity, and the love of making games. I'm certainly no professional at it and in order to make something like this it would have taken me quite a bit of time. Or I would have had to jump into another development environment that I'm not as familiar with.
So thank you! You have saved me and I'm sure many other developers out there a lot of time, really appreciated. :)
Here to throw some support your way again. I'm extremely grateful to you and everyone that helped make these ANE's. I can't thank you enough! I'm a user interface artist at a game studio, so I'm an artist by trade. I program out of necessity, curiosity, and the love of making games. I'm certainly no professional at it and in order to make something like this it would have taken me quite a bit of time. Or I would have had to jump into another development environment that I'm not as familiar with.
So thank you! You have saved me and I'm sure many other developers out there a lot of time, really appreciated. :)
You're most welcome :-)
I'm building them because we need them, and as this thread started when others were needing them, too, figured we'd jump in and attempt to build something useful for the community.
Anyway, glad they're of use to more than just ourselves :-)
I'm finally trying to set this up for a Flash game I'm porting to the Ouya. However I'm using Flash Builder 4.5.1 - I'd rather not upgrade to 4.6 or 4.7 unless I have to.
I think the main thing I'm doing differently for that platform is changing the ANE's filename to have ".swc" at the end and including it as an externally-linked SWC. The code compiles and runs just fine, but I was getting an error in that OUYAControllerANE.isSupported was always false.
Then I realized I needed to add the following to the bottom of my *-app.xml:
...Which I did, but now when I try to debug on the device I get this error while packaging the application: "An implementation for native extension 'com.gaslightgames.OUYAControllerANE' required by the application was not found for the target platform"
Any ideas? Has anyone else gotten this working with Flash Builder 4.5.1?
Hmm. That's an error from Adobe (not one that I've traced out) and was an issue we came across when correctly implementing the isSupported() method.
The story: The isSupported() method was wanted, but others were hitting issues getting it to work. Implemented it and attempted to run the ANE on Windows, but it threw that error. If one adds the relevant <platform> tag to the extension.xml in the AS3 Library project, then this error goes away.
So... the simple questions:
Are you definitely using the latest build of the ANE?
Can you run a build on Windows? The controller wont work, but you should get the "This platform is not supported" error traced to the Debugger.
I made the jump to 4.7, as we had 4.6 and Adobe provided the upgrade for free. With the assortment of fixes and updates, I would recommend making the leap to the latest version. You also get Workers (Threads), which are currently Desktop only, but concurrency should be coming to mobile soon, too! And proper support for ANEs which, in this case, might help.
Of course, you could always try the trial for 4.7 and see if that solves the problem? It'll let you know if the rest of the project is working properly :-)
First of all, I resolved my previous problem, I mostly just needed to do the adt build myself on the command-line, and check that I was using the right parameters there... adding an "-extdir" parameter to my ANE directory was probably the most important part of that.
Second, to answer your query above Gaslight, yes I am interested in the AIROUYAIAP project, and now I'm trying to use it as well! However I'm getting a problem when running the adt command-line statement I mentioned; I get many warnings like this one:
trouble processing:
class name (tv/ouya/console/util/SerialNumber) does not match path (libs/tv/ouya/console/util/SerialNumber.class)
at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
at com.android.dx.dex.file.DexFile.add(DexFile.java:143)
at com.android.dx.command.dexer.Main.processClass(Main.java:301)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:278)
...
I did some googling and found this error is caused by redundant/conflicting symbols. I wonder if this is because I'm including both the Controller ANE and now the IAP ANE, and they include some of the same symbols and classes?
It would be nice to have a working example project that included both the controller and IAP ANE's, for a start.
I want to thank you again, GaslightGames, for doing excellent work making these ANEs, I appreciate that I and other Flash-on-Ouya developers are getting the benefits of your hard work! I hope to see several AIR Mobile games on the Ouya store during the launch window; if there are, you'll deserve much of the credit!
I have a temporary work-around in place for that issue - I've simply remove the controller ANE for now... though I'll have to come back and address that at some point...
Now I'm getting the following error whenever I call ouyaIap.getProductInfo() (with a product ID that I believe should be valid)...
Unable to rebuild purchasable. Encryption data state unknown
I'll post an update when/if I find a solution to this.
It seems that Unity added encryption to purchases last week with the 1.0.0 ODK release. Since this ANE hasn't been updated since early February, I'm going to assume that it has no support for this, and this is why I'm getting an encryption-related error when trying to use it.
Gaslight, I hope that this side of things can be supported by your ANE soon. Please let me know if I can help! Perhaps I'll try poking around in the ANE code myself, though it's been a long time since I've worked in Java.
Comments
CEO, Rocket Bunny Games
No worries :-)
Getting it to work took more than just fiddling with the SWC, as I suspected. One must create another extension library (SWC), but this time with some "blank" methods that return the expected data/data-types but don't do anything.
As for the IAP Native Extension - the base ANE exists, we have typical comms and the Native side creates the OuyaFacade object. It doesn't do anything yet, as I was fixing the whole isSupported stuff. But it's coming along and, looking deeper at it, shouldn't take more than another day - if anyone is interested?
<extensions>
<extensionID>com.gaslightgames.OUYAControllerANE</extensionID>
</extensions>
...Which I did, but now when I try to debug on the device I get this error while packaging the application: "An implementation for native extension 'com.gaslightgames.OUYAControllerANE' required by the application was not found for the target platform"
Any ideas? Has anyone else gotten this working with Flash Builder 4.5.1?
The story:
The isSupported() method was wanted, but others were hitting issues getting it to work. Implemented it and attempted to run the ANE on Windows, but it threw that error. If one adds the relevant <platform> tag to the extension.xml in the AS3 Library project, then this error goes away.