Show Menu
主题×

Developer quick start

此信息可帮助您了解 BlackBerry 库的实施过程。

获取 SDK

SDK 需要 BlackBerry 10 或更高版本。
在解压缩下载的 SDK 之后,请确认以下文件存在于 AdobeMobile 文件夹中:
  • Device-Coverage/libADBMobileShared.so
  • Device-Debug/libADBMobileShared.so
  • Device-Profile/libADBMobileShared.so
  • Device-Release/libADBMobileShared.so
  • public/ADBMediaAnalytics.hpp
  • public/ADBMediaSharedHeader.hpp
  • public/ADBMediaState.hpp
  • public/ADBMobile.hpp
  • Simulator-Coverage/libADBMobileShared.so
  • Simulator-Debug/libADBMobileShared.so
  • Simulator-Profile/libADBMobileShared.so

将 SDK 添加到您的项目

  1. Right-click on your project and select Configure > Add Library .
  2. Select External library and click Next .
  3. 单击​ 设备库 ​字段旁边的​ 浏览。
  4. Navigate to the ADBMobile-4.0.0BETA-BlackBerry folder.
  5. In the Device-Debug folder, select libADBMobileShared.so and click Open .
  6. 单击​ 模拟器库 ​字段旁边的​ 浏览。
  7. Navigate to the ADBMobile-4.0.0BETA-BlackBerry folder.
  8. In the Device-Debug folder, select libADBMobileShared.so and click Open .
  9. 单击​ 包含文件夹 ​字段旁边的​ 添加。
  10. Navigate to the ADBMobile-4.0.0BETA-BlackBerry folder.
  11. public 文件夹添加到包含项中。
  12. In the ADBMobile-4.0.0BETA-BlackBerry folder, there is a .json config file named ADBMobileConfig.json .
    将该文件复制到项目的根目录。
  13. Right-click on your project and select Refresh .
    The .json file should now be visible in your Project Explorer .
  14. 打开项目的 bar-descriptor.xml 文件。
  15. 在窗口底部选择​ 资产选项卡。
  16. 确认已选择​ (所有配置) ,然后单击窗口的​ 资产部分中的 ​添加文件​
    There is a bug in the QNX Momentics IDE that sometimes prevents those buttons from being visible. If you can't see the buttons, resize the windows until they appear.
  17. Click Workspace.
  18. Find the ADBMobileConfig.json file in your project and click OK .
Your application can import the classes/interfaces from the adobeMobileLibrary.jar library by using #include <ADBMobile.hpp> .

添加应用程序权限

In bar-descriptor.xml in the project directory, add the line <permission>access_internet</permission> , or in the QNX Momentics IDE, select the Internet box on the permissions section of the Application tab.

Update the ADBMobileConfig.json config file

ADBMobileConfig.json 文件包含全局 SDK 设置。您需要更新几个值才能开始使用它。
以下是 ADBMobileConfig.json 文件的示例:
{
    "version" : "1.0",
    "analytics" : {
        "rsids" : "coolApp",
        "server" : "my.CoolApp.com",
        "charset" : "UTF-8",
        "ssl" : true,
        "offlineEnabled" : true,
        "lifecycleTimeout" : 5,
        "privacyDefault" : "optedin",
    }
}

You must at least update the rsids and server parameters. For more details, see Adobe Mobile class and method reference. Adobe Mobile class and method reference
现在,您可以在 BlackBerry 10 应用程序中实施 Analytics。