Android on HTC Kaiser..

I have tried before a couple of times to install Android on my Kaiser and succeeded once but without phone functionality. For some reason, it didn’t boot in Android the next time i tried.

Yesterday i got back to it again and things have improved so much since my last attempt.

There is a whole new dedicated page now (by the same XDA-developers ) – Android On HTC

And then there is the vogue-Android project on Google Code.

Just for the record, this particular bundle worked for me fine!

Now i can boot in Android everytime but still no Telephone functionality. Even though i get “registered to network” message!

Wi-Fi not working and neither the bluetooth.

Only was playing around with the photo browsing and video player!

Tags: , , ,

Windows 7 on MacBook Pro..

Ok.. I haven’t been following up much with the crowd on Windows 7 stuff.

But listening to Scott talking about Windows 7 made me give a shot at it. Yes, even after he called himself a Schill, i wanted to try ;)

Having the VMWare Fusion installed made it much simpler to try this out. After downloading the RC 7 (build 7100) tried to make a new VM with it.

For some reason, the Fusion thought i am installing Vista 64 bit and not Windows 7. But i am sure they’ll catch up with that soon!

Picture 1

Win7

Before installing Fusion, i had a bootcamp partition with XP on it.  Even though i am happy with Fusion, i still wanted to keep the Bootcamp partition. Well, the only itching point was i had to reboot the machine everytime i wanted to run Visual Studio. But i am OK with that. Somehow i thought , that way, XP has all the resources and processor power just for XP. So thats why even XP feels sooo much better on MacBook Pro!

Then i came across, Jeff Atwood’s blog entry on Virtual Machine – The Single Most Important Virtual Machine Performance Tip. He’s so right! But its a shame i cant fix another hard disk in MBP, or i dont know yet. So i’ll stick with bootcamp for now!

Another thing i missed when i am bootcamped is my iTunes collection. But Fusion lets you share whenever you create your VM with it. Now i am happy listening iTunes from Windows 7. Will share more experiences soon..

Here’s my current settings with Vista x64..errr.. Windows 7

Picture 2

Tags: , , ,

DVD – RIP (no, not ripping, Rest In Piece!)

When the macbook air came out, i loved apple for the fact that they foresee (or made?) end of DVD drives.

I only chose macbook pro for the processor power and better graphics performance.

Last night when i tried to see one small video (2 mins length) which was stored in DVD, i almost screamed with my MacBookPro!
The file was compressed with .mkv and i had my favorite VLC player installed.
But when i tried to play from DVD, the poor thing kept spindling the dvd and nothing was happening.
Couldn’t torture the MBP more than few seconds and ejected the dvd and got on with my other stuff..

well, the interesting thing was when i was going through the console for something else, this caught by eye..

org.videolan.vlc[4109] [00000001] main libvlc debug: VLC media player - version 0.9.9a Grishenko - (c) 1996-2009 the VideoLAN team
org.videolan.vlc[4109] [00000001] main libvlc debug: libvlc was configured with ./configure  '--enable-release' '--disable-debug' '--with-macosx-sdk=/Developer/SDKs/MacOSX10.4u.sdk'
org.videolan.vlc[4109] [00000001] main libvlc debug: translation test: code is "C"
org.videolan.vlc[4109] [00000001] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
org.videolan.vlc[4109] [00000001] main libvlc: Key authenticated
org.videolan.vlc[4109] [00000001] main libvlc: Status file authenticated
org.videolan.vlc[4109]  m_el[mi_level] == NULL
org.videolan.vlc[4109]  arrrrrrrrrrrrrg Up cannot escape itself
org.videolan.vlc[4109] [00000440] a52 decoder: A/52 channels:2 samplerate:48000 bitrate:384000
org.videolan.vlc[4109] No accelerated IMDCT transform found
org.videolan.vlc[4109] [00000407] avcodec decoder error: more than 5 seconds of late video -> dropping frame (computer too slow ?)

Really?? MBP with 4GB RAM is too slow for playing a video from a DVD?

Damn! I dont know who to hate, VLC? or DVD drive?

ofcourse, its the DVD (or me for sticking with those discs still)
I think its time i should get one of those 2TB hard drives and get all those DVDs copied (maybe i’ll use some Windows PC)

After all, i dont think i am alone feeling like this :)

Tags: , ,

iProgrammer Tip#7: springboard failed to launch application with error 7

Today i had another  weird moment with xCode/iPhone Simulator.

I had couple of projects open for a while and switched to one of those and wanted to test on the Simulator,
but xcode was reporting

Error launching simulated application: SpringBoard failed to launch application with error: 7

The Console log was showing like:

Xcode[27865] Error launching simulated application: Error Domain=DTiPhoneSimulatorErrorDomain Code=1 UserInfo=0x3fc3d80 "SpringBoard failed to launch application with error: 7"

When i switched the Active configuration to release, it was launching the app in simulator as usual. But Debug configuration seemed to have some issue. For next 10 minutes or so i was comparing the differences in Build settings/Target settings etc, nothing seems to be the problem.

Looking more attentively at Console logs shown the following lines were repeating everytime xcode fails to launch..

6/30/09 10:47:41 AM com.apple.launchd[55426] (com.apple.iPhoneSimulator:com.apple.installd[27624]) Exited: Terminated
6/30/09 10:47:41 AM com.apple.launchd[55426] (com.apple.iPhoneSimulator:com.apple.dataaccess.dataaccessd) Unknown key for integer: JetsamPriority
6/30/09 10:47:41 AM com.apple.launchd[55426] (com.apple.iPhoneSimulator:com.apple.apsd) Path monitoring failed on “/var/mobile/Library/Preferences”: No such file or directory
6/30/09 10:47:41 AM com.apple.launchd[55426] (com.apple.iPhoneSimulator:com.apple.installd[27624]) Exited: Terminated
6/30/09 10:47:41 AM com.apple.launchd[55426] (com.apple.iPhoneSimulator:com.apple.dataaccess.dataaccessd) Unknown key for integer: JetsamPriority
6/30/09 10:47:41 AM com.apple.launchd[55426] (com.apple.iPhoneSimulator:com.apple.apsd) Path monitoring failed on "/var/mobile/Library/Preferences": No such file or directory

When i googled, found there are quite close but the same trouble has been faced by many fellow xcoders.

  • Multiple Targets in Xcode: "Failed to launch simulated application: unknown error
  • iPhone: Failed to launch simulated application: unknown error
  • XCode error: failed to launch simulated application
  • and finally

    iPhone Simulator: SpringBoard failed to launch application with error no 7

    What worked for me finally:

    Reset Content and Settings didnt work either but Quitting the simulator and re-launching did it.

    I almost felt abused as i expected a complex solution to fix :)

    anyway, back to happy xCoding!!

    Tags: ,

    iProgrammer Tip #6: “Weak linking” additional libraries

    Sure, first time when i learnt about frameworks,  i was really excited!  What interested me most was, a framework can be marked as “Weak” so that applications can still work using new features in new framework and when using old version of the framework,can ignore some functionality. But as much as i was excited, i didn’t know how to mark a framework as “Weak”.

    for instance, I was trying to support Compose Mail from within my application and while going through instructions below:

    3. Make MessageUI a weak framework (set its role to Weak)
    An application will fail to launch or proceed if it attempts to load a
    framework on devices where this framework is absent.
    With weak linking, an application does not fail, but proceeds when a symbol or
    framework is not present at runtime. All weak-linked symbols are set to NULL on
    devices without them.
    
    To designate MessageUI as weak-linked, select the target's Link Binary With
    Libraries build phase, then change MessageUI's role from Required to Weak in the
    detail view.

    Sounds simple, but for some reason i couldn’t figure out immediately how to do that. Maybe its common knowledge?

    But for those who dont know this, here’s a tip to get this done:

    To add new framework:

    1. select the Target and select the application name and pull down (either -> arrow or click on that arrow symbol)
    2. select Link Binary With Libraries
    3. Right click and select Add
    4. Choose Existing frameworks
      • Add framework
    5. Then click on the + in the next screen
      • Add
    6. Depends on your target SDK, you will get the option to choose the additional frameworks. For 3.0 it looks like below
      • list..
    7. After adding the framework, you can select the “Type” on the right and change to “Weak”
      • Picture 9

    Then Build as usual.

    Important to note:

    Check for the existence of APIs before calling them

    and

     Provide a workaround for non-existent APIs

    Tags: ,

    iProgrammer Tip #5: Dismiss keyboard while entering text in UITextView..

    We have managed to Dismiss keyboard from UITextField in response to ‘return’ in keyboard .

    But unfortunately, the same trick wont be useful when working with UITextView.

    UITextViewDelegate does not have such a method to be delegated. Below is the list of optional methods for UITextViewDelegate

    @protocol UITextViewDelegate <NSObject>

    @optional

    - (BOOL)textViewShouldBeginEditing:(UITextView *)textView;

    - (BOOL)textViewShouldEndEditing:(UITextView *)textView;

    - (void)textViewDidBeginEditing:(UITextView *)textView;

    - (void)textViewDidEndEditing:(UITextView *)textView;

    - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text;

    - (void)textViewDidChange:(UITextView *)textView;

    - (void)textViewDidChangeSelection:(UITextView *)textView;

    @end

    After staring at them for a while, it dawned that shouldChangeTextInRange could be our rescue.

    - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text

    {

    if([text isEqualToString:@"\n"])

    {

    [textView resignFirstResponder];

    return FALSE;

    }

    return TRUE;

    }

    Tags: ,

    iProgrammer Tip #4: Dismiss keyboard from UITextField in response to ‘return’ in keyboard

    Lets say you have  a UI with a UITexttField and a UIButton which does some action on the text you entered.

    If the user can see the Button while the keyboard is up, its all well and good!

    But what if the button gets under the keyboard and you dont have the ScrollView capability to push up the button in viewport?

    I had run into such a situation and the trick i used was handling the optional delegate method  textFieldShouldReturn

    1. In the header file of your viewcontroller, state that it conforms to UITextFieldDelegate

    @interface myViewController : UIViewController <UITextFieldDelegate>

    {

    IBOutlet UITextField* myTextField;

    IBOutlet UIButton* myButton;

    }

    - (IBAction) click;

    @end

    2. Tell the textfield that your viewcontroller is the delegate (preferably in viewDidLoad)

    - (void)viewDidLoad

    {

    [super viewDidLoad];

    myTextField.delegate = self;

    }

    3. Finally implement the optional delegate method as

    - (BOOL)textFieldShouldReturn:(UITextField *)textField {

    [textField resignFirstResponder];

    return NO;

    }

    Thats it! Now when you press return or any of those custom return key ( mostly set to Go / Done / Search, others will work too ofcourse! )

    Tags: ,

    iProgrammer Tip #3: Multiline text in UITableViewCell (without custom view)

    The trouble with UITableViewCell is it doesn’t handle multiline text by default!

    So if you want to have multiline text in your table view, you might be tempted to create Customview and drawRect. But there is another way!

    Its 2 step process!

    Step 1:  Calculate required Height of each row  and send the info to Tableview by implementing

    - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath

    {

    NSString *str = // Your text to be displayed

    UIFont *font = [UIFont fontWithName:@"Helvetica" size:17.0]; // You can choose a different font ofcourse.

    CGSize withinsize = CGSizeMake(tableView.frame.size.width, 1000); //1000 is just a large number. could be 500 as well

    // You can choose a different Wrap Mode of your choice

    CGSize sz = [str sizeWithFont:font constrainedToSize:withinsize lineBreakMode:UILineBreakModeWordWrap];

    return sz.height + paddingspace; // padding space of 20 should be fine!

    }

    Step 2  Add a UILabel and set text as below in cellForRowAtIndexPath

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

    {

    static NSString *CellIdentifier = @”Cell”;

    UITableViewCell *cell;

    cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    if (cell == nil)

    {

    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];

    CGRect rectLabel = CGRectMake(cell.frame.origin.x+20, cell.frame.origin.y+10, cell.frame.size.width-20, cell.frame.size.height-20);

    UILabel* label = [[UILabel alloc] initWithFrame:rectLabel];

    label.lineBreakMode = UILineBreakModeWordWrap;

    label.numberOfLines = 0;

    label.font = [UIFont fontWithName:@"Helvetica" size:17.0]; //Same font used for calculating height

    label.text = [tweets objectAtIndex:indexPath.row];

    label.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

    [cell addSubview:label];

    [label release];

    }


    return cell;

    }


    This should give a decent cells. You might change the font color or size as desired!

    Tags: ,

    Few Erlang Links..

    This is the outcome of my random search on erlang before i am getting into it.

    Hope i get some time to explore each of this in some details.

    The place for erlang!

    Ericsson homepage for erlang

    Open-source Erlang is being released to help encourage the spread of Erlang outside Ericsson

    One of the best presentations i’ve seen. I wonder how many programming language inventor would give an introduction about hardware scene before going in detail about the language. But it makes so much sense for erlang.

    Teaser introduction

    Another presentation by the inventor.

    Good collection of tutorials organized nicely

    Short wiki with interesting links

    ejabberd is a Jabber/XMPP instant messaging server written in Erlang/OTP.

    RabbitMQ is a complete and highly reliable Enterprise Messaging system

    Yaws is a HTTP high perfomance 1.1 webserver particularly well suited for dynamic-content webapplications

    ErlyWeb is a component-oriented web development framework written in Erlang and designed to work with Yaws

    Nitrogen brings cutting-edge web development to Erlang

    MochiWeb is an Erlang library for building lightweight HTTP servers

    Let your xcode help you on erlang development. Yet to try this.

    Will add more as i bump into..

    Tags: , , , ,

    iProgrammer Tip #2: Get around “Device could not support development..” error in Organizer

    All of a sudden the Organizer stated that my development device “could not support development”.

    Restarting XCode couple of times didnt help!

    Worked workaround: Reset the device and also restart xcode to be on safe side and everything would be back to normal!

    Apparently this seems to me a bug in xcode with some corrupted data in device maybe.

    Tags: , , ,

    SEO Powered by SEO Boost from PcDrome.