SYSTEM REQUIREMENT
1. Windows Machine
2. Java (Please make sure JAVA_HOME path is set up)
3. Apache Ant
4. Git
5. Eclipse with Android SDK
6. SalesforceMobileSDK-Android
SET UP ANT
1.Download Apache Ant Zip File From http://ant.apache.org/bindownload.cgi
2.Extract Zip to any of your System drive.
3.Set up ANT_HOME.
To check Ant is properly set up go to command prompt ant type ant –version. If it shows version then
ant has been properly set up.
SET UP GIT
- Download git from http://git-scm.com/downloads
- Install git
SET UP ANDROID BUNDLE
- Download Android ADT bundle from http://developer.android.com/sdk/index.html
- Extract the zip file to a Drive in a folder
- This bundle will contain Eclipse with ADT plugin, Android SDK.
- Set up Android SDK. Download Android 2.2. Open Eclipse go to Window - > Android SDK Manager.
- Select Tools, Android 2.2 and all its component Click install packages.
(I have already installed Android 2.2 that is why it is not counting its packages, please don’t be confused)
- Set up Emulator, in Eclipse go to Window -> Android Virtual Device Manager - > New fill all the details
SET UP SALESFORCE MOBILE SDK
Keep clicking “Ok” on all the popups which will pop out.
It will show some Errors please follow these steps.
- Right click on SalesforceSDK go to Android Tools - > Fix project properties.
- Go to project properties -> Android make sure Android 2.2 is checked.
- Now there will be 4 other errors like
- For the first one. Double click the error it will open encryption.java file comment the line no 74 where there is error save it. You will see 2 errors are gone. Now in the same file change Build.VERSION_CODES.HONEYCOMB to Build.VERSION_CODES.FROYO saves.
- SCREENLAYOUT_SIZE_XLARGE double click it, it will open ForceApp.java file change it to SCREENLAYOUT_SIZE_LARGE save now all error are gone, there will be some warnings ignore it.
CREATE A HYBRID APP
HYBRI D LOCAL APP (ALL THE HTML AND JS WILL BE I NSIDE THE APP CONTAI NER)
Open command prompt go to salesforceMobileSDK location type
Ant create_hybrid_local -Dapp.name={appName} -Dtarget.dir={targetDir} Dpackage.name= packageName} [-Duse.smartstore=true]
- appName:-Name of your App
- targetDir:- App location in your system
- packageName:- type some package name for example com.myapp
- smartstore:- if you are creating a app having capability of offline storage make it true or else don’t include it . (Advised that you should not go for offline version at start up) for example in commond prompt
C:\AndroidDev1\SalesforceMobileSDK-Android> ant create_hybrid_local -Dapp.name=MyApp -Dtarget.dir=C:\MyMobileApps\FirstApp -Dpackage.name=com.myapp
- Now the app set up is done. Start your app coding from index.html page in the same folder.
- To run the App Right click on it Run As -> Android Application. Enjoy !!!!!!
HYBRI D REMOTE APP (ALL HTML AND JS WI LL BE ON SALESFORCE)
Open command prompt go to salesforceMobileSDK location type
Ant create_hybrid_vf - Dapp.name={appName} -Dtarget.dir={targetDir} Dpackage.name={packageName} -Dapex.page={apexPage} [-Duse.smartstore=true]
- appName:- Name of your App
- targetDir:- App location in your system
- packageName:- type some package name for example com.myapp
- apexPage:- Specify which VF should be opened at the start of the app.
- smartstore:- if you are creating a app having capability of offline storage make it true or else don’t include it . (Advised that you should not go for offline version at start up)
for example in commond prompt
C:\AndroidDev1\SalesforceMobileSDK-Android> ant create_hybrid_vf -Dapp.name=MyApp -Dtarget.dir=C:\MyMobileApps\FirstApp -Dapex.page=/apex/VFpage -Dpackage.name=com.myapp
- Same as step 2 of previous one.
- Same as step 3 of previous one.
- Same as step 4 of previous one
- Now the Setup is done. You can start coding your VF page and the related page in your SF org.
- To run the App Right click on it Run As -> Android Application. Enjoy !!!
No comments:
Post a Comment