Blackberry 10 Platform

This topic explains the prerequisites, the process of including and using Tally Authentication Library in the Blackberry 10 application project, and the available API/methods.

Prerequisites

1. Add images folder to the assets folder of the project.

2. In the <YourAppName>.pro file, add the following statements before include(config.pri) statement:

HEADERS += $$quote(<Path_where_library_is_extracted>/public/TallyLoginScreen.hpp)

HEADERS += $$quote(<Path_where_library_is_extracted>/public/TallyLoginInterface.hpp)

HEADERS += $$quote(<Path_where_library_is_extracted>/public/TallyAppEventHandler.hpp)

HEADERS += $$quote(<Path_where_library_is_extracted>/public/TallyNetworkManager.hpp)

LIBS += -lbbdevice

Note: The path can contain back slashes, but not spaces.

3. Include the following Standard Platform Blackberry Libraries :

o Data Management > Qt XML

o User interface > BlackBerry System

o Communication > Qt Network

o Platform > Qt Core

To add the libraries

1. Right-click the project in Project Explorer.

2. Click Configure.

3. Select Standard Blackberry Platform Library.

Including the Library in Blackberry 10 Project

1. Right-click the project in Project Explorer.

2. Click Configure .

3. Select Add Library.

4. Select External Library, and click Next .

5. Click Browse for Device Library , and select the libTallyLoginAuthentication.a file present in the Device-Debug folder (<Path where library is extracted> \TallyAuthenticationLibrary\Device-Debug).

6. Click Browse for Simulator Library , and select the libTallyLoginAuthentication.a file present in the Simulator-Debug folder (<Path where library is extracted> \TallyAuthenticationLibrary\Simulator-Debug).

7. Click Add , and select the Public folder present in the Tally Authentication Library folder.

8. Click Next , and Finish .

Using the Library in Blackberry 10 Project

1. Include the following statements in the class, where you want to call the login screen:

#include "TallyLoginInterface.hpp"

#include "TallyLoginScreen.hpp"

#include "TallyNetworkManager.hpp"

2. Set the online/offline mode by using the TallyLoginInterface class.

3. Set the developer mode to yes , when the application is in testing phase.

4. Make an object of class TallyLoginScreen.

5. Connect the signals ( authenticationCompletedSignal and CancelButtonPressedSignal ) provided by the authentication library with the required SLOTs, as required.

6. Call the showLoginScreen() function to display the login screen using TallyLoginScreen object.

7. Call the function CloseLoginScreen() from the same TallyLoginScreen object to close the Login screen.

TallyLoginInterface::setOnlineMode(true);

//false can be used if you want library to work in offline mode

TallyLoginInterface::setDeveloperMode( true );

TallyLoginScreen *screen = new TallyLoginScreen();

connect(screen, SIGNAL (authenticationCompletedSignal()), this , SLOT (logincompleted()));

connect(screen, SIGNAL (CancelButtonPressedSignal()), this , SLOT (logincancelled()));

screen->showLoginScreen();

API/Methods Provided

API/Methods

Purpose

void setOnlineMode(boolean)

To set the mode (online/offline) in which the library operates.

If not set by default, the library operates in offline environment.

boolean getOnlineMode()

To get the current mode of the library.

String getTallyNetID()

To get the Tally.NET ID which the library has authenticated, either successfully or unsuccessfully.

String getSessionID()

To get the session ID after successful authentication.

If the authentication is not successful, this method returns null.

int getErrorCode()

To get the error code after unsuccessful authentication.

If the authentication is successful, this method returns 0.

String getErrorDescription()

To get the error description corresponding to the error code, after unsuccessful authentication.

If the authentication is successful, this method returns null.

String getLibraryVersion()

To get the current version of the library.

int getStatus()

To get the status of the authentication done by the library.

0 –  Success 1 –  Failure

void setDeveloperMode(boolean)

To set the developer mode for the library.

In developer mode, the library points to the test server.

boolean isDeveloperMode()

To check whether the library is currently working in developer mode or not.