Software Developer Life Cycle :)

Got this very interesting photo in mail….

18651_318332056963_698911963_3643306_729408_n

iPhone Dev : Persisting Values

Well i think most of us rely upon using SQLite for storing variables and data for our iPhone apps,but what if we only want to score 2-3 values.Like high score in some game or the number of visits to app.Setting up whole SQLite for just 2-3 variables doesn’t seem logical.

To solve this we use [NSUserDefaults standardUserDefaults].Basically this is used to store the default values and can also be used to save values associated with keys.

To Save Variables:

   1: if([[NSUserDefaults standardUserDefaults] stringForKey:@"HighScore"])

   2: {      

   3:     int score = 250;

   4:     NSString *string = [NSString stringWithFormat:@"%d", score];

   5:     NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

   6:     [defaults setObject:string forKey:@"HighScore"];

   7:     [defaults synchronize];

   8: }

So if you have a HighScore value you can save it for some key,in this case”HighScore”.

To Retrieve Variables:

   1: if ([[NSUserDefaults standardUserDefaults] stringForKey:@"HighScore"]){        

   2:     NSString * highScore = [[NSUserDefaults standardUserDefaults] stringForKey:@"HighScore"];

   3: }

And that’s it.Simple and no need to setup SQLite for storing your simple variables.

iPhone Dev : Turning Sound On/Off in Cocos2d/CocosDenshion

Well its a pretty basic requirement in game development but for the very first time you don’t exactly know how to do it.Naturally i went to Cocos2d website and looked in cocosdension help.Here is the way to do this mentioned on cocos2d website

   1: [CDAudioManager sharedManager].backgroundMusic.volume = 1.0f;

Range is 0.0 for off to 1.0 for maximum volume.

But when your using multiple background sounds this way gets a little messy.Something to do with the fact that for very sound file you have to reset the music volume and previous music volume value does not persists.So natural i banged my head quite a lot on how to fix this.

After few hours of head banging i just jumped into the code file and found an extremely easy way to mute/unmute sounds.

   1: [CDAudioManager sharedManager].mute = FALSE; //Sound On

   2: [CDAudioManager sharedManager].mute = TRUE;  //Sound Of

That’s it just one line and your settings last all across your app even if your using multiple sound files with [CDAudioManager sharedManager].This is the best way to implement if you have a settings screen in your game where you can turn sounds on/off.Basic stuff but is really helpful once you know it.

Apple iPad – “iPhone on steroids” OR much more

Steve Jobs unveiled  Apple much awaited tablet pc “iPad” yesterday.iPad will start from an incredible affordable price of $499 and will be launched around April this year.Jobs described it as "so much more intimate than a laptop and so much more capable than a smart phone."

In last 24 hours it has been iPad media frenzy over the internet. From strict criticism,disappointments,applauses to even jokes.Frankly speaking everyone has his own expectation with the iPad.Taking into perspective the extraordinary leap that iPhone took people where expecting iPad to be similar.They wanted it to be like some sort of futuristic “star trek” or “Minority report” sort of touch and control sort of gadget when in reality it turned out to be much familiar.So naturally people are disappointed.

The lack of camera and USB ports was a huge disappointment i have to admit.Lack of camera can be assumed to be a huge technical blunder from the geniuses at apple.But then when you see the broader picture and see apple competition in tablet pc arena there isn’t much to speak off.Amazon kindle is basically a book reader and with the touch screen and the finishing,iPad provides much better book reading experience.Hp Slate PC’s running window 7 shown by Balmer earlier this month were not exactly eye catching as well.

From development perspective just consider it as an iPhone/iPod with huge touch screen and powerful processor,and i think these 2 factors open a huge new market of app development for iPad.with such a huge screen(compared to iPhone) there will be more sophisticated an complex applications making there way to iPad ,not to mention the potential in games market.Surely big giants like EA will soon be announcing some extraordinary game titles for iPad very soon.SDK 3.2 beta is already available for download from appstore.

So all said and done may be apple is still at the top of tablet pc market and comes April we might see a frenzy to buy the new hottest gadget in town”iPad”.

Apple iPad

SmartFox server : Connecting to the server

After a very horrible experience of using Red5 recently i recently started exploring SmartFox server.Must say that the initial expression is excellent.Server configurations are easy and development is straight forward.Also there is extensive help available on smartFox website. And the best thing is server is that unlike Red5, smartfox is not limited to flash action script.You can connect it to through .net,java and today i even connected it through objective-C.

Here is simple tutorial on how to connect and make  connection to smartfox server.

1:Setting up connection String

   1: var ip = "10.1.1.143";

   2: var port = 9339;

   3: var zone = "simpleChat";

2:Creating connection

   1: //connect to server

   2: var smartfox:SmartFoxClient = new SmartFoxClient(true);

   3: smartfox.addEventListener(SFSEvent.onConnection, handleConnection);

   4: smartfox.connect(ip, port);

3:Handling connection event

   1: function handleConnection(evt:SFSEvent):void

   2: {

   3:         var ok:Boolean = evt.params.success;

   4:         if (ok)

   5:         {

   6:                 txt_window.text = "Connection succesfull!";

   7:                 trace("Connection succesfull!");

   8:         }

   9:         else

  10:         {

  11:                 txt_window.text = "Can't connect!";

  12:                 trace("Can't connect!");

  13:         }

  14: }     

And that’s all you need to do to make connection to server and get the success/fail event.

CS193P : iPhone Application Programming lectures by Stanford

CS193p : iPhone Application Programming is online course offered by Stanford that’s makes you go over all the iPhone concepts from MVC architecture to memory management issues. All these lectures are available freely on iTunes. But if you are not using iTunes you can also see them directly at the following link.

You can see the all the 18 lectures online at http://deimos3.apple.com/WebObjects/Core.woa/Feed/itunes.stanford.edu.2024353965.02024353968.

hope this helps

Windows 7

Windows 7 which is the working name of Microsoft’s next Major window release is scheduled to be released some time late 2009 or early 2010. Windows 7 user interface was demonstrated for the first time at the D6 conference. Graphically it looks great .Far better than Vista. Here are some screen shots of the UI from d6 Conference.

 

CakePHP

CakePHP is a rapid and quick development framework (just like ruby) that helps in quick development and deployment of an application. It follows common design patterns like MVC.

Structure
CakePHP follow MVC architecture so there are three basic layers in CakePHP.

Controllers
A controller is used to manage the logic for a part of your application. Each controller can offer different functionality; controllers retrieve and modify data by accessing database tables through models; and they register variables and objects, which can be used in views. Controller can use different Components to implement the logic.

Models
Models represent data and are used in CakePHP applications for data access. A model usually represents a database table but can be used to access anything that stores data.They can connect to your database, query it (if instructed to do so by a controller) and save data to the database.

Views
The view layer of CakePHP is how you speak to your users. Views should not contain complex business logic; only the elementary control structures necessary to perform particular operations, such as the iteration of collected data through a for each construct, should be contained within a view.

Deployment and Baking
CakePHP comes with baking feature which greatly reduces development time for simple crud based applications>All you have to do is Create a database and Cake will do the rest for you with all the logic and views with links automatically created.

You can follow the examples on Cake Official Website to get started.
If you are already familiar with ruby and MVC architecture getting started on CakePHP would be extremely easy.
For full details about CakePHP visit official site for further details.

The secret of Bill Gates success

Nice article about the early days of Microsoft and Bill’s Business Approach.

here are the few Extracts:

“it wasn’t just what Microsoft did, but what his rivals didn’t do that let Microsoft get ahead”

“They did not understand how to bring in people with business experience and people with engineering experience and put them together. They did not understand how to go around the world.”

“Most of our competitors were one-product wonders. “

“They would do their one product, but never get their engineering sorted out.”

“They did not think about software in this broad way. They did not think about tools or efficiency. They would therefore do one product, but would not renew it to get it to the next generation.”

Full article and bill interview Video at http://news.bbc.co.uk/2/hi/business/7464074.stm 

Follow

Get every new post delivered to your Inbox.