Monday, 1 April 2013

Getting Started with SVG Animation

With HTML5, you can embed SVG images inline in your Web pages. Although the level of support for some of the SVG elements still has a long way to go, there are many advantages to using these graphics. Since you create the SVG code in XML in your pages, you can also implement animation and interaction on the contents of an SVG. SVGs are also scalable at any level, so are ideal for catering to different user environments.

In this tutorial we are going to look at basic animation within SVG elements in HTML5 pages. The results will not work in all modern browsers. Although inline SVG is in itself supported in all current versions of the major browsers, the animation elements are not. You will be able to see some of the effects in both Firefox and Chrome, but the effect in which we animate colour can only be reliably viewed in Chrome at the moment. As is always the case with HTML5 skills, this is more of a preview of what we will be able to do in the near future than a practical guide of techniques you can rely on already, so make sure you include alternatives in your live sites. You can see the demo now for an indicator of what we are working towards.

Create an HTML5 Page

Start by creating a new HTML5 page using the following outline:
<!DOCTYPE html>
<html>
<head>
</head>
<body>

</body>
</html>

We won't be using any scripts or CSS in the head section for this tutorial, however, you can use both to apply effects to the elements inside SVGs.

Create the SVG Element

In the body section of your page, add the SVG element as follows:




The remainder of our code will be placed between these opening and closing tags. The main attributes to pay attention to in the opening SVG tag are the dimensions. You can alternatively specify relative percentage values for the width and height if you have CSS dimensions set for the containing page element.

Add the Definitions

The SVG is going to contain shapes, definitions of gradients and animations. Let's start by defining a couple of gradients. The SVG is going to contain a simplistic representation of the sun rising against a blue sky background. In an SVG, you define re-usable items such as gradients in the dedicated defs section, so add it inside the SVG element first:




Inside this section, place a gradient to represent the sky background:

 
 


This is a linear gradient, with an ID so that we can apply it to our shapes when we create them. The x1, y1, x2, y2 attributes represent the start and end co-ordinates of the gradient. In this case we want the gradient to unfold vertically so the start point is the top left corner and the end point is the bottom left corner. The stop elements represent points in the gradient - in this case it is going to go from one shade of blue to another, will full opacity throughout.

Now add a radial gradient for the sun:

 
 


In this case we define the central points of the start and end circles of the gradient - it will spread from the center of the circle shape to its outer edges. The first colour stop starts 20% into the gradient, so there will be an area of solid colour at the centre.

Add the Shapes

The SVG is going to display a rectangle background and circular sun. First add the rectangle, after the closing defs tag but still inside the SVG element:




You can include a shape using a single self-closing tag, but we are going to include the animation properties inside the rectangle element, so we separate the opening and closing tags. The rectangle properties include the x and y co-ordinates for its top left corder and the width and height, which we set to cover the whole image. We set the gradient we defined in the defs section by referring to it in the fill attribute.

Now add the circle element for the sun:




The circle is defined using the co-ordinates for its central point and the length of the radius. Again, we specify one of the gradients already defined. The circle will be in the center of the image, occupying 80% of the total width (twice the radius).

Animate Movement

If you open your page now you will see a static image of the sun in front of the sky background. Now we can add some animation using the SVG animation elements, which come from SMIL animation. First, to animate the sun, making it move into the image as though rising from the horizon, add the following animate element inside the circle element:


This element specifies an animation that will move the circle element on the y axis, which we specify by referring to the cy attribute of the circle. The attribute type tells us what type of animation this is. The from and to attributes indicate the desired start and end positions for the circle. The begin attribute indicates that the animation should start immediately and the dur attribute that it should last 5 seconds. Setting the fill attribute to freeze stops the circle from going back to its original position when the animation has elapsed.

Animate Opacity

As well as moving the circle, let's fade it in at the same time. Add the following animation, also inside the circle element:


This time the animation is on a CSS property - the opacity. We want the circle to go from zero to full opacity, to last 5 seconds and to execute once.

Animate Colour

Let's also animate the sky to complement what is happening with the sun. This animation has less browser support at the time of writing, so you may need to view the page in Chrome to see it in action. Add it between the opening and closing rectangle tags:


This is an animateColor element, which animates a change in colour over 5 seconds. The animation uses the same colours we specified in the linear gradient for the sky - browsers without support for the colour animation will simply display the gradient instead.

Conclusion

That's our basic animation complete. Open your page in a supporting browser to see the result. You should see the sun shape rise up into the image while fading in, as the background changes colour from one shade of blue to a darker one. Check out the demo to see what it should look like. This is really just the beginning when it comes to SVG animation, as there are other elements for transformational animations such as rotations and translations. With any luck you'll be able to use them for more and more users as time passes, but for the moment these effects must necessarily be used with caution.

Monday, 22 October 2012

Introduction to Android Technology

Android technology is used in mobile computing devices and is among the fastest growing mobile technologies in use. Many business and personal users manage their work and personal communications on Android devices. The Android system provides users with a range of standard applications, with many more available for download and installation. Android devices facilitate communication, Internet, social media, business, productivity and leisure activities. Many companies target the Android platform with mobile apps, providing Android users with access to commercial and other services.

Operating System

Android is a mobile platform, with versions of the Android operating system running on millions of devices across the globe. Multiple versions of the Android operating system have been released since the platform launched. Users of devices with the Android system installed can access communication functions such as mobile telephony and text messaging. Android devices are also enabled for Internet access, either through wireless networks or through the mobile network in the case of smartphones. Since Android devices provide Internet access, users can utilise Web services such as email, Web browsing and social networking.

Devices

Android runs on mobile computing devices, particularly smartphones and tablet PCs. These devices use interaction through touch screens, in conjunction with buttons and sometimes trackballs, although this varies between devices. The screen sizes on Android devices vary from small smartphones up to larger tablets. Although the tablet market is increasing, Android is run primarily on smartphones, so Android devices typically facilitate telephony functions. Since Android runs on mobile devices, many apps for the platform are designed to facilitate mobile connectivity.

Applications

Devices running the Android system ship with a variety of basic applications pre-installed. These basic applications include those for making phone calls, sending text messages and managing contacts, as well as Internet applications for emailing and browsing the Web. Android users can also install additional apps from the Google Play store. Google Play is the official marketplace for Android apps. Some of the apps are free to download and install, with others available commercially at a fixed price in the user's currency. Google Play features a wide range of applications for business, entertainment, productivity, office and other organisational tasks.

Development

Software developers can create apps for the Android marketplace, releasing them through the Google Play store so that users can purchase them. Android developers write apps in the Java programming language, with certain application resources defined using XML markup. Some apps also involve other technologies such as SQLite for database development. To create Android apps, developers download and install the Android Developer Tools and SDK (Software Development Kit). The tools are designed to work with the Eclipse IDE (Integrated Development Environment). Once an app is ready for deployment, the developer can export and publish it through the Google Play store, with various signing and versioning requirements that must be met before an app can be made available for download.

References

Android Developers: Welcome

Monday, 8 October 2012

Accounts Payable Spreadsheet in Excel - How To

Anyone who runs a business needs to keep track of any outstanding amounts owed to creditors. With a spreadsheet, you can track and manage accounts payable for your business, ensuring that you meet your financial obligations and keep your business on track. Accounts payable spreadsheets can also provide a useful reference if you encounter any queries about past payments later on. Creating an accounts payable spreadsheet requires a few steps that anyone can carry out, even if you have no experience with accounts.

1

Open Excel and create a new workbook. In Excel, select "New" from the "File" menu then choose "Blank Workbook" from "Available Templates." In the worksheet that opens, enter a heading for each data item you want to store for each accounts payable record, adding each heading to a cell in the top row. Common data items to record for accounts payable include the date an invoice was received, the creditor, for example using any account or invoice reference numbers you have, the amount and when the payment is due. You can also include a column representing the date on which an amount has been paid if you wish to keep records in the spreadsheet after payment occurs. In this case you would need to update the amount in the column representing funds owed when you settle a payment.

2

Enter some accounts payable data. Add some actual records to your spreadsheet so that you can be sure you have all of the rows and columns you need. Try to use real data from your accounts, including the reference numbers or other identifiers you use within your organization to refer to the creditors in question. If you find that you do not have sufficient columns, you can add new ones by right-clicking within the worksheet and choosing from the Insert menu. Add a new heading at the top of any new columns you insert.

3

Perform calculations on your data. You can use spreadsheet functions to apply calculations to your accounts payable data. For example, you may wish to include a cell in which you calculate the total amount currently outstanding to your creditors. You can do this by selecting all of the values in the column representing the amounts owed, plus an empty cell under them, then clicking the AutoSum button. The new cell will automatically update to include the total of amounts listed in the spreadsheet. For this total to remain accurate, you will need to update records as you make payments to settle any amounts listed in the spreadsheet.

Notes
  • You can use an accounts payable spreadsheet in conjunction with other spreadsheets for your business, for example to keep a running total of the liability amounting from your outstanding bills.
  • If you plan on using the accounts payable spreadsheet as your main reference for making payments to creditors, you must ensure you enter each amount owed as you receive bills or invoices.


Related
Microsoft Office: Basic Tasks in Excel 2010

Monday, 3 September 2012

Google AdSense Basics

Google AdSense is a platform for Web publishers who want to include advertisements on their Internet properties. If you run a website or blog, perhaps for a business, you can serve Google adverts on it as a way to monetize it. If you want your adverts to be displayed through the AdSense network, you need to sign up to Google AdWords. When you use AdSense as a publisher, you have a range of options in terms of how the resulting adverts appear within your sites.

Publishers

You can use Google AdSense on any websites you have, including blogs. To become part of the program, you need to sign up for an AdSense account. Once you have signed up you will be able to access code that you can place on your sites. Wherever you place the code is where the adverts will appear. If you use the Blogger blogging platform, the process of adding adverts to your posts (and blog in general) is automated. Many sites use AdSense to monetize projects, however you do need a lot of website traffic to make significant amounts of income this way. It also helps if your website content is on topics that advertisers are looking to target.

Targeted Adverts

Advertisers use Google's platform to target potential customers. Rather than paying for adverts on any site, Google lets businesses target users who are more likely to be interested in their products and services. For example, if you run a blog about credit cards, companies advertising credit cards may like their adverts to be on your site as your readers are interested in their product area. Google AdSense adverts are therefore targeted, so the ads that appear on your site will be relevant to its content. For advertisers, this is key to the appeal of Google's model, as it means that their advertising investment is being used in a way that is more likely to have positive results. In some cases advertisers only pay Google when their adverts are actually clicked.

Revenue

Earnings from AdSense are calculated using two factors: impressions and clicks. Impressions are a measure of how many times the pages you have adverts on have been viewed. Clicks are your website users actually clicking on the adverts. The amount you earn varies depending on the price of the adverts on your pages. The advertisers do not pay set prices for every advert, as the price varies according to the targeted key words and phrases, among other factors. What you receive as a publisher is 68% of the revenue if you are on the AdSense for content program, 51% if you use AdSense for search.

Options

When you add AdSense to your sites, you can choose from a variety of advert sizes and styles. The area used for adverts is divided into units, so your site may include blocks of adverts rather than larger individual adverts occupying several units. You can set the colors within the ads to match your site design. In terms of requirements, there are a number of restrictions on your content if you want AdSense ads on your pages. Your content cannot be of an adult nature or contain copyrighted material. Your sites must also meet Google's Webmaster Quality Guidelines.

Related Links

Adsense Help: Adsense Academy
Google: Webmaster Guidelines

Twitter and Marketing

Twitter has quickly become a key element in the marketing strategies of many businesses, small and large. If you want to put Twitter to good use for your business, the vital elements fall into a few basic categories. Twitter offers traditional advertising opportunities in the form of promotions, but there are many other ways to use the service for marketing that don't cost anything. By seeing Twitter as a communication, networking and branding tool, you can use it to your advantage.

Communication

Twitter is of course primarily a communication tool. For this reason you can use it to communicate with existing clients and customers as well as press. With existing clients you can provide support and capture vital feedback from your customers or users. Many companies use Twitter to promote special offers or deals. This gives followers an incentive to keep themselves acquainted with what you are tweeting about. It goes without saying that Twitter is potentially most valuable when attracting new custom, but it is also an effective channel from which to manage your existing client base.

Branding

Twitter is a microblogging platform. This puts it in an excellent position to express a consistent message representing your business brand. Key strategies here include linking to any updates about your products, including media items such as videos, newsletters, blog posts and media coverage, as well as linking to the relevant sections of your company website. If you want your tweets to be noticed by Twitter users who are not already following you, you can do so by tweeting on trending topics. You can see the list of trending topics when you log into your Twitter account. Often, the trends involve tweeting using hashtags. Twitter users often view all tweets on a particular topic or hashtag, regardless of whether those tweets are from accounts they follow.

Network

Twitter is part of the world of social networking, so it naturally provides extensive networking opportunities. Many companies take the approach of seeking out Twitter users who appear to be potential customers and following them, in the hope that they will follow back. However, it is more valuable to have a small number of followers who are genuinely interested in your product than a large number who are paying little attention to it. To attract the attention of tweeters who are more valuable to your business, you can carry out searches on Twitter. Searching for a topic that is either specific to your business or related to it, then replying to those tweets, is a way to connect to users who are interested in your product area.

Promotion

In terms of traditional marketing, Twitter offers a range of promotion options. You can purchase promoted tweets, accounts and trends. This is akin to a mainstream advertising approach, with the promoted content appearing within user timelines even if the user does not follow your account. Twitter targets these tweets at relevant users, based on their own accounts. Promoted tweets also appear within search pages, profile pages and Twitter clients. Twitter clients are applications used on mobile and desktop platforms, used as an alternative to accessing Twitter through the Web browser.

Related Links

Twitter: What are Promoted Tweets?
GigaOM: 62 Ways to Use Twitter for Business
Entrepreneur.com: Five Ways to Use Twitter for Marketing That You Might Not Know About
Copyblogger: The Ultimate Guide to Twitter Marketing
Mashable: 5 Proven Twitter Marketing Strategies