Wednesday, 18 December 2013

Categories in Objective-C

Very elegant concept introduced by apple in objective-c programming language is 'Category'.
We can treat them to extending the functionality of existing class.

  • Used to "Customise the existing class" i.e. to extend the functionalities of existing class.
  • Category made for a class will also available for all its subsequent subclasses.
  • Scope of category is to the entire application.
  • We can name the Category as existing class name so no need to remember new name.
  • Data variables are not available to use only Member functions.
  • Very easy to create.
Resources:

Sunday, 11 August 2013

Adding multiple buttons with spacing on UINavigation Bar programatically in iOS

This is the situation where we are unable to see the Navigation bar of UIViewController on storyboard...So to add the buttons on Navigation bar programatically as shown in following figure, we need the following code snippet.
    UIImage *image = [UIImage imageWithContentsOfFile: [[NSBundle mainBundle] pathForResource:@"sync" ofType:@"png"]];

UIButton* addButtons = [UIButton buttonWithType:UIButtonTypeCustom];
[addButtons setBackgroundImage:image forState:UIControlStateNormal];
[addButtons setShowsTouchWhenHighlighted:YES];

addButtons.frame = CGRectMake(0,0, image.size.width, image.size.height);

[addButtons addTarget:self action:@selector(syncAction) forControlEvents:UIControlEventTouchUpInside];

UIBarButtonItem *addButtonBars = [[UIBarButtonItem alloc]initWithCustomView:addButtons];

UIImage *images = [UIImage imageWithContentsOfFile: [[NSBundle mainBundle] pathForResource:@"logout1" ofType:@"png"]];

UIButton* addButtons1 = [UIButton buttonWithType:UIButtonTypeCustom];
[addButtons1 setBackgroundImage:images forState:UIControlStateNormal];
[addButtons1 setShowsTouchWhenHighlighted:YES];

addButtons1.frame = CGRectMake(0,0, image.size.width, image.size.height);

[addButtons1 addTarget:self action:@selector(Logout11) forControlEvents:UIControlEventTouchUpInside];

UIBarButtonItem *logout = [[UIBarButtonItem alloc]initWithCustomView:addButtons1];

// Optional: if you want to add space between the sync & logout buttons
UIBarButtonItem *fixedSpaceBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
fixedSpaceBarButtonItem.width = 5;   

self.navigationItem.leftBarButtonItems =[logout,fixedSpaceBarButtonItem,addButtonBars];

Wednesday, 3 April 2013

SOAP web service in blackberry (java environment)

Hi everyone,
    It's my pleasure to give a tutorial and environment setup needed to complete a web service for .net using a SOAP protocall.When I need this, I spent 2 days to did a successful compilation of SOAP in blackberry,so decided to post SOAP tutorial here.

First of all we need a SOAP JAR which must be "pre-verified", other wise you have  a very tedious process to create a pre-verified jar...so I attaching a alredy preverified jar for SOAP.

download: blackberry preverified ksoap2 jar 

==>then add to the project you need through ->properties->java build path->libraries-->add external jar.
==>also checkmark the checkbox under the tab-export import.

And the code sample tutorial is attached here.


Let me know..if you have any problem regarding this...Best luck.

and one important note,  append ";devicedide=true" to the service URL.
(If deviceside=true is specified in the connection URI, a direct TCP connection is opened from the handheld, without using the BlackBerry MDS Connection Service.)

Thursday, 14 March 2013

40 Per Cent of BB10′s Apps are Wrappered Android Conversions


Turns out BlackBerry's proud claim that the new BB10 phones are launching with 70,000 bespoke apps was a bit of a lie—with one of the company's own men admitting that up to 40 per cent of these are frantic Android port jobs.
Martyn Mallick, BB's VP of global alliances and business development, told reporters after the launch event that "40 percent [of BB10 apps] are wrapped Android applications," many of which came about as part of the recent Port-a-thon initiative, in which anyone with any functional app could earn themselves a few quid by smashing together a BB10 version using BlackBerry's porting tools.
Not to mention there are plenty of so-called BB10 apps that are little more than shortcuts to mobile web sites. Still, it's early days. Anyone who used an Android phone in the mobile platform's first year or two of existence can testify to the amount of time it takes to build up a quality app portfolio.