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);
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. This behavior is because iOS closes the ...
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. Once Google pair up a device with an account you are required to go to the account chooser to undo it. You should get a link below ...
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; } If you want to declare variables inside a case you need to ...
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 ...
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. If you were wondering how could you re-arrange the UI to appear above the keyboard, the answer is ...
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. Notice that I have not bothered to check what the day is or the month or the year when arriving at the resulting date. Objective C handles ...
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. The new picker is quite different so be aware of any usability issues. In my case the problem was that I couldn't see the picker at all because of the new colour scheme. So don't ...
If your program logic makes decisions based on time here are few things you need to remember. [NSDate date] will give you the GMT time and date. But this is calculated using the current device time. If the device time is wrong this value is also wrong. [[NSTimeZone systemTimeZone] name] will give the device time zone. e.g. Asia/Colombo [[NSTimeZone systemTimeZone]secondsFromGMT] ...
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. #include - (NSString *) getPrimaryKey{ NSDate *curDate = [[NSDate alloc]init]; NSTimeInterval inter = [curDate timeIntervalSince1970]; //return as double [curDate release]; NSString ...
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. Google's Android keyboard release carries gesture typing, which means you can glide through letters to form a word and can lift a finger to create a space. ...
Just got an email with subject "Account access denied" from paypal (see screenshot below). The mail said that there have been an unauthorized access to my account and I'm required to verify my account by clicking on a link given in the mail. As a best practice I never click on links inside emails. I copy pasted the link in ...
Earlier in the morning I wanted to undo a retweet I did. It took me a while to figure out how to. Just posting it here for future use and for you who is reading this right now. 1. Find the tweet your retweeted. 2. Notice that the retweet link now says retweeted. 3. Click on it
You can make your NSViews auto arrange/resize according to its superview's size by setting appropriate values using NSView's setAutoresizingMask: method. For this example's sake I'll consider elements added as subviews to the contentView of the NSWindow. NSWindow can change its size when going into full screen, when the user clicks on the resize control (green button) and when the user ...
Sample code line 1: NSString *someString; line 2: someString = [self getStringValue]; line 3: NSLog(@"length of the string = %d",[someString length]); In the above example sometimes the code can crash at line 3. Possible reason would be that the object "someString" is either null or nil. null vs nil has always been a debate with my friends, when to use ...
Did you know that by using "removeItemAt:" method in NSFileManager you could actually delete the documents directory? It is bit of a scary thought and I sometimes feel that it shouldn't be the case to keep careless developers away from bugs, but unfortunately or not it is possible. A possible bug you will miss out because of poor validation would ...
Looks like Apple is serious about provisioning and developer certificates for Mac apps from their latest Mac OSX version (10.8 - Mountain Lion). It has always being the case for iOS apps but not for Mac apps. Just got this error while trying to install Fink However the good news is that there still exists a work around. Unbelievably simple ...
Incorrect code sample UIImagePickerController *pickerController = [[UIImagePickerController alloc]init]; pickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; pickerController.delegate = self; [self.navigationController.view addSubview:pickerController]; [pickerController release]; Actually there is nothing wrong with the addSubview method. The only problem is that it doesn’t load the gallery. In iOS 5 the gallery gets loaded without any issue. However if you want to make your app com
It is common knowledge that the UINavigationBar will display the previous UIViewController's title in an arrow shaped button at the left hand side corner. Basically if the previous UIViewController doesn't have a title the back button won't be visible as well.This is annoying and I always thought that the best practise would have been to have the button with ...
I'm using ZipArchive developed by aish to create zip files. ZipArchive is an Objective-C class to compress or uncompress zip files, which is based on open source code "MiniZip". It worked fine on many of the iPhone apps I developed. However it does not support opening of an existing zip and adding more files to it. So I did this ...