• iSENDu

    • iSENDu Videos
  • S-Cube

    • S-Cube Project
  • Event Seeker

    • volume.at
  • q·.:World

    • q·.:LAUNCHER
    • q·.:CARD
    • q·.:Generator
    • q·.:Specs
  • Home

    • Imprint
    • GTC
    • Sitemap
  • services
  • blog
  • help
  • about

ikangai.com

  • Search Blog

  • Pages

    • A Cross-Platform Software System to Create and Deploy Mobile Mashups
    • Apps using q·.:Codes
    • Concours Worldvision de la q·.:Launcher
    • expressFLOW
    • Prototype
  • Latest Entries

    • Writing Scientific Papers
    • Code Snippet of the Week: Using Quartz to draw the background of UIButtons
    • Concours Worldvision de la q·.:Launcher
    • Concours Eurovision de la Chanson
    • We’ve got mail from Apple
  • Categories

    • Code snippet (1)
    • Design (11)
    • Development (32)
    • Events (7)
    • Hardware (2)
    • iSENDu (39)
    • iTunes App Store (20)
    • News (13)
    • Science (7)
    • Software (18)
    • Sports (1)
    • Uncategorized (48)
    • University (2)
    • Website (4)
  • Archives

    • August 2010 (2)
    • July 2010 (7)
    • June 2010 (7)
    • May 2010 (6)
    • April 2010 (13)
    • March 2010 (11)
    • February 2010 (8)
    • January 2010 (8)
    • December 2009 (9)
    • November 2009 (6)
    • October 2009 (8)
    • September 2009 (13)
    • August 2009 (14)
  • Subscribe

    • Subscribe rss feed

Archive for the ‘Software’ Category

Writing Scientific Papers

Friday, August 27th, 2010

We did it! We submitted our first scientific paper to a conference. Our target conference is the International Conference on Software Engineering (ICSE) which will take place at Hawaii (obviously a very nice location :-) ) between May 21st and May 28th 2011. The competition is more than tough – we expect an acceptance rate around 10 per cent. Thus, we consider our paper more or less a “stunt”: high risk, but potentially high rewards.

So what is our paper about? Well, it is about the application of SOA principles on mobile operating systems like the iPhone OS and the implications of this approach. We investigated the role of Apps and App Stores with regard to the SOA triangle and discussed how to use our Apps (q·.:Launcher and q·.:Card) for this. Interested in more? I guess then you’ll have to wait, until we receive notification of the ICSE program committee, which is due on November 19th. In the meantime we will continue working on our new project with woodapples and write another scientific paper which is a joined effort with Distributed Systems Group of Vienna Technical University. This time, the topic is centered around crowd sourcing and how we do this at ikangai solutions.

your ikangai team

Tags: ICSE 2011, Paper, q·.:CARD, q·.:Launcher, Science, SOA
Posted in Science, Software | No Comments »

Code Snippet of the Week: Using Quartz to draw the...

Wednesday, August 11th, 2010

Ever wanted to use UIButtons with backgrounds that change when a UIButton is pressed? Unfortunately, this is not so straightforward as one could wish for. Typically, you have to use predefined images to do this、 and set the background image according the state of the UIButton with
[contactButton setBackgroundImage: imageHighlighted forState:UIControlStateHighlighted];
A standard solution that includes that a PNG UIImage is displayed when the button is pressed looks like this:

UIImage *imageHighlighted = [UIImage imageNamed:@"highlighted.png"];
UIButton *contactButton = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 158, 30)];
contactButton.backgroundColor = [UIColor clearColor];
[contactButton setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
[contactButton setTitleColor:[UIColor lightGrayColor] forState:UIControlStateHighlighted];
[contactButton setTitle:@"Contacts" forState:UIControlStateNormal];
[contactButton setTitle:@"Contacts" forState:UIControlStateHighlighted];
[contactButton actionsForTarget:@selector(selectContacts:) forControlEvent:UIControlEventTouchUpInside];
contactButton.titleLabel.font = [UIFont fontWithName:@"Verdana" size:12];
[contactButton setBackgroundColor:[UIColor clearColor]];
[contactButton setBackgroundImage: imageHighlighted forState:UIControlStateHighlighted];
[self addSubview:contactButton];

Wouldn’t it be nice to do this without PNG images you have to draw upfront? Fortunately, there is Quartz to help you with that. The main benefit of Quartz is its flexibility: you can apply all kind of effects on the UIButtons without needing to draw PNG images before. The Code for creating Quartz background images for UIButtons is straightforward: you have to define a context with UIGraphicsBeginImageContext from which you retrieve a UIImage with UIGraphicsGetImageFromCurrentImageContext. This image is later used in the button when it is highlighted: [contactButton setBackgroundImage: imageView.image forState:UIControlStateHighlighted];

// 1. create UIImageView container that contains a "nil" UIImage and assign variable for later use
UIImageView *imageView = [[UIImageView alloc] initWithImage:nil];
UIImage *image = imageView.image;
// 2. set size of the UIImageView -> the same as the UIButton
imageView.frame = CGRectMake(0, 0, 158, 30);
// 3. start image context
UIGraphicsBeginImageContext(CGSizeMake(158, 30));
// 4. define fill color of rectangle
CGContextSetFillColor(UIGraphicsGetCurrentContext(), CGColorGetComponents([UIColor colorWithRed:1 green:1 blue:1 alpha:1].CGColor));
// 5. draw rectangle
[image drawInRect:CGRectMake(0, 0, 158, 30)];
// 6. create context path
CGContextBeginPath(UIGraphicsGetCurrentContext());
// 7. set origin
CGContextMoveToPoint(UIGraphicsGetCurrentContext(), 0, 0);
// 8. add rectanlge to path
CGContextAddRect(UIGraphicsGetCurrentContext(), CGRectMake(0, 0, 158, 30));
// 9. fill rectangle
CGContextFillPath(UIGraphicsGetCurrentContext());
// 10. get image from current context
image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

The trick is to use a UIImageView with an empty image: [[UIImageView alloc] initWithImage:nil]; This allows us later to access the UIImage from the UIImageView. The reason for this is that you cannot create an empty UIImage (at least, I’m not aware of this). The use is simple: you create a UIButton as you are used to and set the image for the state: [contactButton setBackgroundImage: image forState:UIControlStateHighlighted];

// 11. create UIButton
UIButton *contactButton = [[UIButton alloc]initWithFrame:CGRectMake(84, 225, 158, 30)];
contactButton.backgroundColor = [UIColor greenColor];
[contactButton setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
[contactButton setTitleColor:[UIColor lightGrayColor] forState:UIControlStateHighlighted];
[contactButton setTitle:@"Press Me" forState:UIControlStateNormal];
[contactButton setTitle:@"Color Change" forState:UIControlStateHighlighted];
contactButton.titleLabel.font = [UIFont fontWithName:@"Verdana" size:12];
// 12. set background image for highlighted state
[contactButton setBackgroundImage:image forState:UIControlStateHighlighted];
[self.view addSubview:contactButton];
[imageView release];
[contactButton release];

You can download the demo project from here.

Your coding ikangai team

PS: The code snippet uses portions of this code.

Tags: Background, Code Snippet of the Week, Quartz, UIButton
Posted in Code snippet, Development, Software | No Comments »

Working on the S-Cube Knowledge Model iPhone App

Friday, February 26th, 2010

Having finally started to understand people from academia ourselves, we have now decided that it is time for ordinary people to do the same :-) . We are currently in the process of writing an iPhone app for the so-called S-Cube Knowledge Model, which is a collection of definitions in the area of Web Services and Web Service related Technologies. There are – of course – some challenges for the representation of content on a small device like an iPhone, but we are very optimistic that we will master these and be able to provide a useful application with some interesting ideas concerning the user interface.

Your ikangai team

Tags: Academia, iPhone App, S-Cube, S-Cube Knowledge Model
Posted in Science, Software | No Comments »

Apple’s enemy selection policy

Friday, February 5th, 2010

Apple was always careful with the selection of it’s enemies and alliances. The famous 1984 commercial showed an IBM dominated world where only the use of an Macintosh could guarantee freedom. During the nineties, the Think Different campaign put Apple user at the same level with people like Ghandi, because he would have used a Mac for his work to bring freedom to his people. The current Get a Mac campaign shows cool Apple users and boring, business stereotypes that are not able to handle the simplest tasks like making a Web page without a lot of trouble.
A central motive in all the ads is the role of Apple as a David that takes on a fight with a Goliath (IBM, Microsoft).
But, who is going to be the next target of Apple? Or put differently, who is the next Goliath? Well, this might actually be Google. Apple recently bought Quattro Wireless, a company that is specialized in mobile marketing. Google is certainly interested in the mobile advertisement market and offers the Google Phone with Andriod. So, both companies are in the same market and will compete for the same customers. It’s only a matter of time, when we will see Apple ads that present Andriod phones as poorly designed and difficult to use and keeps on pestering the users with permanent advertising.

your ikangai team

Tags: 1984, Apple, Get a Mac, IBM, Microsoft, Think Different
Posted in News, Software | No Comments »

Code snippet of the week-Modal UIAlertView

Monday, January 25th, 2010

Some things on the iPhone are more complicated than they need to be. One example is the use of modal UIAlertViews to ask the user for feedback before continuing with the execution of the program. In a pseudo code notation, it looks like this:

startWithSomething()
int res = Inputbox("Do you want to save the data?", Yes, No)
if (res==1) {
  doSomething()
} else {
  doSomethingElse()
}
continueWithSomething()

This pseudo code snippet would wait until the user either decides Yes and then execute doSomething() followed by continueWithSomething() or doSomethingElse() followed by continueWithSomething().
If one decides to implement the same on the iPhone, we need to do a few additional things. First of all, we need to create an UIAlertView delegate that implements the UIAlertViewDelegate protocol. Then, we need to assure that the delegate informs us about the user decision. We do this by generating events to which we attach event observers:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(doSomething:) name:@"UserSaysYes" object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(doSomethingElse:) name:@"UserSaysNo" object:nil];

This code listens for events with the name UserSaysYes (UserSaysNo) and calls the method doSomething (doSomethingElse) if the corresponding event can be observed.
In the UIAlertViewDelegate we need to generate the events by adding the following code:

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex=0) {
NSMutableArray *keys = [NSMutableArray arrayWithObjects:@"Info", nil];
NSMutableArray *objects = [NSMutableArray arrayWithObjects:@"Yes Sir!" , nil];
NSDictionary *info = [[NSDictionary dictionaryWithObjects:objects forKeys:keys]];
[[NSNotificationCenter defaultCenter]postNotificationName:@"UserSaysYes" object:info];
} else {
NSMutableArray *keys = [NSMutableArray arrayWithObjects:@"Info", nil];
NSMutableArray *objects = [NSMutableArray arrayWithObjects:@"No Sir!" , nil];
NSDictionary *info = [[NSDictionary dictionaryWithObjects:objects forKeys:keys]];
[[NSNotificationCenter defaultCenter]postNotificationName:@"UserSaysNo" object:info];
}

The implementation of doSomething (doSomethingElse) is straightforward: we parse the notification object and print the content on the console. Then we call continueWithSomething in order to complete our example.

-(void) doSomething:(NSNotification *) notification {
NSDictionary *info = [notification object];
NSstring* text = [info objectForKey:@"Info"];
NSLog(text);
[self continueWithSomething];
}
-(void) doSomethingElse:(NSNotification *) notification {
NSDictionary *info = [notification object];
NSstring* text = [info objectForKey:@"Info"];
NSLog(text);
[self continueWithSomething];
}

The drawback of this method is obviously that the modal logic is scattered among different method implementations which can make a program hard to read. However, if you have one or two places in your code that need modal user input, this is certainly a way to do it.

Your ikangai team

Tags: Code Snippet of the Week, Modal, UIAlertView
Posted in Development, Software | No Comments »

Older Entries
Copyright © 2010 IKANGAI Solutions. Design by creativesyntax.at
IKANGAI Blog is powered by Wordpress | Login
Facebook It! Digg It! Stumble It! del.icio.us