apk 설치

카테고리 없음 2013. 1. 11. 12:20
Boolean value = Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState());
if(value){
Log.d("SDCARD", "__________ sd card is exist");
} else {
Toast.makeText(getApplicationContext(), "sd카드가 있어야 설치가 됩니다.", 0).show();
}

URL myFileUrl = null;
try {
            myFileUrl= new URL(fileUrl);
            myFileUrl_Global = new URL(fileUrl); 
} catch (MalformedURLException e) {
            e.printStackTrace();
}

File apkFile = new File(Environment.getExternalStorageDirectory()+ "/ListViewTest.apk");//HelloAndroid.apk
                  Log.d("file", apkFile.toString());
                  Uri apkUri = Uri.fromFile(apkFile);
                  Log.d("uri", apkUri.toString());      
                  try 
                  {
                  Intent intent = new Intent(Intent.ACTION_VIEW);
                  intent.setDataAndType( apkUri, "application/vnd.android.package-archive");
                  startActivity(intent);
                  ListViewActivity.this.finish();
                  
                  
                  
                  }
                  catch (Exception e) 
                  {
                  // TODO: handle exception]
                  Log.d("Exception", e.toString());
                  }



http://www.androidpub.com/1294511


http://neoroid.tistory.com/entry/%EB%8B%A4%EC%9A%B4%EB%A1%9C%EB%93%9C-%EB%B0%9B%EC%9D%80-pdf-%EB%82%98-apk-%ED%8C%8C%EC%9D%BC-%EC%8B%A4%ED%96%89%ED%95%98%EA%B8%B0



http://sdop.egloos.com/3630690

Posted by [czar]
,