Sunday, November 20, 2016

Cloud service models and IBM Cloud offerings


The traditional on-premises core IT has the benefits such fully customizable and few limitations among many others but the time commitment to set up and deploy can be weeks and the maintenance of this type of infrastructure can be expensive and difficult depending on the level of complexity.
IBM offers three types of services in the cloud in order to solve expenses and time in the development and maintenance of core IT: Iaas, PaaS and SaaS

IBM SoftLayer Infrastructure as a Service (IaaS)

IBM SoftLayer provides self-service deployment of virtual and dedicated bare metal servers in secure data centers around the world. It provides the hosting infrastructure used by IBM Bluemix Public and IBM Bluemix Dedicated services. 

IBM Bluemix Platform as a Service (PaaS)

IBM Bluemix Platform as a Service is built on Cloud Foundry open source technology. It makes application development easier by allowing developers to focus on code and data alone. Bluemix Platform as a Service handles managing middleware, operating systems, and hosting infrastructure automatically. 


Software as a Service (SaaS) and IBM Cloud Marketplace


The Software as a Service model provides business applications on a ready-to-use and self- service model. The IBM Cloud Marketplace is a place where enterprise cloud customers can discover, learn, try and buy cloud services from IBM and Business Partners.

And this is all!
Soon a little more detail about the capabilities of IBM Bluemix PaaS.

Tuesday, November 15, 2016

MobileFirst on Bluemix: Getting Started

Hi folk,

As I explained in previous post the IBM MobileFirst Platform is available as an on-premise server or on the IBM Bluemix cloud offering. In this example I'm going to focus on the MobileFirst for Bluemix cloud offering for creating a mobile application and then download to emulate in a test environment.

You’ll first need to sign into your Bluemix account. If you don’t already have one, you can create a trial account for free.

The steps are divided into::
Step 1 - Create the MobileFirst service to register the applications
Step 2 - Create an application
Step 3 - Download code and emulate

Step 1 - Create the MobileFirst service to register the applications

Procedure:
1. Login into IBM Bluemix dashboard
2. Click Catalog tag menu
3. Click Mobile option
 3. Click Mobile Foundation
4. You can find the different prices and rates. Create a developer instance for free. Change the default server name and click Create
5. The creation of the service allows you to parameterize advanced options. In this example I want to start the default basic server. Scroll down and click Star Basic Server
Note: Starting the server can take up to 10 minutes to complet.
6. Launch the administration console. Click Launch Console
Note: Copy the automatically generated password for the admin user

7. Login with admin user to MobileFirst Operations Console

 

Step 2 - Create an application

Procedure:
1. Go to IBM Bluemix Mobile project dashboard from menu App and select Mobile
2. Click Create Project
3. Select the Business Directory starter and click Create Project
4. Write the Project Name and click Create
5. Click Build Get Code
6. Select Android platform
Note: Generate Code can take up to 1 minutes to complet.

After the code has been generated, three options are displayed:

 

Step 3 - Download code and emulate

Procedure:
1. Click Download Code
2. Unzip the file
3. Open Android Studio and Open an existing Android Studio project
4. Select the folder unziped
Note: If an error occurs when synchronizing the project Gradle. Click Install and wait for the installation to finish
5.  Click Run to build and run the application in the emulator
In the emulator appears the application created in Bluemix !!
I just set up a development environment with an application created from a Bluemix template, wow!

Soon I will publish how the application is registered on the created MobileFirst service and how the application uses Bluemix services. Be Patient !!!

Cheers!

IBM MobileFirst Platform 8.0 - Developing Applications (Adding the MobileFirst SDK to Android Applications)

Folk, I'm still testing IBM MobileFirst Platform 8.0. Today it's time to add the MobileFirst SDK to Android Applications.

I will follow once again the guide documented in the development site of IBM MobileFirst Platform.

Hope that helps!

Let's go, the dependencies correspond to core functions and other functions:
  • IBMMobileFirstPlatformFoundation - Implements client-to-server connectivity, handles authentication and security aspects, resource requests, and other required core functions
  • IBMMobileFirstPlatformFoundationJSONStore - Contains the JSONStore framework
  • IBMMobileFirstPlatformFoundationPush - Contains the Push Notifications framework
Prerequisites:
  • Android Studio and MobileFirst CLI installed on the developer workstation
  • A local or remote instance of MobileFirst Server is running
  • Setting up your MobileFirst development environment and Setting up your Android development environment
Procedure:
1. Create an Android Studio project or use an existing one


2. In Android → Gradle Scripts, select the build.gradle (Module: app) file
3. Add the following lines after apply plugin: 'com.android.application': 
repositories{
     jcenter()
}

4. Add the following line inside the android section: 
packagingOptions {
     pickFirst 'META-INF/ASL2.0'
     pickFirst 'META-INF/LICENSE'
     pickFirst 'META-INF/NOTICE'
}

5. Add the following line inside the dependencies section:
compile 'com.ibm.mobile.foundation:ibmmobilefirstplatformfoundation:8.0.+'
6. In Android → app → manifests, open the AndroidManifest.xml file. Add the following permissions above the application element:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>

7. Add the MobileFirst UI activity next to the existing activity element:
<activity android:name="com.worklight.wlclient.ui.UIActivity" />
Note: If a Gradle Sync request appears, accept it.

8. Registering the application to MobileFirst Server, go to project folder and run:
$ mfpdev app register
Verifying server configuration...
Registering to server:'http://###.###.###.###:9080' runtime:'mfp'
Registered app for platform: android


Note: To check the registration in the console, in this example I have installed the MobileFirst Server component in my local environment: http://localhost:9080/mfpconsole/login.html



9. Creating a WLClient instance, in this example, added in MainActivity class.
WLClient.createInstance(this);
Note: Creating a WLClient instance should happen only once in the entire application lifecycle. It is recommended to use the Android Application class to do it.

10. Run the app in Run → Run 'app'
Cheers!!!

Monday, November 14, 2016

IBM MobileFirst Platform 8.0 - Developing Applications (Adding the MobileFirst SDK to iOS Applications)


The MobileFirst Foundation SDK consists of a collection of pods that are available through CocoaPods and which you can add to your Xcode project:
  • IBMMobileFirstPlatformFoundation - Implements client-to-server connectivity, handles authentication and security aspects, resource requests, and other required core functions
  • IBMMobileFirstPlatformFoundationJSONStore - Contains the JSONStore framework
  • IBMMobileFirstPlatformFoundationPush - Contains the push notification framework
  • IBMMobileFirstPlatformFoundationWatchOS - Contains support for Apple WatchOS
Prerequisites:
  • Xcode and MobileFirst CLI installed on the developer workstation
  • A local or remote instance of MobileFirst Server is running
  • Support level
    • Xcode 7.1 and later
    • iOS 8 and later
Procedure:
1. Create an Xcode project or use an existing one (Swift or Objective-C). For example I have chosen Swift.
Note: Swift is a new programming language for iOS, macOS, watchOS, and tvOS apps that builds on the best of C and Objective-C, without the constraints of C compatibility. Swift adopts safe programming patterns and adds modern features to make programming easier, more flexible, and more fun. Swift’s clean slate, backed by the mature and much-loved Cocoa and Cocoa Touch frameworks, is an opportunity to reimagine how software development works. 




2. If CocoaPods is already installed in your development environment, skip to step 3.
Open a Command-line window and navigate to the root of the Xcode project and run:
Note: "pod setup" command might take several minutes to complete. Use a git process.

$ sudo gem install cocoapod
$ pod setup
Setting up CocoaPods master repo
Setup completed

3. This creates a Podfile
$ pod init

4. Edit the Podfile.
Comment out or delete the contents of the file.
Add the following lines and save the changes:

use_frameworks!

platform :ios, 8.0
target "MyHelloiOS" do
    pod 'IBMMobileFirstPlatformFoundation'
end

5. Back in the command-line window, run the commands. These command add the MobileFirst Native SDK files, add the mfpclient.plist file, and generate a Pod project.
Note: The commands might take several minutes to complete.

$ pod install
Analyzing dependencies
Downloading dependencies
Installing IBMMobileFirstPlatformFoundation (8.0.2016070718)

[!] Please close any current Xcode sessions and use `MyHelloiOS.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

$ pod update
Update all pods
Updating local specs repositories

CocoaPods 1.2.0.beta.1 is available.
To update use: `sudo gem install cocoapods --pre`
[!] This is a test version we'd love you to try.

For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.2.0.beta.1

Analyzing dependencies
Downloading dependencies
Using IBMMobileFirstPlatformFoundation (8.0.2016070718)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

6. Close Xcode and open Xcode MyHelloiOS.xcworkspace file


7. Registering the application to MobileFirst Server, go to project folder and run:
$ mfpdev app register 
Verifying server configuration...
Registering to server:'http://####.####.####.####:9080' runtime:'mfp'
? Enter your bundleId: jif.examples.helloios
To prevent future prompting for the bundle ID in iOS projects, update the '<string>' element that corresponds to the '<key>CFBundleIdentifier</key>' in your Info.plist file.
Registered app for platform: ios

8. In Xcode, right-click the project entry, click on Add Files To [ProjectName] and select the mfpclient.plist file, located at the root of the Xcode project.




 Cheers!!!

IBM MobileFirst Platform 8.0 - Developing Applications (Adding the MobileFirst SDK to Cordova Applications)

Hi folk, again back with new developments. I will start a series of post about the development of applications for mobile devices based on IBM MobileFirst Platform.

The idea is to learn new concepts about: MobileFirst-provided APIs for Native, Cordova and Web applications, such as JSONStore and WLResourceReuest.
The MobileFirst Cordova SDK is provided as a set of Cordova plug-ins, and is registered at NPM.
NPM is the package manager for JavaScript.

Available plug-ins are:
  • cordova-plugin-mfp - The core SDK plug-in
  • cordova-plugin-mfp-push - Provides push notifications support
  • cordova-plugin-mfp-jsonstore - Provides JSONStore support
  • cordova-plugin-mfp-fips - Android only. Provides FIPS support
  • cordova-plugin-mfp-encrypt-utils - iOS only. Provides support for encryption and decryption
The Cordova platform versions supported by the MobileFirst plug-ins, are:
  • cordova-ios: >= 4.1.1 and < 5.0
  • cordova-android: >= 5.1.1 and < 6.0
  • cordova-windows: >= 4.3.2 and < 5.0
Prerequisites:
  • Apache Cordova CLI 6.x and MobileFirst CLI installed on the developer workstation.
  • A local or remote instance of MobileFirst Server is running.
  • Setting up your Cordova development environment.
Before you start, make sure that the MobileFirst Server is running.

Procedure:

1. Check Cordova version
$ cordova -v
6.1.1

2. Create Cordova project
$ cordova create MyHelloCordova jif.example.hellocordova MyHelloCordova --template cordova-template-mfp
Creating a new cordova project.
Retrieving cordova-template-mfp using npm...


Note:
“MyHelloCordova” is the folder name of the application
“jif.example.hellocordova” is the ID of the application
“MyHelloCordova” is the Name of the application
--template modifies the application with MobileFirst-specific additions
Because the application was configured using the MobileFirst template, the MobileFirst core Cordova plug-in is added automatically.



3. Change directory to Cordova project:
$ cd MyHelloCordova

4. Add one or more supported platforms to the Cordova project by using the Cordova CLI command: cordova platform add ios|android|windows. For example:
$ cordova platform add android

5. Registering the application to MobileFirst Server
$ mfpdev app register
Verifying server configuration...
Registering to server:'http://####.####.####.####:9080' runtime:'mfp'
Updated config.xml file located at: /Users/jorge/Development/Mobile/mfp/workspace/MyHelloCordova/config.xml
Run 'cordova prepare' to propagate changes.
Registered app for platform: android


Note: You can also register applications from the MobileFirst Operations Console

6. Propagate changes and run the example
$ cordova prepare
$ cordova emulate