2011-12-08 51 views

回答

0

我覺得你不能阻止用戶重新安裝它,但在你的應用程序,你把它檢查數據庫設備ID以前安裝的應用程序,如果你發現了,那麼你禁用應用程序的功能的功能。

+0

我認爲他可以做,但他需要建立一些補丁。首先它會安裝在設備上的應用程序之前,並檢查從數據庫的應用程序的重新安裝檢查。 –

+1

@Last Warrior - 在這種情況下,他必須在安裝了他的應用程序的每個設備上安裝補丁程序,就像沒有安裝其他應用程序一樣。 – user370305

+0

@LastWarrior你知道它很容易讓植根電話擦拭分貝 – ingsaurabh

0

你不能自己卸載應用程序(否則你會看到病毒從頭開始擦除我們的手機),但如果在數據庫中找到設備,仍然可以禁用應用程序。

  • 創建與服務器的連接
  • 詢問是否授權該設備
  • 關閉,如果你不授權
+0

可以存儲什麼獨特的設備ID? – user1087134

0

//使用下面的代碼,查找應用是應用程序安裝或沒有
//你的應用程序包的名稱是唯一的ID

// appUniqueIdStr -package應用程序的名稱

boolean installed = appInstalledOrNot(appUniqueIdStr); 
if(installed){ 
//dont install 
} 
else{ 
//install 
} 


    /** 
    * check app installed or not 
    * @param uri is the package name of the app 
    * @return boolean whether installed or not 
    */ 
    private boolean appInstalledOrNot(String uri) 
    { 
     boolean app_installed = false; 

     ListofAppinMyDevice getmyApp=new ListofAppinMyDevice(); 
     ArrayList<PInfo> apps =getmyApp.getInstalledApps(false); /* false = no system packages */ 
     Log.e("hi", "apps==="+apps.toString()); 
     String uri_app=null; 
     if(uri!=null) 
     { 
      uri_app=uri; 
     } 
     else 
     { 
      uri_app=null; 
     } 

     for (int i = 0; i < apps.size(); i++) 
     { 

      Log.e("pack name", "apps.get(i).pname.==="+apps.get(i).pname.toString()); 

      if(apps.get(i).pname.toString().trim().equalsIgnoreCase(uri_app)) 
      { 
       app_installed=true; 
       Log.v("hi","im inside the loop"); 
       break; 
      } 
     } 

     Log.e("boo", "app_installed==="+app_installed); 
     return app_installed ; 
    } 
相關問題