Posts Tagged 'Programming'

Snow Leopard Development Stacks

Just in case you were wondering, here’s a rundown of project versions you’ll find in the Snow Leopard GM:

After some digging, it appears that Snow Leopard (Apple’s latest OS X release) includes quite the refresh of web development stacks.

One update that is particularly exciting is the inclusion of PHP 5.3 which is fantastic for PHP developers as this release marks a major milestone in the progression of the language…

  • Apache 2.2.11
  • Java 1.6.0_15
  • Perl 5.10.0
  • PHP 5.3
  • Python 2.6.1
  • Rails 2.2.2
  • Ruby 1.8.7
  • RubyGems 1.3.1
  • SQLite 3.6.12
  • Subversion 1.6.2

All looks pretty much up to date, or at least of respectable vintage, yes?

Also take a gander at 23 Snow Leopard Tweaks You Didn’t Know About for some handy tips not generally known, at least by us … specifically, how to boot the 64-bit kernel!

h/t: DZone!

Continue Reading →
0

Snow Leopard lives!

Just in case you managed to somehow not be expecting this, as of just now Snow Leopard developer documentation, sample code, and Xcode 3.2 download are live at

http://developer.apple.com/mac/

and there seems to be quite a revamp of the reference library to go with it:

http://developer.apple.com/mac/library/navigation/

There was notice on the lists that Snow Leopard NDAs are now lifted, so … well, actually we don’t have anything Snow Leopard specific we were keeping secret, far as we know all our projects were compatible with only trivial tweaking here and there. Compatible enough that we’re not going to jump on the upgrade bandwagon immediately, we’ll give it a couple weeks and see if any massively widespread freakouts become apparent in developer land either iPhone or desktop. But if you’re ready for the bleeding edge, there you go!

[UPDATE: Heh, that was quick — already an issue that would have been a problem for various domains of trolldom showed up on cocoa-dev:

Here’s the problem. Snow Leopard ships with OpenSSL 0.9.8, with a universal 0.9.7 and PPC32-only 0.9.6 thrown in for backward compatibility reasons. The 10.6 SDK comes with the headers for 0.9.8, but not 0.9.7.

So if you need to use libcrypto 0.9.7, you must use the Leopard or Tiger SDKs. You can’t use the Snow Leopard SDK and libcrypto unless you want to make your software require Snow Leopard. (You could try moving and linking things around, but then who knows what you’ll break…) If this is going to be a problem, then you might want to consider using an alternative cryptography engine.

Righty then. Apparently it will be a little while before we move our operations wholesale over to Snow Leopard!]

Continue Reading →
0

Library: Bing SDK

Hey, if you have warm snuggly feelings about The Beast From Redmond and their so far underachieving Bing search engine, have we got a treat for you today: there’s now an open source SDK for your iPhone programming joy!

The Bing SDK for iPhone and Mac is a Cocoa Framework which enables Mac and iPhone developers to easily integrate Bing search results into their applications.

The SDK was designed to remove the headache of manually having to parse XML or JSON in order to communicate with the Bing API.

The SDK Provides:

  • Synchronous or Asynchronous querying
  • Access to Web, Image, Video, News, and Phonebook source types
  • Potential to easily add dynamic search results to all of you applications!

Not too sure why this is more interesting than [insert your favorite metaphor for uselessness here], but hey, if there’s some reason you’re not down with all the Google Mobile iPhone compatibility work, then perchance this would indeed be just the ticket.

h/t: electronista!

Continue Reading →
0

Snippet: Playing YouTube Videos

So it’s very easy to play a video in your iPhone app — whether local or off the web — with MPMoviePlayerController; and it’s very easy to put a video on the web via YouTube. However, there is a problem combining the two; since YouTube doesn’t give out direct links to its videos, you can’t give a YouTube video to MPMoviePlayerController. And if you tell the system to open the URL, well then your app’s gone. A non-optimal experience, indeed.

But here’s a way around that — just have a UIWebView containing nothing but the EMBED code for the link you want to pull up, and it’ll show up — once it loads, so you do have a white flash while you wait — as a YouTube brand, play button, and frame from the video. When the user taps that, the YouTube application is launched on top of your app, and when it’s finished, control is returned. Not bad on the convenience, indeed.

Unfortunately, there’s no kind of direct control or notifications of loading, progress, quitting, etc. However, you can get some indirect notifications based on your application’s window state: add in your view controller

[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(windowNowVisible:)
name:UIWindowDidBecomeVisibleNotification
object:self.view.window
];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(windowNowHidden:)
name:UIWindowDidBecomeHiddenNotification
object:self.view.window
];

to get these called when the YouTube window is shown and goes away respectively.

- (void)windowNowVisible:(NSNotification *)note
{
twlog("YouTube window went away");
}
- (void)windowNowHidden:(NSNotification *)note
{
twlog("YouTube window took over");
}

and hey, if that’s all you require by way of notification you’re good!

Now, if some clever spark out there would tell me how to set up the HTML delineated in that article so it would actually display an image of my choice instead of what comes from YouTube, then I’d be really happy! Bueller? Bueller? Anyone?

UPDATES:

HCYoutubeParser: Class which lets you get the iOS compatible video url from YouTube directly!

Continue Reading →
2

Snippet: Distance Calculation

So, if you’re doing a GPS-enabled application, chances are you’re going to want to figure out distances sooner or later. Perhaps even, as in this iphonesdk thread, have a SQL database of points of interest and want to pick nearby ones. And here is how you would construct that kind of query:

sprintf(buffer, "SELECT * FROM POIs WHERE (ABS(lat - %f) < 0.03) AND (ABS(lng - %f) < 0.04);", nLat, nLon);

Handy, that. And if you really need exact distance sorting, here is a formula that works at any latitude:

//spherical distance in meters 
- (CGFloat) sphericalDistanceFromLat1:(CGFloat)lat1 Lon1:(CGFloat)lon1 
      toLat2:(CGFloat)lat2 Lon2:(CGFloat)lon2
{ 
   return acos(sin(lat1 * 0.0174533) * sin(lat2 * 0.0174533)
      + cos(lat1 * 0.0174533)
        * cos(lat2 * 0.0174533)
        * cos((lon2-lon1) * 0.0174533))
        * 6371000; 
}

Now you know!

Continue Reading →
3

User Support Services

So, since we mentioned offhandedly the topic of support woes yesterday, let’s dig around a little and see just what kind of services are out there to make that process easier, shall we? Especially since as it happens, the topic came up on the iphonesdk list a couple days ago and there were a number of options suggested:

  • The GetSatisfaction.com people that just a little while back we mentioned the library that you can embed right into your app; but after following up the links that Informed Reader “Jer” was kind enough to grace that post with, we’re just a bit skittish about doing business with them, slick integration and free signup notwithstanding.
  • Lighthouse for tickets paired with the from the same company Tender for customer service. This one piques our interest because as you may recall if you’re a really old school follower, we decided waaaay back when that Lighthouse Keeper was the sine qua non of OS X simple issue tracking, and why yes it still has pride of place in our Dock, no reason to second-guess that since. (And our gushiness was enough to merit a quote on their product page, no less. Heh.) Pricing starting at $19 a month though … hmmm, we’d have to have a good bit more support needs before that really made sense.
  • Hesk.com, which looks quite interesting; PHP/MySQL software you install on your site for free (long as you don’t mind their logo) or can have hosted if you want. Client interface demo looks nice and clean as well, a strong consideration with support software indeed.
  • SupportSuite from Kayako.com, as you can see on the recommender’s site here. If you want really full-featured that certainly looks like a top contender, but we at least don’t have any particular need for any of that so far, especially at the $30/month and up their solutions cost.
  • Fixx which is free for individual developers you might look at … but the recommender added “after looking at Hesk it definitely has a more user-friendly interface”; which as you see above had struck us at first glance as well. So we won’t investigate that one further we don’t think.

So there’s a number of interesting options. So far our support needs don’t actually merit the trouble of setting up even a free one; but hey, always nice to keep abreast of the subject in case the need ever does suddenly become compelling! In that vein, any opinions on these or other services worth (or not) considering, Dear Readers?

UPDATES:

Appsfire App Booster is recommended by Five Lakes Studio!

Continue Reading →
4

Users Blowing

No, we’re not going to talk about support woes today, and we’re not talking about anything sexual either, misinterpretable title notwithstanding; we’re pointing you at another excellent Mobile Orchard tutorial, Detecting When A User Blows Into The Mic:

The job of detecting when a user blows into the microphone is separable into two parts: (1) taking input from the microphone and (2) listening for a blowing sound.

We’ll use the new-in-3.0 AVAudioRecorder class to grab the mic input. Choosing AVAudioRecorder lets us use Objective-C without — as other options require — dropping down to C.

The noise/sound of someone blowing into the mic is made up of low-frequency sounds. We’ll use a low pass filter to reduce the high frequency sounds coming in on the mic; when the level of the filtered signal spikes we’ll know someone’s blowing into the mic….

Not that we have any actual immediate need for this … or can think of any good ones off the top of our head, really; but hey, if you want to put a cool easter egg in your iPhone app, this certainly would be a stylish way to trigger it!

Continue Reading →
0

App Store Alternatives

So as an established iPhone developer, no doubt you’ve had your share of frustrations with the App Store and its approval process. Or maybe you just don’t like giving Apple it’s 30% cut. Or the … challenged … reports and payment process. What to do? What to do?

Well, there’s always the jailbreak crowd, we suppose — and they have indeed listed almost two dozen apps now! — but call us crazy, we just kinda tend to assume that the somewhere around 8% of the crowd that jailbreaks their phones in the first place are not heavy spenders on software, if you know what we mean and we think you do. If you have any evidence that the people listing Cydia apps are making a buck off it, let us know; but we’re just going to assume that it’s not so.

That doesn’t leave anything, does it? Well, according to Dow Jones, the people at Hottrix have sussed out something:

SAN FRANCISCO -(Dow Jones)- Steve Sheraton has a new magic trick: He’s making Apple Inc.’s (AAPL) App Store disappear.

The magician turned App developer has begun selling his $4.99 “iHypno” mind- reading application for Apple iPhones and iPod Touches directly from his Web site. That means consumers can buy the program without visiting the App Store, the official software bazaar that operates under Apple’s iTunes store.

“It’s based on technology encouraged by Apple,” Sheraton said during an email interview. “It’s totally legal and possibly the way you’ll see other apps delivered in a year or so.”…

Intriguing, yes? We thought so when it came up in this thread on iphonesb. The consensus was that they were using HTML 5 features — specifically the offline application cache — and CSS 3 visual effects which are hardware accelerated on the iPhone and all to provide an application-like experience which was essentially just a Web bookmark far as the phone was concerned.

So, in our never-ending quest to inform and entertain you the Gentle Reader, we decided we’d invest the big five bucks in checking out just how acceptable the experience actually is. So off to the site we went, picked an application, paid through a pretty standard credit card web purchase interface, and in short order got the email

Hi there Alex Curylo,
Thanks for purchasing MindBeam!
Please find below instructions to get up and running with MindBeam in no time. Be sure to practice before performing.
DOWNLOAD HERE:
**************************************
Here are the files you will download to your iPhone/iPod touch (not your computer).
Open this email on your iPhone or iPod touch.
Personal download link on iPhone: http://is.gd/XXXXX
Please keep the link to yourself because it is tied to your payment information.
The link will not work on your home PC, just on your iPhone or iPod touch.

OK then. So we tap on the link on the iPhone, and up comes in Safari

HottrixActivate.PNG
So we do, and after a shortish download we get

HottrixInstall.PNG

Heh. Well, that certainly does confirm the general consensus that these “applications” are cached websites, indeed. But are they actually comparable to native apps?

Why yes, indeed, so they are! Our new MindBeam “application” has animation, device rotation detection, native alerts, and so forth … seriously, it’s more polished and functional than a lot of native apps we’ve seen. There’s nothing that we see that jars the illusion. What’s really interesting is that when you tap the “More Tricks” button that takes you to their website, it looks just like the “application” is quitting and Safari is launching. So either these offline web apps really are run as separate processes, or they’re doing the quit-zoom animation themselves and then letting the standard UI come up. But there certainly is no indication that your “application” is running in Safari — if, indeed, it actually is — or in any way other not acting just exactly like every other native app.

So! That was a most illuminating little experiment, wasn’t it? Apparently it is possible to put together a completely under your control shopping experience for the iPhone that is close enough to providing a native application so that our eagle-eyed vigilance didn’t notice anything jarring, at least not once we got past the bookmarking “install” and into the “application” itself, and we do assure you we were looking.

And the really intriguing thing is, an application developed this way would almost certainly be marketable in the same fashion to Palm Pre users, Android users, and anybody else who uses WebKit or anything else HTML 5 compliant. Sure, they’re probably trivially easy to pirate, but really, what isn’t? Personally, we figure that “display the registered user’s name prominently at startup” is as much copy protection as you need to keep honest people honest, and you can’t keep any other kind honest no matter how much you work at it instead of doing something useful.

So, to sum up, mad props to Hottrix for showing us how to work around the App Store whilst providing what appears to be a perfectly acceptable user experience … and we are definitely going to add to the to-do list getting up to speed on just exactly what classes of application functionality are practical to provide in HTML 5!

Continue Reading →
4

Library: MapKit-Route-Directions

Unfortunately, our Japanese translating skills aren’t up to reading this post, but we think that

MapKitでルート案内をするライブラリを公開しました。

translates to something to do with the library

kishikawakatsumi’s MapKit-Route-Directions at master – GitHub

Extend MapKit to add route directions powered by Google Maps API.

Hey, if you want turn-by-turn descriptions in your MapKit, then you’ll probably find someone who speaks Japanese to sort this out for you, we imagine. And if you do, come back and provide us some English usage notes, k?

Continue Reading →
4

Snippet: Selector choosing

Here’s yet another handy piece from the oft-mentioned Erica Sadun: convenience methods for NSObject which now include an elegant way to account for differing SDK interfaces at runtime.

… I’ve put together a category of NSObject utility methods here:

http://github.com/erica/NSObject-Utility-Categories/tree

This code basically derives from stuff I’ve needed for other projects at various times. The latest addition is a selector check that returns the first one an object responds to, e.g.

SEL aSelector = [object chooseSelector: sel31version, sel30version, sel22version];

This offers run-time selector selection based on the current firmware. To use the selector, I’ve added a plethora of performSelector choices…

Handier than figuring it out yourself!

h/t: iPhoneSDK!

Continue Reading →
0
Page 74 of 93 «...5060707273747576...»