如何使用ServerManagedPolicy拉特? [英] How to use the ServerManagedPolicy lvl?

查看:162
本文介绍了如何使用ServerManagedPolicy拉特?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在关注的developer.android.com的网页。 HTTP: //developer.android.com/guide/publishing/licensing.html#lc-lcc 关于使用ServerManagedPolicy型牌的方向。我已经添加了谷歌市场许可包到我的应用程序库,我已经列入本code在我的onCreate方法:

I've been following the developer.android.com page http://developer.android.com/guide/publishing/licensing.html#lc-lcc for directions on using the ServerManagedPolicy type licensing. I've added the Google Market Licensing Package to my application as a library, and I've included this code in my onCreate method:

String deviceId = Secure.getString(getContentResolver(), Secure.ANDROID_ID);
mLicenseCheckerCallback = new MyLicenseCheckerCallback();
mChecker = new LicenseChecker(this, new ServerManagedPolicy  this, 
           new AESObfuscator(SALT, getPackageName(), deviceId)),               
           BASE64_PUBLIC_KEY);

在这一点上我觉得说明混乱。大部分的网站上的样品code,其余的似乎是开发StrictPolicy或自定义策略。该库提供的例子也似乎是一个自定义的策略。

At this point I find the instructions confusing. Much of the rest of the sample code on the website appears to be for developing a StrictPolicy or a custom Policy. The example supplied with the library also appears to be for a custom Policy.

如何的网站code很多是需要使用的ServerManagedPolicy库?例如,图书馆没有附带任何资源,但该网站$ C $下doCheck呼叫按钮和文本组件。我添加doCheck code,使窗口小部件,或者如果使用该库是这种不必要的?

How much of the website code is required to use the ServerManagedPolicy library? For example, the library did not come with any resources, yet the website code for doCheck calls a button and text widget. Do i add the doCheck code and make widgets, or is this unnecessary if using the library?

有没有在应用程序中使用的ServerManagedPolicy库,做的东西比检查许可证等的例子吗?

Is there an example of the ServerManagedPolicy library used in an application that does something other than check a license?

推荐答案

有一个示例项目,演示如何做到这一点在你的Andr​​oid SDK文件夹:

There is a sample project that shows how to do this in your android sdk folder:

C:\ Program Files文件\机器人\ Android的SDK-WINDOWS \演员\谷歌\ market_​​licensing \样品

C:\Program Files\Android\android-sdk-windows\extras\google\market_licensing\sample

它显示了如何实现serverManagedPolicy的用法:

It shows how to implement the usage of the serverManagedPolicy:

 mChecker = new LicenseChecker(
        this, new ServerManagedPolicy(this,
            new AESObfuscator(SALT, getPackageName(), deviceId)),
        BASE64_PUBLIC_KEY);

您基本上可以忽略所有的doCheck()方法中的小部件调用和修改,并且完全集中于最后一行,这就是:

You can basically ignore all of the widget calls and modifications in the doCheck() method and focus entirely on the last line, which is:

mChecker.checkAccess(mLicenseCheckerCallback);

这行是实际激发LicenseChecker类转化为行动....在doCheck()方法,一切只是禁用按钮和设置上的不必要的部件文本(你的情况)。

This line is what actually fires the LicenseChecker class into action....everything else in the doCheck() method is just for disabling buttons and setting the text on a needless widgets (in your case).

这篇关于如何使用ServerManagedPolicy拉特?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆