The Constantly Shifting Website

CSS and Javascript has given us great flexibility in how we display content. No more fixed sizes and wasted space. But it is coming at a cost. Ad spaces and other asynchronously fetched content isn’t rendering at the same rate as the core content. So what do the viewers see? A constantly shifting page. Content is showing up and disappearing all over the place. You start reading an article and the next thing you know, the page bounces all over the place. You click a links and realize that what you thought you were clicking on isn’t the link you wanted but an ad block or something else that you didn’t want.

Will this trend cause your site to lose traffic? At least for me, I have noticed that I have started to avoid these jittery sites. It also seems to be a trend that is spreading. There is a reason why this has started. You want the site to look as clean as possible and not depend on these async operations to fill in spaces on your page.

Is there a solution out there? I propose something along the lines of a placeholder with a watermark that allows the page to display as expected and only shift out if the async content fails to return anything. Any other ideas?

How Xcode is a disk hog

If you work on the Mac or iOS platform for any length of time, you have installed countless versions of Xcode and it’s accompanying documentation sets. Each one of these are well over 300Mb. The current version is quite necessary and maybe the Beta version is too.

But do you need the documentation to iOS 4.2? If you answer yes, there is a TV show that you may want to watch to get insight into your future. While disk space is quite inexpensive, do you want to carry all of this junk around?

Xcode doesn’t help matters. It’ll install and update for you automatically, but it’ll never clean up after itself. Even worse, it won’t even tell you all of the stuff that it brought over in the past. You’ll have to get it by yourself.

Either from Finder or Terminal, navigate to ~/Library/Developer/Shared/Documentation/DocSets/. For the uninitiated, the ~ is a shortcut to the currently logged in users account. If the machine in question has been running versions if Xcode for any period of time, you’ll see quite a vast history of your development career in the Apple world. Send that old documentation to the trash and get back 10Gb of your disk space so you can fill it up with useful things. Like images of Jennifer Lawrence and Kate Upton

Change to GIT

I’ve been using source control from the beginning (1996 if you really want to know). And since then, I think I’ve just about used them all. CVS, ClearCase, SourceSafe, SVN, and GIT. For the past few years, I’ve been using SVN almost exclusively. It has served me well and I have very few complaints.

But I also don’t want be be caught behind the curve. GIT has become very popular. I’m not quite sure why. It seems to be the equal to SVN. The question is why are so many moving to GIT while SVN is quite adequate. Is it because of GitHub? SourceForge used to be the home to open source projects. Not it’s GitHub. Has this transformation caused a seismic shift in source control?

Now the question for me is should I move Sobetech’s source control to GIT from SVN. The migration process seems to be quite easy. But is it really worthwhile to make a shift for the sake of making a change?

Then why did you name it like that???

I don’t consider myself an old pro when it comes to Android development, but I’m no noob either. So I was driving myself a bit crazy when I wasn’t getting a callback when starting an image picker with startActivityForResult in the Activity class. It had worked in the past with flying colors. I was stumped until I found out that if you send a request code that is negative then you will not get a result result callback.

It’s in there in the JavaDoc. So some might say that I shouldn’t have a complaint. But I do!!! The Activity class has methods that don’t have result callback and the aforementioned one. So if you have both options well named, why have an obscure rule in the parameters that bypasses a major logic thread?

Android pickers

I started to implement a picker for Android and couldn’t have been more disappointed. The first frustration is the need to add v4 Support because of backward compatibility. And you have to be backward compatible because there are SO MANY phones using older versions of Android that cannot be upgraded.

Then there is the UI of the picker widget itself. It’s pretty horrible. Thankfully I found a wheel-type widget hosted on Google Code. It’s a very nice little library. There isn’t much code and the code is pretty easy to read and extend for your own purposes.

It’s not perfect, but it’s much better than what is stock. It’d be nice for this to be part of the core OS.

Amazing Customer Service

I received a new Android phone to do some testing from a friend of mine. The screen on it is not usable for a normal human, but good enough to do some testing. I put in a new SD card and reset it to the factory settings. So far so good. WRONG.

The Motorola Droid X from Verizon has a bootloader that tries to activate the phone with Verizon and won’t allow you to do anything. I talked to the Verizon CSR with my dilemma. I didn’t want to activate the phone, but just to use it for application testing. She didn’t have a solution for me, but she suggested that I get a pay as you go account.

I figured that I could accept some nominal price to make this phone useful. I called a pay as you go CSR and she regretted to inform me that that phone could only be on a plan that was $60/month. I didn’t want to pay that kind of price, but she suddenly had a solution. She could register my phone for that program, but she didn’t have to sell me any minutes or connectivity! She stayed on the line with me as she made her magic happen and I can now test with this phone and it didn’t cost me a dime.

Thank you Chesian from Verizon! You did your company well today.

An awesome tip for jQuery Validation in Twitter Bootstrap

As you may know, SobeCloud uses Twitter Bootstrap and jQuery. I’ve been more than pleased with the results. There was a bit of a whole in the solution. They really didn’t seem to play well when it came to front end validation. I did a series of head-butting episodes over the last couple of months.

Then I found the solution. There is someone who was on this planet called David Cochran who has a website/blog (hell I don’t know, I really didn’t research this all that much) who has an elegant solution which I found on a Google Search.

What I love about this is that it’s detailed enough to get you going and generic enough to plug into what you’re trying to work with. SobeCloud also uses Spring Webflow and that can cause some really ticklish issues when it comes to some integrations. His solution is very concise and very clean. The demo is easy to follow. There are links to tell you where to get more information to take things further. There was only one thing that was missing that I would have liked to see and that was how to deal with the cancel button, but that was easy to find and fix.

I had this solution up and running in 2 hours total, and fully implemented across all of SobeCloud in 4. So many thanks to David Cochran.

More fun with iTunes Connect

We’re rolling out a new application and for the first time, Sobetech is doing In-App purchases. Some of the issues have already been written about on this blog. Now there was a new one, partially caused by a chair-keyboard-interface issue in the submission process.

Anyone who has submitted an iOS app knows that if you use Push Notifications, PassKit and the like, that you have to pay close attention to when you create certificates and provisioning profiles. There is also an issue with In-App purchases. During development, the new purchase items were created correctly and tested thoroughly. Submission time is yet another pitfall to hurdle.

In the finer print of iTunes Connect, it tells you that you have to attach the In-App purchase products before not only submitting the binary, but also before you set the status to Ready To Upload. I ran into the issue that I set the status to Ready To Upload, but still had to do the In-App purchase attachment. iTunes Connect at that stage doesn’t allow you to change the status. You can’t revert back to anything. I was stuck. So stuck that I had to email Apple.

Thankfully, I wasn’t in a grand hurry on this because it did take a day to get someone to address my concerns. But when I did get someone, they gave me the solution sharpish. I wasn’t happy with the solution, because it was a pretty ugly hack. I had to submit a binary and then immediately reject it. That’s the only way I could get the status out of Ready To Upload. Once the solution was provided, it was all over in 15 minutes. I’m not too keen on doing a hack to fix it, but as fix is a fix.

Hopefully the next post will be about the fun and excitement of the new app.

Annoyances with StoreKit

I had a client ask me to do StoreKit integration to do In-App purchases. As a good iOS developer, I followed all of the guidelines and examples provided by Apple and looked for suggestions from StackOverflow.

I did have a disadvantage because I didn’t have full access to the iTunes Connect account. But I did my best but could never get the application to make these In-App purchases. It never found the products in the App Store. It caused considerable consternation.

A week ago, I started to take a kernel of an idea called BetYa (much more to come) and started to develop it. The key to BetYa’s revenue model is In-App purchases, so once again, I had to dive into StoreKit again. Once again, I was back into the morass of not getting products from the App Store.

But this week I was able to forge a breakthrough. The key to working with StoreKit is to get the products as early as possible. The main reason why is that, at least with connecting to the App Store sandbox, connecting to the App Store is VERY slow. The product eventually get returned, but it can take up to a minute. I had to store these products in the Application Delegate because I needed to load these product as soon as the application loads.

It’s not a fool-proof solution, but one that will at least cause the least amount of pain.

JQuery Display Calendar

SobeCloud as you may know handles the maintenance of events for our iOS apps. SobeCloud had moved to DataTables to display search results a while ago. It has been working perfectly. The difficulty is when you are looking at results where the dates are important.

A calendar is the best way to view these types of objects. Internet searches for a JQuery based calendar will show lots of results for input calendars. Output calendars are much more difficult to find. There are many places that have paid solutions that seemed much more complicated to implement than worth even doing a demo download.

Then I found FullCalendar. The beauty of FullCalendar is the simplicity. 2 simple imports for the CSS and JavaScript files gets things started. A single document.ready function and an identified DIV tag and you’re almost home. The best part is that you have the option to load the JavaScript using objects that you already have available in your JSP.