Skip to content

Instantly share code, notes, and snippets.

@Androguide
Last active December 24, 2015 10:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Androguide/6786224 to your computer and use it in GitHub Desktop.
Save Androguide/6786224 to your computer and use it in GitHub Desktop.
Snippet to programmatically install an APK on the user's device.
String file = "path/to/the/file.apk";
Intent intent = new Intent( Intent.ACTION_VIEW );
intent.setDataAndType( Uri.fromFile(file), "application/vnd.android.package-archive" );
intent.setFlags( Intent.FLAG_ACTIVITY_NEW_TASK );
getContext().startActivity(intent);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment