Showing posts with label Gadget. Show all posts
Showing posts with label Gadget. Show all posts

Wednesday, November 5, 2008

Tip, Finding out user idleness.

When the user is not currently at the computer it can be a good idea to ignore some functions. You can find out if the user is in idle state with a framework method, framework.system.user.idle. That method will return a Boolean value, true or false. If the user is idle it'll return true.

For example:

if(framework.system.user.idle)
{
//The user is in idle state
}
else
{
//The user is not in idle state
}

Tuesday, November 4, 2008

To access elements and childs from Javascript to your XML

You'll probably already know how to access an element from Javascript, By it's name. But what if you added a dynamic elements from Javascript and then wanted to access them all again? One by one, by the names? Sounds harsh. The solution is to loop through the all. This can be done in several ways but I'm going to show you one.
If you have a combobox in your gadget and add dynamic items and labels to it by the method appendString. It's impossible then to access them by name as they don't have one yet. But imagine this, we write a combobox in the XML file like this:

<combobox name="cb"
height="100" width="125"
itemWidth="100%"
itemHeight="16"
maxDroplistItems="5"
type="droplist">
</combobox>

Then we fill the combobox with items containing labels from javascript coding:

for(var i = 0; i < array.length; i++)
{
cb.appendString(array[i].name);
}

An array with names will be filling the combobox here, the result in xml would look like this:

<item>
<label>Name 1</label>
</item>
<item>
<label>Name 2</label>
</item>...

Now, how do we do if we want to put a property to the labels, lets say a different size? By this, from javascript again:

for(var i = 0; i < cb.children.count; i++)
{
element = cb.children.item(i).children.item(0);
element.size = 7;
}

By the children property we can access all elements to the combobox and then access that particular item. You see you have to first get the children of the combobox and that are the <item> elements, from there we have to access their children and they are the <label> elements. There are other ways to access elements in the XML file from javascript, this was one way. Instead of writing item(i) or item(0) you can access a child by it's name by writing the name instead item("childName"). Also you can use the enumerator object.

Monday, November 3, 2008

Making your gadget interactive with the web

Offline gadgets are cool but sometimes you may want to interact the web with your gadget, request or send data to and from your gadget to some server. Gadgets can be very powerful with some simple Ajax functionality. With the XMLHttpRequest (XHR) object this can make it all possible. It's not hard to implement and neither to use.

I'm not going to explaine how it works, there is a very well written article to be found here explaining what it does and how, code snippets to use.

Gadget Designer

Gadget Designer is a tool, an IDE or Integrated Development Environment for creating a Google Desktop gadget. The tool will help you build a desktop gadget and provide a WYSIWYG for the UI and instead of running it in the sidebar you can use the tool to directly run it in the tool. The Gadget designer comes with the SDK.

Using the tool is better than working in Worpad. The most value about the tool is probably that you can run the Gadget directly with the program, that will safe you some time. Not all the times are the Gadget designer compatible to run your gadget or even render your UI, one example could be when you are using an element. And soon you'll have to write most of it's functionality in code mode. There are improvements to be made but it's very nice anyhow that you'll get a designer tool with your SDK.

Another nice thing about the tool is that you can debug your gadget while it's running. Using a trace method write this "gadget.debug.trace(string)". That will show a trace message in the console and when you have debug console active.

Desktop Gadget Designer

Monday, October 20, 2008

Starting with Google Desktop Gadget API

So now you have decided to start making something of your own, a good decision. So what you need to do now is make sure you have installed Google Desktop by this time and the latest release. Otherwise download Google Desktop. Google desktop download for Mac user's and Linux user's.

Some pre-conditions before programming your own gadget are that you know at least the basic of JavaScript and are familiar with the XML syntax and have XHTML knowledge will make it easier. Otherwise a good resource to learn more about these 3 techniques are at w3schools.

Download the Google Desktop SDK, you'll need that one. Unpack the SDK somewhere. Then read the documentation for Gadget API. Follow the tutorials, Modifying Hello World and Using gadget designer is the most important ones to start with.

When you are finished with that it's important to continue reading and understand the API overview with instructions for creating the files that's needed for a desktop gadget, look at the document Creating a Gadget.
It's probably very value for Mac users that you make your gadgets supported Mac platforms if possible, read Writing a Cross-Platform Gadget.
It's good with Guidelines for gadgets to improve the overall quality , read the Gadget Design and Testing Guidelines.

Have a look at the Gadget API reference, that one is always good to have open while programming. The SDK comes with several examples, they are a good resource. Good luck now with your start.

Looking at the different Gadget API's

If you are planning to make, write or rather program your own Gadget you will probably need to take a look at the Gadget API.

So why program your own Gadget? You may want to reach out to million of users who can use your Gadget, reach out with your information or service. Promoting your product. Provide functionality to users. Or just for fun...

First you need to know what type of Gadget you want to make. Do you want it to run on websites or in Google Desktop, the sidebar? If you want to make a Gadget that runs on a website take a look at this Gadget API. Else if you want to make a Gadget that runs in the sidebar you should take a look at this Gadget API for Google Desktop.

I'm not going to look at the Gadget API especially for websites. I'm going to work with the Google Desktop Gadget API mainly for desktop applications. There are 2 different Google Desktop API's, Gadget API and the other one is Search API. Both of them use the same SDK.


Saturday, October 18, 2008

Google Desktop sidebar vs Windows Vista sidebar

In the previous post I took a closer look at Google Desktop sidebar and gadget. In this post I'll compare Google Desktop sidebar, gadgets with Windows Vista sidebar gadgets.

Sidebars, Side by side. Not if Google can decide. Google's sidebar really want's to be the only sidebar used, so can we have the both? If you have Windows Vista's sidebar already running it'll be closed when Google Desktop sidebar starts up. Even if Vista's sidebar is using another position. However it's possible to both run Vista's sidebar and Google's. If Google's sidebar is started up first you can start up Vista's sidebar. A very good idea is to have them on their different side even if you don't have Google desktop sidebar in sidebar mode or have Vista's sidebar closed.

Sidebars, Side by side.

Comparing them the sidebars, they are pretty much like to each other. They have the same opportunity to have add, remove, move, dock and un-dock. With Vista's sidebar you can page gadgets while you can't do that with Google's. The width is re-size able with Google's so that gives the developers making a gadget the opportunity to use more space considering the width of the sidebar. But at the same time it could be a big drawback, why? Because all users may not want a for example 300px width sidebar and the gadget that was more fit for 300px wide sidebar does not at all fill it's use in a 150px width sidebar. So in a developers perspective you need to remember that if the gadget is not used un-docked it must have a layout that is re-size able with the most common range of size.

Adding and finding new gadgets seems to be much more easier with Google desktop sidebar and delivers a bit more then Windows Vista's sidebar. As I did explained in the previous post adding a gadget to Google's sidebar, how to add. In Vista's sidebar when adding a gadget you'll have a few gadgets, the ones you have installed and some who you had installed and when you are going to get more gadgets you need to go to a linked resource website to find those.

You could also un-dock all gadgets both in the Vista sidebar and Google's sidebar and then hide them both. Google's sidebar have thou 3 more options how to display the sidebar as I've also covered in previous post.

Windows Vista's configurations are pretty simple and few but that's not the same case with Google's sidebar. There are pretty many configurations for Google's sidebar. Most of the global settings are made in the properties for the sidebar.

With some of the Google gadgets you can connect with your Google account. By doing this data can be saved and loaded from your account. For example you maybe want to save something important in the calendar for a special date and then be able to access that from other places. A Google account can be your solution for that. The Google calendar service is still in Beta when writing.

To save space on the desktop Google gadgets are probably the one that's most effective (collapsing) while Windows Vista gadgets can't be collapsed. Only the opacity can be changed which is also a good idea if you think the gadgets are a bit annoying seeing clearly all the time.

Gadget with 20% opacity (Left) Collapsed Gadget (Right)

Comparing Design Google Sidebar and gadget vs Vista sidebar and gadget.
The difference between the visual Google's Desktop sidebar, in sidebar mode and Vista sidebar is not so big but you feel that it's strong associated with the Google brand. You'll clearly see the Google logo both at the top of the sidebar and at the bottom in the search field. In my opinion the Google logo at the top is not necessary as you find it in the search field. You get the feeling of a commercial product. Vista's sidebar is more neutral but it is not strange that Google is a bit aggressive neither bad to infiltrate Microsoft's operating systems with alternative chose. One thing as I have mentioned before is that Vista's sidebar seems to be missing an interface by finding other gadgets, you'll need to browse a web page. On the other hand you'll need to browse a web page to configure Google's sidebar. The style of the gadgets are nearly the same but much depends on how the developer has designed the gadget. Choosing a sidebar by design is not such a giving idea.

In the next post I'll look at the Desktop Gadget API.

Thursday, October 16, 2008

Closer look at Google Desktop sidebar and Gadget

What are Gadgets?
Gadgets can be placed in the Sidebar or anywhere on your desktop, on your iGoogle page or even any other page including yours. We also know that gadgets are mini applications that shows you some information and often also provides functionality. Informative gadgets could be, showing the latest news lines or the weather. Gadgets may also provide functionality, that could be for example a clock, multimedia control or a to-do list.

How do a Gadget work?
In somewhat technical term a Gadget is a simple XML and JavaScript mini application that can be embedded in web application, other applications and at your desktop.

Not all Gadgets works everywhere.
A good thing to know is that when a Gadget is written it may be written as a desktop mini application or to use as a web application. That's why you don't find Gadgets available for the Desktop in a web application and vice verse.

Why use Gadgets in the sidebar?
As I explained first, that they provides you information and functionality. In the sidebar It may be easier just to check or use your sidebar then to open a website to get the information. In the sidebar It may also be easier if you can control something from there instead of opening some sort of program or setting.

Working with Google Desktop Sidebar.


Placing the sidebar. We have 3 and 5 ways how to place and display the sidebar. We can chose to place the sidebar with the options sidebar, deskbar and floating deskbar.

As default it comes placed as with the option sidebar. With this option it'll work as a sidebar and be placed either on the left or the right side of the screen. You may also prefer to use the option always on top.

Setting the sidebar to Always on top, gives you faster overview of the information and functionality. Doing this will take some place of your screen and working space. But with today's computer screen which are wide there will be a lot of space free anyhow for normal users. With a small computer screen may be a pain to have it on top as your working space will be very limited. If you use dual screens you'll have an excellent opportunity to use the sidebar at the second screen, the left side if you align the screen to left.

When you work with the sidebar mode, using it on top or with a second screen and gets used to it's functionality it may feels sometimes a bit worthless to even have a task bar in Windows. In fact most of the functionality could move over to the sidebar.

In we use the option deskbar in the sidebar it'll place itself as a search field in the taskbar in Windows. The gadgets that was docked in with the sidebar mode or option are hidden now. All un-docked gadgets are still available on the desktop.

Deskbar option

The last option to place the sidebar is floating deskbar. This will turn the sidebar into a singel search field on top of other windows, and all Gadgets that was docked in the sidebar are now hidden.
Floating deskbar option

If we don't want to display or use the sidebar just chose the option None.

Add functionality and information to the Sidebar, adding gadgets.
Adding more gadgets is easy. Just by clicking on the plus sign or by right clicking on the sidebar. Doing this a new window will be opened with some available gadgets.

Adding Gadgets

You can chose from sorted categories to the left and search others on the right upper corner. You can also chose gadgets in multi languages. When clicking on the Add button in the Gadget will install the gadget right away after you have confirmed it in a pop-up windows.

You can un-dock any gadgets to the desktop and place them freely wherever you want. By doing this will automatically toggle the expanded view which is available to use when they are docked with the sidebar. Many of the gadgets has their personal configurations. To save space on the desktop you can often collapse a gadget. To remove a gadget simple click on the cross or right click and remove.

Collapsing gadgets

If you have installed Google Desktop on several of computers you may want to get your gadget contents and settings to all. This is available by right clicking at the sidebar, click at Configure gadgets and then check the box "Save my gadget content and settings so I can access them from any computer". Note that not all gadgets supports that, look at the Configure gadget windows which gadgets are supported.

In the next post I'll be comparing Windows Vista sidebar, gadgets and Google Desktop sidebar, gadgets.

Sunday, September 28, 2008

Getting Started with Google Desktop

Now that we know what Google Desktop is, it's time to getting started with it.
First of all you need to go and download it from http://desktop.google.com/ Note:Google Desktop is free to download.
It's available (when writing) for Windows XP or Vista, Mac OSX 10.4+ and Linux users. Note that Google Desktop doesn't fully support 64 bit Windows (x64). If you try to install Google Desktop on a 64bit Windows you'll get a message saying that it's not currently compatible with your operating system. It requires a 32 bit version of Windows Vista, Windows XP or Windows 2000 with Service Pack 3 or above. Anyhow there is a way to go around this compatibility problem. By opening the command promt with Run in Windows, writing cmd.exe. Then you locate the installation file "GoogleDesktopSetup.exe" and write this "GoogleDesktopSetup.exe /force". By doing that it'll force to install Google Desktop on your computer but Not all features will be available with 64 bit's Windows. The sidebar will work on 64bit but the search wont. The Google Developers of the Desktop application is of course aware of this and there will be a support for 64 bit's later on. On the other hand, there are support for 64bit Linux version.

After the installation is completed Google Desktop will start up automatically and also each time you reboot your computer. As I wrote before in a previous post Introducing Google Desktop it'll start indexing files on your computer automatically when your computer is idle, and that is to say more than 30 seconds. It has a real time indexing, it'll continuous index files as you open a file or update a file. Note that it also includes a web page. The indexing will continue for some minutes to a couple of hours depending on how many files you have stored on your computers hard driver.

There are some few options and status regarding the indexing if you click at the icon in the taskbar. You can pause the indexing for 1 hour or re-index everything, also there is a status for the indexing. Also you'll find others settings if you click at Options.

It's pretty obvious how to search with Google Desktop. There are several of ways, maybe to many?
  • Through the search field in the sidebar.
  • Through the search field in the floating deskbar.
  • Through the search field in the deskbar.
  • Click on the icon in the taskbar.
  • Press twice on the "Ctrl" button.
  • Clicking on the Desktop link at Google's homepage (The preferred way if you want to use the advanced search options).
Google Homepage Desktop SearchGoogle Homepage Desktop search

The main thing with the Desktop sidebar is probably the gadget function. You can have a personalized sidebar with any gadgets that are available to download. Gadgets to show you new emails, weather report, photos and customized news. Gadgets that are included are Analog clock, weather, scratch pad, web clips, news and photos. Not only that they can be added to the sidebar but can also be integrated with your personal iGoogle page. To add new Gadgets to your sidebar you do this by right clicking somewhere at the sidebar and choose Add Gadgets or on the "plus" button on the sidebar. There is no need to install any other external programs when adding a new gadget. The new gadgets will be instant added to the sidebar. You can place the gadgets outside the sidebar by dragging the gadgets to the desktop. By clicking on the Desktop icon you can choose how Google Desktop will be visible and by choosing Floating deskbar the Sidebar will be hidden.

I'll be digging deeper in both the Search- and the Gadget function. Compare the Desktop search with Windows search. Compare Windows Sidebar with Desktop sidebar. Working with the Gadget API. Writing your own gadgets and more.

References:
Google Desktop Download
http://desktop.google.com
Google Desktop - Getting Started
http://desktop.google.com/en/gettingstarted.html

Saturday, September 27, 2008

Introducing Google Desktop

Beginning with Google Desktop.
We know that you have lots of information stored on your computer. Wouldn't it be great if you could find what you need when you need it?
Main parts with Google Desktop is that it makes searching your computer as easy as Google Desktop Sidebarsearching the web with Google. It's a desktop application that makes your computer search able by indexing your local files on your computer such as email, music, photos, videos, word, excel, chat conversations etc. Of course does it also provide web search.

When you make a Desktop search (a search for local files) you'll go to a local web page showing you the most relevant search results as you are used to when making a web search at Google. You have some filter opportunities for your search result. There is also a preview file function so you don't have to wait for an external application to open a file. When making a search on the Desktop homepage there are some advanced search options provided to refine the search.

The Desktop search doesn't work if there are no files indexed. After you install it, it's supposed to start indexing the email, files and web history stored on your computer, but if it doesn't automatically start index you may have to change the options so it does that. This is a one-time indexing and to not slow down the performances of your computer it only index files while the computer is idling. The Desktop also updates your index by adding new for example emails as you receive them.

The Desktop does also provide function to find deleted files. How Google Desktop do this is by creating cached copies of your files each time you view them, and stores these copies on your hard drive.

But that's not all. Not only that Google Desktop makes your local files search able with the app, it also provides information from the web and help you organize with Gadgets and the Sidebar. Google gadgets are mini applications that can be placed on your desktop, in the Sidebar and also be integrated with your iGoogle page. Gadgets can show you the latest news, photos, weather etc. The Sidebar is a vertical bar on your desktop which basically functions as a control panel for your gadgets. You have a full control to add and remove gadgets and place them freely wherever you want on your desktop.