Is there a way to implement share button that shows external share UI (android default one) and a button that opens up a program at certain page (specifically my app google play page)
I’ve seen a lot of games and apps using this, but they probably were probably using UE4.
Anybody?
Yes but UE4 API does not support that out of the box, you need to code it in java layer then hook it up to C++. Good example is Android MessageBox implmentation in UE4
now to add extra code to java layer you need ■■■ it inside Build\Android\ directory of your project, there hsould be already stuff there
There also one impotent things oyu need to do, in Engine directory Engine\Build\Android\Java theres proguard-project.txt and you need to add -keep to your class on Java side, if you don’t do that Android won’t allow to access those Java function in C++ and you will get crash
If you not aware on how Android works at all, first things first you need to learn about Android intent system, which is a core function to call any actions in Android system, the program selection window is part of it as Android ask you which program to use to execute the action when it has multiple options.
here simple example of text shere intent on java with code that force open of option menu:
Intent sendIntent = new Intent(); //create intent
sendIntent.setAction(Intent.ACTION_SEND); //Set intent type
sendIntent.putExtra(Intent.EXTRA_TEXT, "Put text to shere"); //Set text that gonna be shered
sendIntent.setType("text/plain"); // We sending test so we setting MIME to text
Intent chooserIntent = Intent.createChooser(sendIntent, "Title of selection window goes here"); //creating selection window
chooserIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); //Setting shere profam as new task
GameActivity.Get().getApplicationContext().startActivity(chooserIntent); //lauching selection activity
Remeber to add import com.epicgames.ue4.*; to java file you making
Remeber also to isolate android C++ function call with #if PLATFORM_ANDROID … #end if or else you won’t be able to make PC build of your core (which is needed for editor)