Saturday, March 29, 2014

Open URL - Android

The following three lines of code will open a URL in an Android app. I'm guessing you cannot open a local html file using the same method in your browser.

Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse("http://www.google.com"));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);

Wednesday, February 26, 2014

iOS closes the active Wi-Fi connection after 30 minutes


These days I’m involved developing an app (runs on both iPad and iPhone) that relies on Wi-Fi network a lot. I happen to notice that sometimes device looses its connection to the Wi-Fi network. Rest of the team was complaining that they have to keep on going to device settings to re-connect.

Wednesday, January 29, 2014

Google -> Account Chooser -> Automatic Sign In

If you are experiencing automatic sign in to your Google services and you can't find the "stay signed in" checkbox when you sign out, you have come to the correct place for answers.

Wednesday, January 1, 2014

Can’t declare variables inside a switch case – Objective C

If you were under the above impression then the answer is you can with a little bit of change to your code. I’m guessing you are used to the following format,

switch (value){
case value1:
//some code
break;
case value2:
//some code
break;
default:
//some code
break;
}

Tuesday, December 31, 2013

The truth about iOS7 being slow

I have seen many posts describing the above fact, mostly regarding running iOS7 on older devices like the iPhone 4. One truth I found in all the stuff I read is the fact about how iOS7 loads its frameworks. As you all know iOS7 is designed for 64bit. Running 32bit apps might consume more memory than otherwise. Bit hard to believe, right? But it is true. This is how it happens.

Monday, December 30, 2013

Arranging UI elements for iPad split keyboard

It is a common practice to rearrange the UI Elements when the keyboard appears (if required). If you split the keyboard (Do the split gesture or long press the keyboard hide button) the keyboard notifications UIKeyboardDidShowNotification and UIKeyboardDidHideNotification will not get called.

Tuesday, December 10, 2013

Date manipulation – Objective C

You can add/subtract days/months/years from an existing NSDate without much of complicated coding if you use NSCalendar and NSDateComponents. Following is an example how you can add a day to an existing NSDate.

Monday, September 30, 2013

UIDatePicker and iOS7

If you haven't still noticed UIDatePicker has changed in iOS7. However any app compiled using the old xcode will still have the old date picker.

Monday, September 23, 2013

NSDate - few important things

If your program logic makes decisions based on time here are few things you need to remember.

Thursday, June 13, 2013

Generate primary key - Objective C

The following code will generate a primary key using the current time stamp, a character (I have used the character 'T' in this example) and a random number. I have used this to generate primary keys for database records.

Tuesday, June 11, 2013

The new Google keyboard - A duplicate of SWYPE or better?

Google Maps, Google Drive, Google This, Google That…. But there is always room for one more new arrival from Google, and now it is in the form of an app called Google Keyboard.