So I've gone back to developing software for the Mac and iPhone platforms. The first stop on my adventure was the Apple Developer Connection web site. The site is split into three parts: Mac Dev Center, iPhone Dev Center, and Safari Dev Center. There is a lot of really great material here but it's a bit difficult to get into. This is especially true if you're eager to get started.
My next stop was to search out for some good books. The first bunch of books I found was by Jonathan Zdziarski and published by O'Reilly. I first heard of Jonathan as a result of a Ignite Boston event. He gave a great talk about how insecure the iPhone was. That of course led me to take his course on iPhone Forensics and then picked up his three books: iPhone Forensics, iPhone Open Application Development, iPhone SDK. Out of this set the forensics book is scary because you can't unlearn that kind of stuff. The open app book is good but print has a hard time keeping up with the speed of the internet. Finally, the SDK book is good but I found that I needed to get even further back to basics.
The next book I found, which is still in development, is from Pragmatic Programmers called iPhone SDK Development. Being a beta book means that you can buy a digital copy or a digital copy now and a hard copy, when it's published. The book is ok but if you're coming at this raw then it's still a bit rough. This is especially true since sections of the book are still under development. With the release of the iPhone SDK 3.0 I think the authors are going to have a heck of a time capturing the 1000 new APIs in this book.
Finally, I decided to start with the very basics, Objective-C. I grabbed a copy of Learn Objective-C on the Mac by Mark Dalrymple and Scott Knaste. I learned how to program the Mac with Scott Knastes earlier book Macintosh Programming Secrets and so I figured this would be a good starting point. I was right. The book is a solid intro to Objective-C on the Mac and I would recommend it to anyone trying to get started.
It's funny, Objective-C really feels like going back in time now that I know Java. Having to write header files and dealing with memory management just seem so wrong now but such is life. Apparently the latest versions of Objective-C has auto memory management but it's only available for the Mac desktop and not the iPhone. If the iPhone only ran Java but it seems Apple is committed to using Objective-C.
So, once I got the basics of Objective-C I decided to dig a little deeper into Cocoa. Cocoa Programming for Mac OS X has been a very popular book on Cocoa, so I started there. I'm still reading the book but the start was good. It's interesting to see how Apple mixes code and interface design tools.
The problem I had/have was working out how an Mac app gets off the ground. Java has you create a class with a 'static main' and then pointing the Java VM to that class. My challenge was connecting the dots but I think I got it. Every Mac application has a main.m file which basically looks like this:
#import <cocoa/cocoa.h>
int main(int argc, char *argv[]){
return NSApplicationMain(argc, (const char **) argv);
}
Which to a Java developer looks weird. NSApplicationMain isn't something you write. It's a function that lives in the NSApplication file. Essentially it gets the ball rolling and stars the event loop. As I read the documentation on NSApplication and NSApplicationMain I found that it loads the 'main nib file' and that this nib file was something the developer could define. Looking at the Cocoa application project, that XCode creates, I could see only one nib, well really xib, file. The problem of course was that now I wanted to know where the heck this 'main nib file' was defined and how I could change it.
Well, a lot of digging on the net and I found the answer. As part of the Cocoa application project there is a file called info.plist. In the standard project tree the info.plist lives inside the Resources folder which lives inside your app folder. Inside this fun file lives all kinds of information about the application you're building. This file is a dictionary with keys and values. One of the entries just happens to be titled Main nib file base name. All you have to do is change the value of this entry and you're good to go.
So, that's that for now. I hope that someone else, trying to figure this out, finds this useful. More to come as I keep developing.
Thursday, March 19, 2009
Tuesday, July 29, 2008
Book idea - Erlang for Java Developers
While I was out at OSCON 2008 I got the sense that the Erlang language was picking up speed, the flywheel was starting to spin. Now, I've been poking at Erlang for a while now. A thought that occured to me was that a good way to learn the language and help others was to build/write a book about Erlang for the Java developers, help bridge the gap. Bellow is a very rough draft of what that kind of a book might look like:
1. What is Erlang?
1.1 Functional Language
1.2 Power/value (concurrency, resilient, etc)
1.3 Apps building on Erlang
2. History of Erlang
2.1 Where did Erlang come from
2.2 Who wrote what
3 Current state of Erlang
3.1 Erlang.org
3.2 Erlang Conferences
4. A basic understanding of Erlang
5. Mapping from Erlang to Java and back
6. Concurrency
7. Conclusion & final thoughts
Appendix A: Erlang cheat sheet
Appendix B: erl - The Erlang shell
Appendix C: Erlang API including built in functions
Misc:
- Erlang is optimized to do tail recursive functions
1. What is Erlang?
1.1 Functional Language
1.2 Power/value (concurrency, resilient, etc)
1.3 Apps building on Erlang
2. History of Erlang
2.1 Where did Erlang come from
2.2 Who wrote what
3 Current state of Erlang
3.1 Erlang.org
3.2 Erlang Conferences
4. A basic understanding of Erlang
5. Mapping from Erlang to Java and back
6. Concurrency
7. Conclusion & final thoughts
Appendix A: Erlang cheat sheet
Appendix B: erl - The Erlang shell
Appendix C: Erlang API including built in functions
Misc:
- Erlang is optimized to do tail recursive functions
Sunday, July 27, 2008
Beyond SOAP and REST
It's finally happened, one of my ideas has germinated beyond my little world. For the past 4+ years or so I've been messing around with instant messaging and alternative uses for it. I started off with utilizing AIM to access a series of web services providing the user with information. Next I moved on to building a system called StreamingRSS, the code for it is actually in the Google Code store, that allows a server to broadcast RSS to users instantly, ie Push, instead of Pull, which is what RSS does.
Now, I was out at OSCON 2008, awesome time, and one of the best presentations titled "Beyond REST? Building Data Services with XMPP PubSub". These guys took the concept of XMPP forward. I got a bunch of really good ideas from their presentation, places where I went one way and they went another way. Most of their ideas are a cleaner implementation then mine. For the most part, I think this is a result the time. Most of my work was done with an extreamly short time frame so I didn't have time to fully implement. Of course in some cases the technology simply hadn't escaped someone elses lab. No matter, I think these guys did an awsome job.
All this has given me the idea that it's time to write a good article or maybe a white paper on the topic and shate my knowledge on the topic. :)
Now, I was out at OSCON 2008, awesome time, and one of the best presentations titled "Beyond REST? Building Data Services with XMPP PubSub". These guys took the concept of XMPP forward. I got a bunch of really good ideas from their presentation, places where I went one way and they went another way. Most of their ideas are a cleaner implementation then mine. For the most part, I think this is a result the time. Most of my work was done with an extreamly short time frame so I didn't have time to fully implement. Of course in some cases the technology simply hadn't escaped someone elses lab. No matter, I think these guys did an awsome job.
All this has given me the idea that it's time to write a good article or maybe a white paper on the topic and shate my knowledge on the topic. :)
Emergency Beacon
So I was driving through Vermont this weekend and the wife and I were both playing with our iPhones, I've got a iPhone 3G and the wife has the original iPhone, and we were getting intermittent signal. I started to think of the poor CNet writer/editor and his family who got stuck in the middle of the wood out in north CA and died. Scarry thought to tell you the truth.
The wife and I started to talk about emergency supplies and creating some sort of emergency pack. We even talked about what we would put in such a pack and maybe we could sell it. The thing that then came to mind was some kind of emergency beacon. Thus the emergency beacon idea.
The basic concept would be small package, something you could easily store in the car, that when you activate would triangulate your location (GPS) and broadcast an SOS with your location. An after though was to throw in some sort of soalar panel. I think a basic model would just have lights indicating if the GPS locked in and then another light that indicates when the system is broadcasting the SOS. A higher end model would have a display with information like how many satelites the GPS can see, what your location is, and then that the system is broadcasting, and even battery charge/status.
I think this is an awsome idea, next stop is SparkFun to see if they have the parts. Of course the other search is to discover if someone else has done this. One of the keys would be "no subscription"
The wife and I started to talk about emergency supplies and creating some sort of emergency pack. We even talked about what we would put in such a pack and maybe we could sell it. The thing that then came to mind was some kind of emergency beacon. Thus the emergency beacon idea.
The basic concept would be small package, something you could easily store in the car, that when you activate would triangulate your location (GPS) and broadcast an SOS with your location. An after though was to throw in some sort of soalar panel. I think a basic model would just have lights indicating if the GPS locked in and then another light that indicates when the system is broadcasting the SOS. A higher end model would have a display with information like how many satelites the GPS can see, what your location is, and then that the system is broadcasting, and even battery charge/status.
I think this is an awsome idea, next stop is SparkFun to see if they have the parts. Of course the other search is to discover if someone else has done this. One of the keys would be "no subscription"
Wednesday, July 23, 2008
Flex and Ruby on Rails
Ok, this one is going to be short. I want to get a Ruby on Rails to produce Flex/Flash code. What I mean is that I should be able to, as part of the development cycle, create a rails project, create a model, and then when I go to create a view the result would spit out a flex code.
Visual Programming Language
On the rant of needing better development environments, see the last post, I realized that many people would benefit from a visual programming language, using icons and the like, myself included. I think it would be very cool if there was someway to visualize things like threads.
It seems that many people have tried this in the past but they always seem to get stuck at some point. Usually when you go down to the nity grity details. The other thing is that, what I've seen so far, suggests that these apps weren't beautiful. These tools really seem to need a great designer behind the scenes.
Don't get me wrong, I don't know how to do this just yet. It may actually require a brand new programming language, I don't know. I just think it would be very COOL!
It seems that many people have tried this in the past but they always seem to get stuck at some point. Usually when you go down to the nity grity details. The other thing is that, what I've seen so far, suggests that these apps weren't beautiful. These tools really seem to need a great designer behind the scenes.
Don't get me wrong, I don't know how to do this just yet. It may actually require a brand new programming language, I don't know. I just think it would be very COOL!
Active Development Environment
The active development environment, ADE, is the extension of the IDE. The idea is that the IDE is essentially what we've been doing for ever, more or less, in the development world. We write a text document, compile it, run it, see where things crash, and then go edit the doc. Wash, rinse, repeat. Of course there are advancements. Things like code completion and partial compile are awsome. I love these features! But the fact is that we're still editing the document, compiling, running.
This is old school my friends, very old school, and the problem is that we are now applying this same technology to new and emerging programming languages like Ruby and Python. These are languages that want to live in the shell. They can handle the immediate execution. Trying to force these interperted languages into the old model just feels WRONG.
What I want is a development environment that is essentially a shell, like irb, but smarter. If I define a class, I want that class to be captured. If I define a function, that function is captured. At some point I want to be able to work with all these saved functions/class/etc. When I say 'save' I actually mean that I want to manage them. Figure out what lives where and how.
So this is one of those ideas that has been bouncing around my head for sometime now. As a matter of fact I've actually attempted to implement this idea a few times. Thus far I haven't been able to get to where I need to be for this to work the way I want. I've been doing this in Java and I've started to wonder if this is the way to do it.
This is old school my friends, very old school, and the problem is that we are now applying this same technology to new and emerging programming languages like Ruby and Python. These are languages that want to live in the shell. They can handle the immediate execution. Trying to force these interperted languages into the old model just feels WRONG.
What I want is a development environment that is essentially a shell, like irb, but smarter. If I define a class, I want that class to be captured. If I define a function, that function is captured. At some point I want to be able to work with all these saved functions/class/etc. When I say 'save' I actually mean that I want to manage them. Figure out what lives where and how.
So this is one of those ideas that has been bouncing around my head for sometime now. As a matter of fact I've actually attempted to implement this idea a few times. Thus far I haven't been able to get to where I need to be for this to work the way I want. I've been doing this in Java and I've started to wonder if this is the way to do it.
Subscribe to:
Comments (Atom)