Native vs Mobile Web vs Hybrid -Apps


About Native:
Native applications are those which are platform and hardware dependent. These are built using specific programming language like Objective C for iOS, Java for Android and .Net for Windows.

These mobile applications are fast, reliable, responsive and powerful but are tied to a specific platform.

Must be deployed or downloaded. Most apps requires approval and you have to wait for them to get approved.

Access to hardware sensors like Camera, Gyroscope, Microphone, Compass.

Few problems with Audio and Video. Flash works but only if device supports it.

Specific tools required for some platforms ( like Apple's) , You have to built a new app for each target platform.

Tight control over typefaces and layout.

You can charge whatever you wish for your application but most App distributors take a slice up to 30%.
About Mobile-Web:
Mobile-Web applications are simply the  web-pages designed for the Mobile devices, i,e optimizing your websites for use on smaller screens.

Mobile-Web Apps refers to the use of internet connected applications, or browser based access to the internet from a mobile device, which is connected to a wireless network.

Mobile-Web applications holds the promise of overcoming this fragmentation in Mobile OS's and Apple Store marketplaces by enabling you to develop apps that will run across platforms, across devices using open web technologies such  as HTML, CSS, JavaScript.

These Apps can be hosted on your already existing web-server and accessed at a standard URL through the device web-browser.

Since these are platform agnostic, content can be reformatted with CSS  to suit any device.

Browsers can be clunky but new advancements in JavaScript like jQuery Mobile are catching up fast.

W3C’s Geo-location API is a simple JavaScript API that when plugged into your app can enhance the user’s interaction with your service by pinpointing their exact position using the GPS sensors built into today’s devices. Supported by many of today’s Mobile WebKit browsers on all the main platforms. Google Maps uses this for their mobile web app.

Developing and delivering Mobile-Web apps means no high-level coding languages, no payments to App Store platforms, no approval process.

Scope of Mobile-Web Apps with HTML5:

With HTML5's introduction of the new video element , web developers can now  include video within their pages without the need of embedding it in a plugin like flash. Given the high profile case of Apple refusing to support flash on their massively popular iOS devices, this is something of a huge relief to Mobile-Web developers.

The HTML 5 specification contains a standard for local storage that is implemented by a wide variety of browsers. Using the localStorage API You can create applications that store their data locally on the user’s phone rather than on your servers. This can be used to enable applications that use dynamic data such as calendars to also be used offline, or to support personalization of the app by users without them needing to log in or have an account on your site.

Giving your apps some level of offline capability can bring it closer to the native experience as your key interface features – buttons, images, styles, scripts, etc – can all still work even if the user has a poor internet connection.

HTML5 enables developers to specify which files should be stored locally on the user’s device. This saves your app from ending up being a blank page if the user doesn’t have a connection, thus improving the user experience.

HTML5’s Web Workers specification provides applications with the ability to use scripts that run in the background without interacting with users.

Your mobile users will often have to key in information on your app. HTML5 brings new form types that are recognised by the browsers and formatted accordingly, presenting the user with the keyboard they need, no longer needing lengthy JavaScripts... just declared straight in the HTML.

A primary reason that many companies are not already jumping on the HTML5 bandwagon is the belief that HTML apps cannot access native device features. Indeed, pure mobile web apps (i.e., those that run in the browser – not hybrid ones) are currently restricted in their access to features such as the camera, microphone, address book, and so forth.

There is work in progress at the W3C to allow web apps to access such devices services , mobile browsers do not currently provide such functionality – a key requirement for many innovative mobile apps.

About Hybrid-Apps:

A Hybrid-App is a native, downloadable app that runs all or some of its user interface in a embedded browser component.

Hybrid-App development employes native capabilities whiles also serving as a strategic stepping stone towards the adoption of HTML5.

To the user a Hybrid-App is almost indistinguishable from a native one, it is downloaded from the App-Store or Marketplace. It is stored on the device and launched just like any other App.

But to developers there is a huge difference because instead of rewriting the App from scratch for each Mobile-OS, they write at-least some of their application code in HTML, CSS and JavaScript and re-use it across devices.

Hybrid-Apps provide access to hardware sensors, frameworks such as Open-Source PhoneGap Library makes it possible for JavaScript code to query the compass, take pictures, find or create contacts and appointments and tap on many other device features that Mobile-Web apps are barred from accessing.

Unlike the Mobile-Web App, you don't browse to a Hybrid-App, you download and install it.

Also, HTML pages of a hybrid app can be transmitted by a web server, but that’s not a requirement. To improve performance, hybrid apps can include a bundled copy of all required web resources (i.e., HTML, JavaScript, CSS and images) so that users will get instant access to them, without having to wait for a web server to send them over.

what are the different types of iOS provisional Profiles? what is the use of each and how do i create one?

iOS provisional is profile is something which is introduced by apple  for developers , who want to post their apps to App store, Enterprise distribution and  test the apps on their devices.

The different types of provision profiles introduced by apple are :
1) Development( to test on iOS devices).
2) Distribution. ( there are two types of Distribution profiles).
   a) App store ( distribution to app store).
    b) Ad-Hoc   ( this is used when you are working on Enterprise application where you were not worried about posting your app to the app store but if you want to distribute it among group of people).

You Need to have a Developer account in-order to create provisional profiles, for more information on this you can visit www. developer.apple.com and click on iOS Dev center.

Frame, Bounds and center in IOS?


Frame A view's frame (CGRect) is the position of its rectangle in the superview's coordinate system. By default it starts at the top left.
Bounds A view's bounds (CGRect) expresses a view rectangle in its own coordinate system.
Center A center is a CGPoint expressed in terms of the superview's coordinate system and it determines the position of the exact center point of the view.

How to make a NSURL Request and parse the XML response?


   
#import "ViewController.h"
#import "XMLReader.h"


      
     //first you need to create a URL using String.
      NSURL *url = [NSURL URLWithString:@"feed://feeds.feedburner.com/blogspot/MKGLf?format=xml"];
           
      //Once you create a URL,you are ready make a request.
       NSURLRequest *request = [NSURLRequest requestWithURL:url];
        
       //After making request the apparent thing is expecting the response that may be expected response or an Error. so create those objects and initialize them with NULL.
        NSURLResponse *response = NULL;
NSError *requestError = NULL;
      //Once you have response with you, capture your responseData using NSData.
       NSData *responseData = [NSURLConnection sendSynchronousRequest:request        returningResponse:&response error:&requestError];

        //Convert the response data into response String.
NSString *responseString  = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];

        //Now you can start parsing the data using XML parser. You need XML parser in-order to     use the below class method "dictionaryForXMLString"
NSError *parserError = NULL;

      
NSDictionary *xmlDict = [XMLReader dictionaryForXMLString:responseString error:NULL]; 

        //Once You have xmlDict handy, you can pass this to the any ViewController(like tableview) to populate the data.

       

What is the difference between the Release and Autorelease?

Release and Autorelease are the terms related to the Memory Management. whenever you own a object its your responsibility to release it . if you don't release it properly, Objective -C cannot reclaim it for the use of other objects and there will be a memory leak.

                                                        Different ways to own a object are alloc, new , retain and copy Whenever you use this things try to release it so Objective C will take care blowing that object. If you are not sure about releasing that object,  please make sure you do autorelease.

                                                         Whenever you do autorelease of an object the object is not released right way,  it will be added to the Autoreleasepool in the main function. The Autoreleasepool in the main function will maintain a stack of objects to be released and they are released one by  one when "drain"method is called eg: [pool drain]. Drain method is called repeatedly at the end of every event loop.

what is the event loop?

For instance when you click on the button  in the application, button goes and performs what needs to done and comes back to the normal state of the app this is considered as one event loop.

What is Retain Count or Reference Counting?

Retain Count is the term which is related to the Memory Management . whenever you create a object, Objective C doesn't really care about the object you have created , the area of memory is claimed for this object and retain count is increased by one.

                     YourClass *yourObj  = [ YourClass alloc] init];
                      ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
                      [obj someMethod];
                        [yourObj release];

whenever you release that object the retain count does  go down by one ,whenever the retain count reaches zero, Objective C blows that object and it will be ready to reclaim that memory for another Object.
                 
                   YourClass *yourObj  = [ YourClass alloc] init];
                   [someOtherObj someMethod];
                   [yourObj release];
                 
whenever you pass  "yourObj" to  someMethod of someOtherObj, then a retain message is passed to that object and retain count increased to two. someOtherObj will take care of reducing the retain count to one when it is done and the regular release that you made will reduce it to zero.

Here "yourObj" is the pointer variable that stores the memory address of the object (or) simply it is reference to the object. Even after the object is blown from the memory address of the memory still present in "yourObj" variable called dangling pointer but it refers to the nil object.

if you want to learn about what happens when you pass a message to nil Object, you can follow this link