Archive for the ‘iOS’ Category

Export Bookmarks or History on Android Chrome

You can get bookmarks and history dumps with the following shell commands:
adb shell content query --uri content://
adb shell content query --uri content://

I got the following error after running this command:

Permission Denial: opening provider

Do you have any ideas how to get the permission? I think the commands are only working on rooted devices.

With Browser History you can also search and backup your Browser History.

Categories: Android, Development

HTC One M8 – Android 5 Lollipop USB Debugging und Entwickleroptionen aktivieren

Die Entwickleroptionen sind ab Werk nicht aktiv und müssen zuerst freigeschaltet werden.

  • Rufe das Menü deines Android-Smartphones auf und öffne die Einstellungen.
  • Scrolle nach unten  bis zum Eintrag “Info”.
  • Tippe diesen Eintrag an und im nächsten Bildschirm dann auf “Software-Informationen”.
  • Tippe dann ganz unten den Eintrag “Mehr” an.
  • Tippe mehrfach auf den Eintrag “Build-Nummer”. Ein Popup zeigt dir an, wie oft du den Eintrag noch antippen musst, bis die Entwickleroptionen aktiv sind.
  • Gehe  danach zurück ins Hauptfenster der “Einstellungen”.
  • Hier findest du nun zusätzlich den Eintrag “Entwickleroptionen”.
Categories: Android, Development

Wireframe structure for iPhone iOS 4/5

Here you can find a wireframe structure for the iPhone.

Categories: Development, Prototyping

UINavigationBar Color of More Tab in iOS 5

If you start a Tabbed Application and use Storyboards in Xcode with iOS 5 a simple project will be created with two tabs. If you add more than 5 Tabs to the Tab Bar Controller a “More” tab will be created automatically.

The NavigationBar in the More Tab and the modal view (edit) are colored with default blue. To change the color of the moreNavigationController you have to do the following steps.

Extend app delegate so that it implements the UIApplicationDelegate and UITabBarControllerDelegate protocols.

#import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate, UITabBarControllerDelegate> {

 UIWindow *window;
 UITabBarController *tabBarController;

@property (nonatomic, retain) UIWindow *window;
@property (nonatomic, retain) UITabBarController *tabBarController;


The app delegate doesn’t know anything about the ViewControllers yet, so it will have to dig through the storyboard to find it. With Interface Builder you always had a reference to the App Delegate in your MainWindow.xib and you could make connections from your top-level view controllers to outlets on the App Delegate. That is currently not possible with storyboards. You cannot make references to the app delegate from your top-level view controllers. So you have to get those references programmatically. You know that the storyboard’s initial view controller is a Tab Bar Controller, so you can look up the window’s rootViewController and cast it.

UITabBarController *tabBarController = (UITabBarController *)

Then you can get the More Tab by the Tab Bar Controller and  set a color.

UINavigationController *moreController = tabBarController.moreNavigationController;
moreController.navigationBar.tintColor = [UIColor orangeColor];

After that you use the App Delegate as the delegate of the Tab Bar and change the color of the “Edit” View, too.

tabBarController.delegate = self;
UIView *editView = [controller.view.subviews objectAtIndex:1];
 UINavigationBar *modalNavBar = [editView.subviews objectAtIndex:0];
 modalNavBar.tintColor = [UIColor orangeColor];

The complete code of AppDelegate.m:

#import "AppDelegate.h"

@implementation AppDelegate

@synthesize window = _window;
@synthesize tabBarController;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
 // Get top-level view controller reference programmatically
 tabBarController = (UITabBarController *) self.window.rootViewController;

 // Set the color of the navigationbar in moretab
 UINavigationController *moreController = tabBarController.moreNavigationController;
 // //moreController.navigationBar.barStyle = UIBarStyleBlackOpaque;
 moreController.navigationBar.tintColor = [UIColor orangeColor];
 moreController.navigationBar.hidden = NO;
 moreController.navigationBar.backgroundColor = [UIColor blackColor];

 // Set delegate of the tabBarController to handle the UITabBarControllerDelegate calls
 tabBarController.delegate = self;

 return YES;

- (void) tabBarController:(UITabBarController *)controller willBeginCustomizingViewControllers:(NSArray *)viewControllers {

 // Set the color of the navigationbar if edit was selected
 UIView *editView = [controller.view.subviews objectAtIndex:1];
 UINavigationBar *modalNavBar = [editView.subviews objectAtIndex:0];
 modalNavBar.tintColor = [UIColor orangeColor];


Here you can download the example Project.

Categories: CodeSnippets, Development, iOS

Uninstall Xcode

Use the following command to uninstall Xcode:

sudo <Xcode>/Library/uninstall-devtools --mode=all

<Xcode> is the location you’ve installed Xcode.

If you’ve installed Xcode with the default settings you can use this command:

sudo /Developer/Library/uninstall-devtools --mode=all
Categories: Development, iOS, Mac OS X, Xcode

Case insensitive comparison and searching NSString

if( [@"Some String" caseInsensitiveCompare:@"some string"] == NSOrderedSame ) {
   // strings are equal except for possibly case

NSRange range = [@"Some String" rangeOfString:@"string" options:NSCaseInsensitiveSearch];
if (range.location != NSNotFound) {
   // String found
Categories: CodeSnippets, Development, iOS

Remove project or folders from subversion in Mac OS X

Start a Terminal, go to the root folder of your project and type:

find ./ -name “.svn” | xargs rm -Rf

After removing all subversion files i got the following error in Xcode.

Go through Organizer -> Repositories and check your entries there.

Compare files on Mac OS X with FileMerge or KDiff3

FileMerge is a little program which is in the “Developer Package” of Apple.

You can download the package including Xcode, the SDK and FileMerge from Apple if you are a member of the Developer Program or buy Xcode from Mac App Store.

After the installation you can find FileMerge here: “HD/Developer/Applications/Utilities/“.

If you don’t have the Developer Package you can also use KDiff3.

Categories: Development, Mac OS X

Icons for universal iOS apps

App Store Icon

  • 512×512 (scaled down to 175×175 for display in the store)

Application Icon

  • 114×114 (iPhone 4)
  • 57×57 (older iPhones)
  • 72×72 (iPad)

Spotlight Search Results and Settings Icon

  • 58×58 (iPhone 4)
  • 50×50 (Spotlight results for iPad)
  • 29×29 (settings for iPad and older iPhones)

Document Icon

This is a new icon type in iOS 4. It’s used if your app creates a custom document type. The iPad uses the document icon in two different sizes.

  • 320×320 (iPad)
  • 64×64 (iPad)
  • 44×58 (iPhone 4)
  • 22×29 (older iPhones)

For every image in your app, add a second version that’s twice the size, adding @2x to the name. For a low-resolution image named image.png you would add a second file named image@2x.png. The new image will be picked up automatically by iPhone 4. Everywhere your code requests image.png, image@2x.png will be used instead.

Thanks to Neven Mrgan for the Photoshop template:

iPhone Icon Resize Tool:

There is also a web app to simplify the icon resizing for developers:

Categories: Development, Distribution, iOS

Converting NSString to NSDate and vice versa

NSDate *date = [NSdate date];

NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyy-MM-dd"];

// Convert a date to NSString and get rid of the minutes...
NSString *strDate = [dateFormatter stringFromDate:date];

// Convert it back to NSDate
NSDate *newDate = [dateFormatter dateFromString:strDate];
Categories: CodeSnippets, Development, iOS