I'm so confused with unity classes.jar that contain this three files: UnityPlayerActivity, UnityPlayerNativeActivity, UnityPlayerProxyActivity.
Can you help me to understand how they work? And what function they have?
Why Android can find my plugin if I set the activity to UnityPlayerActivity on manifest via unity editor?
Activities on Android, are like main() function - it's an entry point. It represents a single screen with a user interface just like window or frame where user interacts with an app.
Check it: https://www.tutorialspoint.com/android/android_acitivities.htm https://developer.android.com/reference/android/app/Activity.html
Native activities are activities that will be implemented purely in native code. Android NativeActivity https://developer.android.com/reference/android/app/NativeActivity.html
UnityPlayerActivity - extends Android's Activity.
(deprecated) UnityPlayerNativeActivity - extends NativeActivity.
(deprecated) UnityPlayerProxyActivity - used as a proxy layer to switch automatically between NativeActivity and Activity. And chose one of them.
Starting from Unity 5, the UnityPlayerActivity is a default calling class.
When UnityPlayerActivity is called, it launches UnityPlayer activity which is nothing more than a FrameLayout that holds the SurfaceView where-with the help of OpenGL the actual game or app created in Unity will be drawn later on.
https://android.jlelse.eu/unity-and-android-connecting-the-dots-6368b31e86c5 - highly recommended this article for information how Unity connects to Android.
UnityPlayerNativeActivity was default activity back in Unity 4.5 and 4.6. But has bad implementation issues, so again switched to Activity again.
To check differences between Activity and NativeActivity, check the differences on Android documentation. And next interesting articles:
http://answers.unity3d.com/questions/853012/regarding-unitys-main-android-activity.html
Native Activity vs SDK Activity in terms of U.I
UnityPlayerProxyActivity - is a proxy and was used in Unity 3.x to switch between NativeActivity and Activity depending on device capabilites. But now, it's not used anymore.
https://forum.unity.com/threads/androidmanifest-com-unity3d-player-unityplayerproxyactivity.285973/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With