Is that possible to install an apk file by code ?

i know in the android project we can open a apk file then install it, is that possible in corona sdk?

  1. Intent intent=new Intent();
  2.    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  3.    intent.setAction(Intent.ACTION_VIEW);
  4.    intent.setDataAndType(Uri.fromFile(new File(”your apk path”),“application/vnd.android.package-archive”);
  5.    context.startActivity(intent);

 

In Android, we can open an apk file in the phone’s storage by using the intent.

 

 

 

What I was doing is to download the new version apk from the server and install it. Now I can download a apk to the phone but I can’t install it.

  1. Intent intent=new Intent();
  2.    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  3.    intent.setAction(Intent.ACTION_VIEW);
  4.    intent.setDataAndType(Uri.fromFile(new File(”your apk path”),“application/vnd.android.package-archive”);
  5.    context.startActivity(intent);

 

In Android, we can open an apk file in the phone’s storage by using the intent.

 

 

 

What I was doing is to download the new version apk from the server and install it. Now I can download a apk to the phone but I can’t install it.