Archive for the 'iPhone' Category

Why iPhone 3G S Doesn’t Suck Like You Think It Does

My wife wanted my iPhone 3G so I couldn’t hold off on upgrading until next year so I trotted down to the Apple store at 5:30 AM to wait in line this past Friday. Lots of people have called the 3G S a marginal upgrade since there was no aesthetic change but it’s actually a significant upgrade. Although I wanted a new design, it makes sense to redesign every could of years instead of every year and I was glad to continue using my existing accessories.

iPhone 3G S got a storage bump. Thirty-two gigs of flash memory makes for a handy iPod with plenty of storage for my music (those with large music collections might find this cramped, but it’s double that of the old high end iPhone). Apple also added a significant processor upgrade (Anandtech has already gone in depth so I will not) and iPhone 3G S has 256MB of memory, up from 128MB in the original and iPhone 3G. These upgrades make for a “snappy” UI experience. It’s noticeable. The GPU was also upgraded, which will make for better looking games as soon as developers take advantage of it (that will not take long) and smoother frame rates with existing games. The phone comes preloaded with the iPhone 3.0 software (thoughts here) — it’s good. Although the phone supports 7.2 mbps HSPA, AT&T’s network doesn’t. They’re rolling it out, though, so hopefully it’ll help despite reports that show otherwise.

Apple threw in a 3.2 MP camera and added support for video recording. I was a bit miffed at video recording being a 3G S only feature as it could have been added to existing iPhones as well (via software, don’t give me that processor too slow crap..older candy bar phones record video fine). Apple also added speech reco via a voice command interpreter (dial, play music, etc.). This should also have been possible via software (again, candy bar phones). At the end of the day they needs to sell hardware so I understand the business reasons but I’m not a fan. Basically, Apple changed everything on the inside of the phone, added a bunch of software features, and called it the 3G S. If you have a first generation iPhone, this is a must-have upgrade. If you are on an iPhone 3G, it’s a toss-up but I’d spring for it.

Overlay UIView on MPMoviePlayerController

So you wanna overlay a UIView on MPMoviePlayerController?

Tried


[self.view addSubView:myView];

to no avail, right? The reason that fails is that MPMoviePlayerController actually creates a new window and overlays that on your app. This means you can’t just add a subview — it’ll just be hidden.

Try this oversimplified example:


MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:myURL]];

[[NSNotificationCenter defaultCenter] addObserver:self selector: @selector(playerFinishedPlaying:)
name:MPMoviePlayerPlaybackDidFinishNotification object:player];

[player play];

UILabel *label = [[UILabel alloc] initWithFrame:CGRectZero];
label.text = @"Hi, I'm on your MPMoviePlayerController";
label.transform = CGAffineTransformMakeRotation(M_PI/2.0);
label.frame = CGRectMake(0,0,20,480);

[[[UIApplication sharedApplication] keyWindow] addSubview:label];

Wait, WTF? Clever folks might have tried [player _window], which works great on the simulator but fails to build for the device. The trick here is that the sharedApplication’s keyWindow IS the player’s window once the player is on screen, so adding a subview to that window overlays said view on the player. I did run into a bug where the keyWindow property was nil after the player was shown, so if you want to use that again later, make sure to call:


[self.view.window makeKeyAndVisible];

when the player calls back on your controller handling MPMoviePlayerPlaybackDidFinishNotification (in this case, playerFinishedPlaying:).

UPDATE: For iPhone 3.0, I can only get this to work with a bit of a hack — use a timer to show the overlay later. >.< Not sure I like this approach or think it’s reliable but it seems to work. Test it and YMMV for sure.


...

[player play];
[NSTimer scheduledTimerWithTimeInterval:3 target:self selector:@selector(showOverlay:) userInfo:nil repeats:NO];
}

- (void)showOverlay:(NSTimer *)timer {
UILabel *label = [[UILabel alloc] initWithFrame:CGRectZero];
label.text = @"Hi, I'm on your MPMoviePlayerController";
label.transform = CGAffineTransformMakeRotation(M_PI/2.0);
[label setBackgroundColor:[UIColor redColor]];
label.frame = CGRectMake(0,0,20,480);

NSArray *windows = [[UIApplication sharedApplication] windows];
UIWindow *mpw = [windows objectAtIndex:1];
[mpw addSubview:label];
}

iPhone 2.0 Proximity Sensor

Want to turn on the proximity sensor (shuts off the screen when something is close to the phone — e.g. phone is in pocket)?

[[UIApplication sharedApplication] setProximitySensingEnabled:YES];

Similarly, it’s pretty easy to shut it off:

[[UIApplication sharedApplication] setProximitySensingEnabled:NO];

That’s about all you can do with it, for now. I’m not sure if 3.0 will give the ability to read values from the sensor or not , which is what I really want. I need to dig into those docs.

Thoughts on iPhone 3.0

I watched a few liveblogs on iPhone 3.0 (namely gizmodo’s). I must say that I had high expectations going into the event, given the state of iPhone OS 2.0 (pretty good but not quite there).

iPhone has been one of my biggest thrills and disappointments at the same time. On the one hand, it ushered in a new era of innovation in mobile computing. No more crappy WinMo UI or Symbian UI. On the other, it lacked the simplest features that most Moto and SE flip/candybar phones feature:

  1. Bluetooth file xfer
  2. Blutooth tethering
  3. A2DP
  4. Almost anything else Bluetooth
  5. MMS

And it definitely lacked features that WinMo has had for years:

  1. API access to almost anything
  2. Multitasking (WinMo did it with 200MHz processors and crappy batteries so surely Apple can)
  3. Copy and paste!

Well, Apple fixed most of that today. They showed off a lot of new features in iPhone 3.0, many of which should have been there in version 1.1. I’m generally pleased by Apple’s announcements.

What’s coming in iPhone 3.0? Well, take a look at all of the stuff I wanted above — you’ll get most of it. Here’s the skinny — consumers get:

  1. Copy and paste!! (FINALLY!)
  2. A2DP (stereo bluetooth audio — wanted this for 2 years)
  3. Bluetooth tethering if AT&T allows it (I’m sure they will for a healthy $30 a month or some such fee)
  4. Spotlight – search for stuff in Apple apps or use it as a launcher to find apps
  5. MMS
  6. CalDav calendar support (also a must for me!)
  7. Notes sync

There’s more, but that’s all the cool stuff. Did Apple forget the devs? Nope. We get a lot of cool new toys too, some of which would have been nice a month ago when return7 started work on its next app (currently in beta):

  1. Proximity sensor API (yay! we can be hot shots like google now and boy do I have a kick ass app idea using this)
  2. Peer-to-peer discovery/ip connection ala bluetooth+bonjour (it’s 1-to-1, not n-n)
  3. Accessories can access the dock connector or hit the phone via bluetooth — can dream up so many cool robots w/ this now
  4. Google maps API (can’t be used for turn-by-turn)
  5. Official blessing for turn-by-turn (Garmin, give us some love..please!)  but bring your own maps
  6. PUSH NOTIFICATIONS! Hi, welcome to not September 2008. Better late than never, though. I must say, I prefer either backgrounding or some runner that calls some standalone script in an app that’s limited to 10 seconds or so of execution time…but this’ll do. :)
  7. VOIP Service of some sort for apps (not sure how this’ll work but here come the 10 million walkie-talkie apps..they’ll be the new ToDo app)
  8. Access to the music library on the phone
  9. Easier audio recording
  10. Upsell on paid apps (basically makes it easy to do things like episodic content for users)

Once again, there’s more, but those are the highlights. Did I get all of the answers I wanted or everything I wanted? No. Did I expect to? Not so much. I think Apple’s done a pretty good job of appeasing the fanboi (and the !fanboi) in me, though. Will be excited when/if they announce a new iPhone later this year.

Edit: give me tethering.

PunchClock Demo Vid

Check it out here. What do you think?