By default iOS is providing \"Share appname\" option in the shortcut options,when the app is downloaded from the app store.
Refer the image belo
You can use App shortcuts
but the main disadavtange of this option is that it is available from Oreo and above version of android
Here is the sample code
Create a resource file:
res/xmldirectory (Screenshot)
Now you need to register your shortcut in your manifest file under activity tag
Now create a simple share acivity to share your app link
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
public class ShareActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT,
"Hey check out my app at: https://play.google.com/store/apps/details?id=neel.com.demo");
sendIntent.setType("text/plain");
startActivity(sendIntent);
finish();
}
}
OUTPUT
When user long press on app icon your shortcut will display like below image
after click of shortcut
UPDATE use android:excludeFromRecents="true" in your ShareActivity