检测程序是不是被下载过在市场上

try { 
        PackageManager manager = context.getPackageManager();  
        PackageInfo appInfo = manager.getPackageInfo( 
            YOUR_PACKAGE_NAME, PackageManager.GET_SIGNATURES); 
 
        // Now test if the first signature equals your debug key. 
        boolean shouldUseTestServer =  
            appInfo.signatures[0].toCharsString().equals(YOUR_DEBUG_KEY); 
 
    } catch (NameNotFoundException e) { 
        // Expected exception that occurs if the package is not present. 
    } 

 

你可能感兴趣的:(下载)