20110510 Brew工程师培训笔记——第二十章 ILicense 简介

来源:互联网 发布:windows抄袭mac字体 编辑:程序博客网 时间:2024/04/30 09:53

第二十章 ILicense 简介

一、主要内容

(1)Brew 应用的计费方案

(2)ILicense 接口的使用

二、BREW 应用的计费

(1)、演示(Demo option)

(a)、免费

(b)、3 种类型:

1、Number of uses (example: 1-5)

2、Time of Use (example: 1-10 min)

3、Elapsed Time  (1-24 hours)

(2)、包月(Subscription option)

(a)、无限使用

(b)、monthly cost

(c)、date of download is the anniversary date used for the monthly charge

(3)、购买(Purchase option)

(a)、一次下载使用计费

(b)、Broken down into 4 types:

1、Number of Uses (¥1 for 10 uses)

2、Expiration Date (¥3 expires on 6/10/2003)

3、Number of Days (¥1.99 for 3 days)

4、Elapsed Time (¥1 for 15 minutes

(4)、预安装(Preinstall option)

(a)、静态预安装

Can’t get fee from Brew Billing System

(b)、动态预安装

Billing Info can be sent to BDS on use or on power on.

1、Number of Uses (¥1 for 10 uses)

2、Expiration Date (¥3 expires on 6/10/2003)

3、Number of Days (¥1.99 for 3 days)

4、Elapsed Time (¥1 for 15 minutes)

(5)、升级(Upgrade option)

(a)、升级将导致用户额外的费用

Application Upgrade Fee

三、ILicense 接口的使用

(1)、PT_DEMO: 演示版

(2)、PT_PURCHASE: 普通购买版

(3)、PT_SUBSCRIPTION: 订购版

(4)、PT_UPGRADE: 升级

四、计费信息的获得

(1)、LT_NONE 表示许可证不过期, 无相关的值。

(2)、LT_USES 表示许可证在使用应用程序指定的次数后过期, 其值为剩余使用次数。

(3)、LT_DATE 表示许可证在指定日期过期, 其值为过期日期或时间。

(4)、LT_DAYS 表示许可证在下载后数日过期, 其值为过期时间。

(5)、LT_MINUTES_OF_USE 表示许可证在应用程序激活数分钟后过期, 其值为剩余分钟数。

五、按次计费的管理

ILIcense接口提供了3个方法进行管理和维护

(1)、逐一减少应用程序的使用计数 

ILICENSE_DecrementUsesRemaining() 

(2)、逐一增加应用程序的使用计数 

ILICENSE_IncrementUsesRemaining()

(3)、直接设定应用中用户使用次数 

ILICENSE_SetUsesRemaining() 

六、示例程序

licType = ILICENSE_GetInfo(pMe->m_pLicense, &dwLicRemain);

switch(licType)

{

case LT_USES: 

ISHELL_LoadResString(pMe->a.m_pIShell, MYILICENSE_RES_FILE, IDS_LIC_USES, szText, sizeof(szText));  break;

case LT_DATE :

ISHELL_LoadResString(pMe->a.m_pIShell, MYILICENSE_RES_FILE, IDS_LIC_DATE, szText, sizeof(szText)); break;

case LT_DAYS :

ISHELL_LoadResString(pMe->a.m_pIShell, MYILICENSE_RES_FILE, IDS_LIC_DAYS, szText, sizeof(szText)); break;

case LT_MINUTES_OF_USE:

ISHELL_LoadResString(pMe->a.m_pIShell, MYILICENSE_RES_FILE, IDS_LIC_MINUTES, szText, sizeof(szText)); break;

default:

}

七、本章关键点

(1)Brew 应用的计费方案

(2)ILicense 接口的使用

八、问题回顾

(1)、定价类型的种类有那些?

(2)、通过ILicense接口能够获得所有的计费信息么?

(3)、如何用ILicense接口实现内容计费?

原创粉丝点击