Posts Tagged ‘iPhone’

PhoneGap given Apple Seal of Approval

Wednesday, November 25th, 2009

Over the past year or so there has been a lot of consternation on the part of developers writing applications for iPhone using the PhoneGap framework. The problem seemed to be that Apple was unpredictably rejecting applications on the sole basis that they used a 3rd party framework, or that they suspected PhoneGap used techniques they prohibited (like downloading program logic at runtime). Recently, Apple sat down and did a proper technical analysis of the framework to evaluate whether or not they should continue to discriminate based on the use of this framework, or simply evaluate these applications on their own merits instead. According to Jesse MacFadyen of Nitobi:

  • Apple has given PhoneGap a technical analysis , and PhoneGap does not violate the Terms & Conditions of the App Store.
  • Apple will review PhoneGap applications based on their own merits and not on their use of PhoneGap.

This is great news for the development community because it means we can continue to write simple cross-platform applications using HTML, CSS, and JavaScript, and deploy them natively to a number or devices without having to do tonnes of rewrite for each one.

iPhone Anim Maker Updated

Tuesday, September 29th, 2009

After getting some good feedback on my iPhone Animation Tool, I decided to do another release. This time, I added the ability to hard-code the number of columns. Some people weren’t getting the right sized images for their purposes, so this gives you a bit more control over that. This also makes it useful for non-iphone animation work.

I also decided to include the full source code incase somebody wanted to get in there and fix or add something. As always, feedback is welcome.


Download it here.

EasyGlyph 1.2 Released – iPhone Font System

Friday, June 26th, 2009

I’ve added some features and fixed some bugs in EasyGlyph – which is a font system for iPhone. You can ready about this tool in this earlier post. Specifically:

  • Improved the font ripping tool to specify the text hinting style. This is really important for controlling the clarity of the text.
  • Added the source code to the windows app. You can now compile this yourself.
  • Fixed a memory leak in the display code.
  • Begun working on alignment code for the objective-c classes. These still need a bit more work.

Grab the new file here.

Here are some updated screenshots:

screen-capture-2

screen-capture-3

screen-capture-5

WWDC 2009 Keynote Reaction

Monday, June 8th, 2009

Today was the keynote for Apple’s Worldwide Developers Conference 2009. This is an event where traditionally all the new product releases and skunkworks projects underway by Apple are revealed to the world for the first time. Sometimes these events are landmark, such as with the announcement of the iPhone a couple years ago. Sometimes they’re more about incremental improvements to software and hardware, as was the case today. Nearly always, however, they’re exciting news for everyone who likes Apple hardware and software.

Today they made several announcements relevant to web and mobile developers. For starters, Safari 4 is finally out of beta. This is great because it means a faster browser will begin making its way into the hands of users and new features will begin to open up to developers (for example DOM storage).

Last but not least were the iPhone announcements. As expected, iPhone OS 3.0 will now make its way into the hands of customers with over 100 new features for developers and users to drool over, like cut/copy/paste, improved map API’s, more flexible developer API’s, undo support, an improved mail application, and more. On the consumer side, a HUGE new feature (and one that really shocked me actually) is native Internet tethering! This means you can use the Internet connection of your phone on your laptop PC. Another interesting improvement is the integration of a new version of Safari supporting HTML 5 internet streaming of audio and video.

The new “Find My Phone” feature is interesting. If you’re a MobileMe user and you lose your phone, you can log onto a website and it will show you on a map where the phone is. Great if you left it at the bar, but not so helpful if its in your slipper in the broom closet. However it does let you send your phone a message which will cause it to play a special alert, allowing you to track it down in your apartment. Like some ThinkPad PC’s it also supports a remote-wipe feature if your phone is really lost or stolen.

A big thing for application developers is the new In-App Purchase capability. But this is just another one of many new developer features like peer-to-peer connectivity, push notifications, Bluetooth programmability (paving the way for custom bluetooth accessories) among others.

Apparently Apple has opened up the maps restrictions, allowing turn-by-turn direction applications. This is big for custom app developers, but it remains to be seen how this will work with the limitations of the hardware itself.

Speaking of hardware – now for THE BIG NEWS. As expected Apple announced a new hardware spec for the iPhone (called the iPhone 3GS with the S standing for Speed -gong!). This phone is faster and better in just about every way. On an API side it will support OpenGL ES 2.0 (meaning I can finally use that book I bought). It will also have a killer camera app (with tap to focus capability) and a 3MP camera. You can even take video and edit the video right on the phone (works a bit like iMovie). The new phone will offer between 2 and 3x speed improvements for apps (the examples they used were mail, SimCity, and Preview). The phone will also have voice control, letting users call people or bring up apps just by speaking to the phone.

The new phone will have digital compass, although I’m not entirely sure how this would help me. I guess it’s good for mapping applications, or if I need to face Mecca for some reason. The new phone will also have data encryption which is great for business and government users. For battery life, we’re talking up to 9 hours of internet surfing, 10 hours of video, 30 hours of audio, 12 hours of 2g talk-time, 5 hours of 3g talk-time. Although if we are to base anything on the numbers given for the 3G iPhone, those are probably exaggerated. Bottom line is that battery life appears to be improved about 30%.

As for versioning, it looks like Apple will be keeping the current 3G iPhone as the ‘budget’ option for $99. Kindof a pain for developers, mind-you.

The bottom line here is that Apple has once again moved the bar forward, and put immeasurable pressure on competitors like Palm, Nokia, Microsoft, and Blackberry, and by-proxy Google to keep up on both a hardware and software front. From a developer perspective we’ve got lots of new toys to start building with. Looking forward to it!

NimbleKit – HTML & JavaScript iPhone Apps

Sunday, May 31st, 2009

The question has been coming up a lot lately: how can we build iPhone apps using the familiar medium of HTML and JavaScript? Already there are several options available to us, including the popular open source PhoneGap framework from Nitobi. Alexander Voloshyn wanted to take a stab at solving the problem too – the result of which was NimbleKit. His approach was more of a purpose-built framework specifically for iPhone than a general-purpose solution that could be applied to multiple devices. He’s also packaged his solution up with short-turnaround support all for just $99. I asked him some questions about NimbleKit by email. Here is our conversation:

Q. Tell me about the NimbleKit project. What problem are you solving?

There many people who have great ideas of iPhone applications but simply don’t know Objective-C, with NimbleKit it is easy to create own applications using just javascript and HTML. For those who know Objective-C NimbleKit is a huge time saver.

Q. What types of apps are best suited? Could you write a game? What are the limitations?

With NimbleKit it is possible to write wide range of applications, we can display text or image information, play audio, navigate between pages, read files and request any data from internet, interface elements have javascript callbacks to provide interactivity of interface, so to answer your question practically any application can be written using NimbleKit.
Unfortunately applications which use complicated drawing and OpenGL ES are not supported which means no complicated games, but of course you can do simple games on javascript using AJAX.

Q. What level of Objective-C knowledge is required to build a NimbleKit app?

None. However in version 2.0 we plan to give possibility to mix javascript and Objective-C, this way actually practically anything will be possible including OpenGL ES and WebKit mix.

Q. Are there any released apps or projects in the works now that use the framework?

NimbleKit is still very new so nothing yet in app store released, however we understand it is important for our customers to know they can release their apps without any problem, so we develop couple apps to release soon.

Q. Do you anticipate any problems having apps accepted into the App store?

Should not be, everything NimbleKit uses is allowed by Apple. However NimbleKit based on HTML and user may expect to load all app’s content from internet, but doing this will cause problems, most likely Apple won’t approve it because once it’s approved app’s content may change to adult or similar.

Q. Do you have any plans to port the library to non-iPhone platforms?

The library takes all advantages of it’s platform and should not exclude or complicate some features because it is required to be compatible. If we decide to make SDK for another platform we will make it from scratch using all it’s capabilities.

Q. How do you compare your framework to ones such as PhoneGap, Nemo, or Rhomobile?

Compare to similar frameworks NimbleKit has huge advantage in features, documentation, support and ease of use, only NimbleKit can provide you with working application in 3 clicks.

Also there is a big difference in architecture, NimbleKit made the way it can be extended to implement practically any feature, which is not possible with other frameworks.

Q. Right now you’re selling licenses for $99. What level of support do users get for that? Any other perks?

All general questions answered usually within 1 hour. For registered users we provide code level support. Also mailing list available and forum (launches 29 of May). All users can request any features, however registered users get their requests fulfilled first including personal pre-released patches available next day after problem appeared.

Free 30-day trials are available from the NimbleKit website.

EasyGlyph Updated – Kerning Fixed + Dropshadows

Friday, May 29th, 2009

About a week ago I released a font system for the iPhone called EasyGlyph. I looked into switching over to a native true-type-font loader but came back to this because it still seems like the cleanest solution. I noticed there were some issues with the kerning so I fixed that, and added support for drop shadows and glow:

screen-capture-11

Drop shadows really help the fonts stand out. Give it a try! If anybody wants to help convert this to a library that supports Android or other platforms, I’m happy to assist. Just email me: alexei.white@gmail.com if it’s your intention to do this.

screen-capture-21


How Trustworthy are Apple Rumors?

Wednesday, May 27th, 2009

Someone sent me yet-another iPhone rumor for the June 17 launch of SDK3.0 and possibly a new hardware profile for the device. The meat-and-potatoes of this one is basically:

  • OLED Screen resulting in 1.5x battery life
  • FM transmitter
  • Glowing logo & rubber tread on back
  • Higher res camera
  • Super mega-fast CPU
  • Turn-by-turn directions

There are several reasons to doubt the veracity of this rumor. For starters, it wasn’t accompanied by any specific hardware specifiations: graphics processor, CPU, GPS chip, etc. Anyone close to the hardware team would know these things. Other rumors have been accompanied by specifics. Another reason is the cost implications of switching to an OLED screen. Although the same happened on laptop and desktop mac’s, sticking to a $299 price point might shave Apple’s margins considerably. Finally, an FM transmitter seems superflous. Apple has always been about delivering content through the iTunes software universe and has never really been that into letting users sidestep their proprietary networks and formats. FM radio is going to add cost to the device, and be of value to a limited number of people. It might potentially even cut into their iTunes revenues. Finally, the turn-by-turn directions would require significant upgrades to the Maps application on the phone, and there has been no sign of this in 5 beta releases of the 3.0 SDK. It’s possible they have it but haven’t released it but it seems like something they’d want to beta.

What’s interesting here though is the  tendency for popular tech blogs to receive exclusive and anonymous “scoops” on product launch details before the rest of us. Scoops – I might point out – that nearly always turn out to be false. Take a look at some recent other generation 3 rumors for the new hardware being unveiled (supposedly) in June:

iphonegen3rumors

These tend to be non-conflicting, but some of these items seem farfetched. I mean, how can Apple be adding hardware features while simultaneously improving battery life (which seems to be an essential feature of any new device)? Time will tell.

Will Apple Permit JavaScript-based Apps?

Monday, May 25th, 2009

There seems to be a real movement afoot to provide means for developers to write native or near-native phone applications in ECMAScript. PhoneGap is doing it, Rhomobile is doing it, Palm Pre is doing it, and now Haxe is doing it.

HaXe has always been an interesting project. It’s basically a JavaScript compiler with targets for Flash 6-10, PHP, C++, Java, etc. Now you can write HaXe projects for the iPhone. Pretty cool stuff. This is certainly along the lines of PhoneGap in that it helps democratize the platform – however – I suspect it probably violates the iPhone terms of use in that it basically becomes an interpreter:

Usage of such non-public API, as outlined in the iPhone SDK Agreement section 3.3.2 is prohibited:

"An Application may not itself install or launch other executable code by any means, including without limitation through use of a plug-in architecture, calling other frameworks, other APIs or otherwise. No interpreted code may be downloaded and used in an Application except for code that is interpreted and run by Apple’s Published APIs and built-in interpreter(s)."

This seems to be sortof the same problem suffered by apps written using the popular phone framework PhoneGap (http://ajaxian.com/archives/someone-at-apple-please-review-stance-on-phonegap). While I see the need to control how code is executed when running outside the normal security sandbox of a browser, HaXe seems fairly tame because as far as I can tell, the application code is not being altered after the program is compiled (could it??). In any case, you’re still compelled to operate within the same runtime sandbox as a normal Objective-C based application.

In any case, if Apple is going to continue to crack down on frameworks like this, I hope they pick on the way the wind is blowing and provide something to the community that lets people marry the familiar world of ECMAScript, HTML, and/or CSS with the powerful features of the iPhone.

EasyGlyph – Another iPhone Font System

Thursday, May 21st, 2009

See the end of this article for the download link..

Update: 1.2 Is now available. It contains important bug fixes and support for drop shadows.

So Apple provides a number of fonts for use in your iPhone games and apps including:

  • American Typewriter
  • American Typewriter Condensed
  • Arial
  • Arial Rounded MT Bold
  • Courier New
  • Georgia
  • Helvetica
  • Marker Felt
  • Times New Roman
  • Trebuchet MS
  • Verdana
  • Zapfino

These are fine, but what if you want to use your own fonts in a game or application? There are a couple ways to do this (http://stackoverflow.com/questions/360751/can-i-embed-a-custom-font-in-an-iphone-application) – but I wasn’t entirely satisfied with these. To do this is somewhat tricky because you have to store the kerning (spacing) information as well as the bitmap for the font, and provide tools for slicing up sprite bitmaps directly on the iPhone. I took a day or so and wrote a tool to rip the windows font of your choice, and create a UIImage, which can then be converted easily to an OpenGL texture if needed. I call it EasyGlyph and the tool is free to use but devoid of any warranties.

First of all, there’s a Windows application that stitches together the font “sheet” image and calculates all the letter sizes and kerning. You start by generating a 32-bit (with Alpha) PNG graphic of the font using a font face, size, and color. You can of course size any font to whatever size you want once its on your iPhone, but depending on the situation you may want your font to have more or less bitmap detail (remember we’re converting it to a bitmap from a vector drawing). Here’s a screenshot of the tool:

EasyGlyph

Here’s what some Windows fonts look like rendered on the iPhone:

screen-capture-4

Mind the spaceships. They’re part of a game, and aren’t relevant to this article. Because of the kerning code, it can also handle complex overlapping fonts like this:

screen-capture-5

When you save a font to disk, you’ll get two files: a PNG file containing the bitmaps and a C document containing the class constructor along with all the coordinate and kerning information for the font:

myFont = [[EasyGlyph alloc] init];
[myFont initFont:@"chicdecay.png":@"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz 1234567890.,-=+:;<>?!'\"[]@#$%^&*()/\\":@"0,0,69,115.937,37;79.783,0,71,115.937,37;157.421,0,71,115.937,36;236.569,0,67,115.937,37;318.129,0,62,115.937,37; ETC...

You’ll need this along with two classes: “EasyGlyph” and “CustomFontChar” which are included. To generate a bitmap of some text that uses the font, use the instance method writeTextToTexture, which returns a UIImage instance:

[myFont writeTextToTexture:@"Hello World!"]

To convert this to a Texture2D, for use in OpenGL applications, you can do something like this:

textTexture = [[[Texture2D alloc] initWithImage:[myFont writeTextToTexture:@"Hello World!"]] retain];

.. and you’re off to the races.

I’m looking for feedback, improvements, insults – whatever you got basically. Once again this is free to use – I only ask you provide some feedback if you got some use out of it. Enjoy!


iPhone Development Frustration

Tuesday, May 12th, 2009

One of the most frustrating behaviors of the entire Iphone development stack is the constant iPhone brickings I have to endure (see image). Every week or so I’m forced to restore the phone from an image because XCode simply says “Could not support development.”. Oh that’s nice. THANKS you jerk. I get like 4 hours a week to work on these projects and I just long spending 1 of them restoring my phone.

Anybody else seeing this message? Any idea why it happens?



© All rights reserved.