<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5312149573554041790</id><updated>2012-01-19T22:36:36.572-08:00</updated><category term='gphone'/><category term='android'/><category term='qt'/><category term='webkit'/><category term='plasma'/><category term='webkit integration'/><category term='KDE4'/><title type='text'>Random bits</title><subtitle type='html'>Coding for life</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://lbellonda.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5312149573554041790/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://lbellonda.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Luca Bellonda</name><uri>http://www.blogger.com/profile/01526329171154210855</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5312149573554041790.post-2196909924259416631</id><published>2009-04-14T12:15:00.001-07:00</published><updated>2009-04-14T12:25:59.608-07:00</updated><title type='text'>Elephant Memory</title><content type='html'>One of the most frequently annoying things when using computers is to seek a document in same folders of previously opened one and facing an 'Open File' dialog pointing stubbornly to home directory. A simple tip to improve user experience, would be that computer can 'remember' permanently last used directories per application showing last opened file and access date.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A simple preview on KDE4:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_RMulueKiM4M/SeThEdMlu3I/AAAAAAAAAaY/HS2Ti8oHGpU/s1600-h/ipotesi2_1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 234px;" src="http://1.bp.blogspot.com/_RMulueKiM4M/SeThEdMlu3I/AAAAAAAAAaY/HS2Ti8oHGpU/s320/ipotesi2_1.png" alt="" id="BLOGGER_PHOTO_ID_5324628126131927922" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5312149573554041790-2196909924259416631?l=lbellonda.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lbellonda.blogspot.com/feeds/2196909924259416631/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5312149573554041790&amp;postID=2196909924259416631' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5312149573554041790/posts/default/2196909924259416631'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5312149573554041790/posts/default/2196909924259416631'/><link rel='alternate' type='text/html' href='http://lbellonda.blogspot.com/2009/04/elephant-memory.html' title='Elephant Memory'/><author><name>Luca Bellonda</name><uri>http://www.blogger.com/profile/01526329171154210855</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_RMulueKiM4M/SeThEdMlu3I/AAAAAAAAAaY/HS2Ti8oHGpU/s72-c/ipotesi2_1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5312149573554041790.post-7784468910152236897</id><published>2009-04-08T14:29:00.000-07:00</published><updated>2009-04-08T14:45:30.029-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='plasma'/><title type='text'>Activities are for humans</title><content type='html'>Computers are very versatile tools, used in a variety of situations, to work, listen music, write documents, but it is very difficult to create a comfortable user environment for each task. When working to an important document, mail notifications are very annoying, but turning off completely notifications is not the ideal solution, mails related to the activity are welcomed. What is missing is the possibility that the computer adapts his environment to different activities.&lt;/p&gt; &lt;p&gt;Virtual desktops are the more advanced solution to implement activities today, but this is only a start.&lt;/p&gt;  &lt;p&gt;There is a difference between a virtual desktop and an activity: virtual desktop is a collection of resources (windows mainly), an activity is a collection of related resources. You can work for a project, read documents, contact people, receive mails and so on and all these items can stay associated to the activity you are currently operating.&lt;/p&gt; &lt;p&gt;We can roughly consider an activity on top of a collections of virtual desktops.&lt;/p&gt; &lt;p&gt;A 'recent document' menu can contain a lot of unrelated documents, a personal letter written in a pause together with work documents and worst, it has a finite length, so new documents of unrelated activities are pushing into oblivion very important bookmarks.&lt;/p&gt; &lt;p&gt;Activities are useful to categorize and filter environment items, but it is not practical to manually label each resource that can reside in an activity, so the workspace should automatically collect informations, like the mylyn plugin in Eclipse world&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.ibm.com/developerworks/java/library/j-mylyn2/"&gt;http://www.ibm.com/developerworks/java/library/j-mylyn2/&lt;/a&gt;&lt;/p&gt; &lt;p&gt;When in an activity you can associate not only documents related to that activity, but also contacts, sites, and so on.&lt;/p&gt; &lt;p&gt;We work on different projects and we use the computer for personal activity each day. Computers are universal devices and can be used for different purposes.&lt;/p&gt; &lt;p&gt;As a further example, it is an annoyance to receive mail notifications from people not related to projects ( with obvious exception for emergencies ) in working hours. An activity can filter what that can distract, without hiding information, but focusing out of view not relevant factors.&lt;/p&gt;  &lt;p&gt;It is important to have a simple 'relations' manager to handle what resources are related to an activity and move or copy them from a workspace to another (maybe using the KDE plasmoid zoom interface).&lt;/p&gt; &lt;p&gt;It is important to have multiple activity configurations, you can use same laptop at work and at home, even applications menu can change in different situations.&lt;/p&gt; &lt;p&gt;Activities attributes and resources should be shared between teams.&lt;/p&gt; &lt;p&gt;There are two types of applications: specialized ones (video, audio, graphics editor for instance ) and generics ones ( word processors, time tracker, etc) that should have different behavior. How horizontal applications like file browsers should behave? Why not filter activity related directories in 'Open File' dialogs? Currently this dialog supports only a simple filter that maps to file type (a word processor filter documents, a spreadsheet csv and so on)&lt;/p&gt; &lt;p&gt;How to save data in application specific format and not using specialized Desktop Environment routines? How to integrate, for example, Open Office? We should use the metadata we are using for browsers: the tags, but there is the problem to maintain metadata in sync with data when moving files, doing backups and so on. All the files that user opens or write should be logged, but the metainformations should be stored in the document or in the filesystem?&lt;/p&gt; &lt;p&gt;Even phones have different modes: mute, normal, meeting etc.&lt;/p&gt; &lt;p&gt;Tags and activities are separate concepts, tags are traversal and additive, activities are thematic.&lt;/p&gt; &lt;p&gt;Desktop Environment should leads the user how to enter and how to exit from an activity. We should decrease normal desktops visual clutter that confuses the user about his state.&lt;/p&gt; &lt;p&gt;Another problem is how to include external resources if the filter are restrictives, maybe by adding a button in each “Open File” dialog that let us choose to stay in the current activity environment or see all the resources.&lt;/p&gt; &lt;p&gt;Other open problems are how to integrate in this vision externals resources like network infrastructure, network, printers, etc.&lt;/p&gt; &lt;p&gt;Talking about concrete cases, like the recent documents menu, why not make it central for a desktop or expand it to order it for ( I often need this ) creation date, write date, access timestamp or access frequency, category?&lt;/p&gt; &lt;p&gt;Why not display this menu in a cloud representation? More, the vertical list used is a very short and useless representation. A timeline can be more useful.&lt;/p&gt; &lt;p&gt;Different activities can be created for different purposes even using same programs.&lt;/p&gt; &lt;p&gt;In a desktop system I can save programs state on disk passing from an activity to another one, but not on phone system for device limits.&lt;/p&gt;Anyway each journey begins with a single step, and Plasma is a good one.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://techbase.kde.org/Projects/Plasma"&gt;http://techbase.kde.org/Projects/Plasma&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5312149573554041790-7784468910152236897?l=lbellonda.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lbellonda.blogspot.com/feeds/7784468910152236897/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5312149573554041790&amp;postID=7784468910152236897' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5312149573554041790/posts/default/7784468910152236897'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5312149573554041790/posts/default/7784468910152236897'/><link rel='alternate' type='text/html' href='http://lbellonda.blogspot.com/2009/04/activities-are-for-humans.html' title='Activities are for humans'/><author><name>Luca Bellonda</name><uri>http://www.blogger.com/profile/01526329171154210855</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5312149573554041790.post-7384401332491603341</id><published>2009-03-20T13:55:00.000-07:00</published><updated>2009-03-20T14:04:59.527-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='webkit'/><category scheme='http://www.blogger.com/atom/ns#' term='webkit integration'/><category scheme='http://www.blogger.com/atom/ns#' term='KDE4'/><category scheme='http://www.blogger.com/atom/ns#' term='qt'/><title type='text'>A Journey to WebKit via Plasmaland.</title><content type='html'>&lt;p&gt;While writing a little Plasma utility I was tempted to use the new QT WebKit toolkit to handle the User Interface.&lt;/p&gt;&lt;p&gt;To integrate WebKit in a KDE or QT program is no too diffcult, thanks to metadata that QT adds to C++ classes. It is possible to call directly methods of objects resident in our program from HTML pages via Javascipt taking advantage of slot and signals mechanism.&lt;/p&gt;&lt;p&gt;Firstly, we need to insert references to our application  C++ objects in HTML pages, as if thery were native JavaScript variables, using an identifier that will be mapped later to physical objects.&lt;/p&gt;&lt;p&gt;After that we can encode JavaScript functions that take advantage of the methods declared as slots, at certain events, such as pressing a button.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;We can then excute embedded objects methods from HTML passing as parameters a HTML level defined entities, such as the values of a form fields.&lt;/p&gt;&lt;p&gt;Each link between WebKit and our application will begin through Javascript functions, so WebKit will commence operations but we can call frame 'evaluateJavascript' to execute a script in the frame context from our host program.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Let's do an example:&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0pt;"&gt;Suppose that our goal is to recall the method 'reload'  of an instance of a C++ class described in the following way from Javascript : &lt;/p&gt; &lt;pre&gt;class DBusApplet : public Plasma::PopupApplet&lt;br /&gt;{&lt;br /&gt;   Q_OBJECT&lt;br /&gt;   ...&lt;br /&gt;public&lt;br /&gt;slots:&lt;br /&gt;   void reload(const QString &amp;amp;selection);&lt;br /&gt;private:&lt;br /&gt;   ...&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt; &lt;p style="margin-bottom: 0pt;"&gt;In Javascript our application class instance may be mapped as follows, assuming that it is associated to the variable 'appletInterface':&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;function execute(selection)&lt;br /&gt;{&lt;br /&gt;   appletInterface.reload(selection);&lt;br /&gt;}&lt;/pre&gt; &lt;p style="margin-bottom: 0pt;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0pt;"&gt;Since the convers&lt;span style="background-color: rgb(255, 255, 255);"&gt;ion of basic types is automatic, what we should do is to 'inject' our C++ objects into WebKit component, but we have to wait until the component alerts us when is the right moment to do it.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0pt; background-color: rgb(255, 255, 255);"&gt;After that WebKit has fully laoded a HTML page, assigned by the program directly as string or through a URL, the current frame emits the signal "javaScriptWindowObjectCleared" which must have taken care of in the usual way that QT will make available:&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style="margin-bottom: 0pt; padding-left: 30px; background-color: rgb(255, 255, 255);"&gt;connect(page()-&gt;mainFrame(),&lt;/p&gt; &lt;p style="margin-bottom: 0pt; padding-left: 60px; background-color: rgb(255, 255, 255);"&gt;SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(populateJavaScriptWindowObject()));&lt;/p&gt; &lt;p style="margin-bottom: 0pt; background-color: rgb(255, 255, 255);"&gt;Upon receipt of the signal our 'populateJavaScriptWindowObject' method will be called so we can assign the reference of our objects to WebKit using frame 'addToJavaScriptWindowObject' method, whose arguments are the name of Javascript variable that will contain the reference, and our object address.&lt;/p&gt; &lt;p style="margin-bottom: 0pt; padding-left: 30px; background-color: rgb(255, 255, 255);"&gt;page-&gt;mainFrame()-&gt;addToJavaScriptWindowObject(”appletInterface”, this);&lt;/p&gt;&lt;p style="margin-bottom: 0pt; background-color: rgb(255, 255, 255);"&gt; &lt;/p&gt;&lt;p style="margin-bottom: 0pt; background-color: rgb(255, 255, 255);"&gt;&lt;a href="http://doc.trolltech.com/4.4/qtwebkit.html"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0pt; background-color: rgb(255, 255, 255);"&gt;&lt;a href="http://doc.trolltech.com/4.4/qtwebkit.html"&gt;http://doc.trolltech.com/4.4/qtwebkit.html&lt;/a&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0pt; background-color: rgb(255, 255, 255);"&gt;&lt;a href="http://webkit.org/"&gt;http://webkit.org/&lt;/a&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0pt;"&gt;&lt;a href="http://code.google.com/p/dbusapplet/"&gt;http://code.google.com/p/dbusapplet/&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5312149573554041790-7384401332491603341?l=lbellonda.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lbellonda.blogspot.com/feeds/7384401332491603341/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5312149573554041790&amp;postID=7384401332491603341' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5312149573554041790/posts/default/7384401332491603341'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5312149573554041790/posts/default/7384401332491603341'/><link rel='alternate' type='text/html' href='http://lbellonda.blogspot.com/2009/03/journey-to-webkit-via-plasmaland.html' title='A Journey to WebKit via Plasmaland.'/><author><name>Luca Bellonda</name><uri>http://www.blogger.com/profile/01526329171154210855</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5312149573554041790.post-2214262860839022056</id><published>2008-01-04T13:39:00.000-08:00</published><updated>2008-01-04T14:26:17.648-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='KDE4'/><title type='text'>Happy Birthday KDE 4.0.0</title><content type='html'>Maybe it is not the move that can save the mankind or a masterpiece like the Gioconda, but KDE 4.0.0 is virtually ready for the half January release, in a style event at the Google base in Mountain View. &lt;br /&gt;Actual version is not going to be an environment designed to replace KDE 3.5 right now, but instead it is a base over which tomorrow's KDE can grow. Open Source software development process is different from proprietary software one and Aaron Seigo's post explains how: &lt;a href="http://aseigo.blogspot.com/2008/01/talking-bluntly.html"&gt;http://aseigo.blogspot.com/2008/01/talking-bluntly.html&lt;/a&gt;.&lt;br /&gt;Last moment translations (and code freeze) hurry and chaos to respect the settled deadline, seemed to me the mood of a newspaper. After all, more than 700 commit in a couple of days is not a usual event.&lt;br /&gt;Maybe it is too late for desktop applications, but KDE Four is a really charming adventure.&lt;br /&gt;&lt;br /&gt;Good Year, KDE; on Monday we have to return to work using Windows :(&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5312149573554041790-2214262860839022056?l=lbellonda.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lbellonda.blogspot.com/feeds/2214262860839022056/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5312149573554041790&amp;postID=2214262860839022056' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5312149573554041790/posts/default/2214262860839022056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5312149573554041790/posts/default/2214262860839022056'/><link rel='alternate' type='text/html' href='http://lbellonda.blogspot.com/2008/01/happy-birthday-kde-400.html' title='Happy Birthday KDE 4.0.0'/><author><name>Luca Bellonda</name><uri>http://www.blogger.com/profile/01526329171154210855</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5312149573554041790.post-3752715204886776053</id><published>2007-12-09T11:31:00.000-08:00</published><updated>2007-12-09T11:35:50.064-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android: how to show items with different styles in a ListView</title><content type='html'>In the Android environment we can visualize ListView items using ArrayAdapter&lt;String&gt; object, which act as interface between textual data representation and ListView. Its constructor accept a layout resource id pointing to a TextView instanced at each data row visualization.&lt;br /&gt;If we have the need to present the various items with different layouts, we can do it in a simple way by using  the excellent engineering of the base Adapter class, adapting it for our needs. Let's suppose to want to show an icon next to the textual item description if item text contains a given character sequence, let's say it starts with 'a' character to make a simple example.&lt;br /&gt;First of all we need two View class derived objects to show the data into the ListView. The first one, 'SView1' in our example, simply derives from TextView class and it will be populated with text string passed as parameter in its constructor.&lt;br /&gt;&lt;br /&gt;public class SView1 extends TextView {&lt;br /&gt; TextView mText;&lt;br /&gt; public SView1 (Context context, String text)&lt;br /&gt; {&lt;br /&gt;  super(context);&lt;br /&gt;  setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,&lt;br /&gt;              LayoutParams.WRAP_CONTENT));&lt;br /&gt;  setText(text);&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;The second one, 'SView2', is slightly more complex and extends LinearLayout, a class designed to group and organize child Views. In SView2 we'll create two children objects, an ImageView to handle the icon, read from the resources, and a TextView which will contains the data strings.&lt;br /&gt;&lt;br /&gt;public class SView2 extends LinearLayout {&lt;br /&gt; String Title="";&lt;br /&gt; TextView mText;&lt;br /&gt; ImageView mView;&lt;br /&gt; public SView2 (Context context, String text)&lt;br /&gt; {&lt;br /&gt;  super(context);&lt;br /&gt;  this.setOrientation(HORIZONTAL);&lt;br /&gt;  setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,&lt;br /&gt;                LayoutParams.WRAP_CONTENT));&lt;br /&gt;  mView = new ImageView(mContext);&lt;br /&gt;  mView.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,&lt;br /&gt;                LayoutParams.WRAP_CONTENT));&lt;br /&gt;  mView.setImageResource(R.drawable.icon);&lt;br /&gt;  addView(mView);&lt;br /&gt;  mText = new TextView(context);&lt;br /&gt;  mText.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,&lt;br /&gt;       LayoutParams.WRAP_CONTENT));&lt;br /&gt;  addView(mText);&lt;br /&gt;  setText(text);&lt;br /&gt;  }&lt;br /&gt; public void setText(String text)&lt;br /&gt; {&lt;br /&gt;  mText.setText(text);&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Now we have only to personalize the data hander, Adapter class. We can create a class that extends directly ArrayAdapter&lt;&gt; class. The data handling methods can be inherited from the superclass, by overloading only getView() method, called by parent ListView, at each data row visualization. What we will do in this method is only to check string content, and decide view type, SView1 or SView2 instantiate. Parent ListView can propose us to reuse an existent View object, if we want to use it, we should check that the proposed View type is coherent with data. Final step is in the Activity object:  we should instantiate an Adapter e populate it with our data. &lt;br /&gt;&lt;br /&gt;I was forgetting: yesterday RubyOnRails 2.0 was born, congratulations.&lt;br /&gt;http://weblog.rubyonrails.org/2007/12/7/rails-2-0-it-s-done&lt;br /&gt;&lt;br /&gt;Adapter:&lt;br /&gt;public class SimpleStringAdapter extends ArrayAdapter&lt;String&gt; {&lt;br /&gt;&lt;br /&gt; public SimpleStringAdapter(Context context, List&lt;String&gt; Items ) {&lt;br /&gt;   super(context,R.layout.a,Items);&lt;br /&gt; } &lt;br /&gt; public View getView(int position, View convertView, ViewGroup parent) {&lt;br /&gt;   String s = getItem(position);&lt;br /&gt;   boolean isType1 = true;&lt;br /&gt;   if( s==null )&lt;br /&gt;    s = "";&lt;br /&gt;   if(s.startsWith("a"))&lt;br /&gt;   {&lt;br /&gt;    isType1 = false;&lt;br /&gt;   }&lt;br /&gt;   if(isType1)&lt;br /&gt;   {&lt;br /&gt;    SView1 theView ;&lt;br /&gt;    if((null==convertView )||!(convertView instanceof SView1))&lt;br /&gt;     theView = new SView1(super.getContext(),s);&lt;br /&gt;    else&lt;br /&gt;    {&lt;br /&gt;     theView = (SView1)convertView;&lt;br /&gt;     theView.setText(s);&lt;br /&gt;    }&lt;br /&gt;    return theView ;&lt;br /&gt;    } else&lt;br /&gt;    {&lt;br /&gt;     SView2 theView ;&lt;br /&gt;     if((null==convertView )||!(convertView instanceof SView2))&lt;br /&gt;       theView = new SView2(super.getContext(),s);&lt;br /&gt;     else&lt;br /&gt;     {&lt;br /&gt;       theView = (SView2)convertView;&lt;br /&gt;       theView.setText(s);&lt;br /&gt;     }&lt;br /&gt;     return theView ;&lt;br /&gt;    }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Activity:&lt;br /&gt;&lt;br /&gt;public class SimpleView extends ListActivity {&lt;br /&gt;  @Override&lt;br /&gt;   public void onCreate(Bundle icicle) {&lt;br /&gt;     super.onCreate(icicle);&lt;br /&gt;     setContentView(R.layout.main);&lt;br /&gt;        &lt;br /&gt;     List&lt;String&gt; items = new ArrayList&lt;String&gt;();&lt;br /&gt;        items.add("a riga 1");&lt;br /&gt;        items.add("a riga 2");&lt;br /&gt;        items.add("b riga 3");        &lt;br /&gt;        items.add("a riga 4");&lt;br /&gt;        &lt;br /&gt;        SimpleStringAdapter strings =&lt;br /&gt;            new SimpleStringAdapter(this, items);&lt;br /&gt;        setListAdapter(strings);&lt;br /&gt;    }&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5312149573554041790-3752715204886776053?l=lbellonda.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lbellonda.blogspot.com/feeds/3752715204886776053/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5312149573554041790&amp;postID=3752715204886776053' title='14 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5312149573554041790/posts/default/3752715204886776053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5312149573554041790/posts/default/3752715204886776053'/><link rel='alternate' type='text/html' href='http://lbellonda.blogspot.com/2007/12/android-how-to-show-items-with.html' title='Android: how to show items with different styles in a ListView'/><author><name>Luca Bellonda</name><uri>http://www.blogger.com/profile/01526329171154210855</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>14</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5312149573554041790.post-8613785336103967448</id><published>2007-12-06T04:29:00.000-08:00</published><updated>2007-12-06T04:37:34.775-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gphone'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Life with Android</title><content type='html'>I was finally able to explore the Android development environment. The first thing I noted is the easy SDK installation process, you only have to unzip a file and to set an environment variable. If you want to use Eclipse as development environment, you need to download a plugin from Google site. A wonderful thing is the porting of the SDK under different Operating Systems: Linux, MacOS and Windows.&lt;br /&gt;The SDK comes with a good emulator included but sometimes, at least in Linux environment, it loses the synchronism with Eclipse in debug phase.&lt;br /&gt;Anyway the tools used under the hood are command line commands, adb in this case, that reside in SDK tools directory, and in a hurry we can kill its process so Eclipse can restart it in its next debug session. The same SDK seems to be the first step toward a more complete system and various features are reporting not working in the project mailing list. All things considered Android is a very good first step, documentation is complete and it covers each toolkit area, but we can expect a good growth. As a pilot project I wrote a little program to read &lt;a onclick="return top.js.OpenExtLink(window,event,this)" href="http://planet.kde.org/" target="_blank"&gt;planet.kde.org&lt;/a&gt;&lt;br /&gt;feeds, one of my favorite sites. I explored some Android technologies, background services, sqlite database, custom views, and integrated browser, and I enjoyed the system very much, even though I didn't explore multimedia features. The project has been published on Google Code at &lt;a onclick="return top.js.OpenExtLink(window,event,this)" href="http://code.google.com/p/planetandroid/" target="_blank"&gt;http://code.google.com/p&lt;wbr&gt;/planetandroid/&lt;/a&gt; address. The license is obviously GPL.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5312149573554041790-8613785336103967448?l=lbellonda.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lbellonda.blogspot.com/feeds/8613785336103967448/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5312149573554041790&amp;postID=8613785336103967448' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5312149573554041790/posts/default/8613785336103967448'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5312149573554041790/posts/default/8613785336103967448'/><link rel='alternate' type='text/html' href='http://lbellonda.blogspot.com/2007/12/life-with-android.html' title='Life with Android'/><author><name>Luca Bellonda</name><uri>http://www.blogger.com/profile/01526329171154210855</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
