Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
This post has been wikified, any user with enough reputation can edit it.
avatar image
2
Question by ayyappa · Dec 12, 2014 at 12:37 PM · androidplugin

Regarding Unity's Main Android Activity

I saw three classes(UnityPlayerNativeActivity, UnityPlayerActivity, UnityPlayerProxyActivity) which are being referred when writing plugins for Android. Even unity's documentation mentioned two classes (UnityPlayerNativeActivity, UnityPlayerActivity) with out mentioning the differences. [http://docs.unity3d.com/Manual/PluginsForAndroid.html]

However, Once I see the .java files came up with the Unity app, I see UnityPlayerActivity termed as deprecated. So Can I expect only to refer and extend "UnityPlayerNativeActivity" from now on when writing plugins?

Can anyone please confirm on this? Very much thankful to anyone who helps.

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

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Yury-Habets · Dec 12, 2014 at 06:27 PM

This is a good question.

In 4.5 and 4.6, UnityPlayerNativeActivity is the default activity. In 5.0, starting from b12, UnityPlayerActivity is back and again the default activity.

The difference is simple - UnityPlayerNativeActivity extends NativeActivity, while UnityPlayerActivity extends Activity :)

Hope that helps>

Comment
Add comment · Show 8 · 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 ayyappa · Dec 12, 2014 at 06:30 PM 0
Share

Hi thanks for the answer. but UnityPlayerActivity is extending UnityPlayerNativeActivity :|

Im using 4.6 unity btw. Please update your answer after cross checking once.

avatar image Yury-Habets ♦♦ · Dec 12, 2014 at 06:46 PM 0
Share

I thought I'm giving you some useful insight into how this will look like in 5.0...

In 4.5 and 4.6 for backwards compatibility UnityPlayerActivity is extending UnityPlayerNativeActivity. So if some pre-4.3 projects are using UnityPlayerActivity, they will still work but in fact use the native activity.

In 5.0, we plan to get back to Java activity ins$$anonymous$$d of native activity, meaning that UnityPlayerActivity which extends Activity will be the default one.

avatar image ayyappa · Dec 12, 2014 at 06:58 PM 0
Share

Thanks for the update Yury. So If im writing a plugin which will be distributed to others, which class file I need to extend?

avatar image liortal · Dec 14, 2014 at 10:38 AM 0
Share

@Yury - is there any benefit from deriving one over or the other when creating a custom activity for our game?

avatar image Yury-Habets ♦♦ · Dec 14, 2014 at 11:09 AM 0
Share

@liortal, we don't see a clear benefit of native activity vs. Java activity as for now. It uses different input techniques, and native activity has more (let's say) compatibility issues - this is the reason why we switched to Java activity. I would say - use a Java activity if possible. For more recommendations, please refer to Google documentation.

Show more comments

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Turn your Android device webcam (Camera) , flash light 3 Answers

android - native twitter connect 0 Answers

FileNotFoundException: Could not find file MyProject\Temp\StagingArea\AndroidManifest.xml 0 Answers

How to access an Android native plugin in unity ? 0 Answers

Android Permissions API Version 1 Answer


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