<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Google on despatches</title><link>https://icle.es/tags/google/</link><description>Recent content in Google on despatches</description><generator>Hugo</generator><language>en</language><lastBuildDate>Fri, 20 Jun 2025 09:25:00 +0100</lastBuildDate><atom:link href="https://icle.es/tags/google/index.xml" rel="self" type="application/rss+xml"/><item><title>Android - Multi-line Select List</title><link>https://icle.es/2010/04/19/android-multi-line-select-list/</link><pubDate>Mon, 19 Apr 2010 23:37:54 +0000</pubDate><guid>https://icle.es/2010/04/19/android-multi-line-select-list/</guid><description>&lt;p>It turns out that it is surprisingly easy to add a multi line select list to the
UI. There are four main parts to it. The layout file, a subclass to the adapter,
the activity and of course the data itself.&lt;/p>
&lt;p>Lets start with the data. For the sake of this demo, lets use a simple contact
list:&lt;/p>
```java
package uk.co.kraya.android.demos.MultiLineList.domain;

public class Contact {

 private String firstName;

 private String lastName;

 private String mobile;

 public String getFirstName() {
 return firstName;
 }

 public void setFirstName(String firstName) {
 this.firstName = firstName;
 }

 public String getLastName() {
 return lastName;
 }

 public void setLastName(String lastName) {
 this.lastName = lastName;
 }

 public String getMobile() {
 return mobile;
 }

 public void setMobile(String mobile) {
 this.mobile = mobile;
 }

}
```</description><content:encoded><![CDATA[<p>It turns out that it is surprisingly easy to add a multi line select list to the
UI. There are four main parts to it. The layout file, a subclass to the adapter,
the activity and of course the data itself.</p>
<p>Lets start with the data. For the sake of this demo, lets use a simple contact
list:</p>
```java
package uk.co.kraya.android.demos.MultiLineList.domain;

public class Contact {

    private String firstName;

    private String lastName;

    private String mobile;

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

}
```
<p>Some straightforward fields and getters/setters</p>
<p>Next, we need an Adapter. For this one, we will use
a <a href="http://developer.android.com/reference/android/widget/ArrayAdapter.html">ArrayAdapter</a>.
We will extend it so that we can override
the <a href="http://developer.android.com/reference/android/widget/Adapter.html#getView%28int,%20android.view.View,%20android.view.ViewGroup%29">getView method.</a></p>
```java
package uk.co.kraya.android.demos.MultiLineList.domain.adapters;

import java.util.List;

import uk.co.kraya.android.demos.MultiLineList.domain.Contact;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TwoLineListItem;

public class ContactArrayAdapter extends ArrayAdapter {

    private final int resourceId;

    public ContactArrayAdapter(Context context, int textViewResourceId, List objects) {
        super(context, textViewResourceId, objects);
        resourceId = textViewResourceId;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        Contact c = getItem(position);

        // if the array item is null, nothing to display, just return null
        if (c == null) {
            return null;
        }

        // We need the layoutinflater to pick up the view from xml
        LayoutInflater inflater = (LayoutInflater)
                        getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);

        // Pick up the TwoLineListItem defined in the xml file
        TwoLineListItem view;
        if (convertView == null) {
            view = (TwoLineListItem) inflater.inflate(resourceId, parent, false);
        } else {
            view = (TwoLineListItem) convertView;
        }

        // Set value for the first text field
        if (view.getText1() != null) {
            view.getText1().setText(c.getFirstName() + " " + c.getLastName());
        }

        // set value for the second text field
        if (view.getText2() != null) {
            view.getText2().setText("mobile: " + c.getMobile());
        }

        return view;
    }

}
```
<p>The key bit here is the getView method. We pick up
the <a href="http://developer.android.com/reference/android/view/LayoutInflater.html">LayoutInflater</a>
which we can use to pick up the view that defines
the <a href="http://developer.android.com/reference/android/widget/TwoLineListItem.html">TwoLineListItem</a>
view. This allows us to use two different snippets of text as part of the list.
We then pick up the each of
the <a href="http://developer.android.com/reference/android/widget/TextView.html">TextView</a>
items and set the text against them. The formatting of these item are defined in
the xml file.</p>
<p>The TwoLineListItem class also defines a placeholder for the selectedIcon. Check
the documentation for more info.</p>
<p>The xml file for the layout goes as follows:</p>
```xml
<?xml version="1.0" encoding="utf-8"?>
<TwoLineListItem xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">

    <TextView android:id="@android:id/text1"
        android:layout_marginTop="1dip"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="15sp"
        android:textStyle="bold" />

    <TextView android:id="@android:id/text2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@android:id/text1"
        android:layout_alignLeft="@android:id/text1"
        android:paddingBottom="4dip"
        android:includeFontPadding="false"
        android:textSize="15sp"
        android:textStyle="normal" />

</TwoLineListItem>
```
<p>As you can see, we are just defining a TwoLineListItem element with two embedded
TextItems. Tthe android:id parts are important. It ensures that the getText1()
and getText2() methods work as expected!</p>
<p>Finally, we have the activity. In fact, we will be using a
<a href="http://developer.android.com/reference/android/app/ListActivity.html">ListActivity</a>
as follows:</p>
```java
package uk.co.kraya.android.demos.MultiLineList;

import java.util.ArrayList;
import java.util.List;

import uk.co.kraya.android.demos.MultiLineList.domain.Contact;
import uk.co.kraya.android.demos.MultiLineList.domain.adapters.ContactArrayAdapter;
import android.app.ListActivity;
import android.os.Bundle;

public class MultiLineListDemo extends ListActivity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setListAdapter(new ContactArrayAdapter(this, R.layout.main, getContacts()));
    }

    private List getContacts() {

        List contacts = new ArrayList();

        Contact c;

        c = new Contact();
        c.setFirstName("Shriram");
        c.setLastName("Shrikumar");
        c.setMobile("07777777777");

        contacts.add(c);

        c = new Contact();
        c.setFirstName("John");
        c.setLastName("Doe");
        c.setMobile("MOBILE.NUMBER");

        contacts.add(c);

        return contacts;

    }
}
```
<p>getContacts clearly just creates a couple of contacts for the sake of the demo.
its the setListAdapter that is the key here. It creates a new
ContactArrayAdapter that we have written, passes in the context (which is just
the current activity), a resource ID and a List of items to display.</p>
<p>Run it and you should see something like:</p>
<p>
  <img src="/assets/2010/04/multilineselectdemo.png" alt="">

</p>
<p>So easy when you know how. I believe could use a View or a ViewGroup as needed
instead of the TwoLineListItem but I shall leave that to you to discover.</p>
<p>I have included all the files that I created/modified but if you want the whole
project tarred up, just drop me a note ;-)</p>]]></content:encoded></item><item><title>Accepting Google</title><link>https://icle.es/2009/02/10/accepting-google/</link><pubDate>Tue, 10 Feb 2009 11:41:44 +0000</pubDate><guid>https://icle.es/2009/02/10/accepting-google/</guid><description>&lt;p>&lt;a href="http://www.codinghorror.com/blog/archives/001224.html" title="Google monoculture">Jeff Atwood (Coding Horror)&lt;/a>
correctly points out that when we refer to search engines, we are really only
referring to one - &lt;a href="http://www.google.co.uk" title="Google">google&lt;/a>. With its easy to
use, efficient and most importantly effective search functionality, there really
is no reason to use another search engine.&lt;/p>
&lt;p>Jeff raises a couple of valid points. With no viable competition, where is the
incentive for them to improve the functionality.  It&amp;rsquo;s pleasant to see that
google still invests time and money into improving features including the
ability to personalise your search results. However, the question of how long
they will keep doing this is worth asking&amp;hellip;&lt;/p>
&lt;p>The more interesting point that Jeff raises is:&lt;/p>
&lt;blockquote>
&lt;p>&amp;ldquo;I&amp;rsquo;m a little surprised all the people who were so
&lt;a href="http://en.wikipedia.org/wiki/United_States_v._Microsoft">up in arms about the Microsoft &amp;ldquo;monopoly&amp;rdquo; ten years ago&lt;/a>
aren&amp;rsquo;t out in the streets today lighting torches and sharpening their
pitchforks to go after Google.&amp;rdquo;&lt;/p>&lt;/blockquote></description><content:encoded><![CDATA[<p><a href="http://www.codinghorror.com/blog/archives/001224.html" title="Google monoculture">Jeff Atwood (Coding Horror)</a>
correctly points out that when we refer to search engines, we are really only
referring to one - <a href="http://www.google.co.uk" title="Google">google</a>. With its easy to
use, efficient and most importantly effective search functionality, there really
is no reason to use another search engine.</p>
<p>Jeff raises a couple of valid points. With no viable competition, where is the
incentive for them to improve the functionality.  It&rsquo;s pleasant to see that
google still invests time and money into improving features including the
ability to personalise your search results. However, the question of how long
they will keep doing this is worth asking&hellip;</p>
<p>The more interesting point that Jeff raises is:</p>
<blockquote>
<p>&ldquo;I&rsquo;m a little surprised all the people who were so
<a href="http://en.wikipedia.org/wiki/United_States_v._Microsoft">up in arms about the Microsoft &ldquo;monopoly&rdquo; ten years ago</a>
aren&rsquo;t out in the streets today lighting torches and sharpening their
pitchforks to go after Google.&rdquo;</p></blockquote>
<p>My view on this is straightforward. Yes, google is a monopoly on the search
market. There is no viable competition. Yes, it possibly uses this position in
the market to push itself out more and more to the masses.</p>
<p>However, the reason Microsoft got into the bad books (at least for me) is that
while it provided (or provides) fantastic software - it doesn&rsquo;t treat its
customers fairly. Bundling Internet Explorer with windows is fine IF it also
bundled Netscape/Firefox which was/is a strong competitor and the only reason
people did not use them was lack of experience / knowledge of the option.</p>
<p>The reason google is successful is because it is the only viable choice. There
is no other option. If Internet Explorer had no competitor. Then, its fine to
include that exclude the others.</p>
<p>Then there is the unfairness in how Microsoft priced the products in relation to
the number of issues / bugs that were in the product. Not to mention the feeling
that, as customers, you were paying for the privilege of beta testing software.</p>
<p>As a software engineer, I am well aware of the issue around bugs. They are
present, and always will be. That&rsquo;s the nature of software. The issue is not
just the number of bugs that are present in software shipped but also the amount
of time it takes to resolve them.</p>
<p>It&rsquo;s not the monopolisation of the market that &ldquo;got them&rdquo;. It was their
attitude. The monopolisation of the market was the tool used to get them. Kinda
like Al Capone being arrested for Tax evasion instead of all the other crimes he
commited since that was the only way to get him.</p>]]></content:encoded></item><item><title>Bad Google</title><link>https://icle.es/2009/01/31/bad-google/</link><pubDate>Sat, 31 Jan 2009 19:09:31 +0000</pubDate><guid>https://icle.es/2009/01/31/bad-google/</guid><description>&lt;p>I stumbled across [a post by a Mark Ghosh, an unhappy orkut
user](&lt;a href="http://weblogtoolscollection.com/archives/2009/01/31/et-tu-google-then-fail-net-safety/%7b">http://weblogtoolscollection.com/archives/2009/01/31/et-tu-google-then-fail-net-safety/{&lt;/a>
which covers a very basic and age old security flaw within Orkut, a social
networking site similar to Facebook / MySpace which is now owned by Google.&lt;/p>
&lt;p>Google, one of the largest corporations in the world went through and acquired a
whole bunch of online communities and this is all fine. However, should a
company of this calibre not be more careful about associating with a website
that has such a silly but serious security flaw. A flaw that could probably be
resolved within an hour of work. I appreciate that there are probably numerous
other issues that the site has...&lt;/p></description><content:encoded><![CDATA[<p>I stumbled across [a post by a Mark Ghosh, an unhappy orkut
user](<a href="http://weblogtoolscollection.com/archives/2009/01/31/et-tu-google-then-fail-net-safety/%7b">http://weblogtoolscollection.com/archives/2009/01/31/et-tu-google-then-fail-net-safety/{</a>
which covers a very basic and age old security flaw within Orkut, a social
networking site similar to Facebook / MySpace which is now owned by Google.</p>
<p>Google, one of the largest corporations in the world went through and acquired a
whole bunch of online communities and this is all fine. However, should a
company of this calibre not be more careful about associating with a website
that has such a silly but serious security flaw. A flaw that could probably be
resolved within an hour of work. I appreciate that there are probably numerous
other issues that the site has...</p>
<p>However, if the security of the site is not given any priority, how can we, as
the masses place so much trust into an organisation that we trust to perform our
searches, store our emails (GMail), our files(Google Docs) and trawl through our
websites to make it searchable and available to the masses?</p>
<p>In all honesty, if Google cannot allocate enough resources to at least fix
security issues within its products, perhaps, they should at least shut them
down to limit the damage hackers can do to legitimate users.</p>
<p>Sure, if someone falls for a scam and accidentally gives out their password,
they end up paying a price but having zero control over being able to resolve it
is unacceptable. A user should be able to change their password and know that
someone who had your old password can no longer log in...</p>
]]></content:encoded></item><item><title>Building A Website</title><link>https://icle.es/2009/01/12/building-a-website/</link><pubDate>Mon, 12 Jan 2009 00:39:12 +0000</pubDate><guid>https://icle.es/2009/01/12/building-a-website/</guid><description>&lt;p>Most people would think that building a good website is straightforward and it
was. A few years ago, when the web was still relatively new, it was easy enough
to put together a designer and a developer and you could get a reasonable
website as the end product.&lt;/p>
&lt;p>However, in the modern age of websites, this kind of a websites simply does not
cut the mustard. It is of course adequate, but simply feels a little lacking.&lt;/p>
&lt;p>There are several websites that I have recently come across that excel in
design - they have fantastic design but when it falls down when it comes to
usability or functionality. The websites of some graphic design agencies are
prime examples of this.&lt;/p>
&lt;p>On the other hands, we have highly functional websites with a wide range of
features and functionality. The website might even be attractive but fails
terribly in terms of usability. &lt;a href="http://www.sf.net" title="Sourceforge">sourceforge&lt;/a>
is a very good example of this. I used to use it a lot a few years ago but its
usability has gotten worse in the last few years, not to mention the fact that
it seems to have slowed to a crawl. I still use sourceforge now and again to
look up pieces of software but I don't look forward to it.&lt;/p></description><content:encoded><![CDATA[<p>Most people would think that building a good website is straightforward and it
was. A few years ago, when the web was still relatively new, it was easy enough
to put together a designer and a developer and you could get a reasonable
website as the end product.</p>
<p>However, in the modern age of websites, this kind of a websites simply does not
cut the mustard. It is of course adequate, but simply feels a little lacking.</p>
<p>There are several websites that I have recently come across that excel in
design - they have fantastic design but when it falls down when it comes to
usability or functionality. The websites of some graphic design agencies are
prime examples of this.</p>
<p>On the other hands, we have highly functional websites with a wide range of
features and functionality. The website might even be attractive but fails
terribly in terms of usability. <a href="http://www.sf.net" title="Sourceforge">sourceforge</a>
is a very good example of this. I used to use it a lot a few years ago but its
usability has gotten worse in the last few years, not to mention the fact that
it seems to have slowed to a crawl. I still use sourceforge now and again to
look up pieces of software but I don't look forward to it.</p>
<p>Then you have the rare gems, that are exceptionally usable and functional.
<a href="http://www.google.co.uk" title="Google">Google</a> is an excellent example of this. Note
however, that the design of google in minimal.</p>
<p>Having worked in the web for numerous years and having used more websites than I
could possibly count, I strongly feel that the medium that is the web is heavily
under-utilised.</p>
<p><a href="http://www.facebook.com" title="Facebook">Facebook</a> is a good example of some of the
good things you can do with web. Things just feel a lot more natural. If you
take the news feed, you can hover over an item to see the menu at the top right
that lets you set your preferences for that particular item.</p>
<p>Same with your wall, hover over an item on your wall, and you see a menu option,
click on it and you get relevant options.</p>
<p>This is a simple and minor thing. However, this brings in the concept of context
and I think that context is largely ignored in all applications. However, it
should be easier and much more useful to have context sensitive commands /
functionality within websites.</p>
<p>Now, If facebook was to take it one step further and allow you to right click
anywhere on a news item and then choose one of the options, that would be even
better - save me from moving the mouse to the menu.</p>
<p>Another excellent thing Facebook has done is provide the ability to comment on
most things that someone does. Social interaction can take a website from zero
to hero in an instant. How can you allow your customers / visitors to interact
with each other. Even better - Can your website integrate with Facebook and
allow your visitors / customers to use the interaction capabilities of Facebook
to drive your site further?</p>]]></content:encoded></item></channel></rss>