When installing an app, many times there is a need to show the shortcut Icon on the Android home screen. You can do so in Android by adding the following:

AndroidManifest:


And in your page loaded event for the main view:

var androidApp = applicationModule.android;
var context = utils.ad.getApplicationContext();
var pm = context.getPackageManager();
var i = new android.content.Intent();
i.setClassName(androidApp.packageName, androidApp.startActivity.getClass().getName());
i.setFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK);
i.addFlags(android.content.Intent.FLAG_ACTIVITY_CLEAR_TOP);
var shortcutintent = new android.content.Intent("com.android.launcher.action.INSTALL_SHORTCUT");
shortcutintent.putExtra("duplicate", false);
shortcutintent.putExtra(android.content.Intent.EXTRA_SHORTCUT_NAME,"Name of the App");
var ri = pm.resolveActivity(i, 0);
var iconId = ri.activityInfo.applicationInfo.icon;
var icon = android.content.Intent.ShortcutIconResource.fromContext(context, iconId);
shortcutintent.putExtra(android.content.Intent.EXTRA_SHORTCUT_ICON_RESOURCE, icon);
shortcutintent.putExtra(android.content.Intent.EXTRA_SHORTCUT_INTENT, i);
context.sendBroadcast(shortcutintent);