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. Dismiss Notice

Fullscreen game for phones with screen brove

Discussion in 'Android' started by JustKolyas, Sep 25, 2018.

  1. JustKolyas

    JustKolyas

    Joined:
    Jan 10, 2017
    Posts:
    6
    Hello i have MI 8 phone, and i want to know how to open app in fullscreen, because unity add black bar in top of the screen, but PUBG runs in trully fullscreen.
    AspectRatio - variable in player settings does not help.
    In second screenshoot we can see a fullscreen PUBG and in last black bar in Asphalt 9
    First screen is my game


     
  2. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    824
    Hi, do you use the internal build system? If so, does the black bar disappear if you build with gradle?
    Also when you build the apk, check the final manifest to make sure that the aspectratio is specified in there (if you set it in editor).
     
  3. JustKolyas

    JustKolyas

    Joined:
    Jan 10, 2017
    Posts:
    6
    Yep, i'm using gradle build system and
    android:maxAspectRatio="3"
    is specified
    What im doing wrong?
    Code (CSharp):
    1. <?xml version="1.0" encoding="utf-8"?>
    2. <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.unity3d.player" xmlns:tools="http://schemas.android.com/tools" android:installLocation="preferExternal">
    3.   <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
    4.   <application android:theme="@style/UnityThemeSelector" android:icon="@drawable/app_icon" android:label="@string/app_name" android:isGame="true" android:banner="@drawable/app_banner">
    5.     <activity android:label="@string/app_name" android:screenOrientation="sensorLandscape" android:launchMode="singleTask" android:maxAspectRatio="3" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density" android:hardwareAccelerated="false" android:name="com.mcr.game.UnityPlayerActivity">
    6.       <intent-filter>
    7.         <action android:name="android.intent.action.MAIN" />
    8.         <category android:name="android.intent.category.LAUNCHER" />
    9.         <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
    10.       </intent-filter>
    11.       <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
    12.     </activity>
    13.     <meta-data android:name="unity.build-id" android:value="e3c83ffd-e595-4b03-95b2-b627d2179130" />
    14.     <meta-data android:name="unity.splash-mode" android:value="0" />
    15.     <meta-data android:name="unity.splash-enable" android:value="True" />
    16.   </application>
    17.   <uses-feature android:glEsVersion="0x00020000" />
    18.   <uses-permission android:name="android.permission.INTERNET" />
    19.   <uses-feature android:name="android.hardware.touchscreen" android:required="false" />
    20.   <uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false" />
    21.   <uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false" />
    22. </manifest>
     
  4. Evaldas_Unity

    Evaldas_Unity

    Unity Technologies

    Joined:
    Jun 23, 2016
    Posts:
    69
    Hi JusKolyas, could you submit a bug report with your project and let me know the case number? I want to make sure I am running as close of a setup to yours as possible.

    EDIT: Nevermind, managed to reproduce on Xiaomi Redmi 6Pro and reported it : )
     
    Last edited: Sep 26, 2018
  5. rjonaitis

    rjonaitis

    Unity Technologies

    Joined:
    Jan 5, 2017
    Posts:
    115
    Hi JusKolyas, note that your device is running Android 8.1, notch support on pre Android 9 is entirely dependent on manufacturer.
    In this case for Xiaomi phones try adding to your android manifest:
    <meta-data android:name="notch.config" android:value="portrait|landscape"/>

    For Huawei phones it would be
    <meta-data android:name="android.notch_support" android:value="true"/>
     
  6. jesenzhang

    jesenzhang

    Joined:
    Jul 18, 2017
    Posts:
    14
    hi,I added this to my android manifest,and it works for android O ,but failed for android P, how can I make it work on android P?
     
  7. rjonaitis

    rjonaitis

    Unity Technologies

    Joined:
    Jan 5, 2017
    Posts:
    115
    Hi, Unity 2018.3 has a player settings option "Render outside safe area", enable it and it will take care of settings for android P and manifest settings for android O as well.
     
  8. jesenzhang

    jesenzhang

    Joined:
    Jul 18, 2017
    Posts:
    14
    I am using Unity 2018.2.0f2, is there a way to do that with it?
     
  9. rjonaitis

    rjonaitis

    Unity Technologies

    Joined:
    Jan 5, 2017
    Posts:
    115
  10. jesenzhang

    jesenzhang

    Joined:
    Jul 18, 2017
    Posts:
    14
    I am using Unity 2018.2.0f2, is there a way to do that with it?
    it is ok now, thank you !