日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
Android安裝卸載程序具體操作方法解析

對于編程愛好者們來說,Android手機操作系統(tǒng)是一款非常實用的系統(tǒng)。他們可以進行各種Android應用程序的開發(fā)來滿足自的應用需求。在這里我們就先來為大家講解一下有關(guān)Android安裝卸載程序的具體操作步驟。

創(chuàng)新互聯(lián)專注于企業(yè)網(wǎng)絡營銷推廣、網(wǎng)站重做改版、寧化網(wǎng)站定制設計、自適應品牌網(wǎng)站建設、H5場景定制商城網(wǎng)站建設、集團公司官網(wǎng)建設、外貿(mào)營銷網(wǎng)站建設、高端網(wǎng)站制作、響應式網(wǎng)頁設計等建站業(yè)務,價格優(yōu)惠性價比高,為寧化等各大城市提供網(wǎng)站開發(fā)制作服務。

在Android安裝卸載程序的源碼中我們知道:

 
 
 
  1. < activity android:name=".PackageInstallerActivity">   
  2. < intent-filter>   
  3. < action android:name="android.intent.action.VIEW" />   
  4. < category android:name="android.intent.category.DEFAULT" />   
  5. < data android:scheme="content" />   
  6. < data android:scheme="file" />   
  7. < data android:mimeType="application/vnd.android.package-archive" />   
  8. < /intent-filter>   
  9. < /activity>   
  10. < activity android:name=".UninstallerActivity">   
  11. < intent-filter>   
  12. < action android:name="android.intent.action.VIEW" />   
  13. < action android:name="android.intent.action.DELETE" />   
  14. < category android:name="android.intent.category.DEFAULT" />   
  15. < data android:scheme="package" />   
  16. < /intent-filter>   
  17. < /activity> 

因為根據(jù)里面的權(quán)限我們可以 安裝一個程序從sd卡:

 
 
 
  1. String fileName = Environment.getExternalStorageDirectory() 
    + "/myApp.apk";   
  2. Intent intent = new Intent(Intent.ACTION_VIEW);   
  3. intent.setDataAndType(Uri.fromFile(new File(fileName)), 
    "application/vnd.android.package-archive");   
  4. startActivity(intent);  

Android安裝卸載程序的操作中要想卸載一個程序;

 
 
 
  1. Uri packageURI = Uri.parse("package:com.android.myapp");   
  2. Intent uninstallIntent = new Intent
    (Intent.ACTION_DELETE, packageURI);   
  3. startActivity(uninstallIntent);  

默認是不支持安裝非市場程序的 因此判斷一下

 
 
 
  1. int result = Settings.Secure.getInt(getContentResolver(),
     Settings.Secure.INSTALL_NON_MARKET_APPS, 0);   
  2. if (result == 0) {   
  3. // show some dialog here   
  4. // ...   
  5. // and may be show application settings dialog manually   
  6. Intent intent = new Intent();   
  7. intent.setAction(Settings.ACTION_APPLICATION_SETTINGS);   
  8. startActivity(intent);   

Android安裝卸載程序的具體實現(xiàn)方法就為大家介紹到這里。


網(wǎng)站題目:Android安裝卸載程序具體操作方法解析
文章URL:http://www.5511xx.com/article/cciepgg.html