Sep 11

With the OpenFeint App and his game spotlight, we have in our hands a new free game every day.

There are a lot of webs and even apps which allow us to find or be notified when apps get free, for gamer OpentFeint is a must App to have. I have been using it for a couple of weeks and the first thing i do every morning is to get the free game of the day, I don’t really have time enough to do more than a quick test of the game but at least I know I’m not missing the opportunity.

What I like of the OpenFeint system is the achievements and the social face of it, world rankings, friends and all the other options it offers.

We will see if OpenFeint can stand the blow from Apple and his new game center, knowing the guys from the apple it will be very good made and doesn’t only offers a world ranking but a multiplayer option.

Get it here

VN:F [1.9.8_1114]
Rating: 3.0/5 (1 vote cast)
VN:F [1.9.8_1114]
Rating: +3 (from 3 votes)
Tagged with:
Sep 09

Check here for the press release from Apple.

VN:F [1.9.8_1114]
Rating: 2.7/5 (3 votes cast)
VN:F [1.9.8_1114]
Rating: +2 (from 2 votes)
Tagged with:
Aug 31

Depending on the application we are developing, might be interesting or even needed that the iPhone doesn’t autolock while our application is running. We are lucky as there is an easy why to do this and it only needs one instrucction.

[UIApplication sharedApplication].idleTimerDisabled = YES;

That is all we need so the iPhone stays all the time with the screen on, a good place to put it is in the applicationDidFinishLaunch: in our UIApplication delegate.

Be careful though cause if the user runs away from the iPhone from long times it will empty its battery as it will have the display all the time on.

VN:F [1.9.8_1114]
Rating: 5.0/5 (1 vote cast)
VN:F [1.9.8_1114]
Rating: +2 (from 2 votes)
Tagged with:
Jul 26

VN:F [1.9.8_1114]
Rating: 4.7/5 (3 votes cast)
VN:F [1.9.8_1114]
Rating: +6 (from 6 votes)
Tagged with:
Jun 05

When we want to create an application that contains different functionality related with the use of the application, but independent between them, like showing data in different ways or different tasks, we will want to use a Tab Bar in our application.

The Tab Bar will gave us acces to this different views, like independent modules, more over, it helps the user to place himself inside the application, telling him what he is seeing.

Today we will give basic indication to create and set up a Tab Bar in our application. In Xcode we have a template which will create an application with a Tab Bar and two different views, although it is a good start point, when we take a look to the code we can see much of what it’s going on, that because they use Interface Builder to do almost all the setting up. We will show a bit more of code.

Structure

We have an application, inside there is our Tab Bar, we need to tell the Tab Bar which views (UIViewController) it has to show, each view will take care of itself, but we need to setup the property tabBarItem (UITabBarItem) for each view so the Tab Bar can show us the icon and title of it.

Data

The only thing we need is an icon for each view and a title. We can use both at the same time or only one of them, of course, a Tab Bar only with a title doesn’t look right so I will recommend at least to use an icon to represent what is done in that tab. The title is always welcome when the icon is not clear what represents.

The title isn’t more than a normal string that we will give in the code, but the icon is a bit more tricky and although Apple give as some system icons to use, take a look at UITabBarSystemItem, they also tell us how we have to create our own icon.

▪ Use PNG format.
▪ Use only pure white with proper transparency.
▪ Don’t add shadows.
▪ Use anti-aliasing.
▪ Size of 30 x 30 pixels.

Code

To create the Tab Bar and add it to the application use this

- (void)applicationDidFinishLaunching:(UIApplication *)application {
 
tabBarController = [[UITabBarController alloc] init];
 
MyViewController* vc1 = [[MyViewController alloc] init];
 
MyOtherViewController* vc2 = [[MyOtherViewController alloc] init];
 
NSArray* controllers = [NSArray arrayWithObjects:vc1, vc2, nil];
 
tabBarController.viewControllers = controllers;
 
[window addSubview:tabBarController.view];
 
}

We create the Tab Bar, the view controllers we need and put those in an array to tell the Tab Bar those are the one it has to show. We add the Tab Bar view to the window and we are finished.

To set up each of the UITabBarItem of each view we can use the following lines

UIImage* anImage = [UIImage imageNamed:@"MyTabBarIcon.png"];
 
UITabBarItem* theItem = [[UITabBarItem alloc] initWithTitle:@"TabBarItemTitle" 
                                                     image:anImage tag:0];
 
[myViewController setTabBarItem:theItem];

Usually we will put these lines in the view controller itself, on the init method, but might be necesarly to do it in some other place when we are not using our own classes, for example when one of the tabs uses a Navigation Bar, in that case we can put these lines just after creating the Navigation Bar.

VN:F [1.9.8_1114]
Rating: 5.0/5 (1 vote cast)
VN:F [1.9.8_1114]
Rating: -1 (from 1 vote)
Tagged with:
May 15

Sorry, this entry is only available in Español.

VN:F [1.9.8_1114]
Rating: 4.3/5 (6 votes cast)
VN:F [1.9.8_1114]
Rating: +3 (from 5 votes)
Tagged with:
May 14

En muchos foros y blog, se ve gente que pregunta si hay algún control en Xcode que nos permita dar puntuaciones del estilo de las cinco estrellitas que se ve por iTunes, iPhone, iPod y demás. En su día, yo mismo recurrí a Google para ver si encontraba uno, pero a parte de algunas explicaciones de como montarlo, algunas usando un slider del Xcode, con vistas o la clase UIControl, nadie daba nada.

Finalmente decidí montarme uno yo mismo, y hoy os lo traigo, modificado, para que podáis añadirlo fácilmente a vuestro proyecto y usarlo en cualquier vista dentro de vuestra aplicación. Al final del artículo, en el que explico como funciona y como usarlo, encontrareis el link para descargarlo.

Funcionamiento
Personalmente me decanté por usar una vista normal, UIView, para implementar mi “rating control”, el porqué es muy simple, aunque hay una clase especialmente pensada para controles, UIControl, no vamos a hacer grandes maravillas, lo único que nos interesa es que mientras el usuario desplaza el dedo por nuestro sistema de puntuación, se vayan iluminando las estrellas pertinentes.
Para ello uso un UIViewController, que se encarga de crear la vista, añadir el número de iconos necesarios, por norma 5 y seguir la interactuación del usuario para detectar cuando pulsa un icono en concreto, o desplaza el dedo de uno a otro, para mostrar el rating pertinente. De esta manera conseguimos una buena fluidez y el mismo efecto que cuando se usa el rating del iPod, iPhone o iTunes.

No entraré en detalla en el código en si, ya que los interesados disponen de los archivos, más abajo, para curiosear, pero intentaré dar los detalles suficientes para que sea fácil usar esta clase en vuestra aplicación.

Aquí tenéis el contenido de la cabecera de la clase RatingViewController:

//
//  RatingViewController.h
//
//  Created by www.zenbrains.com on 5/13/10.
//  Copyright 2010 Zenbrains. All rights reserved.
//
 
#import <UIKit/UIKit.h>
 
 
@interface RatingViewController : UIViewController {
 
	// Property to acces the rate given by the user
	NSInteger rate;
 
	// Arrays to store the names of the images for the icons, when active and unactive
	// initialize through the designates initializer
	NSArray *ratedIcons;
	NSArray *unratedIcons;
 
	// Instances to set up the aspect of the rating view
	// initialize through the designates initializer
	NSInteger numberOfRates;
	NSInteger ratingViewWidth;
	NSInteger ratingViewHeigth;
	NSInteger ratingIconWidth;
}
 
@property NSInteger rate;
 
// The designated initializer.
- (id)initWithRates:(NSInteger)numRates viewWidth:(NSInteger)viewWidth viewHeight:(NSInteger)viewHeight 
		  iconWidth:(NSInteger)iconWidth ratedIcons:(NSArray*)ratIcons unratedIcons:(NSArray*)unratIcons;
// To move the rating view where you want
- (void)locateRatingViewAtPoint:(CGPoint)point;
// To set the initial rate for the view in case you have a rate stored
- (void)setRate:(int)rate;
 
// You shouldn't need to call this one 
- (void)updateRatingViewWithLocation:(CGPoint)touchPosition;
 
@end

Sobre las variables, los comentarios explican para que se usa cada cosa, solo comentaros algo sobre el rate:

rate, a través de esta propiedad es como se accede al valor actual del rating, esta pensado para valores enteros de 1 a 5 (normalmente) dejando el 0 libre para cuando no tenemos aun una puntuación.

En cuanto a los métodos, también se explican por si solos, solo comentaros que con el initWithRates:viewWidth:viewHeight:iconWidth:ratedIcons:unratedIcons: es con el que se inicializan todas las variables anteriores a los valores que nos interesan, si usáis el típico initWithNibName:bundle: para inicializar esta clase, se usarán unos valores dados por defecto dentro del RatingViewController.m, pero la vista quedará situada en la esquina superior izquierda, luego podéis moverla con el método locateRatingViewAtPoint:.

Daros cuenta de que se ha sobrescrito el método setRate: para que no solo le de el valor a la variable rate sino para que actualice también, el aspecto de los iconos en la vista.

Como usarlo en vuestra aplicación

Bien, una vez ya sabemos cómo funciona, solo queda dar un ejemplo de como usarlo en vuestra aplicación. En el zip de más abajo se incluyen los archivos RatingViewController.h y .m, junto con un set de imágenes que son las que se usan por defecto al llamar el initWithNibName:bundle:. Incluir todos estos archivos a vuestro proyecto. Ahora, desde cualquier otra clase podéis incluir esta vista, por ejemplo desde el viewDidLoad de vuestra vista principal.

- (void)viewDidLoad {
    [super viewDidLoad];
 
	// 3 rates stars
	NSArray *anArray = [NSArray arrayWithObjects:@"starFL.png",@"starFC.png",@"starFR.png",nil];
	NSArray *otherArray = [NSArray arrayWithObjects:@"starEL.png",@"starEC.png",@"starER.png",nil];
	ratingViewController = [[RatingViewController alloc] initWithRates:3 viewWidth:90 viewHeight:30 iconWidth:30 ratedIcons:anArray unratedIcons:otherArray];
	[ratingViewController locateRatingViewAtPoint:CGPointMake(10, 50)];
	[ratingViewController setRate:1];
 
	// 5 rates stars
	anArray = [NSArray arrayWithObjects:@"starFL.png",@"starFC.png",@"starFC.png",@"starFC.png",@"starFR.png",nil];
	otherArray = [NSArray arrayWithObjects:@"starEL.png",@"starEC.png",@"starEC.png",@"starEC.png",@"starER.png",nil];
	RatingViewController *rateViewA= [[RatingViewController alloc] initWithRates:5 viewWidth:300 viewHeight:60 iconWidth:60 ratedIcons:anArray unratedIcons:otherArray];
	[rateViewA locateRatingViewAtPoint:CGPointMake(10, 110)];
	[rateViewA setRate:3];
 
	// 6 rates leafs
	anArray = [NSArray arrayWithObjects:@"leafR.png",@"leafB.png",@"leafY.png",@"leafYG.png",@"leafG.png",@"leafG.png",nil];
	otherArray = [NSArray arrayWithObjects:@"leafE.png",@"leafE.png",@"leafE.png",@"leafE.png",@"leafE.png",@"leafE.png",nil];
	RatingViewController *rateViewB = [[RatingViewController alloc] initWithRates:6 viewWidth:240 viewHeight:40	iconWidth:40 ratedIcons:anArray unratedIcons:otherArray];
	[rateViewB locateRatingViewAtPoint:CGPointMake(10, 210)];
	[rateViewB setRate:30];
 
	// 10 rates leafs
	anArray = [NSArray arrayWithObjects:@"leafR.png",@"leafB.png",@"leafY.png",@"leafYG.png",@"leafG.png",@"leafR.png",
			   @"leafB.png",@"leafY.png",@"leafYG.png",@"leafG.png",nil];
	otherArray = [NSArray arrayWithObjects:@"leafE.png",@"leafE.png",@"leafE.png",@"leafE.png",@"leafE.png",@"leafE.png",
				  @"leafE.png",@"leafE.png",@"leafE.png",@"leafE.png",@"leafE.png",@"leafE.png",nil];
	RatingViewController *rateViewC = [[RatingViewController alloc] initWithRates:10 viewWidth:300 viewHeight:30 iconWidth:30 ratedIcons:anArray unratedIcons:otherArray];
	[rateViewC locateRatingViewAtPoint:CGPointMake(10, 310)];
	[rateViewC setRate:-5];
 
	[[self view] addSubview:[ratingViewController view]];
	[[self view] addSubview:[rateViewA view]];
	[[self view] addSubview:[rateViewB view]];
	[[self view] addSubview:[rateViewC view]];
 
}

En este ejemplo estoy añadiendo cuatro “rating views” a mi vista, normalmente solo usareis uno, para mostrar lo que se puede hacer con esta clase, crear vuestros propios iconos, calcular como ha de ser de grande la vista (podéis usar Interface Builder para encontrar los pixeles) y solo tenéis que crear un objeto de esta clase, inicializarlo y ponerlo donde queráis. Con el código anterior obtenemos lo siguiente

Bueno, espero que os sea de utilidad y podáis usar esta vista en vuestras aplicaciones, sentiros libres de usar el código con o sin modificaciones, pero si tenéis un hueco en el código o los créditos de vuestra aplicación, siempre podéis mencionar nuestro nombre como agradecimiento.

Aquí os dejo los archivos. RatingViewController

VN:F [1.9.8_1114]
Rating: 3.9/5 (8 votes cast)
VN:F [1.9.8_1114]
Rating: +1 (from 1 vote)
Tagged with:
Apr 05

Since we started Zenbrains, we knew it clear that we wanted our applications to have a common fact: being useful and giving the user a very clear value. Of course, from time to time, we would also launch some “divertimento” like Letris (which is coming soon to the store!), but the most clear example of the previous lines was ZenTap, an application for writing assistance on the iPhone.

To our surprise, some days ago we received a message through our website, from Michael Bergmann. He told us he was a father of a 14 years old autistic boy, who had learned to communicate by means of pointing to letters on an alphabet board, which was an amazing advanced step.

We must admit that after such an introduction, and before having read his next words, we were a little confused. But, gaining connection with our possibilities of helping, Michael’s message continued in a very interesting way: the upcoming release to market of iPad brought a very good chance, since it looked like the perfect device in order to help his son… if he had the right application. His question to us was the following: Michael had tried ZenTap, and once he had seen the word prediction mechanism we had used on it, he wanted to know if we were able to help him on that “right application” he had in mind and was about to develop…

So Aram put his shoulders to the wheel and collaborated with the iMean project. Less than two weeks ago from this, we can say that Michael has finished the first version of the app, which is already available on the App Store, and the most important thing: it is helping his son to communicate better!

We are very pleased to hear news like this, which help us to keep working and trusting the human side of technology. We wish a great success to iMean (unfortunately, there are many users that may need it). It is a good reward for us to know that doing some good things brings those good prizes with them.

http://imean.mobi
http://imean.mobi/Blog/

http://itunes.com/apps/imean (AppStore)

VN:F [1.9.8_1114]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.8_1114]
Rating: +1 (from 1 vote)
Tagged with:
Feb 12

Si señores, después de mucho tiempo inadvertido por fin, gracias a nuestros usuarios, hemos conseguido el codiciado puesto número 1.
Llavemos ya 4 días en el primer puesto de aplicaciones de utilidad y 4 días días en el top 10 del ranking global de AppStore España.
Gracias a todos vosotros !

VN:F [1.9.8_1114]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.8_1114]
Rating: 0 (from 0 votes)
Tagged with:
Feb 10

Un equipo de desarrollo español (Ivanovich Games), amigos de ZenBrains acaba de anunciar su última creación: iRemoteDog.

Es una idea genial y muy original. La aplicación consiste en un mando de distancia que permite dar ordenes sonoros a tu perro.

Claro, esta app no hace mágia, primero tienes que entrenar a tu perro para que aprenda esos sonidos.

Se usan un tipo de sonidos que son inaudibles para los humanos pero muy fácilmente reconocibles por los perros.

A parte  para los perros es más fácil entender y diferenciar este tipo de sonidos que la palabras.

Una vez entrenado, puede ser de los más gracioso hacer espectáculos para los amigos, nadie quedará indeferente:¿Controlar un perro con el iPhone, WOW?

Desde aquí deseamos suerte al desarrollador del programa y recomendamos la aplicación.

VN:F [1.9.8_1114]
Rating: 3.0/5 (6 votes cast)
VN:F [1.9.8_1114]
Rating: +3 (from 5 votes)
Tagged with:
preload preload preload