Building the BI Mobile HD Application for Enterprise...
Transcript of Building the BI Mobile HD Application for Enterprise...
Building the BI Mobile HD Application for Enterprise Deployment January 13, 2014
1
Table of Contents Introduction .............................................................................................................................. 2 Overview of Creating an Application ................................................................................ 3
Build the Application with a Storyboard Project .......................................................... 4 Create the Project .............................................................................................................................. 4 Add the BI Mobile HD Content to the New Project ................................................................. 4 Modify Project Properties .............................................................................................................. 5 Modify the Default Application Code ....................................................................................... 12 Run and Test the Project ............................................................................................................. 14
Appendix ................................................................................................................................. 15 Configure a Server When Deploying the Application ........................................................ 15
Building the BI Mobile HD Application for Enterprise Deployment January 13, 2014
2
Introduction Audience: These instructions are intended for an iOS mobile developer using Xcode 5.x who is familiar with Apple’s signing and deployment process and who is also familiar with the details of deploying an application with a selected MDM (Mobile Device Management) vendor. The Oracle Business Intelligence Mobile Security Toolkit provides the ability to generate a signed version of the Oracle BI Mobile HD application. The toolkit includes the necessary content to build this application making use of Apple’s Xcode and the iOS SDKs. Details for building an iOS application can be found at: http://developer.apple.com/library/ios/ -‐ referencelibrary/GettingStarted/RoadMapiOS/chapters/Introduction.html The Oracle BI Mobile Security Toolkit will be updated on a regular basis in order to synchronize with the Oracle BI Mobile HD application available on the Apple App store. The Oracle BI Mobile Security Toolkit updates are delivered in alignment with the releases of the Oracle BI Mobile HD application. As these updates are provided on an on-‐going basis, the expectation is that users update their Oracle BI Mobile HD applications either through the Apple App Store or through the Oracle BI Mobile Security Toolkit. In both cases, the ability to provide incremental updates is not supported. For the application that is accessed through the Apple App Store, the application will be replaced with the latest version available. With the Oracle BI Mobile Security Toolkit, a complete new package of support files and libraries is provided. Issues have been noted with Apple iOS simulators when executed with only the project libraries replaced and the application rebuilt. The simulator does not always respect the updates to the libraries. In order to use simulators with library updates, perform a complete rebuild of the project or reset the content settings in the simulator. In order to avoid these simulator issues, you should replace all project and library files and build a complete new version of the application.
Building the BI Mobile HD Application for Enterprise Deployment January 13, 2014
3
Overview of Creating an Application Below is a diagram that shows the high-‐level process of creating an application for deployment in your organization’s enterprise application store. The first four steps in this process are documented in detail; the final step requires you to work with your IT department, the team in charge of your enterprise distribution, and your MDM vendor. This final step will vary from organization to organization.
Create a New Xcode Project
Add the Oracle BI Mobile HD
Framework to the Project
Modify Project Properties to Match Oracle BI Mobile HD Requirements
Make Minor Code
Modi\ications to Support the Oracle BI Mobile HD Framework
Test, Deploy, and Integrate with a Third-‐Party MDM Vendor
Building the BI Mobile HD Application for Enterprise Deployment January 13, 2014
4
Build the Application with a Storyboard Project Create the Project
1. From the Xcode menu, select File > New > Project to create a new Xcode project.
2. When asked to select a template, choose Single View Application. Click
Next.
3. Give your project a name (any name you want) and fill out the other fields
with your organization’s information. For the Company Identifier and the Class Prefix, you may want to consult your IT department to see if there are standards you should follow.
4. IMPORTANT: In the Devices dropdown, specify the devices you are targeting.
The Oracle BI Mobile HD application is a universal application that supports iPhone and iPad clients, so make sure to select Universal. The rest of this guide is based on that assumption.
5. Select a destination for your new project. Choose a safe location you will
remember.
Add the BI Mobile HD Content to the New Project 1. Download the latest security toolkit files to the machine on which you have
created this new Xcode project. The files can be found here:
Building the BI Mobile HD Application for Enterprise Deployment January 13, 2014
5
http://www.oracle.com/technetwork/middleware/bi-‐enterprise-‐edition/downloads/bi-‐mobile-‐security-‐toolkit-‐1872818.html?ssSourceSiteId=ocomen
2. Extract the files from the zip and drag the OBIMobile.framework,
Settings.bundle and OBIMobile.bundle files to the project. Be sure to drop them on the Project icon and not above the icon. (See screenshot below.)
3. Select Create Groups for Any Added Folders. Leave other options unselected and click Finish.
Modify Project Properties 1. In the Summary section of the new project, add icons for the application. Be
sure to add them for both the iPhone and the iPad. You can do this by dragging and dropping icons into their appropriate image sets’ (AppIcon and LaunchImage) corresponding asset catalog. Detailed steps are listed below.
IMPORTANT: When you create a new project, Xcode defaults to an asset catalog with image sets that only include icons for iOS7. If you plan to
Building the BI Mobile HD Application for Enterprise Deployment January 13, 2014
6
support iOS6, you must change the properties on the image sets to include iOS6 images. If you plan to support only iOS7, you can use the default image sets built when you created the new project. Modify the Image Set Properties to Support iOS6 (Optional)
a. In the Project Navigator, select the asset catalog (for example, images.xcassets).
b. Using the Attribute Inspector, add support for iOS6 devices. This requires more images, and the image set reflects this by adding more image options. See screenshots below for details, but select the following options for each set type:
AppIcon:
• iPhone -‐ iOS 7.0 and Later Sizes • iPhone -‐ iOS 6.1 and Prior Sizes • iPad -‐ iOS 7.0 and Later Sizes • iPad -‐ iOS 6.1 and Prior Sizes
Building the BI Mobile HD Application for Enterprise Deployment January 13, 2014
7
LaunchImages
• iOS 7.0 and Later – iPhone – Portrait • iOS 7.0 and Later – iPad – Portrait • iOS 7.0 and Later – iPad – Landscape • iOS 6.0 and Prior – iPhone – Portrait • iOS 6.0 and Prior – iPad – Portrait (Excluding Status Bar) • iOS 6.0 and Prior – iPad – Landscape (Excluding Status Bar)
Drag and Drop Images to the Image Set
a. In the Finder, select an image, then drag and drop it from Finder to the appropriate image well in the set viewer.
Building the BI Mobile HD Application for Enterprise Deployment January 13, 2014
8
We supply icons for the iPad and the iPhone in the zip file downloaded earlier (see table below), but you can use any icon you want as long as it complies with Apple sizes and specifications. Be sure to add all the required images. This is an opportunity for you to apply some custom branding to the application, so we highly recommend that your own assets be used.
Image Name Image Size Maps to Image Icon-‐72.png 72x72 iPad iOS5,6 (72pt -‐ 1x) Icon-‐[email protected] 144x144 iPad iOS5,6 (72pt -‐ 2x) Icon-‐76.png 76x76 iPad iOS7 (76pt -‐ 1x) Icon-‐[email protected] 144x144 iPad iOS7 (76pt -‐ 2x) Icon-‐120.png 120x120 iPhone iOS7 (60pt -‐ 2x) Icon-‐Small-‐40.png 40x40 iPad Spotlight iOS7 (40pt -‐ 1x) Icon-‐Small-‐[email protected] 80x80 iPad Spotlight iOS7 (40pt -‐ 2x) Icon-‐small-‐50.png 50x50 iPad Spotlight iOS5,6 (50pt -‐ 1x) Icon-‐Small-‐[email protected] 50x50 iPad Spotlight iOS5,6 (50pt -‐ 2x) Icon-‐Small-‐80.png 80x80 iPhone Spotlight iOS7 (40pt -‐ 2x) Icon-‐Small.png 29x29 iPhone Spotlight, Settings iOS5,6
(29pt -‐ 1x) Icon-‐[email protected] 58x58 iPhone Spotlight, Settings iOS5,6
(29pt -‐ 2x) Icon.png 57x57 iPhone App iOS5,6 (57pt -‐ 1x) [email protected] 114x114 iPhone App iOS5,6 (57pt -‐ 2x) OBILaunch_Landscape_v2.png 1024x768 iPad Landscape iOS7 (1x) [email protected] 2048x1536 iPad Landscape iOS7 (2x) OBILaunch_Portrait_v2.png 768x1024 iPad Portrait iOS7 (1x) OBILaunch_Portrait [email protected] 1536x2048 iPad Portrait iOS7 (2x) OBILaunch-‐Landscape~ipad.png 1024x748 iPad Landscape without Status
Bar iOS7 (1x) OBILaunch-‐Landscape@2x~ipad.png
2048x1496 iPad Landscape without Status Bar iOS7 (2x)
OBILaunch-‐Portrait~ipad.png 768x1004 iPad Portrait without Status Bar iOS7 (1x)
OBILaunch-‐Portrait@2x~ipad.png 1536x2008 iPad Portrait without Status Bar iOS7 (2x)
OBILaunch@2x~iphone.png 640x960 iPhone Portrait iOS7 (2x); iPhone Portrait iOS5, 6 (2x)
OBILaunch~iphone.png 320x480 iPhone Portrait iOS5, 6 (1x) OBILaunch-‐[email protected] 640x1136 iPhone Portrait iOS7 (R4);
iPhone Portrait iOS5, 6 (R4) Please refer to the images below for additional help with image mapping.
Building the BI Mobile HD Application for Enterprise Deployment January 13, 2014
9
https://developer.apple.com/library/ios/documentation/userexperience/conceptual/mobilehig/AppIcons.html#//apple_ref/doc/uid/TP40006556-‐CH19-‐SW1 NOTE: Launch images are optional. If left blank, however, the icons will we stretched to provide the launch image. This effect is likely undesirable, so we recommend always using launch images.
2. In the Summary section, select the orientations. For both the iPad and the iPhone, select every orientation:
a. Portrait b. Upside Down c. Landscape Left d. Landscape Right
Building the BI Mobile HD Application for Enterprise Deployment January 13, 2014
10
3. In the Summary section of the new project, verify that Deployment Target is set to a version of iOS that the Oracle BI Mobile HD application supports. Do not select an option lower than 6.1.
Supported iOS versions can be found by checking the Requirements list for the Oracle BI Mobile HD application on the Apple App Store. https://itunes.apple.com/us/app/oracle-‐business-‐intelligence/id534035015?mt=8
4. In the Info section of the new project, expand URL Types. Click +to add a new URL Type. Fill in the following fields with the corresponding values:
• Identifier: com.oracle.obimobile • URL Schemes: oraclebimobile
Leave the rest of the options for the new URL Type blank or as defaults.
5. In the Build Settings section of the new project, search for "Other Linker Flags" and add the follow parameter:
-‐all_load -‐ObjC To add this parameter you must double-‐click in the blank space next to the property. Then in the dialog (shown below),add the new parameter.
Building the BI Mobile HD Application for Enterprise Deployment January 13, 2014
11
When finished, you see the following:
6. In the Build Settings section, verify that the Architectures property is set to
Standard architectures (arm7, armv7s).
7. In the Build Phases section of the new project, in the section called “Link
Binary With Libraries,” make sure the following frameworks are included and that each Status is marked Required:
• MessageUI.framework • Security.framework • QuartzCore.framework • CoreData.framework • UIKit.framework • Foundation.framework • CoreGraphics.framework • libsqllite3.dylib
Building the BI Mobile HD Application for Enterprise Deployment January 13, 2014
12
Modify the Default Application Code 1. Select the file called <classprefix>AppDelegate.h in the project and add or
modify the following lines of code: a. Add #import <OBIMobile/OBIMobile.h> b. Make AppDelegate inherit from OBIApplicationDelegate
The modified <classprefix>AppDelegate.h should have the following lines of code with the changes shown in red:
#import <UIKit/UIKit.h> #import <OBIMobile/OBIMobile.h> @interface <classprefix>AppDelegate : OBIApplicationDelegate @property (strong, nonatomic) UIWindow *window; @end NOTE: The <classprefix> represents the name of the Class Prefix used in step 5 of the section “Create the Project”. If you did not specify a class prefix, the
Building the BI Mobile HD Application for Enterprise Deployment January 13, 2014
13
file will simply be called AppDelegate.h and any reference in the code will be AppDelegate.
2. Comment out all the code in <classprefix>AppDelegate.m and replace it with the following code: #import "<classprefix>AppDelegate.h" @implementation <classprefix>AppDelegate @synthesize window = _window;
@end
/* CODE COMMENTED OUT*/
NOTE: The <classprefix> represents the name of the Class Prefix used in step 5 of the section “Create the Project”. If you did not specify a class prefix the file will simply be called AppDelegate.m and any reference in the code will be AppDelegate.
Building the BI Mobile HD Application for Enterprise Deployment January 13, 2014
14
Run and Test the Project The project is now ready to run and test. From the Product menu in Xcode, you can run and test the new project in the simulator or on an iOS device. We recommend that the application be thoroughly tested prior to deployment or integration with any MDM tool. Before you can distribute your application, you must certify and provision it within the Enterprise Developer Program and sign and build your project in Xcode. This is a process that is driven by Apple. For more details, visit the following link: http://www.apple.com/business/accelerator/deploy/ Please work with your IT department or the team in charge of your enterprise distribution for additional details.
Building the BI Mobile HD Application for Enterprise Deployment January 13, 2014
15
Appendix Configure a Server When Deploying the Application Many organizations do not want their end users to have to bother with server configuration. One of the benefits to creating a “wrapped” application that is deployed in an enterprise application store is the ability to modify the code and avoid this problem of server configuration having to be done by end users.
Storyboard Based Project: 1. Select the file called <classprefix>AppDelegate.m in the project and add the
following method:
-‐ (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // To add a server you can do the following: [super createServer:@"<Provide server name>" host:@"<Provide host>" port:<9704> enableSSL:FALSE enableSSO:FALSE username:@"<Provide username or blank (user will be prompted)>" password:@"<Provide password or blank (user will be prompted>" setAsDefaultServer:NO]; // Override point for customization after application launch. return [super application:application didFinishLaunchingWithOptions:launchOptions]; }
NOTE: Replace any strings above in <> or italics with actual values based on your configuration.