Important Things To Know About Salesforce MobileSDK & Hybrid Apps (2016)
Table of contents
PROGRAMS NEEDED:
Java 7 or Later (oracle.com/technetwork/java/javase/download..)
Cordova (
npm install -g cordova
)ShellJS Version 0.5.3 (
npm install -g shelljs@0.5.3
)Forcedroid (
npm install -g forcedroid
)(Mac Only) Forceios (
npm install -g forceios
)
ENVIRONMENT VARIABLES:
Add to path variable
Git Bin Path (Example: C:\Program Files\Git\bin)
Gradle Bin Path (Example: C:\Program Files\gradle-2.11\bin)
New Variables
Variable Name
Example Path
JAVA_HOME
JDK Bin Folder (Example: C:\Program Files\Java\jdk1.7.0_79)
ANDROID_HOME
The SDK Folder (Example: C:\Users\User\AppData\Local\Android\sdk)
STEPS TO CREATE A HYBRID APP:
Open command prompt
Forcedroid create
(and follow the onscreen commands like naming the app, Proceed to Step 3 if you have a SENDER_ID error , if no error skip to Step 4)Though you get an error, a cordova project will be created, navigate to that cordova project directory in command prompt and enter the following commands
cordova plugin add phonegap-plugin-push --variable SENDER_ID="1234569"
cordova plugin add
https://github.com/forcedotcom/SalesforceMobileSDK-CordovaPlugin
Import the android directory of the cordova project into android studio.
Build Menu > Clean Project.
That is it. We learnt about the required programs and steps to follow to create hybrid apps using SalesforceMobileSDK.
If you like the content, give it some sharing :)