Search Unity

Prime31 Android Plugins Officially Live!

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

  1. RobotInfluence

    RobotInfluence

    Joined:
    Jan 9, 2012
    Posts:
    7
  2. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @Robot, can you send the apk over to questions (at) prime31.com so I can give it a look?
     
  3. RobotInfluence

    RobotInfluence

    Joined:
    Jan 9, 2012
    Posts:
    7
    sure thing!
     
  4. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,266
    Agreed, but you have to find it first is my point. Unity does not return the equivalent of file:///mnt/sdcard or a non-app specific folder on android as far as I can see - I have examined the results of C# environment vairables and Unity Application. paths.
    Your plugin is not telling me where you recorded to.
     
    Last edited: Jan 10, 2012
  5. pretender

    pretender

    Joined:
    Mar 6, 2010
    Posts:
    865
    hi prime31

    here is what i have found out:

    1.) when comment out the create banner for tablet and force smaller ads for phone to create a get them display in tablet but still not on phone. so at least they are working.
    2.) as far logcat is concerned, i use this command: adb logcat -s Unity and i do not see anything related to admob. can you tell me how to get to the admob related logs and i will let you know what is going on!

    thanks!
     
  6. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @Andy, the event that fires when the recording is stopped contains the full path ready to use.

    @pretender, "adb logcat" is all you need to see the logs. It shoul have a pretty steady stream of logs even when doing nothing.
     
  7. lbalasubbaiahapps

    lbalasubbaiahapps

    Joined:
    Oct 6, 2011
    Posts:
    23
    Prime 31 developing good plugins to develop games.i brought too many plugins.I have one doubt In that TTS for android plugin i want to brought.But i have one doubt in my project i need female and male voice.is it give female and male sounds or Only male voice.Or how many type voices i mean Kid,Male,Female like
     
  8. pretender

    pretender

    Joined:
    Mar 6, 2010
    Posts:
    865
    here is the output from adb logcat -s Prime31 when start the game on phone

    C:\Windows\system32>adb logcat -s Prime31
    --------- beginning of /dev/log/system
    --------- beginning of /dev/log/main
    I/Prime31 ( 3396): setting: 2 test devices
    I/Prime31 ( 3396): requested adSize enum value: 0
    D/Prime31 ( 3396): creating ad banner with leftMargin:topMargin: 160:420
    D/Prime31 ( 3396): adView: onReceiveAd
    D/Prime31 ( 3396): adView: onReceiveAd
    D/Prime31 ( 3396): adView: onReceiveAd

    but i do not see any ads!
    can you help me troubleshoot this?

    here is the output of logat when i start the game on tablet (where i can see ads):

    C:\Windows\system32>adb logcat -s Prime31
    --------- beginning of /dev/log/system
    --------- beginning of /dev/log/main
    I/Prime31 ( 603): setting: 2 test devices
    I/Prime31 ( 603): requested adSize enum value: 2
    D/Prime31 ( 603): creating ad banner with leftMargin:topMargin: 406:692
    D/Prime31 ( 603): adView: onReceiveAd

    eveything seems ok, i really do not know why ads do not show up on the phone!

    help is needed!
     
  9. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @subba, TTS has no voice choices on Android as of now.


    @pretender, can you include the full, unfiltered log so I can see all the details?
     
  10. pretender

    pretender

    Joined:
    Mar 6, 2010
    Posts:
    865
    here is the attached log, take a look. i was going through it and this seems problematic:

    W/webcore ( 4329): Can't get the viewWidth after the first layout
    I/Ads ( 4329): onReceiveAd()
    D/Prime31 ( 4329): adView: onReceiveAd
    W/Ads ( 4329): Not enough space to show ad! Wants: <480, 75>, Has: <480, 60>

    there are more message before and after this, take a look please and help me resolve this!

    thanks!
     

    Attached Files:

    • $log.txt
      File size:
      16.4 KB
      Views:
      842
  11. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @pretender, are you taking the screen density into account when positioning the banner? What does your createBanner call look like?
     
  12. pretender

    pretender

    Joined:
    Mar 6, 2010
    Posts:
    865
    here is the script attached to the AdMobAndroidBanner (i did not temper with this, it is default):


    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4.  
    5. public class AdMobAndroidAdapter : MonoBehaviour
    6. {
    7. #if UNITY_ANDROID
    8.     public string adMobPubliserId;
    9.     public string[] testDevices;
    10.    
    11.    
    12.     void Start()
    13.     {
    14.        
    15.         AdMobAndroid.init(adMobPubliserId);
    16.        
    17.         //PUT HERE TEST DEVICES
    18.         AdMobAndroid.setTestDevices(testDevices);
    19.        
    20.         var density = AdMobAndroid.getScreenDensity();
    21.         //Debug.Log(density.ToString());
    22.        
    23.         // center the banner.  this is a basic setup with centered banners
    24.         if(isTablet()){
    25.             AdMobAndroid.createBanner( AdMobAndroidAd.tablet468x60, ( Screen.width / 2 ) - 234 * density, Screen.height-60 );
    26.         }else{
    27.             AdMobAndroid.createBanner( AdMobAndroidAd.phone320x50, ( Screen.width / 2 ) - 160 * density, Screen.height-60);
    28.         }
    29.     }
    30.  
    31.    
    32.     bool isTablet()
    33.     {
    34.         // check for tablet sized screens
    35.         if( Screen.width >= 1000 || Screen.height >= 1000 ){
    36.             return true;
    37.         }else{     
    38.             return false;
    39.         }
    40.     }
    41. #endif
    42. }
     
  13. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @pretender, you used the banner height directly without multiplying by density. It should be: Screen.height - ( 60 * density ). For testing, I usually recommend using 0, 0 as the anchor as well just to ensure the ads are flowing.

    Also, watch out with your tablet checker. The Samsung Super Duper Nexus Galaxy Solar System X 2 (or whatever they call that thing) has a 1024 screen which will show up as a tablet for you with that checker.
     
  14. pretender

    pretender

    Joined:
    Mar 6, 2010
    Posts:
    865
    that's right i managed to make it work properly, thank you!
     
  15. akwok

    akwok

    Joined:
    Apr 21, 2009
    Posts:
    31
    Hello, my chartboost offerwall doesn't show with full screen, it is especially odd if the device has a big screen, is it normal?
     
  16. JohnLeeroy

    JohnLeeroy

    Joined:
    Jun 8, 2011
    Posts:
    68
    Hey Prime31,

    Does your Social Networking Plugin (Twitter) listen to whether the post has been successful? I want to give players visual feedback when their messages are posted.

    Thanks.
     
  17. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @akwok, have you setup your offers in the ChartBoost web portal?

    @John, the plugin fires events for all async tasks that you can listen to
     
  18. akwok

    akwok

    Joined:
    Apr 21, 2009
    Posts:
    31

    Thanks, i do have offers in my offerwall, just my offerwall doesn't show up with a full screen. This can be set in the portal too?
     
  19. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @akwok, do you have a screenshot you can post so that I can see what it looks like? Also, what device are you testing on?
     
  20. pong

    pong

    Joined:
    Nov 22, 2011
    Posts:
    10
    hello ! I have some questions about W3i plugin
    when i open the app few sec , the w3i have a null pointer in onRedeem function

    here is the log


    W/System.err( 8369): java.lang.NullPointerException
    W/System.err( 8369): at com.prime31.W3iPlugin.onRedeem(W3iPlugin.java:206)
    W/System.err( 8369): at com.w3i.offerwall.task.RedeemCurrencyTask.onPostExecute(RedeemCurrencyTask.java:160)
    W/System.err( 8369): at com.w3i.offerwall.task.RedeemCurrencyTask.onPostExecute(RedeemCurrencyTask.java:1)
    W/System.err( 8369): at android.os.AsyncTask.finish(AsyncTask.java:590)
    W/System.err( 8369): at android.os.AsyncTask.access$600(AsyncTask.java:149)
    W/System.err( 8369): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:603)
    W/System.err( 8369): at android.os.Handler.dispatchMessage(Handler.java:99)
    W/System.err( 8369): at android.os.Looper.loop(Looper.java:132)
    W/System.err( 8369): at android.app.ActivityThread.main(ActivityThread.java:4025)
    W/System.err( 8369): at java.lang.reflect.Method.invokeNative(Native Method)
    W/System.err( 8369): at java.lang.reflect.Method.invoke(Method.java:491)
    W/System.err( 8369): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
    W/System.err( 8369): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
    W/System.err( 8369): at dalvik.system.NativeStart.main(Native Method)
     
  21. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @pong, are you calling init first? Have you generated a custom manifest using the prime31 menu? If you have done both of them can you send your W3i info to me (questions (at) prime31.com) so I can catch it in the debugger?
     
  22. pong

    pong

    Joined:
    Nov 22, 2011
    Posts:
    10
    which W3i info? can tell more detail about what i have to give u? thx
     
  23. akwok

    akwok

    Joined:
    Apr 21, 2009
    Posts:
    31
    oh sorry, i mean w3i offerwall, not chartboost :p
     
  24. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @pong, the info you pass to the init method.
     
  25. Default117

    Default117

    Joined:
    Mar 13, 2011
    Posts:
    134
    // Edit
    Found the solution, for anyone else having the same problem read the bottom of the post.

    Hi Mike,

    I have a problem regarding your Recording plugin which i just purchased for Android.

    I've tried implementing the system into my app, and i've also tried running an unaltered version of your demo with the same error:


    Code (csharp):
    1. I/Unity   (16756): Recording to filename: audioFile36.wav
    2. I/Unity   (16756): UnityEngine.Debug:Internal_Log(Int32, String, Object)
    3. I/Unity   (16756): UnityEngine.Debug:Log(Object)
    4. I/Unity   (16756): AudioRecorderUIManager:OnGUI() (at /Users/projectname/Assets/Plugins/AudioRecorderAndroid/testSupport/AudioRecorderUIManager.cs:33)
    5. I/Unity   (16756):  
    6. I/Unity   (16756): (Filename: /Users/projectname/Assets/Plugins/AudioRecorderAndroid/testSupport/AudioRecorderUIManager.cs Line: 33)
    7. I/Unity   (16756):
    8. I/Unity   (16756): startRecordingFailedEvent: AudioRecord initialization failed
    9. I/Unity   (16756): UnityEngine.Debug:Internal_Log(Int32, String, Object)
    10. I/Unity   (16756): UnityEngine.Debug:Log(Object)
    11. I/Unity   (16756): AudioRecorderAndroidEventListener:startRecordingFailedEvent(String) (at /Users/projectname/Assets/Plugins/AudioRecorderAndroid/AudioRecorderAndroidEventListener.cs:31)
    12. I/Unity   (16756): AudioRecorderAndroidManager:startRecordingFailed(String) (at /Users/projectname/Assets/Plugins/AudioRecorderAndroid/AudioRecorderAndroidManager.cs:31)
    13.  
    So it keeps on saying that "AudioRecord initialization failed", what exactly does this mean? I've followed the plugin documentation and all it says is to simply call the record method with a desired filename.
    Is there a restriction on devices? I'm testing on a Nexus S, i'm assuming that since it has a phone it has a microphone and should have no problems with this.

    Thanks.


    /// Edit.

    Seems like the issue was the manifest.xml which im assuming was not permitting microphone access.
     
    Last edited: Jan 16, 2012
  26. Bigshoes

    Bigshoes

    Joined:
    Aug 3, 2010
    Posts:
    69
    Do you have update notes for the plugins? I noticed the IAB plugin has been updated, but just curious as to what was changed?

    Cheers.
     
  27. Default117

    Default117

    Joined:
    Mar 13, 2011
    Posts:
    134
    Another question for the android recorder!
    It seems that the recorder plugin consistently stores the files it records onto the root of the sd card. I always get the callback to result in something like:
    file:///mnt/sdcard/audioFile2.wav
    is there anyway to record the file in the persistent data folder? Like such:
    file:///mnt/sdcard/Android/data/com.CompanyName.ProductName/files/audioFile2.wav

    I've tried something like this:
    Code (csharp):
    1.  
    2. var filepath = "file://" + Application.persistentDataPath + "/01.wav";
    3. AudioRecorderAndroid.startRecording( filepath );
    4. ...
    5. AudioRecorderAndroid.stopRecording();
    6. ...
    7. StartCoroutine( AudioRecorderBinding.loadAudioFileAtPath( filepath, onError, onSuccess ));
    8.  
    But it still returns where it has saved to a wav file directly onto the sdcard.
     
  28. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @Cleyden, if anything major changes (bug fixes, new features, erc) we send an email out, for minor changes we post to Twitter (@prime_31). The IAB Plugin update has no changes of value. It was just internal housekeeping (added some internal comments/docs and refactored some names)


    @Default, you can use File.Move to save the files anywhere you want after the callback fires.
     
  29. Default117

    Default117

    Joined:
    Mar 13, 2011
    Posts:
    134
    Thanks for that. Will give it a shot!
     
  30. akwok

    akwok

    Joined:
    Apr 21, 2009
    Posts:
    31
    we are using w3i android plugin, and sometimes get the following bug:

    Code (csharp):
    1. java.lang.NullPointerException
    2. at com.prime31.W3iPlugin.onRedeem(W3iPlugin.java:206)
    3. at com.w3i.offerwall.task.RedeemCurrencyTask.onPostExecute(RedeemCurrencyTask.java:160)
    4. at com.w3i.offerwall.task.RedeemCurrencyTask.onPostExecute(RedeemCurrencyTask.java:1)
    5. at android.os.AsyncTask.finish(AsyncTask.java:417)
    6. at android.os.AsyncTask.access$300(AsyncTask.java:127)
    7. at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:429)
    8. at android.os.Handler.dispatchMessage(Handler.java:99)
    9. at android.os.Looper.loop(Looper.java:123)
    10. at android.app.ActivityThread.main(ActivityThread.java:4627)
    11. at java.lang.reflect.Method.invokeNative(Native Method)
    12. at java.lang.reflect.Method.invoke(Method.java:521)
    13. at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
    14. at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
    15. at dalvik.system.NativeStart.main(Native Method)
    we have already used the init function, any clue? thanks
     
  31. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @akwok, if it is reproducible can you send your init call my way (questions at prime31.com)? That null pointer appears to be what is supposed to be a List of Balances. It would be a bug that the W3i folks would want to fix if they are sending null Lists of Balances.
     
  32. friuns3

    friuns3

    Joined:
    Oct 30, 2009
    Posts:
    307
    is there any on add click event?
     
  33. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
  34. friuns3

    friuns3

    Joined:
    Oct 30, 2009
    Posts:
    307
    That why i asking, because i didn't found it there. So there is no way to detect if Banner Clicked?
     
  35. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @friuns, those are all the events they send off
     
  36. friuns3

    friuns3

    Joined:
    Oct 30, 2009
    Posts:
    307
    ok then i have to look for another plugin, i dont buy this.
     
  37. Alessaint

    Alessaint

    Joined:
    Mar 21, 2011
    Posts:
    43
    Hi Prime,

    I'm trying to get AdMob to work but the even the supplied testing scene crashes when pressing Set Test Devices button. In logcat it shows this


    W/dalvikvm(22143): JNI WARNING: expected return type 'L'


    I guess it's some problem in this

    Code (csharp):
    1.  
    2. var method = AndroidJNI.GetMethodID( _admobPlugin.GetRawClass(), "setTestDevices", "([Ljava/lang/String;)V" );
    3.  
    but I'm not sure what to do about it... Thanks.
     
  38. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @Alessiant, if you skip out on calling setTestDevices does it work? Does that line crash on all of your test devices? Can you send over the make/model of your test devices? We've run that code on lots of devices and it is a very basic JNI call. I can't see any reason that it might crash...
     
  39. Alessaint

    Alessaint

    Joined:
    Mar 21, 2011
    Posts:
    43
    Thanks for your reply, Prime.

    This happens on quite old LG Optimus One (P500) - on Monday I'm gonna test it on Xoom and Asus Transformer. Calling setTestDevices crashes the app, calling other methods does not - I don't see them do anything noticeable, no banner is created etc. but I'm yet to check the logcat more thoroughly if this isn't cause by something on my side.
     
    Last edited: Jan 28, 2012
  40. Alessaint

    Alessaint

    Joined:
    Mar 21, 2011
    Posts:
    43
    Now that's really strange... I've got to test it on Motorola Xoom (with the Android 4.0 update) and it works flawlessly...
     
  41. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @Alessient, the logcat logs will always let you know if there was no fill or I there was any other expected errors. A good debugging aide is to use the demo scene and watch the logs as it will dump every event that fires to the log
     
  42. ayesha

    ayesha

    Joined:
    Feb 2, 2012
    Posts:
    2
    hello , im new to w3i ...
    i downloaded sample app (Publisher) ios from:

    https://associate.w3i.com/integration/index.html

    and integrated it in my app.
    it works fine But when i changed my app ID it was enable to display currency and apps ..

    can anyone tell that what else i have to do for this integration?
    how to add and display currency???
    and how to display apps ?

    i haven't done unity integration yet . is that the reason that it doesn't shows apps and currency ??

    plz need your help...
     
  43. vaclav87

    vaclav87

    Joined:
    Sep 12, 2011
    Posts:
    4
    hello, is there any way to preserve aspect ratio of image when loading it with promptForPictureFromAlbum ?
     
  44. Alessaint

    Alessaint

    Joined:
    Mar 21, 2011
    Posts:
    43
    Hi Prime,

    I have tested the problem I mentioned above - I'm getting this

    Code (csharp):
    1.  02-03 12:59:41.965: W/dalvikvm(11907): JNI WARNING: expected return type 'L'
    2. 02-03 12:59:41.965: W/dalvikvm(11907):              calling Lcom/prime31/AdMobPlugin;.setTestDevices ([Ljava/lang/String;)V
    3. 02-03 12:59:41.965: W/dalvikvm(11907):              in Lcom/unity3d/player/UnityPlayer;.nativeRender ()Z (CallObjectMethodA)
    while setting testing device in admob and now I'm now pretty sure that it has to do something with building with Development Build flag on.

    I have been able to test it on several devices and it's alwas the same:

    * I create a new empty project
    * import AdMob package
    * setup publisher id and device id in AdMobUIManager
    * build

    if it's a release build it works as expected. If I check Development Build in Unity Build Settings then the application crashes with the mentioned error when trying to set up the testing device. Could you please check if it happens to you too? I'm using the the Unity3.5 RC2 and up-to-date Android SDK.

    Thanks.
     
    Last edited: Feb 3, 2012
  45. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @vaclav, passing in 0 for width/height will return the image as is.


    @Alessiant, I can't repro that on the devices I have with me but I'll check it on the rest of my test devices later today.
     
  46. synapsemassage

    synapsemassage

    Joined:
    Jul 27, 2009
    Posts:
    334
    Hi Prime,

    I'm using your mopub plugin. And I'm wondering if the custom banner size available through the mopubs web interface is available or will be available in the near future as another enum in the plugin? Currently the plugin seems to support only 4 sizes. I would like to use banners in ipad's portrait mode, unfortunately banner size don't include 768x90 nor 768x66 only 728x90. Did I miss something here?
     
  47. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @synapsemassage, the plugin provides every available ad size that the MoPub SDK has. The enum on the Unity side matches directly to all the available values on the native side.
     
  48. synapsemassage

    synapsemassage

    Joined:
    Jul 27, 2009
    Posts:
    334
    I see. Thanks. The MPConstants.h offers only 4 sizes while the mopub's web page offers at least six ad formats plus custom sizes. Seems their page doesn't match the SDK. Weird. Or I misunderstood something in their concept.
     
  49. Seifer

    Seifer

    Joined:
    Apr 18, 2008
    Posts:
    18
    Hi Prime31,

    I'm using Facebook plugin and getting the next exception after update to Unity 3.5 in development build
    Code (csharp):
    1. W/dalvikvm(  775): JNI WARNING: expected return type 'L'
    2. W/dalvikvm(  775):              calling Lcom/prime31/FacebookPlugin;.showLoginDialog ([Ljava/lang/String;)V
    3. W/dalvikvm(  775):              in Lcom/unity3d/player/UnityPlayer;.nativeRender ()Z (CallObjectMethodA)
    Looks like the same issue as Alessaint has.
     
  50. Seifer

    Seifer

    Joined:
    Apr 18, 2008
    Posts:
    18
    Last edited: Feb 22, 2012