Suppose I want to access contacts list, or some other Android API. I know how to that from Android.
How would I proceed to make that from UE4?
Basically, I am trying to do this:
App starts → Actual game starts
App starts → Android business logic → Pass parameters and actual game starts
It is OK if that business logic executes outside of “UE4 framework”, so to speak, and after it is done, continues to UE4.
Generly you should use UE4 APIs as much as oyu can, if you making game you should use Google Play APIs to fetch friend list which you can access from GooglePlayOnlineSubsystem, Google might not like other way of doing it
NDK API should be accessible from C++ (i think this is less invasive solution, if anything you will need to include the include paths in build script. IF you gonna use NDK or any other platfrom APIs you need to enclose it in macro, in case of android it will be
//code that use NDK APIs goes here
Otherwise your code wont build on Windows (this includes editor)
But it seems you can’t access contacts from NDK layer, you can only do so in Java. The java layer of UE4 is inside “Engine\Build\Android\Java” not sure how you can safely modify it but this should give you some hints what to do next.
C++ in UE4 is normal C++, what you doing is you writing extra module (you can even do more then one) to the engine and extending it, so you can do anything that C++ can do. But again use UE4 APIs as much as you can, to ensure that your code will work on any platfrom, use Platfrom/OS APIs only as last resort
Thank you. I did not know I could access NDK directly from UE4. I found out hints here on how to do it with Java: