2013-07-05 27 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

请确认上述内容。 –

相关问题