Pages

Sunday, May 29, 2011

What it seems to be, but it wasn't

Some time ago, I read somewhere that Microsoft will help iOS developers to migrate their apps/games to Microsfot Windows Phone market, and for that objective Microsoft launches iOS to WP7 API Mapping Tool. I was surprised, I thought Microsoft released a tool that save us a lot of time translating our classes from Objective-C, and maybe also xib files will be translated to XAML files with only a mouse click. So a few days ago I decided to download this tool to migrate some of my apps (Tickeating and Valladolid Wifi) to WP7 in a few time but... Oh wait! There was not a "magical tool" that transalate all the code for me...

So, did Microsoft lie us??? I don't think that at all, I want to think that there was a confusion with the name, and the word "tool" will not be there. But wait a moment, Microsoft had the detail for iOS developer to map the libraries from one framework to another. There isn't a "magical tool" that saves us a lot of time, but there is a good tool that saves us some time, be positive my friends.

With this aptitude I think that Microsoft wants to attract iOS apps and game developers to migrate its applications to Windows Phone. Develop for Windows Phone with Visual Studio 2010 its easy for people who develops for iOS so its a great idea release this kind of tools, in an attemp to gain Android apps market share and obviously sell more devices.

This is the URL of iOS to WP7 API Mapping Tool: http://wp7mapping.interoperabilitybridges.com/

[iPhone-app] Valladolid WiFi

Valladolid WiFi is a smart utility application which helps the user to look for public WiFi access points located in Valladolid. From tourist to Valladolid citizens they could use the applications for find a public wifi in a pub, hotel or university and get connected.

At the moment there is only Valladolid WiFi at app store, but we are looking for people who wants to bring this application to their city all over the world. We only need that people send us the name, address and location of their business whith public WiFi and we'll put it into the application database (we need a minimum of 15 WiFi point to launch a city personalized app) and it's for FREE.

If you are interested, please contact me: fiveflamesmobile@gmail.com

Name: Valladolid WiFi
Language: Spanish
Category: Utilities
Cost: Free

Valladolid WiFi AppStore Link

Wednesday, May 25, 2011

[Code Snippet] Custom UINavigationItem title

Last week I was working in an iPhone navigation based project, the customer wanted to have its own corporative colors in the application, and for the UINavigationBar too.

There was no problem with whole color for buttons and bar, using the UINavigationBar tintColor proprerty I set the desired color, but when the UINavigationItem title time becomes it was more difficult. We have to forget the UINavigationItem title proprerty and work with titleView one. This proprerty can be fulfilled with any UIView object, in my case I used a UILabel, but I have to set a different titleView for my different UIViewControllers so I encapsulated this in the function that I make available for you.

+ (UILabel*) labelForNavigationItem:(NSString*)text
{
   
   
    UILabel *titleView = [[[UILabel alloc] initWithFrame:CGRectMake(0, 0, 120, 30)] autorelease];
    [titleView setFont:[UIFont boldSystemFontOfSize:16.0]];
    titleView.backgroundColor = [UIColor clearColor];
    titleView.textAlignment = UITextAlignmentCenter;
    titleView.textColor  = [UIColor colorWithRed:.80784314 green:.77647079 blue:.50980392 alpha:1.0];
    titleView.textColor = [UIColor whiteColor];
    titleView.text = text;
   
    return titleView;
}
And assign the corresponding proprerty on viewDidLoad function

self.navigationItem.titleView = labelForNavigationItem:@"Menu";
That's all.

But at last I found a problem that I wasn't able to accomplish. I want to keep the standard UINavigationController backButton, but how could I change its font color? I think its no possible (at least without using an image), but if someone has any answer I would be grateful.

Enjoy it!

Wednesday, May 18, 2011

[Code Snippet] Hex Color (HTML) to "iOS RGB"

Most of the available applications at mobile markets are games or marketing apps, so our customers wants a very visual interface, an interface which attract the potential users or only embed the corporation logo and colours into the app's look & feel.

But most of developers have one handicap: We don't know about graphic design, color combination and logo designs, although some customer don't take care about that, so we have to work with a designer which makes all that graphic work. In most cases the designer give us the colors in RGB mode (0-255), so we have to convert them to "Mac RGB" (0 to 1) dividing each value between 255. But, what happends when the designer give us the colors on hexadecimal (HTML) coding?.

Today's code snippet tries to solve that with this little function that you can use to convert from hexadecimal to "MAC RGB" whith only a call.


+ (UIColor *) colorWithHexString: (NSString *) stringToConvert
{
NSString *cString = [[stringToConvert stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] uppercaseString];

// String should be 6 or 8 characters
if ([cString length] < 6) return DEFAULT_VOID_COLOR; // strip 0X if it appears if ([cString hasPrefix:@"0X"]) cString = [cString substringFromIndex:2]; if ([cString length] != 6) return DEFAULT_VOID_COLOR; // Separate into r, g, b substrings NSRange range; range.location = 0; range.length = 2; NSString *rString = [cString substringWithRange:range]; range.location = 2; NSString *gString = [cString substringWithRange:range]; range.location = 4; NSString *bString = [cString substringWithRange:range]; // Scan values unsigned int r, g, b; [[NSScanner scannerWithString:rString] scanHexInt:&r]; [[NSScanner scannerWithString:gString] scanHexInt:&g]; [[NSScanner scannerWithString:bString] scanHexInt:&b]; return [UIColor colorWithRed:((float) r / 255.0f) green:((float) g / 255.0f) blue:((float) b / 255.0f) alpha:1.0f]; }




I stole this piece of code from this Ars Tecnica's article where you could find more about UIColor conversions in.

Enjoy it!

Monday, May 16, 2011

Follow us in Twitter.

Five Flames Mobile has its own profile in Twitter network. Follow us! (if you want)

Seguir a FiveFlames en Twitter

Sunday, May 15, 2011

[WindowsPhone-Game] Race

Continuing with the retro games serie for Windows Phone, this game tries to recreate that old arcade machine in which you are a driver who has to avoid those kamikaze cars that comes against you (or maybe we are the kamikaze) moving to the left or to the right, and pick up the girl that appears near the road's border.
Developed with XNA Framework for Windows Phone 7 this game is only available at Microsoft Marketplace, and maybe will be available soon for iPhone at appStore.

Name: Race
Language: N/A
Category: Game
Cost: 0,99$ / 0,79 €

Wednesday, May 11, 2011

[Code Snippet] UIActivitiyIndicator at right bar button place.

Let's continue with the weekly code snippet series. Sometimes we have an UITableViewController inside a UINavigationController that we want to update performing the data query in background and notify the user that this update is going on with a UIActivityIndicator control.

The better place to place the UIActivity indicator is on navigation bar, so the activity indicator don't appears in the middle of the screen bothering the user in is normal interaction with the application.

To accomplish this, here you are a little code snipe for placing an little UIActivityIndicator at top right corner of the screen instead of a UIBarButton.

// Create a 'right hand button' that is a activity Indicator
CGRect frame = CGRectMake(0.0, 0.0, 25.0, 25.0);
self.activityIndicator = [[UIActivityIndicatorView alloc]
            initWithFrame:frame];
[self.activityIndicator sizeToFit];
self.activityIndicator.autoresizingMask =
    (UIViewAutoresizingFlexibleLeftMargin |
    UIViewAutoresizingFlexibleRightMargin |
    UIViewAutoresizingFlexibleTopMargin |
    UIViewAutoresizingFlexibleBottomMargin);

UIBarButtonItem *loadingView = [[UIBarButtonItem alloc]
         initWithCustomView:self.activityIndicator];
loadingView.target = self;
self.navigationItem.rightBarButtonItem = loadingView;

I've found that code snippet in Even Davey's Blog

Enjoy it!

Wednesday, May 4, 2011

[Code Snippet] UITableViewCell background color

Let's go with the code snippet for this week. Recently I had to load some data in a UITableView controller and mark some cells with a different background color depending of its priority, so I tried to set the background color programatically in the cellForRowAtIndexPath method but nothing happends.

So looking for the internet I found this little code snippet that allows us to change UITableViewCell background color programatically.

UIView *bg = [[UIView alloc] initWithFrame:cell.frame];
bg.backgroundColor = [UIColor greenColor]; // or any color
cell.backgroundView = bg;
[bg release];

Enjoy it!

[iPhone-app] CarCharge

CarCharge is an iPhone application that allows the user to localize the nearest electric vehicle (EV) charge point at Spain.
It allows user for searching in a distance from users location an shows all available charge points and the distance to them.
With a very visual and intuitive interface it will be a neccesary application for every EV owner who has an iPhone device.

Name: Carcharge
Language: N/A
Category: Lifestyle
Cost: FREE

CarCharg AppStore Link