Thursday, December 18, 2008

More iPhone code, opening some URLs in Safari

I answered a question about this in the iPhone developer forums, so thought others might find it useful too.

If you have a UIWebView in your app to show some web page (which I'm using for all the help pages.) You may still want it to open a new Safari window for other things--like links to the AppStore for other programs. This little bit sees what they web view will open, and if it's a URL on apple.com or an email address, opens that in Safari or the Mail app.

An equivalent of the "myEndsWith" is something you'll still have to do :)


- (BOOL)webView:(UIWebView *)webView 
shouldStartLoadWithRequest:(NSURLRequest *)request
navigationType:(UIWebViewNavigationType)navigationType {
//Opens any to apple.com in Safari (so app-store links open right :)
if ([[[request URL] host] myEndsWith:@"apple.com"]) {
[[UIApplication sharedApplication] openURL:[request URL]];
return NO;
}
//Mailto opens in email app...
if ([[[request URL] scheme] myStartsWith:@"mailto"]) {
[[UIApplication sharedApplication] openURL:[request URL]];
return NO;
}
return YES;
}

Saturday, December 13, 2008

1 Week, 1 App

I started pulling out a few of the features in FTP On The Go since put together, they really make an entire very useful program.

The Web and FTP servers, along with the directory manager to browse your files, and the viewers for individual files (editor for text, etc) all add up into a very useful program.

Crazy that I could have stopped after the first day of work and called it done. But I wanted to add a much cooler interface...the picture here doesn't show how cool the "bounce" sizing looks when you touch the things on the screen.

About a week later and it's all done and submitted to Apple. Even a website using Peter's nice templates: WiFi Disk. Hopefully shows up in the AppStore soon!

{Edit.  Names changed more for this than any other program we've done.  One of the working titles is in the picture.  Somebody already had a USB disk product with that name, so didn't use it.  But go the .com before I noticed.}

Thursday, December 4, 2008

iPhone Toolbar Menu Icon

I needed an icon for showing a menu of choices in the "FTP On The Go" iPhone app. Since it's using an UIActionSheet, I thought this turned out well...just simple boxes (with a little shading), shown in black here so visible on the background.



Seems the blogger site loses the alpha channel. Here's the original image. Free to use in any app.

www.ftponthego.com/toolbar-menu-button.png

Tuesday, November 25, 2008

Getting our money's worth.

A couple years ago, we bought a new logo design for GetRight (from glyfx.com; highly recommended.)

It was a much improved version of the basic idea I'd done years before with the arrows around a globe. My versions tended to look good as long as computers did 16 colors :)




We needed a new logo for the FTP On The Go program since the one we'd done was pretty simple and not too fancy. Peter adapted the GetRight logo, adding the burst effect and removing some arrows. It turned out awesome!

Monday, November 24, 2008

Clone wars

I watched the newer Clone Wars movie. If you expect it to be the first extended episode of a TV series for kids, you'll be happy. I'm sure my 10 year old nephew loved it.

But come on: The enemy characters in any number of video games I've played showed far better tactics than the stupid droid army (in this and the other movies). Marching in nice easy-to-hit rows into enemy fire was what lost the British the US revolutionary war.

Friday, November 21, 2008

Q

Just saw the new James Bond movie. Good, but is Q gone?

It used to be, Q would manage to provide just the gadget needed. You could count on the fact that if Bond had a laser watch, something would need to be cut; or if a mini underwater air tank, he'd be trapped underwater before the end of the film.

Now, it's mainly product placement for the newest Sony gadgets. Must be nice owning a movie studio.

Though Technology is to blame a bit; they had to get pretty crazy to have a gadget that wasn't available at Wal-Mart. Invisible cars and silly things like that.

Wednesday, November 19, 2008

Fading Default.png when iPhone app starts

More iPhone code. I wanted to have the startup logo (Default.png) graphic fade into the first screen after the program starts. This is a much nicer transition than just letting the view switch instantly.


1) Add the new image view to the class.

UIImageView *splashView;

And add this selector:
- (void)startupAnimationDone:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context;


2) at the very bottom of "applicationDidFinishLaunching" add:

splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 320, 480)];
splashView.image = [UIImage imageNamed:@"Default.png"];
[window addSubview:splashView];
[window bringSubviewToFront:splashView];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.5];
[UIView setAnimationTransition:UIViewAnimationTransitionNone forView:window cache:YES];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(startupAnimationDone:finished:context:)];
splashView.alpha = 0.0;
[UIView commitAnimations];



3) Add this selector to cleanup the image and save memory.

- (void)startupAnimationDone:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {
[splashView removeFromSuperview];
[splashView release];
}



4) Awesome bonus bit. Add this below the splashView.alpha = 0.0 line. It adds that extra bit of coolness to the transition.

splashView.frame = CGRectMake(-60, -60, 440, 600);

Signatures

Getting support emails for a dozen years, I've noticed that while most people have just a simple name or name and quote for their email signature, occasionally there's somebody with a LOT more.

Their name, every possible way to contact them, every website they're associated with, even awards. There's probably some deep psychological meaning you could get from it. But I'm too busy to figure what that is.

-Michael

Tuesday, October 21, 2008

iPhone/iPod touch WiFi

Since I'm doing a variety of network programs for iPhones and iPods (FTP OnTheGo, ContactClone) I've got an iPod touch for testing, as well as my iPhone 3G and the older iPhone that's now my wife's. With the network programs, I've been changing settings and noticed a difference in the number of wireless networks they showed.

I did a test sitting at my desk...

The iPhone and iPhone 3G saw 2 wireless networks in the settings, sometimes a third would appear for a few seconds, but would disappear again.

Exactly the same with a first generation iPod touch consistently saw 4 to 5, and a few times as many as 8 wireless networks! The quality was low, so I'd have trouble actually connecting, but was a very surprising difference. I guess the antenna in the iPod is a lot better than the one in the iPhone.

I'm curious how an iPod touch 2nd generation would compare...but not curious enough to buy one yet :)

Monday, October 13, 2008

iPhone Code - Table Header Context Help

Now that the iPhone NDA has been changed, I thought I'd post a bit of code for various things I've done for the iPhone. I wanted to do a contextual help sort of thing for different sections in a grouped table view. This will be in the next version of FTP On The Go and shows some of the features coming if you look closely at the screen :)
Pressing the button pushes a view onto the navigation controller that shows a webpage off our server with the help contents.

I got the graphic for the help button by changing the hue/saturation from an icon purchased from icons-icons.com.
Sorry for bad formatting from the blog stuff.


In the .h file...

#define SETTING_HEADER_FONT_SIZE 16.0
#define SETTING_HEADER_HEIGHT 36.0
#define SETTING_HEADER_ROW_WIDTH 308.0

In the .m file...


In the viewDidLoad, there's this to set the heights.

tableView.sectionHeaderHeight = SETTING_HEADER_HEIGHT;
tableView.sectionFooterHeight = 6;


- (UIView *)tableView:(UITableView *)tableView
viewForHeaderInSection:(NSInteger)section {
UIView *hdrView = [[UIView alloc]
initWithFrame:CGRectMake(0,6, SETTING_HEADER_ROW_WIDTH, SETTING_HEADER_HEIGHT)];
hdrView.backgroundColor = [UIColor clearColor];
UILabel *label;
label = [[UILabel alloc] initWithFrame:CGRectMake(12, 6, SETTING_HEADER_ROW_WIDTH-100, SETTING_HEADER_HEIGHT)];
label.font = [UIFont boldSystemFontOfSize:SETTING_HEADER_FONT_SIZE];
label.textAlignment = UITextAlignmentLeft;
label.highlightedTextColor = [UIColor whiteColor];
label.textColor = [UIColor darkGrayColor];
label.shadowColor = [UIColor whiteColor];
label.shadowOffset = CGSizeMake(0, 1);
label.backgroundColor = [UIColor clearColor];

if (section==0) {
label.text = @"Downloading Files";
} else if (section==1) {
label.text = @"Sharing \"Saved Files\"";
}
[hdrView addSubview:label];

UIButton *button = nil;
if (section==1) {
button = [[UIButton alloc] initWithFrame:CGRectMake(SETTING_HEADER_ROW_WIDTH-32, 2, 32, 32)];
[button addTarget:self action:@selector(clickSharingHelp: forControlEvents:UIControlEventTouchUpInside];
}

if (button!=nil) {
[button setImage:[UIImage imageNamed:@"help32.png"] forState:UIControlStateNormal];
button.showsTouchWhenHighlighted = YES;
[hdrView addSubview:button];
}
return hdrView;
}

Friday, August 22, 2008

App Store

We're excited that we now have several programs in the iPhone's App Store.

Our Business tool FTP On The Go, an FTP client.
As well as an hourglass program: iHourglass, both a free houglass with one image, and a premium version that has about 10. (And there are a few more things coming!)


What the App Store really has changed is overnight it created a market for really cheap little software programs. Our Premium iHourglass is $1.99. Until now, there never has been a real way or place to market and sell a program for a dollar or two. As a programmer who does it for a living, there is far more incentive to work on a simple little tool or silly program that might make a little money.

There's a whole new market for something that costs a dollar and is just kinda cool or a little bit useful...the lifespan might not be years like a good Windows/Mac utility can do (GetRight is going strong and is over 11 years old). But if it only takes a few days or evenings to create as the iHourglass and the next one did, it doesn't matter. If it doesn't last long, create something else! (Though we really think that FTP On The Go will have a good long lifespan...people have needed FTP programs for a couple decades now.)


If Microsoft had done a similar thing with the Gadgets in Vista, I bet they'd have attracted a bunch more developers to create them.

Wednesday, July 23, 2008

SIC 2008

We got back from the Shareware Industry Conference in Boston on Sunday. Another good year. We always come back with either one big idea that pays for the conference, or a bunch of little ones that do the same. This year, it's the bunch of little ones.

We showed off our new secret project to a bunch of people and got some great responses. Good suggestions on pricing, and a lot saying "tell me when it's out so I can buy!" which is always great to hear. (Should be posting soon about just what it is if you weren't there.)

Peter updated the GetRight.com homepage based on things from the critique session, they drew our card out of the hat this year. But overall, they liked our designs and pages. By far the best reviewed site. (Yeah Peter!) They especially the navigation button and buy page layouts.

Speaking of "Buy" pages, we forgot the cards with the coupon on it, so posting it here :) This is a coupon for 50% off GetRight Pro. It expires the end of this month, so if you're interested, do it now.

We have been pretty lucky with the drawings for prizes too, and this year was the best so far. Shawn won an Xbox 360 and Rock Band. Pretty awesome!

Now to just keep going thru the notes we all wrote.

Monday, June 23, 2008

Apple is smart

So the iPhone 3G is coming, and while it's got some nice additions, it isn't a huge step over the iPhone 1. But that may be really really smart.
  • It lets them be cheaper, $199 rather than $399 if they'd thrown in everything. A much more acceptable price. They'll sell a ton more that way.
  • It lets just about any application that developers create work on both the old and new models. This one is huge. One stable platform.
  • Everything is software, so they didn't need to figure out the next brilliant idea--just get the hardware and tools so some developers can build it.
  • And somebody is going to think of that brilliant idea...something people would buy an iPhone for just by itself.

On a very related note, I bought my first Mac; and first Apple computer since I got a Apple IIgs back in high school.

So Apple has not only sold me a iPhone, but also a computer (admitedly, it's the cheap Mac Mini--but it runs the iPhone programming tools just fine.) And my wife is insisting I upgrade the iPhone so she can have the old one :) Gotta love her for that!

Monday, May 5, 2008

Picking on Revenge of the Sith.

It was on TV, and I had nothing to do, so I just rewatched Star Wars: Revenge of the Sith.

A few plot holes that leapt out on this viewing.
* R2-D2, a star-ship repair droid, shouldn't have better fighting skills than specificially built battle robots.

* Several battle droids, equipped with basic wireless like in a laptop, or just flashing lights for communication, should be able to easily kill any Jedi. A simple command system to synchronize their fire, and not line up their shots within the 3 foot straight line where they can all be blocked by a light saber would do it.

* If your first command from the new boss is "kill all these 10 year old kids" wouldn't you wonder if maybe you're on the Evil side?

* Even given our current level of pre-natal care, Amidala would have known she was having twins and surely would have told the father.



And going back to the previous I & II...
* What kind of society elects teenage girls to be their queen?

Tuesday, April 22, 2008

Geeky Tip

This is a rediculously geeky tip. Since upgrading to Vista, the backup program I use (Second Copy) slows down the whole computer to a crawl--the CPU is at 100%. This tip makes it bearable to still use it while it backs up and "fixes" the program using 100% of the computer.

Start the Windows Task Manager by pressing CTRL+ALT+DEL. On the "Processes" tab, right click the program that is using all the CPU and select "Set Affinity" from the menu. On the window that shows, uncheck one of the boxes (but leave at least one still checked!)


This works until you close the program, or restart Window; then you'll have to do the same thing again.


What this really does: Most newer computers really have more than one "core" in the main chip, this lets them do several things at once. Doing that Affinity sets the program so it will only use one of the cores in the chip--which lets the other core have a break and let you do something. After doing that, on the graph page in task manager, one will be at 100% while the other isn't---where before the program would have them both at 100%.


Wednesday, April 16, 2008

Star Wars Awesomeness

My wife ordered an old iron-on transfer book on eBay. She originally thought whe might use it for a quilt for me...but when it arrived, we realized there's no way we'd do that. It's far too cool as an old book.

(c) 1977 and I'd guess very early because of the text and pictures. A few decades pre-Photoshop, so I'm sure they had Darth Vader and the rest in these t-shirt for the cover.





They're all backward, and over the 30 years, the transfers have copied themselves to the opposite page a bit.


"Artoo Detoo" instead of R2-D2.

Same for "See Threepio"


One of our favorites...the old promotional poster that don't really look anything like the real characters.

Tuesday, March 4, 2008

A day at the beach



We went to the beach with the dogs. Notice how Makena will let Isabella sprint after the ball, then steals it at the last minute so she can be the one to return it to use.

We went with our friends Dara and Chere, and their dog Marcel.

Tuesday, February 26, 2008

iPhone Gestures

My wife and I have an iPhone. My biggest, and really only, complaint is about how it works as an iPod.

When she is driving and I'm in charge of the music, she says "Next" a lot. You have to press the Home button, then slide to unlock, then press the small Next button all to go to the next song.
(EDIT: As comments noted; also doing double-click the Home button and look to see the Next on the screen too. But still, you've got to look at the screen.)


Hopefully somebody at Apple is listening...add Locked iPhone Gestures.

Let me press the Home button, then "draw" commands with my finger on the "locked" screen. Simple shapes to tell it go to the next song or other commands. If it was me, I'd do a > shape like the button in the UI for next. Two fingers sliding down to do II that would pause. < to go back. I'm sure you could think of more...and it would be awesome.


And while you're at it, when playing an audiobook, the little slider to move back and forth in the book is way too sensative. For a 5 minute song it's OK, but a 2 hour book jumps minutes at a time. Again, you add Gestures. The good old "circling finger" as if I was using an old style iPod would be perfect to scroll forward and backward in the track.

Not what I expected

After spending a lifetime watching cartoons and movies, this is not what I expected to see happen after a fire hydrant was hit by a car.

Sunday, February 24, 2008

Cool thing for my Resume

About 2 years ago now, when I was first adding the BitTorrent support to GetRight, I wrote a proposal for how others could do the same combining of HTTP/FTP downloads into a BitTorrent download that I was adding into GetRight.


It's been edited and updated a few times, the original is here:
http://getright.com/seedtorrent.html



As I've been working on other things and not paying attention, it's become a quite accepted standard for BitTorrent clients. All the main ones, including the BitTorrent.com client itself, now do it. Pretty awesome!


I've just written it up in the format for the new "BitTorrent Enhancement Proposals".



I get to add to my resume: "Invented the WebSeed mechanism that has become part of the BitTorrent protocol standards." (Draft in the proposals right now...but a lot of clients have done it.)
http://bittorrent.org/beps/bep_0019.html

Thoughts on Tech News...MS vs Yahoo

So when Microsoft made its huge bid for Yahoo, was it thinking:

If they take it, great.

If they don't, it will so mess Yahoo up, they'll be sidetracked for months or years and we can overtake them that way. People are starting to sue Yahoo for not accepting. It's created a huge amount of uncertainty for all Yahoo's employees. Hmm.

Monday, January 14, 2008

Creating "AntiImages"

I've no idea if there's an official name for this technique; I called it "AntiImage" when doing it.

The basic idea is overlaying a white/black transparent image file (usually a PNG) over a solid color background. That way a single graphic can change color to match the layout of a website by only using CSS.

My brother had the basic idea first and talked about it here. But his Photoshop skills are far better than mine, so I needed a way to do the same thing with an existing graphic.

I found a couple plugins for paint.net that let me do it in just a few steps. The first is Color Difference to Alpha and the second was Curves+. Install those first. (This would be really hard without something like that color-to-alpha converter!)


Step 1) Open the image in Paint.net, then pick the Adjustments--"Black and White" menu. I started with an image from a set purchased from icons-icons.com
Orginal: to black-and-white version:


Step 2) Set White to be the active drawing color, then choose the Effects--Color--"Primary Color Difference to Alpha" menu. This gives a sort of shadow of the image. I used just the paint bucket tool to fill the area outside the circle with the background color of the web page (white in my case--your web page will need to have solid color background too.)



Step 3) Pick the Adjustments--Curves+ menu. Select Alpha from the drop down at the top, then you can drag around the curve to see how it looks. How you want to change will depend on the original image. For this one, I made it a little less transparent.


Step 4) Use CSS to set the background-color for the IMG tag, then just use the graphic as the image! All these graphics below use the same overlay image. For the website I'm working on, where clients can pick a color scheme to customize it, this lets us use one image that looks good no matter what sort of color scheme they choose.


The graphics are all more subdued than the original and than the background color (which shows around the edges since I'm not an expert with this blog tools CSS/HTML editor)...but the colors match pretty well. (And you could use the CSS :hover to just change the background color to do a mouse-over effect as well!)