iPhone: Download and Display Gravatar

March 28, 2009 | Filed Under Mac OS X, iPhone | No Comments

Back to the real iPhone for a while… Gravatar, or globally recognized avatar, is an interesting free service. It can be integrated with AddressBook app or other apps that can have a picture related to email address. Here an Objective-C Example to retrive the Gravatar. It’s really simple!

iPhone GravatarThe Source Code is Available Here: iPhone Gravatar Example.

The Apple Worldwide Developers Conference (WWDC) takes place June 8-12, 2009 held at Moscone Center West in San Francisco. http://developer.apple.com/WWDC/.

Qt4 iPhone Like App Prefs

March 28, 2009 | Filed Under Qt4 | 2 Comments

Qt iPhone like App PrefsHere a simple example on How to Customize an ItemView class, in this case a QTreeView, to be similar to the iPhone Application Preferences Panel.

All the look’n’ feel magic is provided by the ItemDelegate that paint the right object using the specified type.

There’re six different item types: Button, Link, Group, Value, Multi-Value, Info. Values are all string except boolean that are painted as On/Off Button. Double Tap on this item to change is value. For all the others item when you click on it a right event will be dispatched, and you’ll have to handle it to load the right “Edit” page.

This is Just an Example, to use in an application you need, at least, to differentiate the Display Role Value and the real KeyName value.

The Source Code is Available Here: Qt4 iPhone Like App Prefs Source Code.

Qt4 Drawing Notification Badges

March 24, 2009 | Filed Under Qt4 | 1 Comment

Qt Draw BadgesWow a Couple of Minutes of Free Time, and here two lines of code example to answer at Dave’s question “How to Draw iPhone Like Notification Badges“.

Badges are used olso in Mac OS X in application like iTunes and in the DockBar, check this post “Cocoa Notification Badge” to see how to use it with cocoa.

Obviously Notification Badges will be a features of My OpenMoko Apps.

The Example is very simple, there’s a method that draws the badge with specified text and Brush, you can put the badge where you want not only on top left as showed in the picture :)

The Source Code is Available here: Qt Draw Badges Source Code.

OpenMoko: My Phone, Video Preview

March 22, 2009 | Filed Under OpenMoko, Qt Embedded | 4 Comments

We’re gonna show you some of future plans. Before that, let me remind you of where we’re at with the iPhone. (Greg Joswiak, March 2009 Apple Event)

Ok, the iPhone 3.0 is here (ok, still beta). There’re some great features like the Push Notification Service, P2P networking capabilities, Hardware Access and so on… but for us? poor Linux developers?

Previously showed in this post OpenMoko “My iPhone”, I’m working to make my Neo Freerunner similar to the iPhone. Yesterday I’ve switched to QtEmbedded 4.5 for Applications that doesn’t require media or phone content, unfortunatly QtEmbedded doesn’t have Phonon support.

Till now (Just 3 ‘days’ of development), I’ve implemented some of the Touch Screen gesture, like sweep, scroll, double tap, zoom, rotation… and others nice features with the accelerometer like Shake and Screen orientation, Normal or Landscape automatically enabled without writing a line of code.

Now there’s one more thing I want to show you, a video preview of my OpenMoko.

One more thingFreerunner freely runs Gentoo“, Gentoo Team have reached the first milestone for running Gentoo on the Freerunner.  http://gentoo.mindzoo.de

I’m still an Apple iPhone Fan, but developing OpenMoko with Qt is fantastic! Thanks Trolls!

Qt WebKit: Virtual Keyboard

March 16, 2009 | Filed Under Qt4 | 1 Comment

The Development of “Moko Touch” (My iPhone Clone for OpenMoko) goes on, And I’m writing a Mobile WebKit Browser. But The Phone need a Virtual Keyboard, and I Need to handle the WebKit forms. Internal WebKit/VirtualKeyboard of QtExtended doesn’t handle password forms… So, here an example of How to Add a Virtual Keyboard to your QWebView.

QWebKit Virtual Keyboard

Usage is easy, load your web page click on a Editable form and the keyboard will magically appear, click out of a form and keyboard will magically disappear :)

The code use a lot of JavaScript to handle the form click and focused out, and I don’t like it! So, If you’ve suggestions on how to implement it differently, post a comment or send me a mail! Thanks.

The Source Code is Available here: QtWebKit Virtual Keyboard Source Code.

OpenMoko: My “iPhone”

March 15, 2009 | Filed Under OpenMoko | 6 Comments

Moko Touch No Code Post Yesterday, No Code Post Today.

But for those that doesn’t follow my Tweets, Yesterday I’ve updated the Cocoa SQLite Wrapper to support the NULL value.

I had in plan to post an Example of “Qt Animation“, Moving Objects along a path, something like CoverFlow or other Effects. But my Moko needs to be more usable, and needs an iPhone like UI.

Cocoa: Sidebar with Badges, Take 2

March 8, 2009 | Filed Under Cocoa | 13 Comments

Cocoa SidebarDo you remember the Cocoa Sidebar? No, Take a Look at this post Cocoa Sidebar with Badges.

Joel asked me to revise the Sidebar, allowing to add/remove and do other operation at any time.

I’ve rewritten all the code of the Sidebar, and I’ve added a couple of new features, like the default action handler and obviously the ability to add, remove items and badges at any time.

All the past features, like Drag & Drop are still present, but there’s something else to do to improve it. If You’ve suggestions, patches or something else post a comment or send me a mail!

The Source Code is Available Here: Cocoa Sidebar 2 Source Code.

Update 10 March 2008 – Source Updated with Fixes.

OpenMoko: NEO QtExtended Accelerometer

March 7, 2009 | Filed Under OpenMoko | No Comments

Neo Accelerometer Device 3QtExtended doesn’t have an accelerometer class, so I’ve decided to Write my on class with a simple Example. A Spot that moves around X and Y Axis using Accelerometer Information.

The Second NEO Freerunner Sensor, in contrast to the first sensor  is turned 45 degrees around the Z axis. See the attached image to get a clue about its orientation.

The information from both of the accelerometers is exported through two different input event based file mappings. These device nodes can be found at /dev/input/event2 and /dev/input/event3.

The QAccelerometer Class emit an Event called accelerate(qreal x, qreal y, qreal z) that gives you X, Y, Z axis values.

Each acceleration event relays the current acceleration readings along the three axes of the device. Therefore, a value of 1.0 represents a load of about +1g along a given axis while a value of -1.0 represents -1g.

You can find More information about OpenMoko Accelerometer here “Accelerometer Data Retrieval” and “Accelerometer Technical Fundamentals“.

Keep in Mind this Simple Table of X, Y,  Z axis and Phone State:
( 0,  0,  1) = Front
( 0,  0, -1) = Back
( 1,  0,  0) = Vertical (Short Side), Right
(-1,  0,  0) = Vertical (Short Side), Left
( 0, -1,  0) = Vertical (Long  Side), Front
( 0,  1,  0) = Vertical (Long  Side), Back

The Source Code is Available Here: NEO QAccelerometer Test Source Code.

Next Page »