Archive

Archive for May, 2011

Create runnable Jar-Files with Eclipse Helios

  • Select your project in Package Explorer and choose File | Export… in the menu.

  • Then select Java | Runnable JAR file.

  • Select your configuration and destination in following dialog and click finish.

  • Done 🙂
Categories: Misc

Stereomix with Windows 7 and ASUS P5B Deluxe to record audio output

For recording your audio output with a tool like No23 Recorder or Audacity you need to select Stereomix in the recording settings. But there was no Stereomix, Stereo-Mix, Wave Out or All-you-here entry in the settings.

Perhaps the only thing you have to do is to activate Stereomix in your Windows Sound settings.

If you have no Stereomix entry there you have to download the correct sound driver for your onboard Sound Card. For the ASUS P5B Deluxe it is the SoundMAX Integrated Digital HD Audio Driver included in AD1988AB_Audio_V6585_XpVistaWin7.zip you can find at the Asus support page. Search for P5B Deluxe and have a look at the AUDIO category on the page.

After the installation process you should see the Stereomix entry in your sound settings and can select and activate it.

Categories: Windows 7

Model Driven Software Development for Android

With the MDSDACP and the Android Content Provider Generation Eclipse Plugin it is possible to generate the Android Content Provider + Database + Model from an ecore domain model. It’s an Open Source Project under Eclipse Public License 1.0. For more informations have a look at the Project Home Page here.

Categories: Android, Development

LogCat doesn’t show anything

If the LogCat panel is empty in Eclipse the emulator (or your connected device) doesn’t have the focus. Go to the DDMS perspective and try clicking on the ’emulator’ entry in the Devices panel (top-left screen).

Categories: Android, Development

How to install the Android SDK on Mac OS X

  • Download the latest version of the Android SDK
  • Unzip it and move it where needed, e.g. to your user directory
    unzip ~/Downloads/android-sdk_r11-mac_x86.zip
  • Open Terminal.app (in /Applications/Utilities)
  • Edit ~/.profile and append (if you have the SDK moved to your user directory):
    export PATH=~/android-sdk-mac_x86/platform-tools:~/android-sdk-mac_x86/tools:$PATH
    export ANDROID_HOME=~/android-sdk-mac_x86
  • Load new .profile
    source .profile
  • Run Android SDK Manager
    android
  • Install Components
Categories: Android, Development, Mac OS X

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: http://blog.cocoia.com/2010/iphone-4-icon-psd-file/.

iPhone Icon Resize Tool: http://www.nbsoftlab.com/nbblog/?page_id=131.

There is also a web app to simplify the icon resizing for developers: http://rdicongen.appspot.com/.

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