kony mobilefabric crm quickstart guide
TRANSCRIPT
Kony MobileFabric™
KonyMobileFabric QuickStart Guide Series
Building the KonyMobileFabric CRM Sample App
Release 6.0
© 2014 by Kony, Inc. All rights reserved 1 of 94
Kony MobileFabric CRMQuick Start GuideVersion1.0
Revision History
Date Document Version Description of Modifications/Release
07/03/2015 1.0 Document Released for MobileFabric 6.0.3
© 2014 by Kony, Inc. All rights reserved 2 of 94
Kony MobileFabric CRMQuick Start GuideVersion1.0
Table of Contents
1. Overview 4
1.1 KonyMobileFabric 4
1.2 PhoneGap 5
1.3 MobileFabric CRMSample 5
2. Software Installation and Configuration 7
2.1 Installing and Configuring Node.js 7
3. Installing and Configuring Cordova 13
4. Installing JDK 1.8 15
5. Installing the Android SDK 21
6. Installing Eclipse 32
7. Installing the Eclipse Android Plug-in 37
8. Configuring Back-end Integration Using MobileFabric 45
8.1 MobileFabric Trial Account Creation 45
9. Creating a Salesforce.com Account 47
10. Configuring MobileFabric Server 52
11. Installing the Demo Application 75
© 2014 by Kony, Inc. All rights reserved 3 of 94
1. Overview
This section provides an overview of the KonyMobileFabric, PhoneGap, andMobileFabric CRM
Sample application.
Important: After you set up KonyMobileFabric using AmazonWeb Services (AWS), you can
build your sample application.
For more details on How to set upMobileFabric in AWS, refer to AWSMobileFabric QuickStart
Guide
1.1 Kony MobileFabric
KonyMobileFabric provides enterprise security and complex system integration services and allows
developers to focus on building app experiences. MobileFabric delivers a powerful set of services to
handle identity, integration, orchestration, data sync, andmessaging.When these services are
configured within KonyMobileFabric, they can easily be incorporated into amobile application using
any third-party app development tool with our SDKs or direct REST API interface.
Kony MobileFabric offers five major services:
l Identity: Authenticate and authorize your application users including Salesforce, Active
Directory, SAP, or other third-party identity providers that support Security AssertionMarkup
Language (SAML).
l Integration: Securely connect your application to any back-end data using a variety of
connectors for standard services such asREST, SOAP, and JSON end points and for
enterprise connectors such as Salesforce and SAP. You can also build custom connectors
using Java code to handle any atypical integration requirement.
l Orchestration: Optimize application performance or create new services by building server-side
composite services and workflows including the ability to execute custom business logic.
1. Overview Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 4 of 94
l Sync: Enable applications to work offline by keeping a copy of relational data structures on the
device. Securely synchronize changes between end-user devices and enterprise databases or
web service-enabled systems.
l Messaging: Engage with your users over cross-platform push notifications, SMS, and email.
This service includes the ability to track the effectiveness of messaging campaigns. You can
also collect user information and behavior analytics to enable you to better target messaging
based on user segmentation rules and location defined by geo-boundaries or iBeacons.
1.2 PhoneGap
PhoneGap is a free and open source framework that allows you to createmobile apps using
standardized web APIs for the platforms you care about. To ensure proper stewardship of the source
of PhoneGap, and tomaintain a transparent and open governance that waswell documented and
understood, Adobe/Nitobi donated the PhoneGap codebase to the Apache Software Foundation
(ASF) and was renamed asCordova. Currently PhoneGap is a distribution of Apache Cordova. Think
of Apache Cordova as an engine that powers PhoneGap.
1.3 MobileFabric CRM Sample
TheMobileFabric CRM sample application was developed using the PhoneGap/Cordova APIs and
has the following functionality:
l Ability to connect to MobileFabric instance and authenticate against the Salesforce APIs using
the identity that has been configured in theMobileFabric.
l Ability to invokeMobileFabric services that have been configured. These services in
MobileFabric are configured based on the Salesforce objects and the operations that are
exposed by these objects.
This document captures the details of:
l Software installation and configuration that are needed to executeMobileFabric CRM sample
application. The software programswhose install and configuration are discussed include
Eclipse, Android Development Toolkit (ADT) plug-in, Node.js and Cordova.
1. Overview Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 5 of 94
l Process of creating a Salesforce account and loading the data that is needed to execute the
demo application.
l Creation of MobileFabric trial account.
l Configuration of theMobileFabric CRM sample application on theMobileFabric Server by
creating the identity and integration services.
l Installation and configuration of MobileFabric CRM sample client application in Eclipse.
l Setup of the emulator and execution of theMobileFabric CRM sample client application in the
emulator.
Below are the steps and the order we’ll cover in this QuickStart guide:
1. Installing and configuring Node.js.
2. Installing and configuring Cordova.
3. Installing JDK 1.8.
4. Installing the Android SDK.
5. Installing Eclipse.
6. Installing the Eclipse Android Plug-in.
7. Configuring the Back-end integration usingMobileFabric.
8. Creating a SalesForce.com account.
9. Configuring theMobileFabric Server.
10. Installing the DemoApplication.
1. Overview Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 6 of 94
2. Software Installation and Configuration
This section captures the details of all the software that needs to be installed and configured to run the
MobileFabric CRMSample application.
2.1 Installing and Configuring Node.js
1. Type https://nodejs.org/ in your browser to open the node.js install screen. Click Install.
2. In the screen below, click Run.
2. Software Installation and Configuration Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 7 of 94
3. In theWelcome screen below, click Next.
2. Software Installation and Configuration Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 8 of 94
4. To accept the terms and conditions in the screen below, click Next.
5. Change the location of the install in the Destination Folder screen below if required. By default
the Node.js will install under the Program Files folder.
2. Software Installation and Configuration Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 9 of 94
6. In the Custom Setup screen below, choose all the features to be installed. Click Next to
continue.
2. Software Installation and Configuration Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 10 of 94
2. Software Installation and Configuration Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 11 of 94
7. In the final screen below, click Install, completing the installation.
2. Software Installation and Configuration Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 12 of 94
3. Installing and Configuring Cordova
1. Click the Start button (or theWindows icon in the task bar) and choose All Programs. Scroll
down to choose Node.js > Node.js Command Prompt.
2. In the command prompt window, shown below, type: npm install –g cordova to installs
the Cordova libraries.
3. Test to see if Cordova is installed by typing
Cordova
at the command prompt. The commandwindow below should report the following:
3. Installing and Configuring Cordova Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 13 of 94
3. Installing and Configuring Cordova Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 14 of 94
4. Installing JDK 1.8
1. Type http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-
2133151.html in your browser.
2. Click on Accept Licence Agreement” under Java SE Development Kit 8u45,” shown below.
3. Next, in the screen below, click the Accept License Agreement option button, and click on jdk-
8u45-windows-x64.exe in the “Download” column to download the JDK for Windows 64 bit.
4. Installing JDK 1.8 Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 15 of 94
4. Installing JDK 1.8 Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 16 of 94
4. In the screen below, click Save to save the file on your localmachine.
5. Click on the “jdk-8u45-windows-x64” file from the install folder to begin the installation
of the JDK.
6. If prompted with screen, requesting tomake changes to the computer, click Yes.
4. Installing JDK 1.8 Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 17 of 94
7. Click Next in the screen below.
8. Choose the default destination folder as shown in the screen below and click Next.
Close the install screen when the installation is complete.
4. Installing JDK 1.8 Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 18 of 94
9. You can check if the correct version of the JDK installed by opening aWindowsCommand
Prompt window typing the command:
Java –version
shown in the screen below. The Java version should be 1.8.
4. Installing JDK 1.8 Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 19 of 94
4. Installing JDK 1.8 Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 20 of 94
5. Installing the Android SDK
1. Type https://developer.android.com/sdk/index.html#Other in your browser. Click on
installer_r24.3.3-windows.exe
5. Installing the Android SDK Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 21 of 94
2. Next, agree to the terms and conditions and click on Download installer_r24.3.3-windows.exe
3. When prompted with a security warning, click on Run, and in the screen below, click Yes.
5. Installing the Android SDK Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 22 of 94
4. Next the SDK installation wizard launches, shown below. Click Next to continue.
A screen that indicates the installed version of the JDK appears, shown below. The version of
the JDK should be the same as the one that you installed earlier.
5. Installing the Android SDK Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 23 of 94
5. Installing the Android SDK Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 24 of 94
5. Choose the Install just for me default option in the screen, shown below.
6. A screen appears that allows you to select the destination folder for the SDK install. Choose the
default location. Click Next to continue.
5. Installing the Android SDK Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 25 of 94
5. Installing the Android SDK Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 26 of 94
7. In the screen that appears, choose the default Start menu folder. Click Install to continue.
5. Installing the Android SDK Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 27 of 94
8. The SetupWizard screen appears. Click Finish.
9. The Android SDK screen appears. Choose the following tools and API versions, shown below.
Click on “Install Packages”.
l Tools:
o Android SDK Tools – 24.1.2
o Android SDK Platform Tools – 22
o Android SDK Build Tools – 21.1.2
5. Installing the Android SDK Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 28 of 94
o Android SDK Build Tools – 20
o Android SDK Build Tools – 19.1
l Android APIs:
o Android 5.0.1 (API 21)
o Android 4.4W.2 (API 20)
o Android 4.4.2 (API 19)
o Android 4.1.2 (API 16)
l Extras:
o Android Support Library 22
5. Installing the Android SDK Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 29 of 94
5. Installing the Android SDK Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 30 of 94
10. In the Choose Packages to Install screen, click Accept to accept the licenses, and click Install.
5. Installing the Android SDK Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 31 of 94
6. Installing Eclipse
1. Type http://www.eclipse.org/downloads/ in your browser and download the Eclipse Luna SR2
(4.4.2) (Eclipse IDE for Java Developers) – 64 bit as shown in the screen below.
6. Installing Eclipse Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 32 of 94
2. In the screen below, click Save to save the zip file.
6. Installing Eclipse Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 33 of 94
3. After the file is saved, right-click on the file and click Extract All.
4. A prompt to Select a Destination and Extract Files appears, shown below. Extract the files
into a folder.
6. Installing Eclipse Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 34 of 94
5. Once the files are extracted, a folder structure appears, shown below. Click on the round,
indigo Eclipse icon to launch Eclipse.
6. Installing Eclipse Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 35 of 94
6. Installing Eclipse Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 36 of 94
7. Installing the Eclipse Android Plug-in
1. Launch Eclipse from the folder where Eclipse was installed by clicking the round, indigo Eclipse
icon, shown below. If a prompt appears asking if you want to run the file, click Run.
2. Select the location of the workspace in the screen below. If needed, you can choose the default
workspace that is prepopulated in the dialog. ClickOK.
7. Installing the Eclipse Android Plug-in Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 37 of 94
3. After Eclipse is launched, click Help and choose Install New Software from the drop-down
menu, shown below. This will allow you to choose the web site to download the plug in.
7. Installing the Eclipse Android Plug-in Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 38 of 94
4. Click Add … in the Available Software screen. The Add Repository window appears.
5. In the Add Repository screen, type ADT Plugin in the Name field. For the Location field, type
https://dl-ssl.google.com/android/eclipse/ and ClickOK.
7. Installing the Eclipse Android Plug-in Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 39 of 94
7. Installing the Eclipse Android Plug-in Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 40 of 94
6. Select the Developer Tools check box to select all six items. Click Next to continue.
7. The Install Details screen appears, shown below. The screen lists all items that are to be
installed. Click Next to continue.
7. Installing the Eclipse Android Plug-in Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 41 of 94
7. Installing the Eclipse Android Plug-in Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 42 of 94
8. The Review Licenses screen appears. Review the licenses and accept the terms. Click Finish.
9. If a security warning is displayed, clickOK.
10. Restart Eclipse if prompted.
7. Installing the Eclipse Android Plug-in Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 43 of 94
11. After Eclipse launches, click onWindows -> Preferences -> Android. The
Preferences screen appears and indicates that the Eclipse Android plug-in is using the Android
SDK that was installed earlier.
7. Installing the Eclipse Android Plug-in Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 44 of 94
8. Configuring Back-end Integration Using MobileFabric
This section captures the details of theMobileFabric trial account creation, Salesforce.com account
creation, and configuration of theMobileFabric Server to invoke the Salesforce.com services.
8.1 MobileFabric Trial Account Creation
1. If you do not have access to a KonyMobileFabricMessaging account on KonyCloud, you can
register for a free trial at http://www.kony.com/trials. When the following screen appears, select
KonyMobileFabric + Kony Studio.
2. Once you click on the Start Your Trial button, you will see the screen below.
Please use your work email for immediate registration approval.
8. Configuring Back-end Integration UsingMobileFabric
Kony MobileFabric CRMQuick StartGuide
Version1.0
© 2014 by Kony, Inc. All rights reserved 45 of 94
Once you activate your account, you will have access to our Cloud Portal at
https://cloud.kony.com that provides documentation, tutorials and support via KonyCommunity.
You will also have access to our KonyCloud Console at https://manage.kony.comwhere you
will manage your KonyMobileFabric services.
8. Configuring Back-end Integration UsingMobileFabric
Kony MobileFabric CRMQuick StartGuide
Version1.0
© 2014 by Kony, Inc. All rights reserved 46 of 94
9. Creating a Salesforce.com Account
1. Type https://www.salesforce.com in the browser. Click on Start Your Free Trial as shown in
the screen below.
2. Enter all the information in the registration form shown in the screen below, and click Start Free
Trial.
9. Creating a Salesforce.com Account Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 47 of 94
After a successful registration, the following screen appears.
9. Creating a Salesforce.com Account Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 48 of 94
4. Next, click on the URL that was sent to your email address used to register the account. A
screen that prompts you to set up a new password appears.
5. To invoke the Salesforce APIs, a security token is needed. Log in to your Salesforce account,
and click onMy Settings, shown below.
9. Creating a Salesforce.com Account Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 49 of 94
6. Click on Reset My Security Token in the Personal section.
7. Click on Reset Security Token. The token is thenmailed to the email account that was used to
create the Salesforce.com account. Save the security token information because it is needed to
configure the client application of the demo.
9. Creating a Salesforce.com Account Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 50 of 94
After the new token is created and emailed, the following screen is displayed.
9. Creating a Salesforce.com Account Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 51 of 94
10. Configuring MobileFabric Server
Before configuringMobileFabric, it is assumed that you have registered with the SalesForce.com
account asmentioned in the earlier section.
1. Typemanage.kony.com in your browser. Enter the user name and password for the cloud
account that has been set up. Click Sign In.
10. Configuring MobileFabric Server Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 52 of 94
2. The following screen appears. Click Apps on the top left corner.
10. Configuring MobileFabric Server Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 53 of 94
3. The applications screen appears. Click on the Custom Apps icon.
4. The following screen appears. Click on Configure new to configure the Identity Service.
10. Configuring MobileFabric Server Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 54 of 94
5. Click on edit (pencil) icon as shown below tomodify the name of the application.
After the name of the application is changed, the following screen displays. In this sample, the
name of the application is “MobileFabricCRMDemo.”
6. Complete the fields in the Identity Configuration screen, shown below. The clientId and
clientSecret that were retrieved by registering with Salesforce.com (asmentioned in the earlier
Salesforce sign-up section) will need to be entered to invoke the APIs that are exposed by
SalesForce.com. Click on Save when done.
10. Configuring MobileFabric Server Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 55 of 94
After the identity service is successfully created, the following screen displays.
10. Configuring MobileFabric Server Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 56 of 94
8. Click on Integration under the Configure section. Click on Configure New to configure new
integration services.
9. Enter the information as shown below for the service definition of Account. The userID and
password are retrieved after registering with Salesforce as discussed. Choose Use Existing
Identity Provider for the AuthenticationType, and select the identity that has been created earlier
10. Configuring MobileFabric Server Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 57 of 94
from the dropdown. Click Save and Continue.
10. Click on the Integration tab and then clickOperation to select the object and operations to be
added. Choose the Account object from the object drop-down list. Choose the Select All option
10. Configuring MobileFabric Server Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 58 of 94
from theOperation drop-down list. Click on Add Operation and then Done.
11. The following screen appears after the operations are added. The next step is to test if the
designated object is configured correctly. Click on getAccount under the Name column.
10. Configuring MobileFabric Server Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 59 of 94
12. Copy the string “SELECT name, type, BillingCity, BillingState, AnnualRevenue, website,
Industry, phone, BillingStreet fromAccount where type!=null” in the Test Value field, shown
below. Click Test. If the query runs successfully, the result of the query execution will appear
on the right (shown below). Click Cancel to exit the screen and perform the configuration of a
10. Configuring MobileFabric Server Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 60 of 94
new service.
13. Configure the service definition of Lead. Click on Configure New in the screen below that allows
you to configure a new service.
14. Complete the fields in following screen. Click Save & Continue. MoblieFabric displays a screen
to choose the operations of the Lead object.
10. Configuring MobileFabric Server Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 61 of 94
15. Select the Lead under the Object column and “getLead” as the operation. Click on Add
Operation and Done.
10. Configuring MobileFabric Server Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 62 of 94
16. Click on “getLead” under the Operation column. Copy “SELECT
ID,NAME,FIRSTNAME,LASTNAME,TITLE,PHONE,EMAIL FROMLead” in the Test value
column. Click Test.
If the configuration is correct, the response will appear on the right.
Click Cancel to display the screen that allows the creation of a new service definition.
10. Configuring MobileFabric Server Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 63 of 94
17. Click on Integration in the screen below to create the service definition of Opportunity.
18. Complete the fields shown below. Click Save and Continue to display the screen to choose the
operations for the Opportunity object.
10. Configuring MobileFabric Server Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 64 of 94
19. In the screen below, choose theOpportunity object and “getOppurtunity” operation. Click Add
Operation.
10. Configuring MobileFabric Server Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 65 of 94
20. In the screen below, click “getOpportunity.” which allows to test the getOpportunity operation
by entering sample query.
10. Configuring MobileFabric Server Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 66 of 94
21. Enter “SELECT name, Amount, CloseDate, Type, LeadSource, StageName,
ExpectedRevenue, Probability fromOpportunity” in the Test Value. Click Test.
10. Configuring MobileFabric Server Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 67 of 94
22. If a response alert is displayed, clickOK. If the configuration is correct, the results will appear on
the right.
Click Cancel to move to the next screen to create the service definition for “Contact” object.
10. Configuring MobileFabric Server Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 68 of 94
23. Click on Configure New in the following screen to create the service definition for Contact, and
display the following screen.
24. Complete the following fields. Click Save and Continue to display a screen to choose the
operations of “Contact” object.
10. Configuring MobileFabric Server Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 69 of 94
25. Select the Contact object from the drop-down list, and choose All Operations. Click Add
Operation to choose the operations needed for the Contact object. And display the screen with
10. Configuring MobileFabric Server Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 70 of 94
all the exposed operations of the Contact object.
10. Configuring MobileFabric Server Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 71 of 94
26. Click getContact in the following screen to test the operation by executing a test query.
27. Enter “SELECT ID,NAME,FIRSTNAME,LASTNAME,TITLE,PHONE,EMAIL FROMContact”
in the “Test Value” column. Click Test. If the configuration is correct, the results display on the
right in the screen below. Click Cancel when done. The screen that allows you to publish the
10. Configuring MobileFabric Server Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 72 of 94
application displays.
28. To publish the application, click Publish on the topmenu. Select the DemoEnvironment, and
click Publish. Once publication is successful, the “Not Published” text below will be updated with
a green “Published” message.
29. After the application is published, click the key symbol next to the environment name. In our
example, the environment name is “DemoEnvironment.” Record the App Key, App Secret,
10. Configuring MobileFabric Server Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 73 of 94
and service URL. You will use those data later to configure the client application.
10. Configuring MobileFabric Server Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 74 of 94
11. Installing the Demo Application
This section discusses the details of the download and configuration of the demo application. You will
also learn how to install of the application on an emulator and an Android device.
Download and Configure the DemoApplication
1. Type https://github.com/kony/KonyMobileFabric_Demo_PhoneGap in your browser. Click on
Download Zip on the right of the screen, shown below. A zip of the application installs.
2. Set the path to the ant bin folder as ant will be used later byCordova to build the platform folder
needed for Android. This path can be set by typing the following in theWindowsCommand
Prompt window where the other Cordova commandswill be run. In the current install, the path
is set as below:
set PATH=%PATH%;C:\EclipseInstall\eclipse-java-luna-SR2-win32-x86_
64\eclipse\plugins\org.apache.ant_1.9.2.v201404171502\bin
11. Installing the Demo Application Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 75 of 94
3. Type the command: “echo %PATH%” to check if the path is set correctly. The path in the
window below shows that the set path command in the previous step was executed correctly.
4. Unzip the Demo_PhoneGap file you downloaded earlier. Open the config.js file that is located
in thekony/www/js folder.
5. Change the Default Username and Default Password tomatch the username and password
that was set up in Salesforce.
11. Installing the Demo Application Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 76 of 94
The AppKey, AppSecret and ServiceURLwill be the same aswhat you saved when the
application is published. The IdentityService, AccountIntegrationService
LeadIntegrationService, ContactIntegrationService andOpportunityIntegrationService will
contain the names of the services as configured in theMobileFabric console.
6. Open aWindowsCommand Prompt window. Navigate to the project folder. In the current
application (the project folder is kony).
11. Installing the Demo Application Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 77 of 94
7. Delete the platforms and plug-ins folders.
8. Add the required plug-ins by typing “cordova plugin add org.apache.cordova.device” and
“cordova plugin add com.kony.sdk.” These commands are to be run from the kony folder,
11. Installing the Demo Application Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 78 of 94
shown below.
9. Add the Android folder under the platforms by typing “cordova platform add [email protected]”
shown in the following screen. Click on the Eclipse icon in the Eclipse install folder as
11. Installing the Demo Application Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 79 of 94
explained in earlier steps.
10. After launching Eclipse, click on File - > Import to display an import screen. Choose Existing
Android Code intoWorkspace. Click Next.
11. Installing the Demo Application Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 80 of 94
11. From the Import Projects screen, browse to the folder where the project was unzipped to
earlier.
11. Installing the Demo Application Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 81 of 94
11. Installing the Demo Application Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 82 of 94
12. Select the Kony folder, and clickOK.
11. Installing the Demo Application Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 83 of 94
13. The Import Projects screen appears with the two projects to be imported. Click Finish.
14. After the project is imported, open theMainActivity.java file under the src folder.
Replace the code inMainActivity.java with the code below. Save the file.
package com.popcorn.kony;
import android.os.Bundle;
import org.apache.cordova.*;
import com.kony.sdk.KonyCordovaHelper;
11. Installing the Demo Application Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 84 of 94
public class MainActivity extends CordovaActivity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
super.init();
// Set by <content src="index.html" /> in config.xml
super.loadUrl(Config . getStartUrl());
KonyCordovaHelper.init(appView, this);
}
}
11. Installing the Demo Application Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 85 of 94
15. Next the application will be installed on an emulator that has to be configured. Click onWindow
-> Android Virtual Device Manager in Eclipse as shown in the screen below.
16. In the Android Virtual DeviceManager screen, click Create. To display all the Android Virtual
Devices that are already configured. You can create new AVDs if needed.
11. Installing the Demo Application Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 86 of 94
17. Enter the AVD name and the details, as shown below, by selecting options from the drop-down
boxes. ClickOK to create the new AVD.
11. Installing the Demo Application Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 87 of 94
11. Installing the Demo Application Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 88 of 94
18. Choose the AVD that was created in the earlier step and click Start. A launch screen displays.
11. Installing the Demo Application Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 89 of 94
19. Click Launch to launch a new AVD instance.
20. Deploy the application in the simulator by right-clicking on Kony, project and choosing Run As -
> Android Application. This launches the application in the emulator and the log-in screen of
11. Installing the Demo Application Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 90 of 94
the application, shown below.
11. Installing the Demo Application Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 91 of 94
21. Click Sign In. The Dashboard screen appears as below.
11. Installing the Demo Application Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 92 of 94
22. Click Contacts to display a list of all contacts.
11. Installing the Demo Application Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 93 of 94
23. Click a specific contact to display related details, shown below.
11. Installing the Demo Application Kony MobileFabric CRMQuick Start GuideVersion1.0
© 2014 by Kony, Inc. All rights reserved 94 of 94