Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by FuelDev · Aug 25, 2016 at 11:44 AM · androidpluginpluginsmanifestmetadata

AndroidManifest.xml: meta-data unityplayer.UnityActivity

I've been recently looking at some sample AndroidManifest.xml files for several Unity projects and periodically, some projects have a main app Activity with the following meta-data tag:

<meta-data android:name="unityplayer.UnityActivity" android:value="true" />

Does anyone know what purpose adding that particular meta-data tag does?

Not all sample projects that I've seen have that and the Unity Android plugin documentation makes no reference to it. I haven't been able to find any explanation for it anywhere in my searches online. It just seems to appear. Any ideas? Hoping someone from Unity can chime in :)

Update (2016/08/25): I've done a bit of investigating and it seems to have made it's appearance in the default generated AndroidManifest.xml since Unity 4.3.3f1. By setting the value to "true" it appears to impose a fixed set of attributes/values on the main Activity tag. If the value is "false", or the meta-data tag doesn't exist in the AndroidManifest.xml, then the main Activity tag is left unmodified from the result of merging of the manifest files found within the Assets/Plugins/Android/ folder. This would suggest that it's a toggle for ensuring the necessary attributes are used when a Unity-based Activity (UnityPlayerActivity, UnityPlayerNativeActivity, UnityPlayerProxyActivity) -- not a subclass of one -- is set as the main application Activity. I'm just guessing, of course.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by canyon_gyh · Sep 30, 2018 at 06:56 AM

I guess that control UnityPlayer or UnityPlayer's Child , UnityPlayer can control Android Fragment is closely related

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by julian_cruz · Oct 24, 2018 at 02:45 PM

What it does, it's select the activity to be patched with the following properties.

 android:screenOrientation="fullSensor" android:launchMode="singleTask" 
 android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density" 
 android:hardwareAccelerated="false"

if none activities have this property, the following filter will be by the activity name, trying to find the following matches.

 "com.unity3d.player.UnityPlayerNativeActivity",
 "com.unity3d.player.UnityPlayerActivity",
 "com.unity3d.player.UnityPlayerProxyActivity"

In case of these statements are false, a warning will be thrown with this message with the specific properties required. "Unable to find unity activity in manifest. You need to make sure orientation attribute is set to {0} manually."

keep in mind that you can set the properties manually.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image MechEthan · Sep 05, 2019 at 05:57 PM 0
Share

It's important to note that the patched values are dependent on your Android Player Settings -- for example, it patches in android:screenOrientation="fullSensor" if the Player Setting "Default Orientation" is set to "Auto Rotation", but if you set it to "Portrait" then Unity will patch the activity to have: android:screenOrientation="portrait"

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Android game displays 2 game icons 0 Answers

Problems with Multiple Plugins 1 Answer

PLease help: android plugins manifest woes 2 Answers

Project Tango or Vuforia Android plugin support on Unity for Linux 2 Answers

Too many method references; max is 65536. 4 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges