Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
Joseph_BERTHE
Active Contributor
0 Kudos

This tutorial is based on the online help from Sybase infocenter which is quite good and informative. But I wanted to show you how to call a BAPI from your iPhone using SUP (Sybase Unwired Platform).

I’ve based my work on the tutorials of pierre.dominique2/blog who did three articles on SDN. To do my tutorial, you have to perform Developing Mobile Applications with Sybase Unwired Platform (1/3) and Developing Mobile Applications with Sybase Unwired Platform (2/3).

In that tutorial we will show you how to configure an empty Xcode project in order to use Sybase Unwired Platform API.

Prerequisites

Before starting, you need to have first the content of the Generated Code from your MBO (Windows side) and the folders includes and libs from the SUP folders. For the tutorial, I have copied all the content to my desktop : /Users/jberthe/Desktop/Sybase Unwired Platform

 
Furthermore, you will need those tools as well :
  • Sybase Unwired Platform 1.5.3
  • MacOS 10.6 (Snow Leopard), XCode 3.2.3 (it seams working on 3.2.4)
  • iPhone SDK 4.0.x

Create an iPhone application

The goal of this section is to develop a simple iPhone application using the generated code provided by the Sybase Unwired Workspace. We will use the MBO created to call the SAP Backend to retrieve the flights list.

Configure the XCode Project

  • Start XCode and click on Create a new Xcode project
  • In the windows Choose Template, select Application > Windows-based Application

  • Save the project as : SUPSapAccess
At this point you have an empty project.
  • In menu Project > Edit Project Setting navigate in the General tab and select Base SDK for All Configurations : iOS Simulator 4.0 then press the button Rebuild Code Sense Index

  • Close the window and quit XCode application, then relaunch it. In that manner the SDK Base will be affected.
  • When you re-open the SUPSapAccess project you should see you are in Simulator - 4.0

We are going to import the generated files
  1. in the Groups & Files view, right click on the project name
  2. Select Add and Existing Files...
  3. Select the folder Generated Code
  4. Then press Add button. Check the box for Copy items into destination group’s folder (if needed), then click Add button

Add libraries into the project
  1. in the Groups & Files view, right click on the project name
  2. Select Add and Existing Files...
  3. Select files into folder Libs  > Debug-iphonesimulator
  4. Then press Add button. Check the box for Copy items into destination group’s folder (if needed), then click Add button

Add Settings.bundle to the Xcode project. This allows the iPhone device client user to use the Settings application to input his or her user preference information such as server name, server port, user name, and activation code.
  1. in the Groups & Files view, right click on the Resource sub-folder
  2. Select Add and Existing Files...
  3. Select Settings.bundle file into the includes folder
  4. Then press Add button. Check the box for Copy items into destination group’s folder (if needed), then click Add button

Enter the Xcode project Header Search Paths
  1. In menu Project > edit Active Target “SUPSapAccess”
  2. Navigate to the Build tab, and in the Search in Build Settings, enter “Header Search Paths”
  3. Add the folder path where you copied the includes files : /Users/jberthe/Desktop/Sybase Unwired Platform/includes
Add libraries into the general tab
  • Click on + sign and add all of those libraries :
    • Security.framework
    • AddressBook.framework
    • QuartzCore.framework
    • CoreFoundation.framework
    • libicucore.A.dylib
    • libz.1.2.3.dylib
    • libstdc++.dylib
  • Go back to the Build tab and search : Library Search Paths
  • Delete the line "$(SDKROOT)/usr/lib/gcc/i686-apple-darwin10/4.0.1" which is an other link for the libstdc++

Close the properties windows and then you sould have a project like this:

At this point, you should have a Build Success.
 
The next step will be the integration of SUP API Calls into your iPhone application.

 

4 Comments