i just tried to install and run the sample program by following the instructions in the README.txt. But at point 3 i ran into some problems, as the tests would fail. Now, i took me a while to figure out why it would always fail, but i finally managed to locate the bug: (please note, that i am located in germany, i guess that people who are located in countries that use the same number format as the US-Citizens do not run into this problem)
Problem is: The output string that is produced by Strings.formatDollarAmount(product.getPriceInCents()) does not work properly for my localisation (and i believe for many others as well). Furthermore, the imported packages in IapSampleActivity.java and (i believe it was) StringsTest.java do not refer to the included tv.ouya.sample.util.Strings.java.
Solution is: Import the correct class and change the Strings.formatDollarAmount(int amount) method to properly instanciate like this: NumberFormat.getCurrencyInstance(Locale.US)
I was very confused that this topic has not shown up here already, so i guess i either overlooked it or the maybe the problem has already been fixed?
However, i hope that this information is useful for anybody at least.
now I need your help. I just started with all of this android, ouya thing a few days ago and therefor I am not that experienced. Still I am stuck with this sample app, although there are no more failures after ant clean test the app is not working properly, as the buttons won't perform any actions when pressed.
More precisely the methods ouyaFacade.requestPurchase(...) and ouyaFacade.requestGamerUuid(...) don't work. Here is the LogCat output that occurs if the gamer uuid button is pressed:
01-05 18:43:33.360: E/JavaBinder(1247): *** Uncaught remote exception! (Exceptions are not yet supported across processes.)
01-05 18:43:33.360: E/JavaBinder(1247): android.content.ActivityNotFoundException: Unable to find explicit activity class {tv.ouya/tv.ouya.console.service.iap.ui.GamerUuidActivity}; have you declared this activity in your AndroidManifest.xml?
01-05 18:43:33.360: E/JavaBinder(1247): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1541)
01-05 18:43:33.360: E/JavaBinder(1247): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1416)
01-05 18:43:33.360: E/JavaBinder(1247): at android.app.ContextImpl.startActivity(ContextImpl.java:891)
01-05 18:43:33.360: E/JavaBinder(1247): at android.app.ContextImpl.startActivity(ContextImpl.java:880)
01-05 18:43:33.360: E/JavaBinder(1247): at android.content.ContextWrapper.startActivity(ContextWrapper.java:276)
01-05 18:43:33.360: E/JavaBinder(1247): at tv.ouya.console.service.iap.IapService$1.requestGamerUuid(IapService.java:73)
01-05 18:43:33.360: E/JavaBinder(1247): at tv.ouya.console.internal.IIapServiceDefinition$Stub.onTransact(IIapServiceDefinition.java:102)
01-05 18:43:33.360: E/JavaBinder(1247): at android.os.Binder.execTransact(Binder.java:367)
01-05 18:43:33.360: E/JavaBinder(1247): at dalvik.system.NativeStart.run(Native Method)
Edit: Maybe I should mention, that I don't have the console atm and everything runs on an emulator.
We're looking to release a new ODK in the new few days which will address issues some people have seen like this, if you can hold off developing in those areas for a couple of days you'll save yourself some pain :).
When I try the IAP sample, I get 'invalid app UUID'.
Even though I copied it from the website, and pasted it into the java source.
I also created the 3 products.
Note that the instructions in README.txt and the instructions in the source of IapSampleActivity.java contradict each other!
From the readme:
1. Login to the Developer Portal at https://developer.ouya.tv and make a note of your developer UUID:
2. Navigate to Products and add two or more products. For at least one of these products, the product identifiers should start with "__DECLINED__"
3. Find and edit the following file: src => java => tv => ouya => sample => IapSampleActivity.java
- Change DEVELOPER_ID to match the UUID that you noted from the Developer Portal.
- Remove the existing strings from PRODUCT_IDENTIFIER_LIST and update it with the list of product identifiers you created in step 2 of this section. They must match the product identifiers you defined in the Developer Portal exactly.
And then in the source code itself:
/**
* Log onto the developer website (you should have received a URL, a username and a password in email)
* and get your developer ID. Plug it in here. Use your developer ID, not your developer UUID.
* <p/>
* The current value is just a sample developer account. You should change it.
*/
From the TTY log, I see that the app still manages to retrieve the list of products.
I/ActivityManager( 311): START {cmp=tv.ouya.console/.launcher.store.AppDetailsActivity (has extras) u=0} from pid 502
D/inAppPurchase( 502): Binding to StoreService
D/inAppPurchase( 502): Successfully bound to IapService
E/IAP Client Service( 543): Receipt list failure: 2001 message: Unable to get an authentication token from the server.
W/IapSample( 3291): Request Receipts error (code 2001: Unable to get an authentication token from the server.)
W/InputMethodManagerService( 311): Focus gain on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@42b657e0 (uid=10032 pid=543)
I/ActivityManager( 311): Activity reported stop, but no longer stopping: ActivityRecord{42baa438 tv.ouya.sample/.IapSampleActivity}
@alsutton Is IAP Sample Program "Request Gamer UUID" button supposed to work now with the latest firmware/sdk (January 13)? I got this error: unable to fetch gamer uuid (error 2011: unable to get an authentication token from the server). Is it because I am already logged in on the console with my dev account?
I haven't tested it entirely, and I also switched back to an older framework and launcher version, as the new one seems to have some annoying issues (can't access the ouya application on my android device manually, because it wants me to login, which never works). But what I recall from the short time I used the new framework+launcher was: Most of the functionality worked for me, I could click on products and a purchase dialogue would open, I could request the gamer uuid via the button... however, products I should have "bought" would never appear in the list of purchased products, but I did not spend much time to figure out the problem behind that, as I need to go to the university again :D
Comments
Android Specialist
OUYA
@pendran Is it working for you now?
But what I recall from the short time I used the new framework+launcher was:
Most of the functionality worked for me, I could click on products and a purchase dialogue would open, I could request the gamer uuid via the button... however, products I should have "bought" would never appear in the list of purchased products, but I did not spend much time to figure out the problem behind that, as I need to go to the university again :D