Sybase Unwired Platform: How To Develop An Iphone Application Using Sup
Sybase Unwired Platform: How To Develop An Iphone Application Using Sup
Applies to:
Sybase Unwired Platform 1.5.2 onwards
Summary
This document talks about creating an iPhone Application using Sybase Unwired Platform.
Here we take Customer and Sales Order tables as example MBO’s.
Below procedure gives an insight to create the MBO’s and Mobile Client Customization and deployment of
MBO’s on the server, which in turn interact with Mobile Client (iPhone)
Author Bio
Pradeep Gudipati
Lead Engineer
Advent Global Solutions Inc.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 1
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
Table of Contents
Creating an MBO 3
Pre-requisites3
Procedure 3
Generate the SUP Code for iOS development 12
Pre-requisites12
Procedure 12
Custom development for iphone 15
Procedure 15
Creating Custom Code 16
Building & Running the application 40
Related Content 47
Copyright 48
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 2
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
Creating an MBO
Pre-requisites
Sybase Unwired Platform installed on a Windows System.
Procedure
1. Create a new Mobile Application
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 3
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
2. Open Diagram Editor by Right clicking on project and selecting Open in Diagram Editor
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 4
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
3. Create MBOs by dragging & dropping Customer & Sales Order Tables onto the Device Diagram
editor
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 5
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
4. Create relationship
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 6
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 7
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
Click Next
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 8
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
Click Next
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 9
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
Select the Connection Profile to the DB if already existing else create new one by selecting the template from
the drop down. Click Finish and the MBO’s are deployed to the SUP server.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 10
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 11
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
Pre-requisites
Apple Macintosh Machine with XCode .
Procedure
1. Right Click on the Project and select Generate the code option then click next
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 12
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 13
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
Select all the MBOs and tick the “Generate metadata classes” option and click finish
Now the Objective-C code is generated into the specified output location.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 14
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
Procedure
1) Create a new project in Xcode with template as windows-based project
Import libraries “libMO.a”, “libSUPObj.a”, “libclientrt.a” in Objective folder .The library version
should correspond to the configuration you are building. For example, if you are building a
configuration for a debug version of the simulator, then add the libraries to libs/Debug-
iphonesimulator/ .
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 15
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
SupDemoAppDelegate.h
#import <UIKit/UIKit.h>
-(void)showNoTransportAlert:(NSInteger)ret;
@end
SupDemoAppDelegate.m
#import "SupDemoAppDelegate.h"
#import "SUPMessageClient.h"
#import "SupDemoCallbackHandler.h"
#import "SupDemo_SupDemoDB.h"
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 16
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
@implementation SupDemoAppDelegate
@synthesize window;
@synthesize navController;
-(void)showNoTransportAlert:(NSInteger)ret
{
NSString *message = nil;
if(ret == kSUPMessageClientNoSettings)
{
message=@"No required settings,use the Settings app to enter the provisioning information.";
}
else if(ret == kSUPMessageClientKeyNotAvailable)
{
message=@"Unable to access the key";
}
else {
message = @"Operation fails.";
}
UIAlertView *noTransportAlert = [[[UIAlertView alloc]initWithTitle:@"Message Client Fails to Start"
message:message delegate:self cancelButtonTitle:NSLocalizedString(@"OK",@"Label for alert button OK")
otherButtonTitles:nil]autorelease];
[noTransportAlert show];
}
- (void)applicationDidFinishLaunching:(UIApplication *)application {
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 17
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
-(void)applicationWillTerminate:(UIApplication *)application
{
[SupDemo_SupDemoDB unsubscribe];
[SUPMessageClient stop];
}
}
-(void)dealloc
{
[navController release];
[window release];
[super dealloc];
}
@end
2. Create call back handler named SupDemoCallbackHandler that handles the asynch login
request sent to the server.
SupDemoCallbackHandler.h
#import "SUPDefaultCallbackHandler.h"
@interface SupDemoCallbackHandler : SUPDefaultCallbackHandler {
SUPInt field_importCount;
SUPInt field_replaySuccessCount;
SUPInt field_replayFailureCount;
SUPInt field_searchSuccessCount;
SUPInt field_searchFailureCount;
SUPInt field_loginSuccessCount;
SUPInt field_importSuccessCount;
}
+ (SupDemoCallbackHandler*)newInstance;
- (SUPInt)importCount;
- (void)setImportCount:(SUPInt)_importCount;
@property(assign) SUPInt importCount;
- (SUPInt)replaySuccessCount;
- (void)setReplaySuccessCount:(SUPInt)_replaySuccessCount;
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 18
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
SupDemoCallbackHandler.m
#import "SupDemoCallbackHandler.h"
@implementation SupDemoCallbackHandler
+ (SupDemoCallbackHandler*)newInstance {
SupDemoCallbackHandler* _me_1 = [[SupDemoCallbackHandler alloc] init];
[_me_1 autorelease]; return _me_1;
}
- (SUPInt)importCount {
return field_importCount;
}
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 19
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
- (void)setImportCount:(SUPInt)_importCount {
field_importCount = _importCount;
}
- (SUPInt)replaySuccessCount {
return field_replaySuccessCount;
}
- (void)setReplaySuccessCount:(SUPInt)_replaySuccessCount {
field_replaySuccessCount = _replaySuccessCount;
}
- (SUPInt)replayFailureCount {
return field_replayFailureCount;
}
- (void)setReplayFailureCount:(SUPInt)_replayFailureCount {
field_replayFailureCount = _replayFailureCount;
}
- (SUPInt)searchSuccessCount {
return field_searchSuccessCount;
}
- (void)setSearchSuccessCount:(SUPInt)_searchSuccessCount {
field_searchSuccessCount = _searchSuccessCount;
}
- (SUPInt)searchFailureCount {
return field_searchFailureCount;
}
- (void)setSearchFailureCount:(SUPInt)_searchFailureCount {
field_searchFailureCount = _searchFailureCount;
}
- (SUPInt)loginSuccessCount {
return field_loginSuccessCount;
}
- (void)setLoginSuccessCount:(SUPInt)_loginSuccessCount {
field_loginSuccessCount = _loginSuccessCount;
} - (SUPInt)importSuccessCount {
return field_importSuccessCount;
}
- (void)setImportSuccessCount:(SUPInt)_importSuccessCount {
field_importSuccessCount = _importSuccessCount;
} - (void)onImport:(id)theObject {
self.importCount = self.importCount + 1;
}
- (void)onReplayFailure:(id)theObject {
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 20
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
self.replayFailureCount = self.replayFailureCount + 1;
}
- (void)onReplaySuccess:(id)theObject {
self.replaySuccessCount = self.replaySuccessCount + 1;
MBOLogInfo(@"================================================");
MBOLogInfo(@"=================================================");
}
- (void)onSearchFailure:(id)theObject {
self.searchFailureCount = self.searchFailureCount + 1;
}
- (void)onSearchSuccess:(id)theObject {
self.searchSuccessCount = self.searchSuccessCount + 1;
}
- (void)onLoginSuccess {
MBOLogInfo(@"================================================");
MBOLogInfo(@"Login Successful");
MBOLogInfo(@"=================================================");
self.loginSuccessCount++;
}
- (void)onSubscribeSuccess {
MBOLogInfo(@"================================================");
MBOLogInfo(@"Subscribe Successful");
MBOLogInfo(@"=================================================");
}
- (void)onUnsubscribeSuccess {
MBOLogInfo(@"================================================"); MBOLogInfo(@"Unsubscribe
Successful");
MBOLogInfo(@"=================================================");
}
- (void)onImportSuccess{
MBOLogInfo(@"================================================");
MBOLogInfo(@"import ends Successful");
MBOLogInfo(@"=================================================");
self.importSuccessCount++;
}
- (void)dealloc {
[super dealloc];
}
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 21
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
@end
SubscribeController.h
#import <UIKit/UIKit.h>
#import "CustomerListController.h"
@interface SubscribeController :
UIViewController<UITableViewDelegate,UITableViewDataSource,UITextFieldDelegate> {
IBOutlet UITableView *tblView;
UITextField *txtfield_username;
UITextField *txtfield_password;
CustomerListController *listController;
}
@end
SubscribeController.m
#import "SubscribeController.h"
#import "SupDemo_SupDemoDB.h"
#import "SupDemoCallbackHandler.h"
#import "SupDemoAppDelegate.h"
#import "SUPMessageClient.h"
@implementation SubscribeController
@synthesize subscribeButton;
-(void)subscribe
{
[SupDemo_SupDemoDB subscribe];
while ([(SupDemoCallbackHandler *)[SupDemo_SupDemoDB callbackHandler] importCount]<1)
{
sleep(1);
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 22
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
}
sleep(3);
if(listController == nil)
{
listController = [[CustomerListController alloc] initWithStyle:UITableViewStyleGrouped];
}
SupDemoAppDelegate *delegate =[[UIApplication sharedApplication]delegate];
[delegate.navController pushViewController:listController animated:YES];
// The designated initializer. Override if you create the controller programmatically and want to perform customization
that is not appropriate for viewDidLoad.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
// Custom initialization
}
return self;
}
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
self.title=@"Subscribe";
[super viewDidLoad];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 23
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
UILabel *lblUserName,*lblPassword;
switch (indexPath.row)
{
case 0:
lblUserName=[[UILabel alloc]initWithFrame:CGRectMake(20,10, 70,30)];
lblUserName.text=@"UserName";
lblUserName.font=[UIFont boldSystemFontOfSize:14];
[cell addSubview:lblUserName];
[lblUserName release];
default:
lblPassword=[[UILabel alloc]initWithFrame:CGRectMake(20, 10, 70, 30)];
lblPassword.text=@"Password";
lblPassword.font=[UIFont boldSystemFontOfSize:14];
[cell addSubview:lblPassword];
[lblPassword release];
break;
}
return cell;
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 24
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
[textField resignFirstResponder];
if(textField == txtfield_password)
{
[UIApplication sharedApplication].networkActivityIndicatorVisible=YES;
[SupDemo_SupDemoDB deleteDatabase];
// Set log Level
[MBOLogger setLogLevel:LOG_INFO];
//Set up connection profile(server, user, password,cid)
SupDemoCallbackHandler *databaseCH = [SupDemoCallbackHandler newInstance];
[SupDemo_SupDemoDB registerCallbackHandler:databaseCH];
[SupDemo_SupDemoDB createDatabase];
[SupDemo_SupDemoDB startBackgroundSynchronization];
NSInteger result = [SUPMessageClient start];
[SupDemo_SupDemoDB asyncOnlineLogin:txtfield_username.text password:txtfield_password.text];
while([databaseCH loginSuccessCount]<1)
{
sleep(1);
}
sleep(3);
[self subscribe];
[UIApplication sharedApplication].networkActivityIndicatorVisible=NO;
}
else
[txtfield_password becomeFirstResponder];
return YES;
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 25
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
- (void)viewDidUnload {
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (void)dealloc {
if(listController)
{
[listController release];
listController = nil;
}
[super dealloc];
}
@end
4. Create CustomerListController
CustomerListController.h
#import "DetailController.h"
#import <UIKit/UIKit.h>
NSArray *customerList;
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 26
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
DetailController *childController;
}
@end
CustomerListController.m
#import "CustomerListController.h"
#import "SupDemoAppDelegate.h"
#import "DetailController.h"
#import "SupDemo_Customer.h"
@implementation CustomerListController
@synthesize customerList;
- (id)initWithStyle:(UITableViewStyle)style {
// Override initWithStyle: if you create the controller programmatically and want to perform customization that is not
appropriate for viewDidLoad.
if (self = [super initWithStyle:style]) {
}
return self;
}
/*
- (void)viewDidLoad {
[super viewDidLoad];
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
}
*/
- (void)viewWillAppear:(BOOL)animated {
self.title = @"Customers";
NSMutableArray *array = [[NSMutableArray alloc]init];
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 27
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
- (void)viewDidUnload {
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 28
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell;
}
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 29
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
- (void)dealloc {
[customerList release];
[childController release];
[super dealloc];
}
@end
DetailController.h
#import <UIKit/UIKit.h>
#import "SupDemo_Customer.h"
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 30
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
SupDemo_Customer *originalObj;
}
@property (nonatomic, retain) IBOutlet UITextField *fname;
@property (nonatomic, retain) IBOutlet UITextField *lname;
@property (nonatomic, retain) IBOutlet UITextField *phone;
@property (nonatomic, retain) SupDemo_Customer *originalObj;
-(SupDemo_Customer *)originalObj;
-(void)setOriginalObj: (SupDemo_Customer *)newObj;
-(IBAction)buttonPressed:(id)sender;
@end
DetailController.m
#import "DetailController.h"
#import "SupDemoAppDelegate.h"
#import "SupDemo_SupDemoDB.h"
#import "EditCustomerDetails.h"
@implementation DetailController
@synthesize fname;
@synthesize lname;
@synthesize phone;
-(SupDemo_Customer *)originalObj
{
return originalObj;
}
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 31
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease];
}
switch(indexPath.row)
{
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 32
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
case 0:
cell.textLabel.text=@"Address";
cell.detailTextLabel.text=[originalObj address];
break;
case 1:
cell.textLabel.text=@"City";
cell.detailTextLabel.text=[originalObj city];
break;
case 2:
cell.textLabel.text=@"State";
cell.detailTextLabel.text=[originalObj state];
break;
case 3:
cell.textLabel.text=@"Zip";
cell.detailTextLabel.text=[originalObj zip];
break;
case 4:
cell.textLabel.text=@"Phone";
cell.detailTextLabel.text=[originalObj phone];
break;
case 5:
cell.textLabel.text=@"Company";
cell.detailTextLabel.text=[originalObj company_name];
break;
case 6:
cell.textLabel.text=@"Sales Order";
cell.accessoryType=UITableViewCellAccessoryDetailDisclosureButton;
break;
}
return cell;
}
-(void)editDetails
{
EditCustomerDetails *editCustomerDetailsCntller=[[EditCustomerDetails
alloc]initWithNibName:@"EditCustomerDetails" bundle:[NSBundle mainBundle] forCustomer:originalObj];
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 33
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
@end
6. Create EditCustomerDetails
EditCustomerDetails.h
#import <UIKit/UIKit.h>
#import "SupDemo_Customer.h"
UITextField *txtfieldFname;
UITextField *txtfieldLname;
UITextField *txtfieldAddress;
UITextField *txtfieldStreet;
UITextField *txtfieldPin;
UITextField *txtfieldPhone;
UITextField *txtfieldCompany;
SupDemo_Customer *customer;
@end
EditCustomerDetails.m
#import "EditCustomerDetails.h"
#import "SupDemo_Customer.h"
@implementation EditCustomerDetails
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil forCustomer:(SupDemo_Customer
*)customerobj{
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
// Custom initialization
}
UIBarButtonItem *barButtonitemEdit =[[UIBarButtonItem
alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(updateDetails)];
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 34
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
self.navigationItem.rightBarButtonItem=barButtonitemEdit;
customer=customerobj;
return self;
}
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
- (void)viewDidUnload {
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
-(void)viewWillAppear {
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 35
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
switch (indexPath.row)
{
case 0:
lblFname=[[UILabel alloc]initWithFrame:CGRectMake(20,10, 80,30)];
lblFname.text=@"First Name";
lblFname.font=[UIFont boldSystemFontOfSize:14];
[cell addSubview:lblFname];
[lblFname release];
break;
case 1:
lblLname=[[UILabel alloc]initWithFrame:CGRectMake(20,10,80,30)];
lblLname.text=@"Last Name";
lblLname.font=[UIFont boldSystemFontOfSize:14];
[cell addSubview:lblLname];
[lblLname release];
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 36
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
break;
case 2:
lblAddress=[[UILabel alloc]initWithFrame:CGRectMake(20,10, 70,30)];
lblAddress.text=@"Address";
lblAddress.font=[UIFont boldSystemFontOfSize:14];
[cell addSubview:lblAddress];
[lblAddress release];
case 3:
lblState=[[UILabel alloc]initWithFrame:CGRectMake(20,10, 70,30)];
lblState.text=@"State";
lblState.font=[UIFont boldSystemFontOfSize:14];
[cell addSubview:lblState];
[lblState release];
case 4:
lblZip=[[UILabel alloc]initWithFrame:CGRectMake(20,10, 70,30)];
lblZip.text=@"Pin";
lblZip.font=[UIFont boldSystemFontOfSize:14];
[cell addSubview:lblZip];
[lblZip release];
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 37
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
case 5:
lblCompany=[[UILabel alloc]initWithFrame:CGRectMake(20,10, 70,30)];
lblCompany.text=@"Company";
lblCompany.font=[UIFont boldSystemFontOfSize:14];
[cell addSubview:lblCompany];
[lblCompany release];
case 6:
lblPhone=[[UILabel alloc]initWithFrame:CGRectMake(20,10, 70,30)];
lblPhone.text=@"Phone";
lblPhone.font=[UIFont boldSystemFontOfSize:14];
[cell addSubview:lblPhone];
[lblPhone release];
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 38
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
[txtfieldPhone becomeFirstResponder];
[cell addSubview:txtfieldPhone];
break;
return cell;
}
}
-(void)updateDetails
{
SupDemo_Customer *newCustomer = [SupDemo_Customer find: [customer id]];
if (newCustomer)
{
[newCustomer setFname:txtfieldFname.text];
[newCustomer setLname:txtfieldLname.text];
[newCustomer setAddress:txtfieldAddress.text];
[newCustomer setState:txtfieldStreet.text];
[newCustomer setZip:txtfieldPin.text];
[newCustomer setPhone:txtfieldPhone.text];
[newCustomer setCompany_name:txtfieldCompany.text];
[newCustomer save];
[newCustomer submitPending];
while ([SupDemo_SupDemoDB hasPendingOperations])
{
sleep(1);
}
//SupDemoAppDelegate *delegate = [[UIApplication sharedApplication] delegate];
[self.navigationController popViewControllerAnimated:YES];
}
}
- (void)dealloc {
[super dealloc];
}
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 39
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
@end
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 40
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 41
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
On The device go to Settings > Sybase Settings and enter the same details as shown below
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 42
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
7. Launch the application and enter the same credentials as used for SCC or use username : supuser,
password : s3pUser
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 43
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 44
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 45
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 46
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
Related Content
SUP 1.5.5 : MBO development
SUP 1.5.5 : iOS development documentation
SUP 2.0.0 : Documentation
SUP 2.0.0 : SCC
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 47
Sybase Unwired Platform: How to develop an iPhone Application using SUP.
Copyright
© Copyright 2011 Advent Global Solutions Inc., All rights reserved.
© Copyright 2011 SAP AG., All rights reserved.
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG.
The information contained herein may be changed without prior notice.
Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.
Microsoft, Windows, Excel, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation.
IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, System x, System z, System z10, System z9, z10, z9,
iSeries, pSeries, xSeries, zSeries, eServer, z/VM, z/OS, i5/OS, S/390, OS/390, OS/400, AS/400, S/390 Parallel Enterprise Server,
PowerVM, Power Architecture, POWER6+, POWER6, POWER5+, POWER5, POWER, OpenPower, PowerPC, BatchPipes,
BladeCenter, System Storage, GPFS, HACMP, RETAIN, DB2 Connect, RACF, Redbooks, OS/2, Parallel Sysplex, MVS/ESA, AIX,
Intelligent Miner, WebSphere, Netfinity, Tivoli and Informix are trademarks or registered trademarks of IBM Corporation.
Linux is the registered trademark of Linus Torvalds in the U.S. and other countries.
Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of Adobe Systems
Incorporated in the United States and/or other countries.
Oracle is a registered trademark of Oracle Corporation.
UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.
Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of
Citrix Systems, Inc.
HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C®, World Wide Web Consortium, Massachusetts
Institute of Technology.
Java is a registered trademark of Sun Microsystems, Inc.
JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by
Netscape.
SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP Business ByDesign, and other SAP products and services mentioned
herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries.
Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions, Web Intelligence, Xcelsius, and
other Business Objects products and services mentioned herein as well as their respective logos are trademarks or registered
trademarks of Business Objects S.A. in the United States and in other countries. Business Objects is an SAP company.
All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document
serves informational purposes only. National product specifications may vary.
These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP
Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or
omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the
express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an
additional warranty.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 48