Friday, December 23, 2011

Difference between iCloud and Dropbox

iCloud was just launched by Apple for about two months ago with iOS5, but a lot of criticisms about it already.

I think most of people complaining iCloud because they couldn’t use iCloud as Dropbox. Dropbox is a mature cloud service, which people can save and access files from a computer, iOS, Android, Blackberry… It is more like a skydrive, and you can save any kind of files into Dropbox. On the other hand, iCloud is very similar to other Apple’s software, e.g. iTunes, and App Store, which serves Apple’s hardware, e.g, iPhone, iPod, iPad, Mac. All of Apple’s software and hardware help each other, and all together they form a unique strong empire of “Apple”.

With iCloud, iOS users can backup, restore and even update to newer iOS by air, “Cut the Cable”. If user buys music or app from one Apple device, all the purchases can be installed into user’s other Apple devices from iCloud. It is really convenient. Another good selling point of iCloud, is about document or data synchronizing, for instance Mail, iCal, iWork, PhotoStreams. Have to emphasize iWork here because most of professionals care about it. You can work on your Pages, Numbers, and Keynotes files with any iOS or mac OS devices, and all the updates from one device will be automatically updated to other devices.

iCloud has brought us a lot of convenience and efficiency improvements. However, I hope it can be more open.

1. That would be great if they can build up a client-end application for computer, where user can interact with their iCloud files more easily instead of going to and keying Apple ID and password every time.
2. That would be great if they can allow my App “Save to Cloud to appear in their or the future iCloud Application that I talked in point 1. “Save to Cloud” is mainly helping user put some documents (Any kind of documents) into iCloud and access them with any iOS devices. 5GB free space, user can put a lot of stuff there. I was thinking Apple might do it in the way of Dropbox that user can freely use it as a skydrive from different OS. I have recently realized that this is not possible because it is not Apple anymore if they do so. Apple is closed but open. Closed, means they won’t let Android or Window 7 to access iCloud or let Microsoft Office or other non-Apple’s Application to apprear in While open, means they open up iCloud API to iOS and Mac developers. Developer can access iCloud within their application

To sum up, Apple’s iCloud is doing good in Apple’s way. Dropbox is unbeatable as a skydrive. However, iCloud is so young, and Apple is hiring a lot of talents for iCloud business, so let’s waiting for something surprising to happen.

So, I have decided to work hard to give “Save to Cloud” users more convenience during interacting with iCloud documents, I will develop a separate App for Mac. Some news saying Apple may open iCloud API to Windows PC. Well. If that is true, I will develop an application for Windows.

Sunday, November 20, 2011

My App (2): Save to Cloud

Please be noted that this App was removed from App Store in May, 2012.
Reason: The App's concept of using iCloud as a cloud disk to save files is not aligned with Apple's perception. Apologize for any inconvenience caused.

This is an App created based on iOS5's iCloud Technology. (Demo)

Main functions: 
1. Save Files to iCloud and automatically shares between different iOS devices.
2. Save Accounts(username/password) to iCloud and automatically shares between different iOS devices.

User Tips: 
On Mac, you can interact (drag files in, delete files, edit files, create folders...)with your iCloud documents on a Mac at path: /Users/Your_User_Name/Library/Mobile Documents/MUPXVM5Q6W~com~creiapp~fileincloud/Documents

Second Tab: Files
Do all the things with file. e.g. Move, Copy, Rename, send as Email attachment, Send local file to iCould, download iCloud files to local, share the file iCloud link to friend for them to download
You can even open unzip a .zip file with this App.

Common ways to add files to the "Save to Cloud":
  1.  connect iOS device to iTunes, drag and drop via iTunes Files sharing.
  2.  open email attachment from "Mail" App.
  3.  open file from any other App that has an option for "Open in...".
  4.  upload image/video from Album via “Loader”

Third Tab: Accounts This tab was developed for people who don't wanna memorize dozens of website logins accounts/passwords. Save the account information in iCloud, you can view it in any iOS device with your iCloud ID set up. 

Strongly suggested you set an App Passcode if you want to save any information here. With App passcode, people wont be able to read your accounts information even they steal your device and jailbreak it. The reason is your account information is secured by complex encryption. 
Have to mention that, the Passcode login for "Save to Cloud" is special because people wont be able to figure out your passcode from your fingers movement during login. The number pad is generated randomly every time.

Some screenshot:

I will be glad to hear your comments after using the App. Thank you very much.

Sunday, August 14, 2011

Push Notification iOS Side Programming

Push Notification (also called Remote Notification) is a powerful free function provided by Apple. App can use it to push promotions or other tailor-made messages to App users.

iOS side code is simple, most of time within 200 lines. However, the logic part is a little bit difficult if you want to write an "intelligent" handler when push message comes, taking consideration of the following three scenarios:
  1. App is not running. 
  2. App is running at the background.
  3. App is running at the forefront.
Here, I am going to share some of the iOS side code for "Register for Push Notification" and "Handling of Push Notification".

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
[[UIApplication sharedApplicationregisterForRemoteNotificationTypes: UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert];
[UIApplication sharedApplication].applicationIconBadgeNumber = 0;

        //////////Your App launch Setups
        //////////Your App launch Setups
        //////////Your App launch Setups
        [self.window makeKeyAndVisible];
//for receiving push notification when the App is not running.
if (launchOptions!=nil) {
if ([launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey]!=nil) {
NSDictionary * userInfo=[launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
//this userInfo actually contains information about the received Push notification, so write some code about it and do handling about it here. 
    return YES;


-(void) application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
//send the token to your server here
//send the token to your server here
//send the token to your server here

Please take a look at the above code.
First line is to Register for Push Notification, and second line is to clear BadgeNumber if there is any.

Let's go to next function first,
-(void) application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken.

This function is called when the App receive the "token" from Apple, so you'd write some code to send this code to your server (Better hash it first). With this token, your server will be able to send Push Notification to the user with this "token".

Move back to function (didFinishLaunchingWithOptions), near there end the few lines of code is actually handler for scenario 1: App is not running. 

Handler for scenario 2 & 3 will be handled by the following function, basically it is the place you can capture the message (userInfo) for the Push Notification. In this example, I use an AlertView to display the Push message for scenario 3, which looks intuitive. Then, any further handling with be written within the AlertViewDelegate methods.

-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
NSLog(@"Got Notification%@",userInfo);
if ( application.applicationState == UIApplicationStateActive ){
// app was already at the forefront: Scenario 3
if ([[userInfo objectForKey:@"aps"] objectForKey:@"alert"]) {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil
message:[NSString stringWithFormat:@"%@",[[userInfo objectForKey:@"aps"] objectForKey:@"alert"]]  delegate:self
  otherButtonTitles:@"View", nil];
[alertView show];
[alertView release];
else// app was just brought from background to forefront: Scenario 2
//Write your code here to handle your Push Notification

Hope this helps some people. It is not very in detail, but the structure is there. Thank you.

Monday, August 8, 2011

My App (1): Vcard Backup

VCard Backup

Expert on iPhone's Address Book

Main functions of this App are as following:

1. Import VCF contacts from your old mobile device (e.g. Nokia, Android) to iPhone. Just a few button clicks to BULK_import all your contacts, as long as they are standard VCFs. So this app helps reduce a lot of hurdles for people just switching from other smartphone to iPhone.
2. Export your current iPhone Address Book contacts as VCFs, and save them in your computer for usage of other platform or just as a reliable way to backup your contacts. To most people, contact list within the phone is the most important information that they are afraid to lose. So this app will be their good choice: You Can See The VCards.
3. Backup and Restore Address book (2nd Tab). All the data produced within the 2nd Tab is stored within the App. User can use this as a convenient way of backup and restore, but be careful that the saved data will be lost when the App is uninstalled.

Here are some step guidelines and screen captures for this App.

A: Import

  1. Connect your iPhone with your computer.
  2. Add all the VCFs to the App "VCard Backup" via iTunes' File Sharing.
  3. Open the App in your iPhone, and hit Refresh button. You should see total number of VCFs detected by the App.
  4. Hit "Import to Address Book".
  5. That's it. All the contacts are added to your Address Book.

B: Export

  1. For iOS 6, please turn off Contacts to access your Facebook Contacts, as shown below.
  2. Connect your iPhone with your computer.
  3. Open the App "VCard Backup".
  4. Hit "Export All Contacts".
  5. Save the folder "Export" to your local directory via iTunes' File Sharing.

C:Backup & Restore

  1. Click "Backup Address Book".
  2. Click "Restore from Backup" to restore directly within the App. OR
  3. Click "Email".
  4. Open the Attachment (Backup.vcf) from Mail, you will be able to add all the contacts to address book of any iOS device.
Please leave me a comment here if you have any improvement suggestions or find any Bugs of the App. Thank you.

Tuesday, August 2, 2011

How to add UITextField to UIAlertView from XIB

Today, I am going to share how to add UITextFields to UIAlertView from XIB. 
UITextFields can be added through coding, but I prefer draw it in a small view from XIB because it is more convenient and visualizable. In the following example, I will add 3 UITextFields and 4 UILabels in the small view.

1. Create a view_controller and add the customized small view(named AlertXIB in the picture, while named "changePasswordView" in the code) parallel to the main view of the view_controller. Add certain number of UILabels and/or UITextfields in the small view. As shown in the picture:

2. Add the view into the view_controller' main view on a button click.

-(IBAction)buttonClicked:(UIButton*) button {
//If I don't add this _fakeTextField, my own textfields won't be able to detect inputs from keyboard, another good thing is that the alertview will be automatically moved up a bit.
UITextField * _fakeTextField=[[UITextField alloc] initWithFrame:CGRectMake(12, 3, 200, 30)];
_fakeTextField.backgroundColor=[UIColor clearColor];

UIAlertView *_myAlertView = [[UIAlertView alloc] initWithTitle:nil message:@"\n\n\n\n\n" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK",nil];
changePasswordView.frame=CGRectMake(12, 3, changePasswordView.frame.size.width, changePasswordView.frame.size.height);
[_myAlertView addSubview:_fakeTextField];
[_fakeTextField release];
[_myAlertView addSubview:changePasswordView];
[_myAlertView show];
[_myAlertView release];

A few things to explain here:
1). The message of the UIAlertView, I use several newline characters, because the message will be determine the size of the UIAlertView.

2). A "_fakeTextField" is also added, reason is what i explained in the comment. You can play around with it. For all the UITextfields "newPassword, oldPassword, confirmPassword", you can configure their UITextFieldDelegate via XIB or code. 

3). delegate of the UIAlertView is set to self (the view_controller), so you can handle further processing when user clicks button on the UIAlertView.

#pragma mark -
#pragma mark UIAlertViewDelegate

-(void) alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
if (buttonIndex==0) {
NSLog(@"button at index 0, cancel and doing nothing");
} else {
//Change password code here
NSLog(@"button at index 1");

3. So when the button click method (buttonClicked:) is called, the view will look like this. The UILabel text in the UIAlertView is in black color is just for demo, while you can change it to any color or size you want.

Tuesday, July 19, 2011

About me


I am first time here blogging in Blogger. I am currently an iOS App Developer. Actually, I just started iOS programming about half an year ago, but I have already fallen in love with it.

I will use this blogger as a base to support all my iApps. Besides,I will share some of my developing experience from time to time.