Dread Pirate PJ's House of Hacks and Tricks » iphone http://www.pjtrix.com/blawg Sat, 23 Aug 2014 19:46:15 +0000 en-US hourly 1 https://wordpress.org/?v=4.2.29 iPhone Development on Windows & Linux with open source tools http/blawg/2009/07/21/iphone-development-on-windows-linux-with-open-source-tools/ http/blawg/2009/07/21/iphone-development-on-windows-linux-with-open-source-tools/#comments Tue, 21 Jul 2009 19:10:57 +0000 http/blawg?p=168 Continue reading ]]> Yesterday I presented at OSCON 2009. I spoke about how to use Eclipse and the iPhone-dev team’s GCC cross-compiler to develop for iPhone on Windows & Linux. I also spoke about XMLVM, an open source project that lets you develop in Java for Android and deploy on iPhone or Palm WebOS.

You can download the slides and program examples here.

To get started with open source iPhone development, you can download the open source toolchain for Linux or for Windows/Cygwin.

Note: To use the toolchain, you need to obtain the iPhone OS headers, frameworks and libraries. You can jailbreak your device and extract the frameworks and libraries using SSH, or you can decrypt the firmware and extract the framework and libraries from the decrypted disk image. The binaries you need are /System/Library/Frameworks and /usr/lib .

You can download the headers from the iPhone-dev team’s Subversion repository with svn co http://iphone-dev.googlecode.com/svn/branches/include-1.2-sdk

To use the iPhone-dev team’s headers, you need headers for Mac OS X 10.4 SDK. Then you type this at the command line:

cd /path/to/iphone-dev/svn/branches/include-1.2-sdk
./configure --with-macosx-sdk=/Developer/SDKs/MacOSX10.4u.sdk

sudo bash install-headers.sh

Or you can extract them from the official iPhone SDK. :-)

Once you get the binaries and headers, move them to /usr/local/iphone-sysroot/ . The headers go in /usr/local/iphone-sysroot/usr/include/ , frameworks go in /usr/local/iphone-sysroot/System/Library/Frameworks/ , and libraries in /usr/local/iphone-sysroot/usr/lib/ .

Then to compile and link, set CFLAGS and LDFLAGS like below :

export CFLAGS=-I/usr/local/lib/gcc/arm-apple-darwin9/4.2.1/include \
-isysroot /usr/local/iphone-sysroot

export LDFLAGS=-framework CoreFoundation -framework Foundation \
-framework UIKit -lobjc -bind_at_load -isysroot /usr/local/iphone-sysroot

Then use these compile and linker commands :

/usr/local/bin/arm-apple-darwin9-gcc -c $(CFLAGS) main.c HelloWorld.m

/usr/local/bin/arm-apple-darwin9-gcc $(LDFLAGS) HelloWorld.o main.o \
-o HelloWorld

The easiest way to set this up for each project is in a makefile. Look in the HelloWorld example in the zip file with the slides for an example.

]]>
http/blawg/2009/07/21/iphone-development-on-windows-linux-with-open-source-tools/feed/ 13
My first book is finally a go! Woo hoo! http/blawg/2009/06/04/my-first-book-is-finally-a-go-woo-hoo/ http/blawg/2009/06/04/my-first-book-is-finally-a-go-woo-hoo/#comments Fri, 05 Jun 2009 02:04:43 +0000 http/blawg?p=135 Continue reading ]]> From February to April, I was working evenings and weekends fulfilling a dream I’ve had for many decades: writing a book about a subject I really care about: game development. On June 22 2009, Apress is publishing a book I collaborated on as lead author and tech reviewer : iPhone Games Projects.

Book cover

There are chapters by :

  1. Olivier Hennessy & Clayton Kane, of Posimotion, developers of Bikini Hunt and Apache Lander
  2. Joachim Bondo, of Cocoa Stuff; developer of Deep Green, a beautiful chess game for iPhone
  3. Richard Zito & Matthew Aitken, of Swipe Interactive, developers of QuickDraw and Pole2Pole
  4. Aaron Fothergill, of Strange Flavour, developer of Flick Sport Fishing, one of the top 20 best selling apps on the App Store
  5. Brian Greenstone, of Pangea Software, developer of Enigmo and Cro-Mag Rally, two of the top 5 best selling apps on the App Store
  6. Mike Kasprzak, of Sykhronics Entertainment; his game Smiles was one of the finalists for Best Mobile Game on the IGF Mobile 2009 competition
  7. Mike Lee, co-founder of Tapulous, now at Apple, lead developer of Tap Tap Revenge, the most downloaded game on the history of the App Store
  8. And a bonus free chapter by Jamie Gotch, of Subatomic Studios, developers of Fieldrunners, winner of Best Mobile Game on the IGF Mobile 2009 competition

As tech reviewer for the book, I checked everyone’s writing for technical accuracy. That was really a great experience. I learned a lot and had fun running everyone’s sample code and checking their tips and tricks for myself.

I also wrote one chapter for the book, on how to implement RESTful web services for high score leaderboards and achievements on iPhone. There’s code in the chapter for a simple Rails web service, and native code for the iPhone as well. It’s a rather deep look at the subject.

I also collaborated with Jamie Gotch on a bonus free chapter. In the chapter we discussed getting started with programming for iPhone, a few tips and tricks, and the A* path finding algorithm. I also developed a Puyo clone and explained the most important parts of the code.

Full source code for the Puyo game will be provided. There is also source code for 3 other sample apps. All the sample code will be made available the same day as the book release at the book’s support page and at apress.com

This was a very neat experience for me. I’ve wanted to have my name on a computer book, and I’ve enjoyed programming games in my spare time, since before I was a teenager (more than 30 years ago, yo! Where has time gone?)

The iPhone gives me, and everyone with the interest, a chance to develop games for others, in a very cool platform with lots of traction. This book, coupled with Beginning iPhone Development, can give you the tools to reach for the stars with your own creations! Enjoy!

]]>
http/blawg/2009/06/04/my-first-book-is-finally-a-go-woo-hoo/feed/ 5
Obligatory WordPress upgrade post #10101010 and other rumblings at Chez PJ http/blawg/2008/11/28/obligatory-wordpress-upgrade-post-10101010-and-other-rumblings-at-chez-pj/ http/blawg/2008/11/28/obligatory-wordpress-upgrade-post-10101010-and-other-rumblings-at-chez-pj/#comments Sat, 29 Nov 2008 03:24:53 +0000 http/blawg?p=122 Continue reading ]]> So today I updated WordPress to 2.6.5. And like every other time, it was a cinch, all over and done in less than five minutes. Thanks, WordPress guys!

In other news, I have been geeking out with both the iPhone SDK and the Android SDK, and I believe I have a little something special going here. I hope to have it ready for release, on both platforms, sometime in January. Development continues.

I will need beta testers soon. Any T-Mobile G1 users interested in helping out, you can email me at dreadpiratepj [at] gmail [dot] com

Speaking of Android, I started playing with it now that the source code to the whole thing has been released. I managed to get Android booting on a Palm TX, but it still needs a lot of work. It boots, but it doesn’t do crap once it boots. :-)

I get all the way to the “Press the MENU key to unlock” screen, but none of the keys do anything. Neither does touching the screen. It’s an issue with the Linux kernel drivers and device configuration. It just wasn’t made to run on a Palm TX without proper tweaking of the source. I just don’t know what the proper tweaking is.

I need to look in my bag of loot for a Palm serial cable (I’m sure I have one somewhere) and hopefully I can get a serial console from which to poke around inside Android.

I do have Android running successfully on my Sprint Touch (my parents, my sister and I have a family plan on Sprint.) Credit for that goes to Dr. Martin Johnson in New Zeland. I just use his release on my phone (before you ask, no, his release doesn’t work on the Palm TX. It’s the first thing I tried. :-)

]]>
http/blawg/2008/11/28/obligatory-wordpress-upgrade-post-10101010-and-other-rumblings-at-chez-pj/feed/ 0
Rush Concert Photos http/blawg/2008/04/12/rush-concert-photos/ http/blawg/2008/04/12/rush-concert-photos/#comments Sat, 12 Apr 2008 20:34:15 +0000 http/blawg/2008/04/12/rush-concert-photos/ Continue reading ]]> On Friday, April 11, 2008, I went to see Rush open their 2008 Snakes and Arrows concert tour at Coliseo de Puerto Rico, San Juan, PR. I had an awesome time with my pals Alejandro, Cesar and Kevin. We were seated about six rows from the stage.

There were a couple of guys from the Philadelphia suburbs right next to us. Some guy from Dallas, TX was two rows ahead of us, and was stranded in PR because of the American Airlines fiasco.

The concert was awesome, three hours of great live music. Truly the best live performance I’ve seen in ages. There was a six minute drum solo by Neil Peart, that was just amazing.

I took my iPhone to use as a camera, knowing digital cameras per se were not allowed. I used an iPhone application called Snapture. This great little app is made for “jailbroken” iPhones. That is, iPhones that have been modified to load and run applications not “blessed” by Apple.

You’ll notice that some pictures are blurry/shakey, followed by two steady, clear ones. Snapture has an optional feature where it takes three pictures within a second or so of each other. This helps you steady the phone and get at least one clear shot.

I took 1426 photos. Yeah, that’s right, 1426 photos. I did this by using the 3-consecutive-shots feature of Snapture, pushing the volume button to trigger the photo capture twice per minute or so.

Set 1 of photos is here.

Set 2 of photos is here.

Each ZIP file contains 713 photos and is less than 260MB.

The pictures I’m uploading are totally unprocessed. They’re right off of the iPhone at 1600×1200 resolution.

I started deleting blurry pictures, and pictures where the stage was too dark or too bright and lacking contrast. But there are so many pictures to go through, I eventually decided not to bother.

The last 250+ pictures are in black and white. I think my finger slipped at some point, and I touched one of Snapture’s on-screen controls. Sorry about that!

]]>
http/blawg/2008/04/12/rush-concert-photos/feed/ 3