ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • apk install
    Search: 카테고리 없음 카테고리 없음 2011. 2. 22. 01:29

    File apkFile = new File("/sdcard/ap.apk");
    Uri apkUri = Uri.fromFile(apkFile);
    Intent intent = new Intent(Intent.ACTION_VIEW);
    intent.setDataAndType( Uri.fromFile(apkFile), "application/vnd.android.package-archive");
    startActivity(intent);


    public void runExecCommand(String execCommand)
    {
    Process pr  = null;

    try
    {
    Runtime rt=Runtime.getRuntime();
    System.out.println("exec run command ["+execCommand+"]");

    pr=rt.exec(execCommand);
    int exitValue=pr.waitFor(); //실행이 완료될때까지 대기



    if(exitValue==0)
    System.out.println("run");
    else
    System.out.println("not run");

    }
    catch(Exception e)
    {
    System.out.println("Exception moveFileProcess["+e.toString()+"]");
    }
    finally
    {
    if(pr != null)
    {
    pr.destroy ();
    pr = null;
    }
    }
    }

    댓글