코드로 apk 설치 및 마운트 해제
TEST CODE:
public class TestInstallAPK extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
// this.unInstallFile();
installFile();
}
/**
* install APK code
*/
private void installFile(){
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setAction(android.content.Intent.ACTION_VIEW);
// String type = getMIMEType(f);
// intent.setDataAndType(Uri.fromFile(f), type);
intent.setDataAndType(Uri.parse("file://" + "/sdcard/Android_gc.apk"),
"application/vnd.android.package-archive");
this.startActivity(intent);
}
/**
* uninstall APK code
*/
private void unInstallFile(){
Uri uri=Uri.parse("package:com.gameclient");
Intent intent = new Intent(Intent.ACTION_DELETE,uri);
this.startActivity(intent);
}
}
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
m1 이클립스에 oracle cloud (오라클 클라우드)연결하기m1에는 oracle이 설치되지 않는다.... 큰맘먹고 지른 m1인데 oracle이 설치되지 않는다니... 하지만 이뻐서 용서가 된다. 이거 때문에 웹 개발 국비수업을 듣는 도중에 몇번 좌절하고 스트레스를 크게 받았...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.