Sub PlaceShortcut
Dim shortcutIntent As Intent
shortcutIntent.Initialize("", "")
shortcutIntent.SetComponent("package.name/.main") 'replace package.name with your app's package name. The "/.main" will cause Main to be launched
Dim in As Intent
in.Initialize("", "")
in.PutExtra("android.intent.extra.shortcut.INTENT", shortcutIntent)
in.PutExtra("android.intent.extra.shortcut.NAME", "App Name") 'Replace App Name with your app's name
Dim pm As PackageManager
Dim i As Bitmap
i.InitializeMutable(88, 88) 'I found this resolution to work best. Feel free to experiment.
Dim c As Canvas
c.Initialize2(i)
Dim rect As Rect
rect.Initialize(0,0,88,88)
c.DrawDrawable(pm.GetApplicationIcon("package.name"), rect) 'Replace package.name with your app's package name
in.PutExtra("android.intent.extra.shortcut.ICON", i)
in.PutExtra("duplicate", False) 'This line will prevent duplicate shortcuts from being placed on the home screen
in.Action = "com.android.launcher.action.INSTALL_SHORTCUT"
pheune.SendBroadcastIntent(in)
End Sub