Tuesday, June 14, 2011

Android: Switching screens in an Activity with animations (using ViewFlipper)

how to switch between layers using animations to make it look like you are changing screens… we will be using a ViewFlipper widget in the layout XML.

1. Create a new Android project, unless you already have one

01 new project

2. Create a new Activity class that extends android.app.Activity.

Android: How to switch between Activities

create an Activity, and to switch to another Activity (think of it as another screen) on the click of a button.

1. Create a new Android project – or you might already have one created.

01 new project

2. Add a new Class that extends android.app.Activity. You need a total of two classes that extend Activity. You will switch from one Activity to another.

ExpandableListView on Android

ListView is pretty widely used. There are situations when you would like to group/categorize your list items. To achieve such a thing on Android, you would probably use the ExpandableListView. The data to the ExpandableListView is supplied by a special kind of adapter called the SimpleExpandableListAdapter which extends the BaseExpandableListAdapter.

Monday, June 13, 2011

How to add CoverFlow Effect on your iPhone App


The main criteria of this post is to help you add a cool effect called the “cover flow/open flow” effect to any of your iphone apps. This is cool in two ways actually. One it adds animation kind of effect to your app and the other, its very easy to build too.

I got to learn about this effect when I was working on my “pianos” app where in i’ll have bunch of animals to select which would be displayed as a menu using this “cover flow” effect. Once a particular animal is selected your piano view for that animal comes up. My piano app will be out soon and you can check that out. The source for this post is the link displayed below.

“http://fajkowski.com/blog/2009/08/02/openflow-a-coverflow-api-replacement-for-the-iphone/”

Based on his post I have simplified things further. He uses “flicker API” for the images in his “cover flow”  but in my version I would just use my own library of images so that this post would target the beginners. To begin with we should work with Photoshop a bit to generate your images. If your not acquainted with photoshop, never mind not a problem at all. This particular task with the photoshop just wants you to scale the  images you use in your library to size “225 * 225″ applying “Free Transformation”. That’s all what you got to do. Once you got your images then your ready to go.


Creating the project

Firstly Create a new “view based”  project with project name like “CoverFlow”.

Once you create a new project you would arrive at a screen shown below with predefined classes already generated for you.

Screen shot 2010-04-07 at 4.05.07 PM

Android - Add data to SQLite database, with SimpleCursorAdapter updated dynamically

Work on the article "A simple example using Android's SQLite database, exposes data from Cursor to a ListView", it was modified to add ui for user to add data to SQLite database. Once SQLite database updated, simple call cursor.requery() to update ListView dynamically.

Add data to SQLite database, with SimpleCursorAdapter updated dynamically

Android: Reading, using and working with XML data and web services in Android

One of the most powerful aspects of any mobile application for a 3G phone is that it can connect to the Internet. By connecting to the Internet the application can offer much more value to the user since it becomes an interface for a web-based component, e.g. using Twitter’s API to create a Twitter application so that you can get your Twitter updates without having to open the mobile browser. The most common way of interfacing with a web-based component is by using web services in XML format.

While trying to developer my own app which reads a web service from my own server, I ran into a lot of difficulties in implementing the client that consumes the web service. Android does not have libraries for XPath handling of XML documents, so it makes deciphering XML data a little bit more difficult. From what I’ve read online the Android team is currently working on including such libraries in future versions.

After some digging around I found an amazing link that shows different methods for consuming an XML file in Android and parsing through it without the use of XPaths. The link is this: Working with XML on Android. To start off, this link is an absolute must-read. Everything that I am going to write in my post here relates to this link. The code offered on that webpage uses polymorphism to show you 4 different methods of working with XML data. It provides a fully-functional Android application and all the source code for it. The source code can be found here: AndroidXML.zip.

My post today will concentrate on how to customize the code from the application in the above link, in order to read and parse your own XML data. If you are a Java pro, you might not need this post. My Java is a little rusty, so I needed some time to figure out exactly what I had to change and where in order to get this to work with my own web service XML. Now that I’ve figured it out, I thought I’d share it. In my next post I will give the simplified version of this code – where there is no polymorphism, and thus there are only the minimum number of classes needed to implement this XML-reading solution.

Friday, June 10, 2011

How to read the assets directory resources - Andriod


1. Get the input stream resource


Resource file sample.txt at $ PROJECT_HOME / assets / directory, can be adopted in the Activity

Context.getAssets (). Open ("sample.txt")

Method to obtain input stream.

Note: If the resource file is a text file that you need to consider file encoding and line breaks. Recommend the use of UTF-8 and Unix line breaks.

2. WebView load the assets directory html files


Resource file sample.html at $ PROJECT_HOME / assets / directory, the following code can be

WebView.loadUrl ("file: / / / android_asset / sample.html");

Load html file.

Wednesday, June 8, 2011

A first hand look at building an Android application

Adding a UIButton Programatically

You might know how to add a button via IB – here is a code sample of how to do that using code

UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[btn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchDown];
[btn setTitle:@"SKIP" forState:UIControlStateNormal];
btn.frame = CGRectMake(0, 100, 320, 50);
[self.view addSubview:btn];

and if you want to add a background image


UIImage *someImage = [UIImage imageNamed:@"splashImage.png"];
[btn setBackgroundImage:someImage forState:UIControlStateNormal];

Adding a UIButton Programatically

You might know how to add a button via IB – here is a code sample of how to do that using code

UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[btn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchDown];
[btn setTitle:@"SKIP" forState:UIControlStateNormal];
btn.frame = CGRectMake(0, 100, 320, 50);
[self.view addSubview:btn];

and if you want to add a background image


UIImage *someImage = [UIImage imageNamed:@"splashImage.png"];
[btn setBackgroundImage:someImage forState:UIControlStateNormal];

Difference between 2 UIDatePicker’s in hours

UIDatePicker *date1;
UIDatePicker *date2;

The function to show difference between these two date pickers


NSDate *date1Val = date1.date;
NSDate *date2Val = date2.date;
NSTimeInterval interval = [date2Val timeIntervalSinceDate:date1Val];
int hours = (int)interval / 3600;
int minutes = (interval - (hours*3600)) / 60;
NSString *timeDiff = [NSString stringWithFormat:@"%d:%d", hours, minutes];

Hacking into PhoneGap iPhone/iPad Apps

Initially a lot of web-developers started with PhoneGap which lets you make webpages and embed them inside an iPhone app.

Now similarly its very easy to get access to those web pages. Let me show you how.
Steps:
Get hold of an phonegap iPhone App. I have one, which I had created a long time back.
- So go to – http://www.phonegap.com/apps
- Select iPhone or iPad
- Pick an app for which you want code (Let me pick my application)

iPhone/iPad AirPrinting Tutorial in 3 steps

Step 1:

Start Xcode and make a New Project – Select View-based Application – I call it AirPrinting.

Thursday, June 2, 2011

Mac Terminal Error : Could not determine audit condition

When I launched my terminal today, was welcomed with this error :-

login: PAM Error (line 396): System error
login: Could not determine audit condition

[Process completed]

It is most probably because I was playing with my /usr/bin permissions the other day.
The fix is easy. Just delete the "/usr/bin/login" dir.

But how do I delete it, if I can't access the "Terminal" altogether ?
Come on - You can access any folder using the "Finder".

1. Open "Finder"
2. Open "Go To Folder"
3. Type "/usr/bin/login"
4. Delete it.

Monday, May 30, 2011

How To Stop iTunes Automatically Syncing Your iPhone, iPod or iPad

iTunes Auto Sync Slowing You Down?

If you’re wondering how you can stop iTunes from automatically kicking off the sync + backup + update process when you plug your iOS device in then look no further.

By holding down the Shift + Control keys (Windows) or Command + Option keys (Mac) and then plugging your iPad, iPhone or iPod into your USB port you will tell iTunes not to sync!

If you happen to miss it and sync kicks off anyway, either slide the unlock slider on your device or hit the eject symbol in iTunes and your device will gracefully stop syncing and disconnect.

This was tested using both an iPad 2 and an iPhone 3GS on iTunes 10.2 (Mac).

Wednesday, May 25, 2011

iOS - File Sharing



File Sharing requires

  • The latest version of iTunes
  • Mac OS X v10.5.8 or later or an up-to-date version of Windows XP, Windows Vista, or Windows 7
  • An iOS device (with the latest version of iOS)
  • An iOS application that supports File Sharing

How to copy files using File Sharing

  1. Connect your iOS device to your computer using the included Dock Connector to USB cable.
  2. Launch iTunes 9.1 or later on your computer.
  3. Select your iOS device from the Devices section of iTunes.

    iTunes Devices section
  4. Click the Apps tab and scroll down to the bottom of the page.

How to Find Your iPhone’s Unique Identifier (UDID)


What is the UDID?


Each iPhone or iPod Touch has a Unique Device Identifier (UDID),
which is a sequence of 40 letters and numbers that is specific to your
device. It’s like a serial number but much harder to guess. It
will look something like this:
2b6f0cc904d137be2e1730235f5664094b831186.


Why do we need the UDID?


Your iPhone can only install programs that are approved by Apple.
Applications in the App Store have been approved by Apple for general
distribution, but beta customers get to try the app before it’s in the
store. We register your UDID with Apple so they can approve our
application especially for your iPhone.


How do I get my UDID?


You can copy/paste your UDID from iTunes or email it directly from
your device by using a free app from the App Store.

Tuesday, May 24, 2011

MTOM - OVER VIEW

MTOM OVERVIEW

With web services-based SOA now being deployed across Global 2000
enterprises, transmitting attachments such as MRI Scans, X-Rays, Design
Documents and Business Contracts using SOAP messages has become a
common practice. SOAP Message Transmission Optimization Mechanism (MTOM),
is a W3C Recommendation designed for optimizing the electronic
transmission of attachments. Through electronic transmission of
documents, corporations can realize significant cost savings and better
service levels by eliminating the use of postal mail. Paper-based
manual tasks can be replaced with simple and efficient electronic
processes where binary data can be transmitted between organizations
through standards such as MTOM.

MTOM provides an elegant mechanism of efficiently transmitting
binary data, such as images, PDF files, MS Word documents, between
systems. The Figure below shows the steps involved in transmitting data
between a Consumer and Producer using MTOM.



MTOM Process

The Consumer application begins by sending a SOAP Message that contains complex data in Base64Binary encoded format. Base64Binary data type represents arbitrary data (e.g., Images, PDF files, Word
Docs) in 65 textual characters that can be displayed as part of a SOAP
Message element. For the Send SOAP Message Step 1 in the Figure above, a sample SOAP Body with Base64Binary encoded element <tns:data> is as follows:

Monday, May 23, 2011

Understanding MTOM

MTOM combines the composability of Base 64 encoding with the transport efficiency of SOAP with Attachments. Non-XML data is processed just as it is with SOAP with Attachments SWA – the data is simply streamed as binary data in one of the MIME message parts. (The MTOM processing model is described in greater detail below.)

MTOM is composed of three distinct specifications:

Monday, May 16, 2011

How to Get the RGB Color Code from hex code

- (UIColor *) RGBColorCodeWithHCode: (NSString *) Hexcode{
NSString *colorstr = [[Hexcode stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] uppercaseString];
// String should be 6 or 8 characters
if ([colorstr length] < 6)
return [UIColor blackColor];
// strip 0X if it appears
if ([colorstr hasPrefix:@"0X"])
colorstr = [colorstr substringFromIndex:2];
if ([colorstr length] != 6)
return [UIColor blackColor];
// Separate into r, g, b substrings
NSRange range;
range.location = 0;
range.length = 2;
NSString *rcolorString = [colorstr substringWithRange:range];
range.location = 2;
NSString *gcolorString = [colorstr substringWithRange:range];
range.location = 4;
NSString *bcolorString = [colorstr substringWithRange:range];
// Scan values
unsigned int red, green, blue;
[[NSScanner scannerWithString: rcolorString] scanHexInt:&red];
[[NSScanner scannerWithString: gcolorString] scanHexInt:&green];
[[NSScanner scannerWithString: bcolorString] scanHexInt:&blue];

return [UIColor colorWithRed:((float) red / 255.0f)
green:((float) green / 255.0f)
blue:((float) blue / 255.0f)
alpha:1.0f];
}

Wednesday, May 11, 2011

iPad Modal View Controllers

Modal view controllers are well documented in the View Controller Programming Guide for iPhone OS but here is a quick recap of how to present and dismiss a modal view. To keep things simple I will cover the steps for presenting the modal view when a button is pressed on a master view controller. When the button is pressed we need to create and show a detail view controller that contains a button that the user can use to dismiss the modal view controller. The NIB file for the detail view controller is trivial in this example consisting of just a single view containing a text label.

Allocating and showing the detail view controller is straightforward:

- (void)buttonAction:(id)sender {
// Create the modal view controller
DetailViewController *viewController = [[DetailViewController alloc]
initWithNibName:@”DetailViewController” bundle:nil];
// We are the delegate responsible for dismissing the modal view
viewController.delegate = self;
// Create a Navigation controller
UINavigationController *navController = [[UINavigationController alloc]
initWithRootViewController:viewController];
// show the navigation controller modally
[self presentModalViewController:navController animated:YES];
// Clean up resources
[navController release];
[viewController release];
}


Tuesday, May 10, 2011

iPhone-iPad Development Tips

1. Screen Resolution;

iPhones are available in different screen resolutions; It is in 320×480 and the iPhone 4 screen resolution is 640×960. Same in caes of iPad; Currently it is 1024×768 and iPad 2 likely to have 2048×1536 screen resolution; So we need to care about this while playing with layouts; Here is a code to determine screen size;

CGRect currentScreen = [[UIScreen mainScreen] bounds];
currentScreen.size.width will return the width of screen;
currentScreen.size.height will return height of screen;

Note: If you rotate your screen to landscape, then height will become width and vise versa;

2. Device Type;

Following piece of code will tell you whether your application is running on iPhone or iPad;

UIDevice* currentDevice = [UIDevice currentDevice];
if(currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
NSLog(@"oh its iPad");
}else{
NSLog(@"This is iPhone");
}

Friday, May 6, 2011

iOS - Architecture


Cocoa Touch Layer - features

Multitasking

Applications built using iOS SDK 4.0 or later (and running in iOS 4.0 and later) are not terminated when the user presses the Home button; instead, they shift to a background execution context. The multitasking support defined by UIKit helps your application transition to and from the background state smoothly.
To preserve battery life, most applications are suspended by the system shortly after entering the background. A suspended application remains in memory but does not execute any code. This behavior allows an application to resume quickly when it is relaunched without consuming battery power in the meantime. However, applications may be allowed to continue running in the background for the following reasons:
  • An application can request a finite amount of time to complete some important task.
  • An application can declare itself as supporting specific services that require regular background execution time.
  • An application can use local notifications to generate user alerts at designated times, whether or not the application is running.
Regardless of whether your application is suspended or continues running in the background, supporting multitasking does require additional work on your part. The system notifies your application as it transitions to and from the background. These notification points are your cue to perform any important application tasks such as saving user data.

Thursday, May 5, 2011

Reading and Writing plists

Reading a plist file from the application bundle just requires a few lines of code, and some error handling. I like to place that code in a nice convenience method like this:
 

- (id)readPlist:(NSString *)fileName {
   NSData *plistData;
   NSString *error;
   NSPropertyListFormat format;
   id plist;

   NSString *localizedPath = [[NSBundle mainBundle] pathForResource:fileName ofType:@"plist"];
   plistData = [NSData dataWithContentsOfFile:localizedPath];
   plist = [NSPropertyListSerialization propertyListFromData:plistData mutabilityOption:NSPropertyListImmutable format:&format errorDescription:&error];
   if (!plist) {
      NSLog(@"Error reading plist from file '%s', error = '%s'", [localizedPath UTF8String], [error UTF8String]);
      [error release];
   }

   return plist;
}

I’m not too fond of using id as return values or parameters to methods. I prefer stronger type checks, so I typically wrap the readPlist method in two methods that return either an array or a dictionary.

Creating a New Navigation-Based Application

Open Up Xcode



You will be doing all of your development in Xcode. Then close the Welcome window (if it shows up)
Start a new iPhone OS Project
Click Xcode > New Project and a window should pop up like this:



Make sure Application is selected under iPhone OS and then select Navigation-Based Application. Click Choose… It will ask you to name your project.  Type in “Hello World” and let’s get started.

iPhone Programming Tutorial – UITableView Hello World

In this tutorial I will walk to you through creating a simple “Hello World” application using a UITableView for the iPhone.  There are many ways that a Hello World program could be made on the iPhone, I am going to show you the simplest.  This tutorial assumes you have a basic understanding of Objective-C.  Apple has provided a very simple and straight forward tutorial on Objective-C.  You can find it here.
You will learn how to:
This tutorial assumes that you have already installed the iPhone SDK.  If you are unsure how to do this, click and follow the steps.

Debugging Tutorial – Automating Your Tests With A UIRecorder Instrument

If you have ever experienced a bug in your application that took many steps to reproduce, then this tutorial is for you.  By nature, testing and debugging are very tedious processes.  This is especially the case for the iPhone.
Say you have an app that drills down 5-levels deep to some other view.  Now let’s say that you have a bug on that view 5 levels deep.  Your normal method of debugging is:
  • Run the app
  • Tap view 1
  • Tap view 2
  • Tap view 3
  • Tap view 4
  • Tap view 5
  • (Crash)
  • Change some code
  • Repeat
As you can see (and I’m sure have noticed), this sucks.  Well, Kendall Gelner gave a killer talk at 360iDev (which I recently attended) on various debugging tips using Instruments and XCode.  One of the most useful techniques (to me) was how to automate your testing.  Let me show you what I mean.

1. Open up the app you wish to test/debug
2. Launch it in the simulator
3. Open Instruments – This is located in /Developer/Applications/Instruments (just do a spotlight search for it)

simple Navigationbased tutorial

It’s time to start displaying some drinks. You’ll need to make some modifications to both the RootViewController.h and RootViewController.m files

1Declare the drinks array.(in RootViewController.h )

@interface RootViewController : UITableViewController{
NSMutableArray* drinks;
}
@property (nonatomic, retain) NSMutableArray* drinks;
@end
(RootViewController.m)

@synthesize drinks;
-(void)dealloc{

[drinks release];

[super dealloc];

}

Backup iPhone Pictures – Mac Tips

Listen to this episode
When you have problems with your iPhone, you may have no other choice than to RESTORE it back to the factory state. Before you restore, iTunes says it is making a backup of your phone. However, it isn’t making a backup of any photos you have taken with it. So when the phone is restored, all of your photos will be gone. The good news is that If you have your iPhone set to sync your photos with iPhoto automatically when you plug it in, you may be OK. However, if you are like me and choose for the iPhone not to launch iPhoto when you connect it… well, you need to backup those pics.

How to do it:

1. Plug-in your iPhone and launch iPhoto. iPhoto will detect your iPhone, and you can now choose to import all or import selected pictures.
mactips_358_1.png
Doing this will add pictures you have taken with your iPhone into your iPhoto library.

Another Way – Image Capture

You can also use Image Captureimagecapture.png to do the same thing, but not add them to your iPhoto library.
1. Plug-in your iPhone. Launch Image Capture. You can find it in your Applications folder. If you don’t see it there, look in the Utilities folder. Note: On the podcast, I said it will be in the utilities folder… I forgot that it may reside in Applications.
2. Now it will detect your iPhone, and you can choose to Download Some or Download ALL to your Mac.
mactips_358_2.png

ScrollView example for TextField in iPhone

In the application when user input in the textfield then see UITextField is hidden under the keyboard.This problem solved using the ScrollView. So let see how it will be worked.
In this application we will see how to ScrollView worked in our application. This is the very simple application. In the application when user input in the textfield then see UITextField is hidden under the keyboard.This problem solved using the ScrollView. So let see how it will be worked.

Step 1: Create a View base application using the template. Give the application name “ScrollViewExample”.

Step 2: Xcode automatically creates the directory structure and adds essential frameworks to it. You can explore the directory structure to check out the content of the directory.

Step 3: Expand classes and notice Interface Builder created the ScrollViewExampleViewController class for you. Expand Resources and notice the template generated a separate nib, ScrollViewExampleViewController.xib, for the “ScrollViewExample”.

Step 4: Open the ScrollViewExampleViewController.h file, we have added scrollview for scrolling the view,and two textfield for display the textbox. So make the following changes in the file:

#import
@interface ScrollViewExampleViewController : UIViewController {

IBOutlet UIScrollView *scrollview;
IBOutlet UITextField *textField1;
IBOutlet UITextField *textField2;

BOOL displayKeyboard;
CGPoint  offset;
UITextField *Field;
}

@property(nonatomic,retain) IBOutlet UIScrollView *scrollview;
@property(nonatomic,retain) IBOutlet UITextField *textField1;
@property(nonatomic,retain) IBOutlet UITextField *textField2;
 

Features of iPhone4


5 Megapixel Camera with LED Flash

Take beautiful, detailed photos with the new 5-megapixel camera with built-in LED flash. The advanced backside illumination sensor captures great pictures even in low light. And the new front-facing camera makes it easy to take self-portraits.

Creating Digital Mockups For Your Apps




While conceptualizing your App, the first things you need to create is a flow chart of how your App will behave and some reference templates and images that will show you how each screen will look in your App. Here are some tools to help you do this.
While conceptualizing your App, the first things you need to create is a flow chart of how your App will behave and some reference templates and images that will show you how each screen will look in your App.

The first step to doing this is to get hold of a pencil and paper and make some rough sketches. Start by making a list of all the possible screens your app will have and then actually listing the functionality each screen will have. Once you have that, you can proceed to make some dummy mockup sketches. At this point you should focus on the “placement” elements of each screen… that is decide, what goes where. Next you can start to imagine the design elements and look and feel of each screen – and how they will all look similar and connect to one another. A flow chart showing how the connect up – will help. I suggest you get hold of a spiral bound sketch book and not lose sheets of paper, that can easily get misplaced. Any writing pad will also do.

To help you make your hard copy and soft copy drawings, these downloadable documents and plans will help you. They will be useful when you are brainstorming or trying to find the perfect flow for your app and putting the visual elements together.
  • Mock App – Templates for Keynote and Powerpoint
  • Yahoo Design Stencils – Yahoo! Design Stencil Kit version 1.0 is available for OmniGraffle, Visio (XML), Adobe Illustrator (PDF and SVG), and Adobe Photoshop (PNG)
Download each of the above packs and files as they are all must have tools when you or your graphic artist are planning the User Interface or graphic design of your Apps.

Playing Video file in Iphone


Let’s start by looking at a short video of the application. The basic idea to make this work is simple, your video content viewable in your simulator.
Step 1: Create a new project from Xcode using View-base application.
Step 2: We need to add some code in the header file.
#import <MediaPlayer/MediaPlayer.h>
#import <UIKit/UIKit.h> @interface Tabbar1ViewController : UIViewController { MPMoviePlayerController *moviePlayer; NSURL *movieURL; }
Step 3: Now you add MediaPlayer.framework in your framework folder.Only shows up in the iPhone SDK frameworks folder, at  /Developer/platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/System/Library/Frameworks.

iPhone SDK Tip: Firing custom events when a link is clicked in a UIWebView

Well I have been asked this a few times and I can see how it would be a very helpful addition to theUIWebView’s feature set. What I am talking about is adding the ability to intercept the event generated when a user selects a link in a webpage being displayed with a UIWebView, this will then allow you to perform any action that you want.
When would you use this I hear you say? Well one person asked me if I knew how to append the users current location onto all HTTP requests? and another just wanted to know how to perform custom actions from an embedded UIWebView.

Once again I will be extending the “Build your very own Web Browser!”, if you haven’t already completed it then I suggest that you head over there now and spend 5 minutes reading it and then downloading the project files at the end.
Start by opening up the WebBrowserTutorialAppDelegate.h file and editing the @interface line to read:

@interface WebBrowserTutorialAppDelegate : NSObject  {
 
What we have done is to make the main AppDelegate a delegate for the UIWebView as well.
Now we need to set our webView to have the main AppDelegate as its delegate, you can do this by opening up WebBrowserTutorialAppDelegate.m and putting the following line just inside theapplicationDidFinishLaunching function:

webView.delegate = self;

Installing GIT on OS-X In 3 Minutes

How to install GIT on OS-X in under 3 minutes:

curl http://kernel.org/pub/software/scm/git/git-1.7.1.tar.gz -O
tar xzvf git-1.7.1.tar.gz
cd git-1.7.1
make configure
./configure --prefix=/usr/local
NO_MSGFMT=yes make prefix=/usr/local all
sudo make install
 
Git should be installed on your OS-X now, which you can verify by issuing: git --version command in Terminal. However, it’s a good idea to also pre-configure the default username and e-mail for your Git installation:

git config --global user.name "Your Firstname Lastname"
git config --global user.email "username@example.com"
git config --global --list
 
I personally, also like to set:

git config --global color.ui "auto"

How to Setting up the GIT

Setting Up

Now that you have the pre-reqs all ready, you can proceed with the install.  Open a terminal and cd into the directory where you want to install things.  Then type the following (or just copy and paste the items below):

git clone git://github.com/sproutit/sproutcore-abbot.git abbot
cd abbot
rake init
cd ..
git clone git://github.com/sproutit/sproutcore-samples.git samples
cd samples
mkdir -p frameworks
cd frameworks
git clone git://github.com/sproutit/sproutcore.git sproutcore
cd ../..

Add the path to abbot/bin to the beginning of your PATH to be able run the abbot command-line tools (sc-init, sc-server, sc-build, sc-gen, sc-manifest, sc-docs, and more) without having to enter the full path:
export PATH=`pwd`/abbot/bin:$PATH
Make sure you have configured your github account with SSH Keys and Username/Email (Without setting up the SSH key for your machine, you will get a permission denied error when trying to initialize the Git repository)
You should now have the full set of SproutCore tools running the latest Abbot-compatible code.

How to Dismiss the Keyboard when using a UITextView

The short answer is to send the UITextViewController the “resignFirstResponder” message … the trick however is when to send the message. In my case, and I assume it would be the same for others, is to listen for any changes to the text in the UITextView and if the carridge return character ‘\n’ is detected then send the “resignFirstResponder” message to the UITextView.
Step 1. The first step is to make sure that you declare support for the UITextViewDelegate protocol. This is done in your header file, as example here is the header called EditorController.h:
@interface EditorController : UIViewController  {
  UITextView *messageTextView;
}
 
@property (nonatomic, retain) UITextView *messageTextView;
 
@end
Step 2. Next you will need to register the controller as the UITextView’s delegate. Continuing from the example above, here is how I have initialize the UITextView with EditorController as the delegate …
- (id) init {
    if (self = [super init]) {
        // define the area and location for the UITextView
        CGRect tfFrame = CGRectMake(10, 10, 300, 100);
        messageTextView = [[UITextView alloc] initWithFrame:tfFrame];
        // make sure that it is editable
        messageTextView.editable = YES;
 
        // add the controller as the delegate
        messageTextView.delegate = self;
    }
Step 3. And now the final piece of the puzzle is to take action in response to the “shouldCahngeTextInRange” message as follows:
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range
  replacementText:(NSString *)text
{
    // Any new character added is passed in as the "text" parameter
    if ([text isEqualToString:@"\n"]) {
        // Be sure to test for equality using the "isEqualToString" message
        [textView resignFirstResponder];
 
        // Return FALSE so that the final '\n' character doesn't get added
        return FALSE;
    }
    // For any other character return TRUE so that the text gets added to the view
    return TRUE;
}

iPhone On-Screen Keyboard Rundown

As I started building the latest Consumetrics iPhone app over the weekend, I had to choose which keyboard style to use for some input fields like name, email, and so on. These fields live in a “settings table” (really just a grouped table with input fields on it), so picking keyboards in Interface Builder is out of the question, unfortunately, since I require some pretty customized cells. Naturally, I checked the documentation first, where I was confronted by this plethora of options:
typedef enum {
        UIKeyboardTypeDefault,
        UIKeyboardTypeASCIICapable,
        UIKeyboardTypeNumbersAndPunctuation,
        UIKeyboardTypeURL,
        UIKeyboardTypeNumberPad,
        UIKeyboardTypePhonePad,
        UIKeyboardTypeNamePhonePad,
        UIKeyboardTypeEmailAddress,
        UIKeyboardTypeAlphabet = UIKeyboardTypeASCIICapable
    } UIKeyboardType;
Good grief. Seven distinct keyboard types? Bah. (Yes, 9 appear in the list, but UIKeyboardTypeDefault and UIKeyboardTypeAlphabet are just aliases for other types. Quiet you.) Some choices were obvious — my email address field will probably use UIKeyboardTypeEmailAddress, for instance — but some other choices are kind of head-scratchers. One of the fields wants a quantity, for example. Which keyboard should I use for that bad boy? UIKeyboardTypeNumberPad? But what if I need units, like “cups”? Can I get an alphabetic keyboard from UIKeyboardTypeNumberPad? I didn’t know, and tragically neither does Google; there aren’t any good breakdowns of iPhone keyboard types on the first few pages. Hitting up some blogs finally pointed me to some more Apple documentation, but even that still didn’t answer all my questions.
After not finding what I need, I did what any good developer would do: put down what I was supposed to be doing, and pick up something more interesting. I slapped together a quick iPhone app to display each keyboard type through a table view, the source for which is attached, and used it to scribble down a quick reference, which follows forthwith:
Overview

How to take Screenshot in Mac


In the article you’ll learn how to take screenshot in mac os. Although it’s very easy and quite interesting work but for the new users it’s bit confusing.
But anyways…to take the screenshots in mac os press “Command button +Shift+3″ and it’ll capture & save the image on desktop.
Apart from it there are many more interesting commands to take the screenshot, let’s see below…
1. To select the area and then take the screenshot give following command
“Command button +Shift+4″
2. Press “Command+Shift+4+space” if you wanted to take the screenshot of complete window.
Foregoing commands will save the screenshot at desktop. You can also save the screenshots in to clipboard. To do that you have to press one more button “Control” with the given commands. for example …
Use “Command+ control+ Shift+ 3″ instead of simple
“Command button +Shift+3″ command.
Apart from it mac os provide a software called “Grab” to capture the images in different styles. You can find this software in : Applications->utilities->Grab

How To Easily Share Files Between Mac & Windows Computers

File sharing between Macs and Windows is a little lob-sided. Out of the box, Macs can detect any Windows computer connected to the local network. It appears right on the Finder’s sidebar. So naturally, it is very easy for a Windows user to share their files with anyone on a Mac. The reverse process – allowing a Mac to share its files – requires a little more attention. The transition from Tiger to Leopard has made it a little bit more complicated for regular users to set up shared folders because the setting has been “disguised”.
In this week’s Macnifying OS X, I’m going to show you how easy it is to share files on your Mac so that it appears on Windows computers automatically.
how to share files between mac and pc

Adding a new user account to Mac

System Prefs Icon

Adding a new user account to your computer

You can create individual user accounts for each person who uses your computer. Each new user has a separate home folder and can adjust his or her own preferences without affecting other users.
  1. Choose Apple menu > System Preferences and click Accounts.
  2. If some settings are dimmed, click the lock icon and type an administrator name and password.
  3. Click Add (+) and type the user’s name.
  4. If you don’t want to use the short name generated automatically, type a new short name. (Once the account is created, you won’t be able to change the short name.)
  5. Type the user’s password in the Password and Verify boxes.
  6. Type a hint to help the user remember the password if they have trouble remembering it at login.
  7. Click Parental Controls and select options to determine what the user can do with the computer.
If you change your mind while you’re creating a new user account, click Delete (-) to cancel.

iphone/ipad force shutdown

iPhone 3G Force Shut-Down


I’ve had my iPhone 3G for a bit over 2 weeks now and am loving it!
But it is a bit glitchy at locking up (especially when the battery is low or you disconnect during a sync with iTunes)
If some does happen (such as the unlock screen not accepting your keystrokes to unlock it and you can’t for some reason power off just by holding the top button for a few seconds) then you either have to drain the battery
- lengthy and not great if as me you may have to do something such as get on a plane!
Or much more handily, use the force power down – like on any computer, iPod etc.
(The image shows a key being pressed, however this digit isn’t being recognised by the phone – this is when you may need to force quit)

What you do is press and hold the top right button (for locking/unlocking) and also the big button at the bottom of the screen – hold them down for between 5 – 10 seconds, and your phone will just switch off
Turn as normal and it should work!

iPhone SDK: Testing Network Reachability

Check Network Resources Before Use

reachability-alert

Using Facebook-connect for iPhone SDK to post stories to Facebook is a great feature to add to your iPhone application. But what happens if the user has no access to the network? If you don’t check the network, the answer is nothing. This leads to user confusion, and it will prevent your app from being approved for the App Store.
So, how do you check? Apple provided a sample application called Reachability which provides the answer. I’ll demonstrate here. In several blog posts people felt that the Reachability sample was overkill for their needs. If you agree, here’s a link to a recipe from The iPhone Developer’s Cookbook that provides an alternate solution. Even if you don’t plan on using it, I recommend reading through the code in the Reachability example.

Project Setup

In an earlier post I used the Facebook-Connect for iPhone SDK to post stories to Facebook. I’ll use the same project to demonstrate how to check that Facebook is reachable. Here’s the project with the API Keys and Template Bundle IDs removed. fbconnect-iphone.zip I’ll include a link to the final project at the end.
Download the Reachability project too. I’ll be importing a class from it to check the network connection status.

How to concatenate char / string on iPhone?

NSString *string = [NSString stringWithFormat:@"%@ %@", @"Hello", @"World"];
NSLog(@"%@", string);

or

NSString *string1 = @”Hello”;
NSString *string2 = @”World”;

string1 = [string1  stringByAppendingString:string2];

Capture iPhone Simulator Screenshots – Revisited – iPhone Simulator Cropper

iPhone project was looking for a tool to capture a series of screenshots for an upcoming application demo. In a Google search he first bumped into a post I wrote back in February of 2009: Capture iPhone Simulator Screenshots – Open Source Screen Capture Tool, a nice Mac tool for taking screenshots. As luck would have it, he also found another screen capture tool, one focused solely on iPhone screenshots: iPhone-Simulator Cropper.
iPhone-Simulator Cropper
This tool works by capturing the screen of the simulator runnning on your system. One really slick feature is the option to create captured images in two primary formats – first, a format suitable for upload to iTunes for your application screenshots – second, capturing a screenshot that is suitable for display on a website.
The following images show the iPhone-Simulator Cropper application, as well as two sample images captured:

iTunes Connect / App Store:

Website (iPhone Device from Apple Marketing):

2 Ways to Take Screenshots From Your iPhone

Ever wanted to know how to get great screenshots from your iPhone? It’s really easy. With the iPhone 2.0 software, you can simply hold down the Home button and press the top (on/off) button. The screen will flash and the screenshot will be saved to your iPhoto library. That’s quick and simple, for sure, but to actually use the screenshots on your computer you still have to transfer them.
You can also grab screenshots directly from your computer while plugged into your iPhone or iPod Touch. First, you have to download and install the iPhone SDK. Don’t worry, it’s free. You just have to have the desktop software tools that come with the SDK.

Open Xcode and open the Organizer window (from the Window menu). Plug in your iPhone or iPod Touch and in a few seconds, it should appear in the list of devices on the left. The first time you plug in your iPhone or iPod Touch you will be asked if you want to use that device for development.

Once you’ve got your device setup, just click the “Screenshot” tab in the Organizer window and you can capture screenshots from your device. You can capture literally any screenshot, including the lock screensaver, video as it’s playing, even as you’re holding a button down.

Friday, April 29, 2011

How to find the own phone number in Iphone

NSString *phoneNumber = [[NSUserDefaults standardUserDefaults]
stringForKey:@"SBFormattedPhoneNumber"];
 
NSLog(@"Phone Number: %@", phoneNumber);

Thursday, April 28, 2011

Verifying iTunes video conversion and video syncing using sample QuickTime files

Verifying video conversion in iTunes

iTunes includes the capability to convert some movies into a format that can be played on your iPhone, iPad, iPod, or Apple TV that supports video playback. To verify that videos you convert using this feature play correctly, follow the steps below:
  1. When the conversion is complete, iTunes will create a copy of your movie in your iTunes library. There will be two movies listed with the same name. The sample_iTunes file with a kind of "MPEG-4 video file" is compatible with your device.
  2. Download this QuickTime sample movie: sample_iTunes.mov (right-click or Control-click this link and save it to your desktop). If you are using Internet Explorer, choose Save Target As from the shortcut menu. If you are using Safari, choose Download Linked File from the shortcut menu. Note: If the movie starts to play in a browser window, click Back and try again. (Make sure you hold the Control key down while clicking if you don't have a right button on your mouse).
  3. Open iTunes and add the sample movie "sample_iTunes.mov" to your Library. Note: The file may also appear as simply "sample_iTunes." To add the movie, open iTunes and choose Add to Library from the File menu.
  4. Locate and select the "sample_iTunes" file in iTunes.
  5. From the Advanced menu, choose Create iPod or iPhone Version or Create iPad or Apple TV version. While converting, you will notice an item named "Converting..." appear in the list on the left.
    The "Converting..." item disappears after the conversion is over.

Free Software for Mac os

Web Browsing

firefox

Mozilla Firefox

The premier free, open-source browser. Tabs, pop-up blocking, themes, and extensions. Considered by many to be the world's best browser.
Download Page

Video Player, Torrents, Podcasting

miro

Miro

Beautiful interface. Plays any video type (much more than quicktime). Subscribe to video RSS, download, and watch all in one. Torrent support. Search and download from YouTube and others.
Download Page

IM - Instant Messaging

adium

Adium

Connect to multiple IM accounts simultaneously in a single app, including: AOL IM, MSN, and Jabber. Beautiful, themable interface.
Download Page

Video Converter, iPhone Converter

video converter

iphone interview questions

—- Objective-C related —-
  • 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

Wednesday, April 27, 2011

Creating custom UITableViewCell Using Interface Builder [UITableView]

Just like user select one row and that row text will be set as product text in next view. Out put of this tutorial will look like this
Picture 11 iPhone Tutorial: {Part 2} Navigatation in UITableView



Picture 12 iPhone Tutorial: {Part 2} Navigatation in UITableView

1. You have to add NavigationController in your application to move from one screen to other. Its really an easy way to navigate from one view to other. So in this tutorial I am going to use UINavigationController. Open ‘SimpleTableAppDelegate.m’ file and change the function ‘applicationDidFinishLaunching’ so that it looks like this:
- (void)applicationDidFinishLaunching:
(UIApplication *)application {
UINavigationController *navController = 
[[UINavigationController alloc] initWithRootViewController:viewController];
// Override point for customization after app launch
[window addSubview:navController.view];
[window makeKeyAndVisible];
}
2. Open the SimpleTable code(you can grab it from here). Right click on classes folder in Xcode and select ‘Add > New File…’.

Tuesday, April 26, 2011

Gyroscope - iPhone

While the entire world was giddily anticipating the start of World Cup soccer this year, it was nose to the grindstone here at Sourcebits developing new soccer madness updates of Funbooth for Mac and iPhone.  Work notwithstanding, our development team had serious fun during production of these applications.  Throughout the beta testing and QA we were constantly capturing images of ourselves in the props of the teams we support, and we made the most of the new social features with the on-the-fly uploading to Facebook and Twitter.  And at the same time, our gaming wing guys at Wandake were busy putting the finishing touches on their now-huge hit Wake Up the Box! for iPhone and iPad.  So it was a real party at times.

While all this was going on, of course there was some big news on June 7, when Steve Jobs introduced yet another Apple engineering marvel: iPhone 4.  Bundled with new features like front-facing camera, superior rear camera, dual mikes for increased noise cancellation, eye-popping Retina Display, multitasking, 720p HD video recording and even a new kind of gyroscope technology, iPhone 4 is a huge evolutionary step in smartphone design.  As the tag line says: “This changes everything.  Again.”  And, marketing hyperbole aside, as far as day-to-day use is concerned for sure this will change the way we use iPhone.
Before this year’s launch, several leaked – or mislaid – iPhone 4 models made the rounds of the major tech blogs, complete with gory dissections and the standard tsunami of specu-babble.  But there was one stealth feature all the teardowns and pundits failed to even guess at: the gyroscope.  And on our side, as veteran iPhone developers, when Steve Jobs announced this during WWDC we were all pretty excited.  And while it still hasn’t gotten much attention in the press, this feature is a game changer in iPhone’s rivalry with Android and Symbian devices.

Apple’s been pioneering smartphone innovations since iPhone’s introduction in 2007 with many widely imitated micro-technologies, in particular the accelerometer.  The accelerometer is a type of sensor that detects changes in a device’s orientation, vibration, rotation or fall by detecting linear acceleration along one of the three X, Y and Z axes – that is: up/down, right/left, and front/back.

3-axis accelerometers enable features we by now take for granted in smartphones (and lately, too, in non-Apple branded consumer digital cameras, music players, and gaming peripherals).  For example, landscape/portrait orientation shifting, tilt for directional control in games and applications, and shake features for refreshing a webpage or shuffling a playlist.  The 1st generation of accelerometer – pre iPhone 4 – could measure only linear motion; it couldn’t sense direction on a compass or twisting motions or rotation, nor had any notion of gravity.

Then last year Apple added a magnetometer to the iPhone 3Gs, enabling it to sense magnetized direction relative to the Earth’s poles. And now, with the introduction of the gyro in iPhone 4, Apple once more ups the ante in spatial detection / orientation with a new sensor for detecting 3-axis angular acceleration around the X,Y and Z axes, enabling far more precise virtualization of pitch, yaw and roll on iPhone.
While detection of change in velocity has been possible for some time thanks to conventional accelerometer calculations in terms of linear acceleration, the gyroscope has been designed to detect angular acceleration, which will detect change in both velocity and direction at the same time.  iPhone 4’s gyroscope enables the sensing of even slight degrees of rotation while simultaneously rejecting linear movements and hand jitters – both still ably handled by accelerometer’s linear movement detection technology.
Combining the 3 axes of the gyroscope along with the 3 axes of the accelerometer now enables iPhone to recognize distance, speed and direction as it moves real-time through space. And thanks to the CoreMotion APIs in iOS, developers with the vision to make use of gyroscope data can access it freely, as some have already done.

3 Excellent Books on iPhone Development

iPhone has been a rage among users ever since it was launched in 2007 and it continues to be the leading mobile device today with millions of applications in the App Store. It has revolutionized mobile computing by giving everybody an opportunity to develop their own applications for the platform. You probably want to develop your own iPhone application, but the question is – Where to begin? There are hundreds of books available on iPhone programming, but not all of them are good enough to give you a quick head-start. In this article, we’ll tell you about three excellent book on iPhone development, which can quickly get you started with iPhone (and even iPad!) application development. 1. Beginning iPhone Development: Exploring the iPhone SDK
This is perhaps the best book for beginners in iPhone development. The book starts with the basics, walking you through the process of downloading and installing Apple’s free iPhone SDK, then stepping you though the creation of your first simple iPhone application. You’ll move on from there, mastering all the iPhone interface elements that you’ve come to know and love, such as buttons, switches, pickers, toolbars, sliders, etc. It will also introduce you to some more advanced topics like GPS API’s and accelerometer. It’s really a must have book for anyone interested in getting started quickly and efficiently with iPhone development. 2. iPhone Programming – The Big Nerd Ranch Guide

This book leads you through essential tools and techniques for developing applications for iPhone, iPad and iPod Touch. You’ll learn about mapping services, accessing accelerometer data, handling multi-touch gestures, ways of sorting and loading data, communication with web services and localization. The book has numerous visual cues and code samples, which will help you get a hang of iPhone programming. It really deserves a place on your bookshelf.
3. Programming in Objective C

The book is not iPhone specific, but it’s still very useful as you need to have a solid foundation in Objective C if you want to develop some really cool iPhone applications. The book assumes no prior programming knowledge and serves as an excellent guide for beginners. You’ll learn about the basics of Objective C programming, Foundation Framework and Cocoa and iPhone SDK.The separation of these main topics, Objective-C Language features and the Foundation Framework for example, almost guarantees that there won’t be much confusion if you are learning the language for the first time and that there will be a distinction between the topics and concepts for each section.

Monday, April 25, 2011

Objective-C Programming in XCode 4 – iPhone iOS 4.3 Hello, World ! tutorial


DemoViewController

1. Install Xcode and create a new project

To develop apps for the iPhone/iPad running iOS, you’ll need a Mac running Mac OS X 10.6.
Apple’s development tools are called Xcode. This tutorial is for Xcode 4, released in March 2011. Please note that you’ll find lots of information on the internet which is valid only for version 3 or 4 of Xcode.
To run your apps on hardware devices, you need to be member in the iOS Developer Program (99$/year). If you are member in the developer program, you can download Xcode 4 for free. If you’re not a member, you can still buy Xcode 4 for $4.99 in the Mac App Store and run your apps in the simulator on the Mac.
So, first step is to download and install Xcode 4 and to run it from /Developer/Applications/Xcode:
Xcode

Base64 encoding options in iPhone / iPad

Base64 is an encoding for transferring binary data in 7-bit text. Originally used in email, it is also used for binary encoding data in HTML files. Another common use for Base64 is in HTTP Basic Access Authentication where it is used to transfer login details (which might not be printable characters).

The key library for handling Base64 on the Mac is normally libcrypto (the OpenSSL library), so it's a little disappointing that libcrypto isn't available on the iPhone.

Using OpenSSL

Via the command line

On the Mac, you can handle simple encoding tasks like base64 encoding with OpenSSL on the command line:

echo "Base64 encode this text." | openssl enc -base64

gives the encoding result:

QmFzZTY0IGVuY29kZSB0aGlzIHRleHQuCg==

The reverse is handled in the following manner:

echo "QmFzZTY0IGVuY29kZSB0aGlzIHRleHQuCg==" | openssl enc -d -base64

giving

Base64 encode this text.
In code

As you'd expect, doing the same work in code takes a little more typing. First, we're using a library, so we need to include it (in your Project's Build Settings under Other Linker Flags add the flag -lcrypto). Once that's done, you should be able to use the following method in a category on NSData:

#include 
#include 

- (NSString *)base64EncodedString
{
// Construct an OpenSSL context
BIO *context = BIO_new(BIO_s_mem());

// Tell the context to encode base64
BIO *command = BIO_new(BIO_f_base64());
context = BIO_push(command, context);

 

Tuesday, April 19, 2011

Adding Multiple Buttons to an Alertview and specifying their actions

Step 1. Open up our alertview project.. if you haven’t done that yet please watch the tutorial on that and then comeback

Alertview Tutorial:CLICK HERE

Step 2. Navigate to the (***ViewController.m)- the stars just represent the name

Step 3. Navigate to the alertview action (where the code is) it should look something like this

-(IBAction)pushAlert {

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@”This is a alert view” message:@”Watever” delegate:nil cancelButtonTitle:@”Cancel” otherButtonTitles:nil];
[alert show];
[alert release];

}

How to Create UIAlertViews

In the header file (***ViewController.h)

-(IBAction)pushAlert;

In the (***ViewController.m)

-(IBAction)pushAlert {

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@”This is a alert view” message:@”Hi my name is bob. I like to code random projects for the iPhone” delegate:nil cancelButtonTitle:@”Cancel” otherButtonTitles:nil];
[alert show];
[alert release];
}




How To Switch Views using Multiple Viewcontrollers

1) Open up XCode > New Project > View Based Application

2) Call it SwitchViews and hit Save If you look under your resources folder, you can see Xcode already gives you new NIB (.xib) files, and already interconnects them New Project

3) Now we need to add another NIB file, but first lets add the class files first. Click File > New File UIViewController subclass. Call it NextView.m and hit Save. (check the box that says create .h too)

Add Subclass

4) It will be added under your classes folder. Now, under your Classes folder, click on SwitchViewsViewController.h to open up the header file.

5. Type this -(IBAction)next:(id)sender;

6) Double click on SwitchViewsViewController.xib

Wednesday, April 6, 2011

Data Protection in iphone 3gs / 4 or iPad

Take security seriously and interested in how to enable data protection on your iPhone, iPod touch, and iPad? The good news is that if you use a passcode, iOS 4 data protections protects the hardware encryption keys on your device, making email, attachments, and 3rd party apps (if they enable it) much more secure. The bad news is, if you updated your iPhone 3GS, iPod touch 3, or original iPad from iOS 3 to iOS 4, data protection might not have been turned on even with the passcode. Not to worry, we’ll walk you through all the possibilities, after the break!

Tuesday, April 5, 2011

Mobile UI Design Tips

  • Consider the font size for people with poorer eyesight.
  • Think about the scaling and sizing of images for different screen sizes and orientations.
  • Analyse colours and their visibility in different lighting conditions and for people with color blindness.
  • Avoid UI bling so the user understands quickly what they are looking at. For example, keep icons simple rather than adding lots of confusing shading.
  • Think about hot spots and content on the UI.
  • Don’t have too many UI designers on the same app. Everyone likes to make their mark on the app and you can end up going around in circles.
  • Don’t over analyse at the start. The end user actually knows best so plan to obtain feedback and iterate. If you really must pre-analyse, have typical end users assess mockups.

Finally think about branding/skinning/white labeling. I have seen so many projects add this late on in the project. It’s far easier to incorporate this from the start rather than add later.

iPhone Data Security

iPhone Data Security
Data security for the iPhone Application should be considered during storage on the iPhone and also during transit over the network.

Data protection during storage.
By default all the data (FDE – Full Disk Encryption) on the iPhone is encrypted using AES encryption algorithm. The key for the same is stored in the iPhone. This feature was introduced in iPhone 3GS and is based on the hardware based encryption. This feature was introduced to enable instantaneous wipeout of the data on the iPhone. By wiping out the key used for the encryption on the iPhone rather than overwriting every bit on the iPhone device, the data on the iPhone was made unusable.

The key used for encrypting the data on the iPhone is not encrypted. There were scenarios where people with knowledge of iPhone and encryption were able to retrieve the key from the iPhone and decrypt all the data on the iPhone (http://www.zdziarski.com/blog/?p=516). This was the weakness with the data encryption using FDE in iPhone 3GS.

With the release of iOS 4 Apple introduced Data Protection feature, a substantial improvement in the security design of iPhone. A combination of the Device Key, User Passcode Key, File System Key and File Key are used to protect the data on the iPhone. This can be called TFA (Two Factor Authentication). TFA is based on ‘what you know’ and ‘what you have’. In case of the Data Protection feature, ‘what you know’ is the User Passcode key and ‘what you have’ are the remaining keys.