Prime31 Android Plugins Officially Live!

Discussion in 'Android Development' started by prime31, Jun 6, 2011.

  1. bpritchard

    bpritchard

    New Member

    Joined:
    Jan 29, 2009
    Messages:
    437
    ok i see.. looking at their documentation they don't make that very clear. Essentially then on first launch i can run my purchase update event, check for previous purchases by name or key i assume and then unlock there... seems simple enough. :)
  2. wilfred

    wilfred

    New Member

    Joined:
    Nov 14, 2011
    Messages:
    17
    Hi Prime,

    In the w3i Android plugins, why it don't call AppWasRun function? I can't so any ad tracking in w3i now. Could you fix it? Thanks.
  3. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,415
    @wilfred, can you be more specific? What exactly are you referring to?
  4. dannyskim

    dannyskim

    New Member

    Joined:
    Jul 20, 2011
    Messages:
    78
    Hey again Mike,

    I'm having an issue with OpenFeint integration, don't know if you can provide any insight. I'm getting a Building DEX failed error when compiling, and I think it is because OpenFeint is possibly duplicating some of your methods... I've checked to make sure I have no duplicate files, so I can't think of what exactly could be wrong:

    UNEXPECTED TOP-LEVEL EXCEPTION:
    java.lang.IllegalArgumentException: already added: Lcom/facebook/android/AsyncFacebookRunner$1;
    at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
    at com.android.dx.dex.file.DexFile.add(DexFile.java:163)
    at com.android.dx.command.dexer.Main.processClass(Main.java:486)
    at com.android.dx.command.dexer.Main.processFileBytes(Main.java:455)
    at com.android.dx.command.dexer.Main.access$400(Main.java:67)
    at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:394)
    at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
    at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:191)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:123)
    at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
    at com.android.dx.command.dexer.Main.processOne(Main.java:418)
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:329)
    at com.android.dx.command.dexer.Main.run(Main.java:206)
    at com.android.dx.command.dexer.Main.main(Main.java:174)
    at com.android.dx.command.Main.main(Main.java:95)
    1 error; aborting

    I know this is kind of outside of the scope of your support, but if you could point me in the right direction at least it would be appreciated.
  5. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,415
    @danny, OF includes a really old version of the Facebook Connect SDK. If you are savvy with jars, you should be able to remove their compiled class files (anything com.facebook) and it *might* work. Besides that there is no easy fix.
  6. dannyskim

    dannyskim

    New Member

    Joined:
    Jul 20, 2011
    Messages:
    78
    Hmm, alrighty. I'll take a look at the associated .jar files with a .class editor and see if I can figure out, I'll post any appreciable results. Thanks for the fast response as always.
  7. dannyskim

    dannyskim

    New Member

    Joined:
    Jul 20, 2011
    Messages:
    78
    So I removed the compiled class files as you recommended and it's compiling. I'm under the assumption that removing these files entirely will cause something to break inside of OF in regards to Facebook posting, so I'll take a look at report my findings.

    If it comes down to decompiling and moving references and such, I'll post a how-to if I find a solid solution that doesn't cause any crashes.
  8. wilfred

    wilfred

    New Member

    Joined:
    Nov 14, 2011
    Messages:
    17
    Hi Prime,

    I mean is your plugin include w3i Advertiser SDK? Because I can't see "AppWasRun()" in Advertiser SDK called.
  9. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,415
    @wilfred, only the iOS version covers both the publisher and advertiser SDKs. Android only covers the publisher SDK.
  10. wilfred

    wilfred

    New Member

    Joined:
    Nov 14, 2011
    Messages:
    17
    i see....Any reason why not include the advertiser SDKs? :(
  11. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,415
    @wilfred, lack of demand. You are te only one who has ever asked for them.
  12. dannyskim

    dannyskim

    New Member

    Joined:
    Jul 20, 2011
    Messages:
    78
    Something in OpenFeint broke your Android Manifest generation script. Could you possibly post the manual changes I would need to make to the .xml file for Social Networking and Android Billing so I can just modify it myself?
  13. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,415
    @danny, the changes required are already present in the Manifest.xml file included with each plugin.
  14. dannyskim

    dannyskim

    New Member

    Joined:
    Jul 20, 2011
    Messages:
    78
    is there anything else that I need to add other than the changes that are included in the Manifest file? I added the meta-data and permissions sections of the IAB Manifest file into the default Manifest file found in the Unity folder, but I keep on getting crashes every time I try to make a purchase now.

    Code (csharp):
    1. <?xml version="1.0" encoding="utf-8"?>
    2. <manifest
    3.     xmlns:android="http://schemas.android.com/apk/res/android"
    4.     package="com.unity3d.player"
    5.     android:installLocation="preferExternal"
    6.     android:versionCode="1"
    7.     android:versionName="1.0">
    8.     <supports-screens
    9.         android:smallScreens="true"
    10.         android:normalScreens="true"
    11.         android:largeScreens="true"
    12.         android:xlargeScreens="true"
    13.         android:anyDensity="true"/>
    14.  
    15.     <application
    16.         android:icon="@drawable/app_icon"
    17.         android:label="@string/app_name"
    18.         android:debuggable="true">
    19.         <activity android:name="com.unity3d.player.UnityPlayerProxyActivity"
    20.                   android:label="@string/app_name"
    21.                   android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
    22.             <intent-filter>
    23.                 <action android:name="android.intent.action.MAIN" />
    24.                 <category android:name="android.intent.category.LAUNCHER" />
    25.             </intent-filter>
    26.         </activity>
    27.         <activity android:name="com.unity3d.player.UnityPlayerActivity"
    28.                   android:label="@string/app_name"
    29.                   android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
    30.         </activity>
    31.         <activity android:name="com.unity3d.player.UnityPlayerNativeActivity"
    32.                   android:label="@string/app_name"
    33.                   android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
    34.             <meta-data android:name="android.app.lib_name" android:value="unity" />
    35.             <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
    36.         </activity>
    37.         <activity android:name="com.unity3d.player.VideoPlayer"
    38.                   android:label="@string/app_name"
    39.                   android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
    40.         </activity>
    41.     </application>
    42.    
    43.     <!-- META DATA -->
    44.     <service android:name="com.prime31.billing.BillingService" />
    45.         <receiver android:name="com.prime31.billing.BillingReceiver">
    46.             <intent-filter>
    47.                 <action android:name="com.android.vending.billing.IN_APP_NOTIFY" />
    48.                 <action android:name="com.android.vending.billing.RESPONSE_CODE" />
    49.                 <action android:name="com.android.vending.billing.PURCHASE_STATE_CHANGED" />
    50.             </intent-filter>
    51.         </receiver>
    52.        
    53.     <!-- PERMISSIONS -->
    54.     <uses-permission android:name="android.permission.INTERNET" />
    55.     <uses-permission android:name="com.android.vending.BILLING" />
    56.    
    57. </manifest>
    Not sure what's going on, and I can't see how OpenFeint could have broken your Manifest generation script.
  15. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,415
    @danny, the Manifest.xml files contain all the changes required for the plugins.
  16. dannyskim

    dannyskim

    New Member

    Joined:
    Jul 20, 2011
    Messages:
    78
    The meta-data portion of the Manifest file needed to be put in the <application> section. I figured I was doing something wrong, which is why I posted the code. Oh well, lesson learned, move on.
  17. bpritchard

    bpritchard

    New Member

    Joined:
    Jan 29, 2009
    Messages:
    437
    @Prime31

    We're having an issue w/a game AFTER we've published it (we've since taken it down). But we added in a checkForPrevious purchased unlocks on first launch and it worked perfectly fine... didn't unlock the game until the user actually purchased it (via the testing accounts). But now that we've put it on the market, it is unlocking on EVERY launch for EVERY user (only new accounts we've created to test with that are not in the google play test account section). have you ever seen anything like this? we're not doing anything fancy... just do the init, and on the billing supported event we check to see if its first launch and if it is we run restoreTransactions, which seems to always be returning a valid receipt because its definitely unlocking.

    Cheers
    Bryan
  18. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,415
    @bpritchard, i've never seen Google Play provide receipts for items that were not actually purchased. You may want to open a bug report with them because something isnt right in there.
  19. bpritchard

    bpritchard

    New Member

    Joined:
    Jan 29, 2009
    Messages:
    437
    I'm assuming that restoreTransactions() returns a list of valid receipts, after when the transactionsRestored event should be running correct? Thats how the sequence is setup.. and d on't do anything in between.. we just start one and wait for that to finish. Our unlock is in the transactionsRestored event, so i would think it would be pretty straight forward.
  20. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,415
    @bpritchard, the transactionsRestoredEvent and the transactionRestoreFailedEvent are only indicators that the request to restore transactions was received by Google Play. They do not return receipts, products or anything of the sort. Play will get around to firing the purchaseSucceededEvent for any purchases that it actually restores.
  21. bpritchard

    bpritchard

    New Member

    Joined:
    Jan 29, 2009
    Messages:
    437
    Oh so i'm backwards? so basically the restoreTransactions will automatically return the purchaseSucceededEvent if there are valid receipts?
  22. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,415
    @bpritchard, that is correct. The transactionsRestored/FailedEvents are merely to tell you if the request successfully (or unsuccessfully) reached the Play servers. Play will then at some point in the future actually do the restoring if there are any transactions to restore.
  23. ironhero

    ironhero

    New Member

    Joined:
    Nov 15, 2008
    Messages:
    65
    Prime 31

    does your Social networking plugin really support single sign on support?

    I've just failed to get it working on your Facebook test scene.

    I run the scene on android device.
    Push Init and Login buttons.
    Get the dialog to install Facebook For Android.
    Installed Facebook for Android and login FB

    Then I started your test app again
    Push Init and Show Post Dialog buttons
    It seem I should get Post Dialog here
    But I got the dialog to install Facebook For Android again

    What I did wrong?
    Need advise to force single sign on support working

    Thanks
  24. devGuillaume

    devGuillaume

    New Member

    Joined:
    Feb 10, 2012
    Messages:
    23
    Could you tell exactly which plugins are affected? We're now considering adding the AdMob plugin on top of Etcetera, Social Networking and In App Billing but this is not a definitive list.
    Thank you!
    Last edited: May 14, 2012
  25. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,415
    @iron, we removed SSO from the Android version a while back. Facebook has a huge pile of bugs with it and affecting different devices that they still haven't fixed. In addition it required overriding the main Unity Activity which has a host of difficulties as well.


    @dev, you are fine with the plugins listed. They will all work without issue.
  26. ironhero

    ironhero

    New Member

    Joined:
    Nov 15, 2008
    Messages:
    65
    @Prime

    override the main Unity Activity is not a problem
    it is extended with a lot of things in my case already
    if it solves the problem, would you like to drop some info on it ?
  27. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,415
    @iron, you would need to create your own authentication system. Our plugin only supports the in app login process.
  28. nikolic

    nikolic

    Member

    Joined:
    Oct 15, 2011
    Messages:
    162
    @prime31

    Sorry if this has already been asked, the topic is not easy to search.
    What are the required manifest permissions for social plugin?
    Thanks.
  29. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,415
    @nikolic, if there were any manifest changes required they would be contained in the Manifest.xml file. The SocialNetworking Plugin does not required any though besides the obvious internet permission.
  30. devGuillaume

    devGuillaume

    New Member

    Joined:
    Feb 10, 2012
    Messages:
    23
    @Prime31, In the askForReview() and askForReviewNow() methods, is the appPackageName parameter the bundle identifier shared between multiple platforms and located in Unity's Player Settings?
    If it is, could you add a method to retrieve this identifier at runtime? It is suggested here how it can be done for iOS (could be useful as well) but I don't know about Android. Or you could just remove the appPackageName parameter altogether?
    Last edited: May 15, 2012
  31. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,415
    @dev, that is a required name that should be the exact package name you setup in the Googke Play web portal when creating your game.
  32. kinzia

    kinzia

    New Member

    Joined:
    Aug 14, 2010
    Messages:
    18
    I've got problem with mobclix plugin and qcar. My qcar work well before generate the manifest xml. After I generate it, all qcar function does not work. Any solution can fix this problem?

    Thanks!!
  33. nshack31

    nshack31

    New Member

    Joined:
    Nov 4, 2011
    Messages:
    95
    These plugins are great, i'm using a few.

    But when using the admob plugin it works great in Portrait using: AdMobAndroid.createBanner( AdMobAndroidAd.smartBanner, 0, 0 );

    but if i change my game to "Landscape Left" and run it on my tablet i cannot see a banner. any ideas?! thanks


    .....edit sorry it actually works on most devices, its low res ones that seem to have a prob
    Last edited: May 17, 2012
  34. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,415
    @kinzia, you will have to setup your AndroidManifest file manually by adding the requirements for QCAR.


    @nashack, we have some really old low res devices in our test bed that work fine. Are you listening to the events the plugin fires? It could very well be that there is just no fill available.
  35. nshack31

    nshack31

    New Member

    Joined:
    Nov 4, 2011
    Messages:
    95
    It's an Archos 7... fairly sure its not a fill issue. I works fine in portrait but refuses to work in landscape. not the end of the world
  36. kinzia

    kinzia

    New Member

    Joined:
    Aug 14, 2010
    Messages:
    18
    how to setup the androidManifest with qcar?
    Thanks!
  37. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,415
    @kinzia, we don't provide support for QCAR. Pleas consult the QCAR documentation or vendor.
  38. achingupta87

    achingupta87

    New Member

    Joined:
    Apr 9, 2012
    Messages:
    145
    Hello EveryBody

    I wants to use Electra Plugins with unity3d for android sample project.

    Can u please tell the How its is possible .

    If any sample project is available please share with me.

    Thanks:mad:
  39. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,415
    @aching, the demos scene is located in the testSupport folder.
  40. achingupta87

    achingupta87

    New Member

    Joined:
    Apr 9, 2012
    Messages:
    145
    I got the testSupport folder but when I try to open this scene it does not open.

    First I open the new project from unity 3.4 then when I try to open this scene nothing is import in the unity nothing is displayed?????

    can u help me whats the problem??????
  41. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,415
    @achung, demo scenes will only work with Unity 3.5.
  42. achingupta87

    achingupta87

    New Member

    Joined:
    Apr 9, 2012
    Messages:
    145
    Now I have the unity 3.5 but the same problem again......when we try to open the scene nothing is included with scene simple unity window is open nothing is show.......where is the problem now. I have the EtceteraAndroid plugin folder which contains two folders some files. I select the scene from the testSupport folder but nothing is shown......please help????????
  43. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,415
    @aching, are you pressing play to run the scene? Are your player settings set to Android? Did you open the files up to look at them?
  44. achingupta87

    achingupta87

    New Member

    Joined:
    Apr 9, 2012
    Messages:
    145
    1st of all I open the unity window . Then from file I select the open scene then select the scene from testsupport folder.
    now nothing is opened in the unity window.........player setting is set for android.........now what i do......please help.
  45. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,415
    @aching, are you pressing play to run the scene? What GameObjects do you see in the object list? Please post screenshots as well. We have never heard of a situation where Unity opens a scene with no errors it doesn't actually open it.
  46. achingupta87

    achingupta87

    New Member

    Joined:
    Apr 9, 2012
    Messages:
    145
    I m using Plane gameObject in the game. I attached the 2 screenshots of unity window which we see when try to run the project..Is It only run in the android device or we can check this in unity editor or webplayer.?????????

    Can u tell me please is Plugin is only works with unity 3.5 or unity 3.5 pro version ??????
    It not works with unity 3.4 or old version????

    Attached Files:

    Last edited: May 22, 2012
  47. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,415
    @aching, it is an Android plugin with Android native code and can only run on an actual Android device.
  48. achingupta87

    achingupta87

    New Member

    Joined:
    Apr 9, 2012
    Messages:
    145
    Thanks Team for your response......One more question from my side.

    Is Prime31 only support unity 3.5 android Pro version or old version also. because I have unity 3.4 android Pro ?
  49. devGuillaume

    devGuillaume

    New Member

    Joined:
    Feb 10, 2012
    Messages:
    23
    Hi Danny,
    Could you post the modified Giraffe.jar? I'm not savvy with jars and it could save me some time. Thank you!
  50. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,415
    @aching, Unity Android Basic 3.4 will work fine.


    @dev, all you have to do is unzip the jar file, delete any files you want to remove then zip it again.