Weekly Poll: Does Your iPhone’s Color Matter?

When I bought my first iPhone — an iPhone 3G — I really wanted a white one. To me, a white iPhone was going to stand out from the rest, and I just liked it. The following year, I wanted black because the white got dirty too easily. Today, I really don’t care, I just want it to look good.

I’ve got friends though, who want any color possible on their iPhone. Pink, blue, green — it doesn’t matter, they only want some kind of color, because they want their iPhone to stand out.

What about you? Do you care about the color of your iPhone or does it matter at all? Let us know in the poll on the right, or make a comment!

Disable the iPhone’s Front Camera

The iPhone 4′s front camera is limited to 640×480 resolution. Although handy for video conferencing, for some apps that’s to small to yield a usable photo. Unfortunately the UIImagePickerController class does not have an option to restrict the user from using the front camera. Although you can check the size of the photo after the user is finished, it’s not great user experience to reject it after they go through the entire process of taking a photo.

One option is to replace the standard camera controls with a custom interface, but that’s a whole lot of work if you just want to prevent the user from taking a photo with the front camera. Fortunately there’s another option: put a transparent button over the “switch camera” button, which will intercept touch events and show an alert dialog. It sounds simple, but as you’ll see there are a few tricks to actually getting this to work.

We’re going to use UIImagePickerController’s cameraOverlayView property to add our button to the view hierarchy. We can’t simply provide a UIButton object though. In the latest iOS SDK, cameraOverlayView is automatically resized to fill the entire screen, while we only want to cover a small corner of it. Instead, we’re going to put the button inside a UIView subclass that will be used for layout and a few other tasks. Go ahead and create this UIView subclass in your project, call it ELCCameraOverlayView, and delete any methods the Xcode template includes by default.

We’ll need a button, so let’s start by giving our new subclass a UIButton instance variable named _button with a corresponding button property. Declare this as you’d declare any synthesized property, but let’s override the default setter method to also add it to the view hierarchy.

- (void)setButton:(UIButton *)button;
{
    if ( _button != button )
    {
        [_button removeFromSuperview];
        [_button release];
        _button = [button retain];
	if ( button != nil )
        	[self addSubview:button];
    }
}

You might create the button in another class (such as a view controller) and assign it to our custom class, but you can also create a standard button in your initWithFrame: method. Note that we still have to call addSubview: here as we’re not using the property accessor method (which is discouraged in init methods).

- (id)initWithFrame:(CGRect)frame;
{
    if ( ( self = [super initWithFrame:frame] ) )
    {
        _button = [[UIButton alloc] initWithFrame:CGRectMake( 240.0f, 0.0f, 80.0f, 80.0f )];
        [self addSubview:_button];
    }
 
    return self;
}

With the button in place, let’s move on to intercepting touch events which would normally go to the “switch cameras” button. We can do this by overriding the UIView methods which are called to determine if an event occurred within a view’s frame or not. Just check to see if the event took place within the button’s frame rectangle.

- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event;
{
    if ( [super hitTest:point withEvent:event] == self.button )
        return self.button;
 
    return nil;
}
 
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event;
{
    if ( CGRectContainsPoint( self.button.frame, point ) )
        return YES;
 
    return NO;
}

It may seem like we’re almost done at this point. If you set the camera overlay view to an instance of this class you’ll see the “switch camera” button should no longer work, and if you give the button an action method you can pop up an alert message telling users not to use the front camera. However, if you rotate the phone to landscape mode, you’ll notice that while the “switch camera” button is re-positioned, our custom button is not! To see what I mean, try setting a custom background color on our button so you can see it on screen.

This is a tricky problem. Unlike UIViewController, our UIView subclass does not have any way of telling when the interface orientation is changed. This doesn’t even matter though, since UIImagePickerController doesn’t actually change its interface orientation, it simply re-arranges the camera buttons while remaining in UIInterfaceOrientationPortrait!

The way I’ve solved this problem is to use the accelerometer to determine the device orientation. It might sound complicated, but it’s actually not a lot of work. Start by adding a new instance variable _interfaceOrientation and property interfaceOrientation to your class, of type UIInterfaceOrientation. We’ll also override its setter method to call setNeedsLayout whenever its changed.

- (void)setInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation;
{
    if ( _interfaceOrientation != interfaceOrientation )
    {
        _interfaceOrientation = interfaceOrientation;
        [self setNeedsLayout];
    }
}

Now let’s move the button whenever the orientation changes, and implement the required UIAccelerometerDelegate method.

- (void)layoutSubviews;
{
    CGFloat width = CGRectGetWidth( self.button.frame );
    CGFloat height = CGRectGetHeight( self.button.frame );
 
    switch ( self.interfaceOrientation )
    {
        case UIInterfaceOrientationPortrait:
        case UIInterfaceOrientationPortraitUpsideDown:
            self.button.frame = CGRectMake( CGRectGetMaxX( self.bounds ) - width, 0.0f, width, height );
            break;
        case UIInterfaceOrientationLandscapeRight:
            self.button.frame = CGRectMake( CGRectGetMaxX( self.bounds ) - width, CGRectGetMaxY( self.bounds ) - height - 50.0f, width, height );
            break;
        case UIInterfaceOrientationLandscapeLeft:
            self.button.frame = CGRectMake( 0.0f, 0.0f, width, height );
            break;
    }
}
 
- (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration;
{ 
	CGFloat x = -[acceleration x]; 
	CGFloat y = [acceleration y]; 
	CGFloat angle = atan2(y, x); 
 
	if ( angle >= -2.25f && angle <= -0.25f )
	{
        self.interfaceOrientation = UIInterfaceOrientationPortrait;
	}
	else if ( angle >= -1.75f && angle <= 0.75f )
	{
        self.interfaceOrientation = UIInterfaceOrientationLandscapeRight;
	}
	else if( angle >= 0.75f && angle <= 2.25f )
	{
        self.interfaceOrientation = UIInterfaceOrientationPortraitUpsideDown;
	}
	else if ( angle <= -2.25f || angle >= 2.25f )
	{
        self.interfaceOrientation = UIInterfaceOrientationLandscapeLeft;
	}
}

We’re almost done! Just make sure to start and stop the accelerometer in your init and dealloc methods.

- (id)initWithFrame:(CGRect)frame;
{
    if ( ( self = [super initWithFrame:frame] ) )
    {
        _interfaceOrientation = UIInterfaceOrientationPortrait;
        _button = [[UIButton alloc] initWithFrame:CGRectMake( 240.0f, 0.0f, 80.0f, 80.0f )];
 
        [[UIAccelerometer sharedAccelerometer] setDelegate:self];
        [self addSubview:_button];
    }
 
    return self;
}
 
- (void)dealloc;
{
    [[UIAccelerometer sharedAccelerometer] setDelegate:nil];
    [_button release];
    [super dealloc];
}

Finished! If you haven’t tested your overlay yet, you can add it to your UIImagePickerController as so.

UIImagePickerController *controller = [[UIImagePickerController alloc] init];
ELCCameraOverlayView *view = [[ELCCameraOverlayView alloc] initWithFrame:controller.view.frame];
 
[view.button addTarget:self action:@selector(selectFrontCamera:) forControlEvents:UIControlEventTouchUpInside];
 
controller.sourceType = UIImagePickerControllerSourceTypeCamera;
controller.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;
controller.cameraDevice = UIImagePickerControllerCameraDeviceRear;
controller.delegate = self;
controller.cameraOverlayView = view;
 
[self.navigationController presentModalViewController:controller animated:YES];
[controller release];
[view release];

Don’t forget to provide the button’s action method. You could show an alert, for instance.

- (void)selectFrontCamera:(id)sender;
{
    NSString *title = NSLocalizedString( @"Front Camera Disabled", @"" );
    NSString *message = NSLocalizedString( @"The front camera does not have sufficient resolution.", @"" );
    NSString *button = NSLocalizedString( @"Okay", @"" );
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title message:message delegate:nil cancelButtonTitle:button otherButtonTitles:nil];
 
    [alert show];
    [alert release];
}

I’ve uploaded the complete ELCCameraOverlayView class files here. Leave a comment if you have any questions!

D.C. Earthquake Reporting & the Power of the Mobile Web

D.C. Earthquake

Minutes after 1:53 p.m. EST today, I noticed my Facebook and Twitter connects updating their statuses and tweeting about an event: “earthquake!”

I searched Google News and found this: Rare Strong Earthquake Hits Colorado. Five minutes after the event, few if any mainstream news organizations had posted a story about the D.C. quake. (But poor Colorado for getting its thunder stolen.)

Yet Twitter was exploding with people posting about the D.C. earthquake the instant it was happening, many from their mobile phones:

D.C. Earthquake Tweets

This is the power of the mobile web and a powerful side of technology. We are all citizens, always reporting.

Thankfully, no injuries were reported.

D.C. Earthquake Reporting & the Power of the Mobile Web is a post from Apple iPhone Review.


Daily iPhone App: Gesundheit

Gesundheit is a strange but beautiful little game, recently released to the App Store by Konami. It’s sort of a puzzle game, though there are action elements as well. You play a little pig whose talent is that he can sneeze boogers out at a distance, which may not sound like much, but certainly comes in handy when his little pig town is invaded by rampaging monsters who just happen to like the taste of his nose’s output.

It sounds gross, and it kind of is, but the game’s winning art style and great soundtrack make it all much more charming than revolting. Each stage has the little pig navigating the town’s roads and buildings to try and not only grab some starfruit, but also catch all of the monsters in traps by sneezing in the right direction.

It’s a lot of goofy fun, and especially at the launch price of just US 99 cents, it’s easy to recommend this one. Full Game Center integration and a nice stream of challenges as you play keep the replayability on this one high, and that art style and soundtrack are just really, really enjoyable. Definitely give it a look.

Daily iPhone App: Gesundheit originally appeared on TUAW – The Unofficial Apple Weblog on Wed, 24 Aug 2011 08:00:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

Firemint hosts contest, win a chance to play Spy Mouse first

Developer Firemint (makers of the extremely popular Flight Control and Real Racing games) is about to release its latest game Spy Mouse. Along with parent company EA, it’s hosting a contest to let a few players into the game early. You have to log in with Twitter over on this page, then “answer the clue,” a new one every day, to be entered to win. You can also do a little social networking promotion for Firemint to increase your chances. For every 100 likes the company gets on its Facebook page, another winner will get picked for the current clue.

In addition to playing the game early, Firemint’s also giving away copies of EA games like Dead Space and The Sims 3. If you’re interested to see what Firemint’s been up to as early as possible (and for free), definitely give the contest a look. Heck, you could always do what I do: Send the promotional tweets out on a completely separate Twitter account, which lets you get the word out there without bothering your usual followers.

Firemint hosts contest, win a chance to play Spy Mouse first originally appeared on TUAW – The Unofficial Apple Weblog on Wed, 24 Aug 2011 00:00:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

Bungie details iPad release of Crimson: Steam Pirates, coming next week

Man, after all the rumors, it almost seems expected: Bungie has finally announced its first original project for the iPad, a game called Crimson: Steam Pirates. It’s due out on the iPad next week, and will let you command a steampunk crew across a turn-based battlefield, combining strategy, action, and Bungie’s own polish and experience into what looks like a pretty impressive iOS game.

The best news is that it’s free to play — the first chapter of the game contains eight missions, two multiplayer scenarios, and lots of extras like Bungie.net and Facebook integration. Other chapters will soon be available for $1.99, with chapter 2 coming immediately after release, and presumably more content later. For now, the app is iPad-only, which leaves us iPhone owners out of the loop, unfortunately.

Still, the game looks good, and Bungie has had few bad games in its time. Stay tuned — we should see it ready for download next Thursday.

Bungie details iPad release of Crimson: Steam Pirates, coming next week originally appeared on TUAW – The Unofficial Apple Weblog on Tue, 23 Aug 2011 22:00:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

McAfee: Android malware soars while iPhone untouched

McAfee says that the Android OS is having some issues with malware lately — according to a new study from the anti-malware company, Android malware has grown by 76% over the past few months, sending the number of troublesome scripts out there to over 40. Some of the malware appears to be legitimate apps, and other issues come from code that sends unwanted text messages or performs other scammy behavior.

Meanwhile, Apple is doing great with iOS — McAfee has recorded zero legitimate threats to a stock iPhone, with the only attacks on the hardware coming to four different jailbroken devices. It appears Apple’s “walled garden” approach, while limiting to some developers and customers, has at least made good use of those walls in keeping malware away.

The other mobile OS with a spotless score? webOS, which of course is probably that way simply because it’s just not used that much.

McAfee: Android malware soars while iPhone untouched originally appeared on TUAW – The Unofficial Apple Weblog on Tue, 23 Aug 2011 21:00:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

Dear Aunt TUAW: Help me ditch the screenshot shadow

Dear Aunt TUAW,

I miss my old style screenshots.

I use screenshots a LOT for presentations and training purposes — specifically the window-only snapshot (cmd-ctrl-shift-4 followed by the spacebar).

This feature is still in Lion; however, it now includes a pretty big drop shadow with the screenshot. Is there a way I can turn this drop shadow off to trim the window down to just the important parts — the window and its contents?

Your loving nephew,

Patrick

Dear Patrick,

There’s a simple command-line approach to controlling whether Lion adds those shadows or not (Snow Leopard, too, as this dates back quite a while). Just issue the following to disable the shadows. Use false instead of true to enable them.

defaults write com.apple.screencapture disable-shadow -bool true

There are other cool screencapture preferences you can use as well. For example, you can set the capture format to JPEG, TIFF, or PNG using the following. Google around to discover more.

defaults write com.apple.screencapture type jpeg

After setting the defaults, you must restart the SystemUI server:

killall SystemUIServer

And there you have it. If you’re not a command-line kind of guy, you can also use the latest build of GrabUpper to set the shadow and capture format defaults with a simple menu selection.

Hope this helps! Hugs,

Auntie T.

Dear Aunt TUAW: Help me ditch the screenshot shadow originally appeared on TUAW – The Unofficial Apple Weblog on Tue, 23 Aug 2011 19:00:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

Daily Mac App: Tremors


Who says we’re not topical here at TUAW. For our Daily Mac App, I bring you Tremors. Developed by TUAW’s own Michael Jones, this $2.99 app helps you monitor seismic activity around the globe.

It leverages USGS data, but it includes quake data from all over. Tremors had no trouble locating today’s Virginia shake-up, seen above.

What’s more, it offered that in terrain, roadmap view, satellite and hybrid modes. When you zoom in using Satellite, you can see these quakes had epicenters right in the middle of someone’s backyard.

A handy list-view lets you see where each quake has happened and when. It surprised me how many quakes took place around the world in just the last few hours. Virginia looks piddling in that list, although I’m told that it’s all about how the plates are laid out, not about just the magnitude and distance from the epicenter.

Anyway, Tremors is a cool app to explore and hopefully very few of you will have to get up close or personal with any of the seismic activity reported there in.

Daily Mac App: Tremors originally appeared on TUAW – The Unofficial Apple Weblog on Tue, 23 Aug 2011 18:30:00 EST. Please see our terms for use of feeds.

Permalink | Email this | Comments

Galaxy S II shows Android-stye buttons replacing iPhone-style home button

Samsung has posted an updated video showing the American version of the Galaxy S II. It’s notable that Samsung has removed the iPhone-like home button and replaced it with more Android-style controls. In the video you’ll see the current version of the phone, and the new button arrangement at the very end.

Apple has loudly (and legally) complained about competing phones that have copied the look and feel of the iPhone design, and it looks like Samsung is responding by removing elements that are clearly derivative.

The U.S. version of the phone is likely to appear on August 29th.

[Via Electronista]

Galaxy S II shows Android-stye buttons replacing iPhone-style home button originally appeared on TUAW – The Unofficial Apple Weblog on Tue, 23 Aug 2011 18:00:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

OS X Lion 10.7.1 update hits Mac App Store – one week later

One week after its release through Software Update, the 10.7.1 update for OS X Lion has made its way onto the Mac App Store. It’s not clear if the delay was intentional or not. Unforeseen technical issues may have complicated issuing an update to such a large piece of software on Apple’s new app distribution platform.

However, it’s just as likely that this will be Apple’s strategy going forward: offer OS X updates through traditional channels like Software Update and direct download to more tech-savvy users who typically watch for these kinds of things, give the update a week to settle, then offer the download to the more casual set who only updates via the Mac App Store. In that case, those of us who update right away might end up acting as de facto beta testers during that week.

It’s too early to tell either way what Apple’s intent for future OS X updates will be. However, if the 10.7.2 Lion update has the same weeklong delay between Software Update and the Mac App Store, it makes it more likely that Apple plans to follow that pattern going forward.

OS X Lion 10.7.1 update hits Mac App Store – one week later originally appeared on TUAW – The Unofficial Apple Weblog on Tue, 23 Aug 2011 17:00:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

Three more Apple Stores open their doors this Saturday

Last weekend, Apple opened three new Apple Stores. Apple plans on opening three more stores this Saturday, well on the way to opening a total of 30 new retail outlets between July and September.

According to ifoAppleStore, two new stores will open in the U.S. and one in France. The “Natural State,” Arkansas, gets its first Apple Store on Saturday at The Promenade at Chenal in Little Rock. The store was originally scheduled for an October opening, but the construction apparently went into warp drive, allowing for an earlier debut.

The other new American store is the second in Charlotte, North Carolina. The Northlake Mall store (not to be confused with the SouthPark store on the other side of Charlotte) is the fifth Apple Store in the state.

The new French store is the eighth in the country, and the fourth in the Paris metro area. The Careé Sénart store is located in Sénart to the southeast of Paris.

The U.S. openings leave Montana, North Dakota, South Dakota, Wyoming, West Virginia, and Vermont as the only states without Apple Stores.

Three more Apple Stores open their doors this Saturday originally appeared on TUAW – The Unofficial Apple Weblog on Tue, 23 Aug 2011 16:30:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

WSJ: Sprint will sell the iPhone 5 in mid-October

At TUAW we typically look the other way when it comes to iPhone rumors, but once something hits the Wall Street Journal, we pretty much consider it a done deal. The WSJ now reports that Sprint will offer the iPhone 5 in mid-October, bringing the handset to the third-largest US carrier. The iPhone 5 will hit AT&T and Verizon at the same mid-October date. This is according to the Journal’s sources, “people familiar with the matter,” who have usually turned out reliable information in the past.

The Journal notes that the mid-October launch points to a later-than-expected launch for the iPhone 5, which was expected to debut in September. If the WSJ’s sources are correct, and if Apple follows its prior pattern, it’s likely the iPhone 5 will be announced sometime in September with the hardware hitting the market around 30 days later.

Sprint is the second-largest CDMA carrier in the US, and rumors about the iPhone coming to that network have abounded since even before the CDMA-model iPhone 4 hit Verizon. If the iPhone 5 does indeed make it to Sprint, T-Mobile will be the last major wireless carrier to not offer Apple’s handsets.

WSJ: Sprint will sell the iPhone 5 in mid-October originally appeared on TUAW – The Unofficial Apple Weblog on Tue, 23 Aug 2011 16:00:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

Big US retailers adopting Apple products: Say goodbye to the cash register

Earlier today TUAW reported on how one New York City restaurant has adopted the iPad as a menu and point of sale system replacement. Now All Things D is reporting that Apple products — predominantly the iPad — are being purchased in droves by major retailers across the country.

Home improvement chain Lowes is reportedly deploying 42,000 handheld devices to stores in the U.S. and Canada. Other major deployments have been announced by rival Home Depot, Nordstrom, and Urban Outfitters. As noted by All Things D’s Tricia Duryee, some of the retailers haven’t spilled the beans on what devices they’re actually fielding, but it’s anticipated that they’ll be Apple devices — iPhones, iPads, or iPod touches.

While the devices can be easily set up to accept payments, many of the retailers are initially using the devices for customer service use cases: looking up answers to customer questions or checking availability of products.

Pacific Sunwear, AKA PacSun, will be rolling out iPads in 300 of its stores, and plans to increase the distribution of the tablets to up to 600 more locations by next year. PacSun is using an application by developer Global Bay to assist customers in ordering items that are out of stock in the stores.

Global Bay CEO Sandeep Bhanote mentioned that one retailer it helped has seen a 12 percent increase in average order transaction when customers receive service from associates carrying in-store Apple devices. For PacSun, the iPads are anticipated to let store associates close five more transactions a day — and that’s more than enough to cover the cost of the equipment and software.

How about you, TUAW readers? Other than at Apple Store retail locations, have you started seeing a lot of Apple products at your favorite retailer? Let us know in the comments.

Big US retailers adopting Apple products: Say goodbye to the cash register originally appeared on TUAW – The Unofficial Apple Weblog on Tue, 23 Aug 2011 15:30:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

CNN reportedly buys iPad magazine app Zite

Techvibes is reporting that CNN is buying Vancouver-based iPad magazine app Zite for up to US$25 million. Zite is an iPad magazine app that aggregates news based on your personal preferences.

Personalized magazine aggregator apps are becoming increasingly popular on the iPad. Other similar apps to Zite include Pulse, Flipboard, AOL Editions, and more. All the apps basically work in the same way: you input your preferences for the stories you want to read, or the app reads your preferences from social media sites and presents you with news stories.

CNN’s interest in Zite as a stand-alone news aggregator would be an interesting departure from its video-heavy iPad app. While that app does also have print stories, it’s possible CNN wants Zite for its underlying technology to incorporate into its existing iPad app, allowing for a more personalized experience for its users. Or, who knows, perhaps CNN wants to get into the magazine aggregator business on all its own, though it would be rather self-limiting if CNN only used its own sources for the aggregator app. After all, the appeal of such apps is that they pull news from multiple news sources around the web. At this time, Zite is still available as a free download from the App Store.

CNN reportedly buys iPad magazine app Zite originally appeared on TUAW – The Unofficial Apple Weblog on Tue, 23 Aug 2011 15:00:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments