Archive

Archive for the ‘Development’ 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://com.android.chrome.browser/bookmarks
adb shell content query --uri content://com.android.chrome.browser/history

I got the following error after running this command:

Permission Denial: opening provider com.google.android.apps.chrome.ChromeBrowserProvider

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.

Advertisements
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;

@end

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 *)
  self.window.rootViewController;

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;
...</pre>
UIView *editView = [controller.view.subviews objectAtIndex:1];
 UINavigationBar *modalNavBar = [editView.subviews objectAtIndex:0];
 modalNavBar.tintColor = [UIColor orangeColor];
<pre>

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];
}

@end

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.