2013-07-05 62 views
0

我想在谷歌播放中上傳Android應用程序(.apk),是否需要在付費應用程序中擁有(.apk)的許可證密鑰。如果是,爲什麼需要它?關於Google Play中的Android應用程序

MyLicenseCheckerCallback拋出它應該實現的錯誤,然後超類型的方法。 它說允許()必須通過一個整數參數,哪個參數應該通過 你可以建議我一些幫助。

private class MyLicenseCheckerCallback implements LicenseCheckerCallback { 
@Override 
public void allow() { 
     if (isFinishing()) { 
         // Don't update UI if Activity is finishing. 
         return; 
} 
// Should allow user access. 
startMainActivity(); 

      } 

@Override 
public void applicationError(ApplicationErrorCode errorCode) { 
    if (isFinishing()) { 
     // Don't update UI if Activity is finishing. 
     return; 
    } 
    // This is a polite way of saying the developer made a mistake 
    // while setting up or calling the license checker library. 
    // Please examine the error code and fix the error. 
    toast("Error: " + errorCode.name()); 
    startMainActivity(); 

} 

@Override 
public void dontAllow() { 
    if (isFinishing()) { 
     // Don't update UI if Activity is finishing. 
     return; 
    } 

    // Should not allow access. In most cases, the app should assume 
    // the user has access unless it encounters this. If it does, 
    // the app should inform the user of their unlicensed ways 
    // and then either shut down the app or limit the user to a 
    // restricted set of features. 
    // In this example, we show a dialogue that takes the user to Market. 
    showDialog(0); 
} 
} 

回答

1

請閱讀這篇文章的原因許可證密鑰需要

https://support.google.com/googleplay/android-developer/answer/186113?hl=ta

,請按照以下步驟來創建一個發佈私有簽名密鑰你有想法:

選擇文件 - >導出

  1. 在彈出窗口中,展開Android並選擇「導出Android」應用程序
  2. 在下一個彈出窗口中,選擇瀏覽按鈕並選擇您需要發佈APK的項目 。
  3. 單擊下一步按鈕。下一組選項用於選擇 現有密鑰庫或創建一個新密鑰庫。選擇創建新密鑰庫 設置您想要保存密鑰庫文件的位置,選擇您自己的密碼 並確認相同。
  4. 下一頁是Key Creation選項集。在此,爲密鑰庫創建一個 別名。再次,選擇一個密碼並確認 相同。以密鑰庫的年數爲單位設置有效性。它必須 至少25年。在此頁面輸入其餘的詳細信息。
  5. 在此嚮導的最後一頁上,選擇要將 APK保存在您的計算機上的位置。

這就是它的全部。

注意:版本簽名密鑰由開發人員創建,而不是由Google爲開發人員創建。這是一個自簽名證書。保持此密鑰安全,並可能在多個位置。如果您無法訪問上述步驟4中創建的簽名密鑰文件,則無法將更新發布到您的應用程序。沒有已知的方法來恢復丟失的密鑰。這同樣適用於您在上述過程中選擇的密碼。不要丟失密鑰文件或密碼。

+0

如何在(.apk)中添加許可證密鑰? –

+0

hai Gaddiel請查看我更新的答案!!!!!! 1 – AndroidEnthusiastic

+0

請確認上述內容。 –

相關問題