| copyright |
|
||
|---|---|---|---|
| lastupdated | 2017-04-28 |
{:new_window: target="_blank"} {:shortdesc: .shortdesc} {:screen:.screen} {:codeblock:.codeblock}
{: #sdk_BMSClient}
BMSCore provides the HTTP infrastructure that the other {{site.data.keyword.Bluemix}} Web and Mobile services client SDKs use to communicate with their corresponding {{site.data.keyword.Bluemix_notm}} services.
{: #init-BMSClient-android}
You can either download and import the BMSCore package to your Android Studio project, or use Gradle.
- Import the Client SDK by adding the following
importstatement at the beginning of your project file:
import com.ibm.mobilefirstplatform.clientsdk.android.core.api.*;
{: codeblock}
- Initialize the
BMSClientSDK in your Android application by adding the initialization code in theonCreatemethod of the main activity in your Android application, or in a location that works best for your project.
BMSClient.getInstance().initialize(getApplicationContext(), BMSClient.REGION_US_SOUTH); // Make sure that you point to your region{: codeblock}
You must initialize the BMSClient with the bluemixRegion parameter. In the initializer, the bluemixRegion value specifies which {{site.data.keyword.Bluemix_notm}} deployment you are using, for example, BMSClient.REGION_US_SOUTH, BMSClient.REGION_UK, or BMSClient.REGION_SYDNEY.
{: #init-BMSClient-ios}
You can use CocoaPods{: new_window} or Carthage{: new_window} to get the BMSCore package.
- To install
BMSCoreby using CocoaPods, add the following lines to your Podfile. If your project does not have a Podfile yet, use thepod initcommand.
use_frameworks!
target 'MyApp' do
pod 'BMSCore'
end{: codeblock}
Then run the pod install command, and open the generated .xcworkspace file. To update to a newer release of BMSCore, use pod update BMSCore.
For more information about using CocoaPods, see the CocoaPods Guides {: new_window}.
-
To install
BMSCoreby using Carthage, follow these instructions{: new_window}.
-
Add the following line to your Cartfile:
github "ibm-bluemix-mobile-services/bms-clientsdk-swift-core"{: codeblock}
-
Run the
carthage updatecommand. -
After the build is finished, add
BMSCore.frameworkto your project by following Step 3in the Carthage instructions.
For applications that are built with Swift 2.3, use the
carthage update --toolchain com.apple.dt.toolchain.Swift_2_3command. Otherwise, use thecarthage updatecommand. -
Import the module.
import BMSCore{: codeblock}
- Initialize the
BMSClientclass, using the following code.
Place the initialization code in the application(_:didFinishLaunchingWithOptions:) method of your application delegate, or in a location that works best for your project.
BMSClient.sharedInstance.initialize(bluemixRegion: BMSClient.Region.usSouth) // Make sure that you point to your region{: codeblock}
You must initialize the BMSClient with the bluemixRegion parameter. In the initializer, the bluemixRegion value specifies which {{site.data.keyword.Bluemix_notm}} deployment you are using, for example, BMSClient.Region.usSouth, BMSClient.Region.unitedKingdom, or BMSClient.Region.sydney.
{: #init-BMSClient-cordova}
- Add the Cordova plugin by running the following command from your Cordova application root directory:
cordova plugin add bms-core
{: codeblock}
- Initialize the
BMSClientclass in your Cordova application by adding the initialization code in the main JavaScript file, or in a location that works best for your project.
BMSClient.initialize(BMSClient.REGION_US_SOUTH);
{: codeblock}
You must initialize the BMSClient with the bluemixRegion parameter. In the initializer, the bluemixRegion value specifies which {{site.data.keyword.Bluemix_notm}} deployment you are using, for example, BMSClient.REGION_US_SOUTH, BMSClient.REGION_UK, or BMSClient.REGION_SYDNEY.
{: #rellinks notoc}
{: #general notoc}
- BMSCore Android SDK{: new_window}
- BMSCore iOS SDK{: new_window}
- BMSCore Cordova Plugin{: new_window}