Building an almighty data retrieval system for all HTML5 webapps   Leave a comment


Download ExampleDifficulty: easy moderate challenging

As discussed in my previous article here, data retrieval is at the heart of every informatory HTML5 web application. Because of this reason, it is important to thoroughly consider and devise a scalable solution for data retrieval, which collectively deals with caching and network retrieval. This is mandatory if you want your app to be functional both online and offline, by retrieving data from network when possible, or from the stored cache otherwise. Considering a good design is also important as any solution you come up with, good or bad, will be used everywhere in the app and thus difficult to modify.

Read the rest of this entry »

What does building an HTML5 web application entails?   Leave a comment


Difficulty: easy moderate challenging

We all understand what HTML is, but how is an HTML5 app different? Before we go into the different components we use in an HTML5 app, let’s try to comprehend the major difference between a web site and a web app. While web sites can only be used when the user is online, web apps can be used when offline as well. To do just that – to allow a web app to work offline, you have to use either HTML5′s Offline Web Applications feature or a mobile application framework, such as PhoneGap.

Read the rest of this entry »

Posted July 1, 2011 by Ohad Kravchick (myok12) in HTML5 Development

Tagged with , , , , ,

Native vs. HTML5 Application Development   Leave a comment


Difficulty: easy moderate challenging

I imagine that many developers and even more entrepreneurs on the verge of creating a mobile application are contemplating whether to build it using native SDKs or using only HTML5. If you are having the same doubts, this article might help you. I will explain what both options mean, what are the implications of each, the pros and cons of each, and even some hybrid options.

Read the rest of this entry »

Custom UIViewControllers, Their Views, and Their Memory Management   4 comments


Download ExampleDifficulty: easy moderate challenging

UIViewControllers serve as backbones in your iPhone or iPad application. Although they are in charge of many other aspects, including user input and output, a task that is somewhat being overlooked is managing memory. In this article, we’ll see how a UIViewController is in charge of its own and its views’ memory footprint, when and how the system can reclaim the memory, and how to control the process. Although this post will benefit all programmers, it relates more to those who manually code their view hierarchy or parts of it, as oppose to relying on Interface Builder and nib/xib files for the job; as your app grows in code size and you learn to write more reusable code, the more relevant this post becomes.

Read the rest of this entry »

How to Use Properties to Better Encapsulate Your Code?   Leave a comment


Download ExampleDifficulty: easy moderate challenging

In this article I will explore the usage of properties in order to simplify, bulletproof, and even better encapsulate your code. These are not merely slogans. By the advanced use of properties [and categories], you’ll see how we save coding time, write less implementation details, make our code less error-prone, and make other classes who use our class more independent.

 

The standard use of properties: to create fields your and other classes can modify and access was thoroughly explained in my previous post: What are Properties and how do they work?. Instead, in this article, we’ll deal with three distinct types of variable usages, whose names I made up, and standardize their implementation using properties. We’ll start with Internal Variables – variables that are to be used only within our implementation, we’ll continue to Seemingly Read-Only Variables – variables that are read-only to all classes but our implementation – and lastly, we’ll discuss General-Specific Variables – variables that are exposed to other classes as a superclass of what they are, whom merits will be explained. We trouble ourselves with coding these cases using properties in order to exclude any implementation details from our code, for instance, by not using retain or release at all. Plus, since the memory options of properties (retain, assign, and copy) are easily changeable from one to another, it will allow for faster and less-buggy code changes later.

Read the rest of this entry »

What are Properties and how do they work?   2 comments


Difficulty: easy moderate challenging

Properties are a way for programmers to simplify the use – or to perhaps minimize the misuse – of handling instance variables, especially in regard to how their memory management is being done. Although properties support scalar C data variables such as BOOL, int, etc., their strength exhibits while dealing with NSObjects, when memory management becomes an issue. If you ever noticed properties and didn’t quite understand what the heck, than I would start by saying that properties are not so complicated as they seem at first and there is no voodoo happening that makes them work – they are merely a different syntactic notation for what you normally code in Objective-C. Properties modify two aspects of your code: 1) they streamline how users of a class access its variables, 2) they simplify memory management for classes, by minimizing or even omitting implementation details of the variables’ memory management. If the previous sentence or even the entire paragraph were difficult to understand, read it again after finishing the article and then see if it makes sense.

Read the rest of this entry »

How to Properly Encapsulate Your Classes in Objective-C   1 comment


Difficulty: easy moderate challenging

The main task of a programmer is not simply to create code that works, but perhaps even more important, to create code that’s manageable, adaptable to new requirements, and allows easy debugging. These qualifications are intended to help programmers, either the original coder or his or her colleagues, to better support the code; the CPU doesn’t need any help – it knows precisely how to handle all instructions, be them cluttered or neat. So, to be able to support those requirements, we strive to divide big chunks of code into separate files, functions, and lines.
Read the rest of this entry »

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: