Pale Shelter

No Comments

Android

No Comments

Galaxy Tab 7.0 Plus

Galaxy Tab 7.0 Plus

 

Developing for Android is not a choice anymore. A lot of my customers are asking for Android apps, so I bought this nice piece of gadget. I need a real device because Android simulator is just too slow and doesn’t seem to work very well. Time to learn how to program for Android!

Project X

No Comments

Today I went to the movies and  watched Project X. Man, that was litteraly like an immersive movie to me. I won’t be giving too much details about it as some of you may not have watched it yet.

Not sure if it was because it’s been so long since I last went to a night club, or if it was because of the girls, or both. Excepting for the ecstasy, the cops and the fact that the entire neighbohood got burned down, I really pretend to go to a party like that one. I don’t really know why, but that movie was like… a dream! :)

[Open Source]FVGravityView

No Comments

Hey folks, I’m proud to announce my new open source project for iPhone. It’s called FVGravityView. It’s basically an UIView that has the ability to fall. Yes, fall. It uses the accelerometer to detect the device position and the view will fall depending on it. It’s basically an UIView that recognizes gravity.

A few thing:
-The default velocity is 20, but you may change this value by changing the velocity property.
-FVGravityView supports dragging. To enable it, set the property isDragable to YES.
-Say you want to invert the gravity. Just set the isInverse to YES.
-It’s basically an UIView, so you may add subviews to it. It also has every drawing capabilities that an ordinary UIView has.

To download the sample project, click here.

PS: I didn’t try it on an iPad, but it should work with no problems at all.

RIP Sensitive Code

No Comments

Hey folks, unfortunately, my blog Sensitive Code is dead. I had no time to update it and ended up not renewing the domain registration. It had a great page rank. For example, if you type UIFileSharing on Google, a post from Sensitive Code it is the first result(not sure for how long). I moved every post from there to this blog, so everything is still available. I hope to write about programming on this blog in the future.

Easy multithreading, a courtesy of NSOperation

No Comments

Threading is known for being very hard in any language. A foolish mistake can make your application crash. Programmers spend a lot of time to make sure everything works fine. On Mac OS X 10.5, Apple finally introduced a very easy way to deal with threading. NSOperation is The Apple Way® to deal with threading. All you have to do is to subclass the NSOperation, create and initialize a NSOperationQueue, create and initialize the NSOperation and add it to the NSOperationQueue. For this tutorial, I will teach you how to write a simple app that will load a RSS feed and display it on a NSTableView.

To get started, go to Xcode and create a new project. I will call mine RSS Reader, but feel free to call it whatever you want. Let’s start by editing our AppDelegate.h. Create 3 IBOutlets:

More

SHOUTCAST Metadata the easy way

No Comments

When I was developing FireRocker, one of my biggest challenges was to figure out an easy way to get the audio metadata. The classic way is to read the value of a HTTP header and see how many bytes I have to wait for until the metadata is sent. Seems like a bit confusing, hum? Luckily, there’s THE easy way! SHOUTcast streams have an HTML page which you can download and parse to get the audio metadata. Say I have the following URL:

http://94.186.155.82:8044

Just add a /7.html to the end of it.

http://94.186.155.82:8044/7.html

If you downloaded this HTML file and opened it with a plain text editor, you’d see something like this:

<HTML><meta http-equiv="Pragma" content="no-cache">
</head><body>153,1,257,1500,153,32,Adrian - Lacrimi
de iubire bY www.FmRadioManele.ro</body></html>

Cool, isn’t it? Now let’s parse it. You can do it in any language, but I will teach you how to write a nice app in Objective-C. Create a new project and name it SHOUTcast metadata(or any name you want). Open your AppDelegate.h and add the following IBOutlets:

More

Audio streaming with QTKit

No Comments

Audio streaming can be a painful task. Download the audio data and feed an AudioQueueBuffer may be a risky operation and may involve many lines of code. So finally, on Mac OS X 10.6 Apple has introduced QuickTime X. We must remember that QuickTime doesn’t necessarily mean QuickTime Player. In this case, I’m talking about the QTKit framework. QTKit(AKA QuickTime Kit) is a high level framework for dealing with media. The QTKit framework was also updated and now includes this and other new features.

More

[Quickies]Shaking a NSWindow

No Comments

On the Mac OS X login window, when you don’t type the right password, the window shakes. It’s a very cool and classic way to tell people the password is wrong. Even WordPress copied it. You can reproduce the same behavior on an ordinary NSWindow with just 7 lines of code! Here’s how it works:

//Gets the window rect
NSRect rect = [window frame];
//Shake offset amount
int amount = -10;
//Shake the window 5 times
for(int i = 0; i < 5; i++){
//Changes the frame origin
[window setFrameOrigin:NSMakePoint((rect.origin.x + amount), rect.origin.y)];
//Pause the thread for 0.04 seconds
usleep((useconds_t)40000);
//Inverts the offset amount
amount *= -1;
}
//Restore the window’s original position
[window setFrame:rect display:NO];

Download the sample app here.

[Quickies]IRCClient, IRC made easy

No Comments

Have you ever needed/wanted to implement an IRC chat on your Cocoa application? It might be easier than you think! There’s a Cocoa “bridge” for the libircclient library. The lib was written by Georgy Yunaev. Get the files on this link. These few lines of code will make it work:

IRCClientSession *session = [[IRCClientSession alloc] init];
MyIRCClientSessionDelegate *controller = [[MyIRCClientSessionDelegate alloc] init];

[session setDelegate:controller];
[controller setSession:session];

[session setServer:@"irc.dal.net"];
[session setPort:@"6667"];
[session setNickname:@"test"];
[session setUsername:@"test"];
[session setRealname:@"test"];
[session connect];

[session run]; //starts the thread

Older Entries