Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

disable nativeactivity

Discussion in 'Android' started by pat_sommer, Aug 17, 2011.

  1. pat_sommer

    pat_sommer

    Joined:
    Jun 28, 2010
    Posts:
    586
    hey everyone,
    im using admob but cant click on the links, some1 told me its a unity bug and i have to edit the manifest so it doesnt use nativeactivity, any help here?

    heres my androidmanifest.xml

    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="keyboard|keyboardHidden|orientation">
    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="keyboard|keyboardHidden|orientation">
    30.         </activity>
    31.         <activity android:name="com.unity3d.player.UnityPlayerNativeActivity"
    32.                   android:label="@string/app_name"
    33.                   android:configChanges="keyboard|keyboardHidden|orientation">
    34.             <meta-data android:name="android.app.lib_name" android:value="unity" />
    35.         </activity>
    36.         <activity android:name="com.unity3d.player.VideoPlayer"
    37.                   android:label="@string/app_name"
    38.                   android:configChanges="keyboard|keyboardHidden|orientation">
    39.         </activity>
    40.  
    41.  
    42.             <!-- ACTIVITIES -->
    43.         <activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation"/>
    44.  
    45.             <!-- META-DATA -->
    46.  
    47.         </application>
    48.  
    49.         <!-- PERMISSIONS -->
    50.     <uses-permission android:name="android.permission.INTERNET" />
    51.     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    52. </manifest>
    53.  
    thanks!
     
  2. NestorAlgieri

    NestorAlgieri

    Joined:
    Sep 11, 2011
    Posts:
    299
    Move the chunk:
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>

    away from UnityPlayerProxyActivity tag

    move it to the inside of tag with name UnityPlayerActivity
     
  3. boxerlin

    boxerlin

    Joined:
    Nov 18, 2010
    Posts:
    11
    When need UnityPlayerProxyActivity to use both UnityPlayerActivity and UnityPlayerNativeActivity ( like Xperia Play ), how to do?

    If use UnityPlayerActivity, the AndroidInput.secondaryTouchEnabled always is false on Xperia Play.
    If use UnityPlayerNativeActivity , the Admob link cant be clicked on Xperia Play.


    Thanks.
     
  4. lyh1

    lyh1

    Joined:
    Jun 30, 2010
    Posts:
    92
    You can modify the native activity so it dont use the admob view.
    In the proxy activity you will need do some check to decide you are going to use the native one or not.
    The draw back is the more devices use the native activity, the less ads income.
     
  5. boxerlin

    boxerlin

    Joined:
    Nov 18, 2010
    Posts:
    11
    Thanks for lyh1 reply!

    I have add some check in the UnityPlayerProxyActivity

    Code (csharp):
    1. if ( model == Xperia Play )  
    2.     use UnityPlayerNativeActivity ( so Admob can not be clicked )
    3. else
    4.     use UnityPlayerActivity
    5.  
    But I wander if I can show Admob on Xperia Play using UnityPlayerNativeActivity ?

    Thanks.
     
  6. lyh1

    lyh1

    Joined:
    Jun 30, 2010
    Posts:
    92
    I try to find why the inputs don't dispatch to views on top of native activity, but I find no answer on google.
    I think this is a limitation of native activity. Any android programming expert can help?
     
  7. rbisso

    rbisso

    Joined:
    Jul 13, 2011
    Posts:
    29
    Hey guys,

    I am running into a similar problem with the Ratrod Studio billing plugin with Xperia Play. I can get either the billing plugin or the secondary touch input to work, but not both. Has anyone discovered a solution for this, yet?