Monday, July 9, 2012

iPhone vs Android Phones

    Many time i come across situation that while interview of iPhone or Android development interviewer will ask question like Tell me 5 differences between these two and every candidate will get hang on this question. Today morning i read one description of one job post where they directly mention that " You must know 10 differences between iPhone and Android".

Just to help my all job seeker friends i am writing this blog post.



1) Closed systems vs. open systems

iOS is developed by apple, and is a closed source mobile offshoot, based on the Mac operating system, optimized for a mobile device

Android is an open source Linux based operating system developed by Google, optimized for mobile devices


2) Security

iPhone has More security. You can blindly rely on iPhone for your data security and other factors.

Android has less security than iPhone

3) User Control

iPhone has better user interface and UI is really easy to use.

Android UI is also good but not that much appealing

4) Vendor Lock-in

iPhone comes up with vendor lockin like AT&T or verizon. Now a days they are allowing unlocked phone but cost is too high.
You can use android phone with any carriers.(ie Open to carriers)

5) Battery Life

iPhone is having better battery life but battery is not replaceable.

Now a days few android phones are also having good battery life but not that much of iPhone but you can replace battery.

6) Memory

iPhone comes up with inbuilt memory device. (8GB,16GB,32GB,64GB)

In android phone mostly we use SD-cards which is main root cause to data leakage and virus infection.


7) Google Integration

iPhone is having limited Google integration. In ios6 they have moves Google Maps too.

Android is having all Google product integrated in phone right from Google maps to Google voice.


8) Hardware support

Apple controls all of its hardware, and it is therefore simple to perform the necessary accessory maintenance.

Google’s Android is simply a platform that functions on different platforms, and doesn’t allow for easy accessory support.

9) Cost

iPhone is more expensive than other smartphones in the market except you are purchasing it on contract.

In Android phone you are having lot of varieties available in different price range.

10) Phone Screen Size and Quality

The iPhone 4S has the superior display right now in terms of detail and brightness.

Android phone just come up with a larger screen but not that much quality.

11) Device Camera

The iPhone 4S has the best camera we’ve used yet.

Android phones camera is not that much effective but give you more control of your images—before and after the shot.


12) Developer support

Apple having really state-of-art development tools with proper documentation which will ease life of apple developer. Only thing is that they are having limited access to the resources or we can say device.

Tools available for android is also good but not that much appealing when we compare it with Apple tools.

13) App Market Policy

Apple is having very strict app approval policy, many time it will take a week or two to review and approve the App on app-store which will maintain quality of app.

Google market approval process is not that much strict and app will get approved within 2-3 days.










If you guys want to add more into this please add it in comment.

Thursday, June 21, 2012

Pass Type IDs in iOS 6

As apple announces their iOS 6 OS they have launch new option called "Pass Type IDs". Same day it has been listed in my apple developer account pane. I am trying to know what it is but cant get more on it.
The only information shared by apple is :

Passes are a digital representation of information that let users take an action in the physical world, in the same way as boarding passes, membership cards, and coupons. Pass Type IDs define a class or category of passes you wish to offer.

You must register your Pass Type identifiers in order to generate Pass Certificates which are used to digitally sign and send updates to your passes. 


I have updated our iPhone to ios6 beta and one more app is new there called "Passbook" where you can save your passes and coupons, etc.

I found some good article where you come to know about passbook programming :

http://www.futurechips.org/thoughts-on-latest-happenings/generating-passes-ios6s-passbook.html

Following is the repository where you can found a PHP code to create passes on the fly.

https://github.com/tschoffelen/PHP-PKPass

Saturday, June 16, 2012

How to make your iOS app UI appealing? Part 1

Now a days apple is releasing their iOS version after every 6 month with having lots of drastic changes. Apple is also concentrating more on UI along with the functionality of iOS so that user can get feel of retina display device.

In other case app like Foursquare, Path, Google places , Quora, pintrest and many others are also presenting Neat and clean UI. The reason behind this is user will get attracted more toward UI not toward functionality. Functionality is the part which is important from developer point of view but user want something different everytime.

In my iOS career i have also developed some good UI appealing app and now want to share some key element which need to taken care of while designing app like this.

1) While starting for any app first clear its requirement, and try to draw that requirement in terms of wireframe by using software like Balsamiq and other. which will give you more clear app development idea and also your client knows that what he will be getting after few months.

2) Try to use .xib rather than using Programmatic way to add controls on view.

3) Check with your graphics designer that he is designing images for you in Retina display size. and also confirms what dpi he is using for rendering this images.

For iPhone and iPod touch launch images, include the status bar region. Create launch images of these sizes:
  • 320 x 480 pixels
  • 640 x 960 pixels (Retina Display) - 180 ppi
For iPad launch images, do not include the status bar region. Create launch images of these sizes:
  • For portrait:
    • 768 x 1004 pixels
    • 1536 x 2008 pixels (Retina Display) -252ppi
  • For landscape:
    • 1024 x 748 pixels
    • 2048 x 1496 pixels (Retina Display) - 252 ppi
 You can get more details on this from developer.apple.com by using your developer account.

4) Before starting designing exact view controllers first decide the button size that you want to use in your application. keep the button or other control ratio same on every view of your application so that user will get feel of navigating in same app.

5) Try to use default controls provided by apple if you don't have graphics for application.

6) Try to use custom controls if you have really clean and neat graphics available.

7) Try to concentrate on one factor where all developer will get confuse i.e. Auto resizing views, which will help you to place controls at some specific location.

8) Whenever you are trying to deal with large number of sequential data coming from server try to use UITableview to represent it. UITableview is having lot of customization methods which will help you to design good UI.

9) Avoid excessive use of UIScrollview in your application which will increase user confusion.

10) Try to reduce number of activity indicator in your application which will lead bad user experience.
 
In next post i will try to explain on particular custom controls which will used by all popular apps along with these tips.

Keep Coding..

Thursday, October 20, 2011

Swipe to delete from UITable view

In order to achieve swipe to delete option use following code snippet:

#pragma for deleting element from tableview

-(void)tableView:(UITableView*)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath
{
   
}

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    if(editingStyle == UITableViewCellEditingStyleDelete) {
        [Array2 removeObjectAtIndex:indexPath.row];
        [Array1 removeObjectAtIndex:indexPath.row];
        [TableName_obj reloadData];
    }
}


Saturday, June 11, 2011

Generate MD5 Hash of a string in iphone sdk

This function will help you generate MD5 hash of a given string.

Include following class your project :

md5.h

+ (NSString *)getMD5FromString:(NSString *)source;

md5.m

+ (NSString *)getMD5FromString:(NSString *)source{
  const char *src = 1;
  unsigned char result[CC_MD5_DIGEST_LENGTH];
  CC_MD5(src, strlen(src), result);
    NSString *ret = [[[NSString alloc] initWithFormat:@"%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X",
            result[0], result[1], result[2], result[3],
            result[4], result[5], result[6], result[7],
            result[8], result[9], result[10], result[11],
            result[12], result[13], result[14], result[15]
            ] autorelease];
    return [ret lowercaseString];
}

Tuesday, May 31, 2011

Interview question part 3

  • Basic Questions:
  • identify basic OO concepts and the keywords Objective-C uses (interface, implementation, property, protocol, etc)
  • what is a designated initializer, what is the pattern for the initializers and why ( if (self = [super ...] ) )
  • basic memory management topics, like ownership retain/release/autorelease
    • what happens if you add your just created object to a mutable array, and you release your object
    • what happens if the array is released
    • what happens if you remove the object from the array, and you try to use it
  • trick: garbage collection on iPhone
  • autorelease pool usage
  • property declarations ( assign, nonatomic, readonly, retain, copy )
    • trick: ask about the nonexistent atomic keyword, what does atomic mean
    • ask on how to correctly implement a retaining setter property
    • ask about the circular reference problem and delegates being usually saved with assign rather then retain
  • what is the difference between the dot notation and using the square brackets
    • what happens when we invoke a method on a nil pointer
    • difference between nil and Nil
  • what is KVO and related theory + methods to use when observing
    • does KVO work with ivars too?
  • protocols – maybe: main difference between c#/java interface and protocols
    • what to do in a situation when a class doesn’t implement a method from a protocol
  • what about multiple class inheritance
  • what is fast enumeration
  • class methods vs instance methods
    • visibility of methods
  • what is an actual class in Objective-c (struct)
    • ask about the isa member
    • ask about isKindOfClass isMemberOfClass
  • root classes: NSObject, NSProxy
    • how does proxy-ing work
    • how to fake multiple class inheritance
  • id type
    • what happens during compilation if we invoke a method on an variable with the type id
    • what happens runtime if the method exists
    • what happens if the methods doesn’t exist
    • pro and cons of using the type id
    • what happens here(compile + runtime): NSString *s = [NSNumber numberWithInt:3]; int i = [s intValue];
  • what are class categories and the () category
  • what is an informal protocol
  • what is a delegate, how to create one, and use one
  • what is a selector, how to do a perform selector
    • how to delay executing a selector
    • what to do when the selector has more paramters (NSInvocation>
    • how to start a selector on a background thread
  • how to start a thread
    • what is the first thing to do on a thread (autorelease pool)
    • what is a runloop, and one very common place where it is used (timers, nsurlconnection)
  • how to download something from the internet
    • what is the difference between a synchronous and an asynchronous request
    • small task: explain how to download an image from the internet, and show this in an image view – all this after a button is tapped on the view
  • what are notifications, how to use them
  • what is a memory warning, how do we respond to it
—- A bit more advanced topics —-
  • when to use retainCount (never, and why)
  • why shouldn’t we invoke instance methods in an initializer and the dealloc
  • NSCoding, archiving
  • NSCopying, why can’t we simply use our own objects as key in a dictionary, what to do to solve the problem ( and the difference between a shallow and a deep copy)
—- UIKit related —-
  • what is a view, and a window
  • difference between a view’s bounds and frame
  • what is the resolution of the current available devices, difference between points and pixels (starting with iOS4)
  • what is the responder chain, becomeFirstResponder
  • what do IBOutlet and IBAction mean, what are they preprocessed to
  • how do tableviews function
  • what about multithreading and UIKit
  • what to do when the keyboard appears and hides some parts of the UI that are important
  • why should we release the outlets in viewDidUnload
  • what is awakeFromNib, what is the difference between a nib and a xib
—- CoreData —-
  • what is a context
  • what about multi threading and core data usage
  • what is an NSManagedObjectId – can we save it for later if the application was stopped
  • what types of stores does core data support
  • what is lazy loading, how does this relate to core data, situations when this can be handy
  • how to ready only a few attributes of an entity
  • what is an fetch result controller
  • how to synchronize contexts
  • how could one simulate an NSManagedObject (i’m thinking of the fact that all the properties are dynamic and not synthesized)
Source : here

Friday, May 20, 2011

Simple bluetooth chat application for iPhone

One of the features available in iPhone OS 4.0 is the GameKit framework. The GameKit framework contains APIs to allow communications over a Bluetooth network. Using these APIs, you can create peer-to-peer games and applications with ease. Unlike other mobile platforms, using Bluetooth as a communication channel in iPhone is way easier than expected.

By using this framework you can ON bluetooth of your iPhone manually, but still there is no chance to OFF the bluetooth manually.

I had attached sample code of this application..its very simple to understand.

Steps to test a code:



Once the application is deployed to the two devices, launch the application on both devices. On each device, tap the Connect button. The GKPeerPickerController will display the standard UI to discover other devices .

After a while, both application should be able to find each other. When you tap on the name of the found device, the application will attempt to connect to it.
When another device tries to connect to you, you will see the popup. Tap on Accept to connect and Decline to decline the connection.

If you are connected, you can now enter some text and start sending to the other device. Data received from another device will be shown in an alert view .


And finally here you will get SOURCE CODE for this tutorial..