Android APK Installation Check installApk(Context context, File file)

Here you can find the source of installApk(Context context, File file)

Description

install Apk

Declaration

public static void installApk(Context context, File file) 

Method Source Code

//package com.java2s;
import java.io.File;

import android.content.Context;
import android.content.Intent;

import android.net.Uri;

public class Main {

    public static void installApk(Context context, File file) {
        Intent intent = new Intent();
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.setAction(android.content.Intent.ACTION_VIEW);
        intent.setDataAndType(Uri.fromFile(file),
                "application/vnd.android.package-archive");
        context.startActivity(intent);// w  w w .  j a v  a2s .  c  om
    }
}

Related

  1. isAppInstalled(Context ctx, String uri)
  2. isApkInstalled(Context context, String packageName)
  3. installApk(Context context, File file)
  4. uninstallApk(Context context, String packageName)
  5. verifySampleSetup(Activity activity, int... resIds)
  6. installWatchapp(final Activity parent, final String pbwFilename, final String appstoreUid)