Archive for March, 2011

State of Web Design in Greece

Advertisement in State of Web Design in Greece
 in State of Web Design in Greece  in State of Web Design in Greece  in State of Web Design in Greece

Most people know Greece because of its glorious past during the ancient years. Nevertheless, present times are quite stressful for the vast majority of its population due to global recession. But let’s remain optimistic and take a look at the past times of Greek tradition in art and design and then see the state of Web design — an area where things keep evolving.

The Golden Ratio & Architecture

Greece is often stated as the country which introduced philosophy and influenced western civilisation more than any other. Indeed, ancient Greeks’ thought was innovative. Among other ideas they embraced art and architecture in a way that impacts modern design.

Parthenon1 in State of Web Design in Greece

Pythagoras and his fellow companions changed the way we perceive mathematics. Their contribution to modern science is remarkable. Pythagoras studied concepts such as harmony and balance. He’s known for the Pythagorean theorem but a few people know that he was also behind the Golden Ratio, a concept which still inspires and guides our designs. A bit later, another Greek mathematician, Euclid, first expressed the idea of the Golden Ratio with words: “A straight line is said to have been cut in extreme and mean ratio when, as the whole line is to the greater segment, so is the greater to the less.”

Golden Ratio in State of Web Design in Greece

The Golden Ratio is omnipresent in nature, art, design, architecture, music and of course mathematics. It epitomises harmony and employs aesthetics and beauty. The great Parthenon was designed and built based on the idea of the Golden Ratio or the Greek letter, φ (phi). This is the first letter of the name of the ancient Greek sculptor, Phidias, whose contribution to the monument was immense. The Parthenon’s architects, Iktinos and Callicrates, adopted not only the concept of the Golden Ratio, but also the epitome of the Greek thought and philosophy in general.

Talking About Aesthetics

Aesthetics is also a Greek word. It derives from the word “αισθητικος” which means perception, feeling, sense. It is a branch of philosophy and it is strongly connected to art, culture and nature. Since the ancient years, aesthetics has many different meanings, because perception varies from people to people or among civilisations. However, the power of aesthetics is global and it is the vehicle which marks the different essences of human’s creativity.

Greece, especially in ancient years, influenced architecture, art and design. Aesthetically, Greek constructions and crafts were complex and included many materials and colours. The remains of those crafts may now look minimalistic and simple, but this is not true. However, the applied rules of good design remain untouched by time. We can still admire the high aesthetic level of those works.

Statue in State of Web Design in Greece

To put it differently, aesthetics is something we feel, not what we articulate. Art and design are the main expressions of aesthetics. When it comes to Web design, aesthetics play a crucial part to the way a website is perceived. Our minds need only 1/20 of a second to decide whether they like or not a particular design and this is an aesthetic decision.

The more we explore design the more we dive into different aspects of human nature. If the roots of aesthetics are hidden in philosophy, the way we perceive things is a matter of psychology and even neurology. It takes a holistic approach before we can arrive to good design results. Part of this approach is already revealed by the study of the crafts in ancient Greece.

Art in the Byzantine Period

The Byzantine period is surely worth mentioning because it succeeded the ancient era and it lasted for more than 1000 years (306 AD to 1453 AD). During this huge time span there was a mix of the form coming from ancient years with the Orthodox culture which evolved and turned to be prevalent.

During this period Greece used to be an empire. There were ample resources to move things on when it came to art. Architecture, sculpture, painting, music and other arts were transformed little by little to something completely different. It is still a question whether this transformation was something that happened smoothly or the influence of the church imposed such structural deviations. At the same time art in the empire, as in any empire, was engulfed by the style of artists coming from different countries.

Helios in State of Web Design in Greece

Despite the vast amount and the value of art during the Byzantine period, there aren’t many design principles derived from it. Modern art and design concepts doesn’t seem to represent that period.

Modern Aproaches

Greece is definitely a country with almost no recent tradition when it comes to design and digital communication. The country lost the Renaissance because it was under the Ottoman rule for almost 4 centuries. During the 20nth century Greece also suffered from two World Wars and a painful Civil War which left deep scars and put mental progress to a halt. This bitter situation affected design too.

98 4Lg in State of Web Design in Greece

With this in mind, we can barely find traces of Greek exemplars in design. One of them was Alec Issigonis who was a car designer. Issigonis used to be a very intelligent man who hated the strict discipline of Mathematics, so he called them “the enemy of every creative genius”. Issigonis’ most prominent product was the famous Mini Cooper. Mini was introduced in 1959 and it still remains an epitome of design.

En GFSOlga in State of Web Design in Greece

The art and science of typography is also an area where Greece has some tradition. Moreover, the word “typography” derives from the Greek words “τυπος” (= typos, meaning form) and “γραφη” (= graphy, meaning writing). However, printing comes to Greece relatively late. Only in the late ’80s we produce the first digital font families, like the one you see above, GFS Olga. If you’re interested in embedding Greek fonts in your website, you can do that via Fontdeck which provides some excellent families.

Kyknos in State of Web Design in Greece

When it comes to modern design and digital communication, Greek designers started by imitating and adopting trends. By time we developed our own language and style without fearing to embrace elements of our tradition. The image above is an example of lovely packaging design of the tomato sauce Kyknos. The new approach is based on the traditional packaging of the sauce. It is handcrafted by Red Design Consultants.

Eurobasket in State of Web Design in Greece

Greek designers, with a voracious appetite and new ideas, now start gaining the respect of the community worldwide. Designers United, a Greek design agency, created the emblem of Euroleague’s Final Four 2009 and 2010. Above, you can see the official ball of the latest Final Four held in Paris.

Web Design: The State of Things

Being a Web designer right now in Greece is like being a teenager. Things are quite unstable. You are neither a child nor an adult, which means that professionalism is welcomed but not always required. A few times being a professional could hurt you, too.

The average Greek designer is much better than he used to be three years ago. However, when comparing with an American, English or Russian colleague he still has a lot of work to do. The average client is now aware of the power of a well designed website, but most of the times he’s not eager to pay for it.

So why do we bother to mention the state of Web design in Greece? Because, as mentioned above, things are rapidly changing. When we design we know that our work is compared with the work of the experts of the world and this makes us better. Not to mention that a bunch of Greek designers globalised their services with success.

In other words: We walk the road of maturity.

Let the Designers Talk

We asked 8 successful Web designers 8 different questions about the state of things in Greece and they way they work. Their answers are quite interesting:

Constantinos Demetriadis, Creative Director, Tribal DDB Athens:

Q: As a Creative Director in big design agencies what do you think of the current state of Web design in Greece?

Greece’s late introduction to the Internet, accompanied by the mediums unique features, have strongly shaped the state of Greek Web design. Like most countries, Greece has had a lot of catching up to do, but in that sense, we’ve been doing a great job at adapting and integrating our ideas. We can safely assume that Greek Web design is only beginning to mature, but shows signs of fast evolution. New standards, universal access, multiple touch points… are all the way we’re headed, and it’s my belief that Greece is ramping up it’s game. And it’s happening now…

Cdimitriadis in State of Web Design in Greece

Maria Theodoropoulou, Web designer/developer at Bluestorm New Media:

Q: You live and work as Web designer & developer in UK for more than 10 years. Would you ever come back to Greece to work here? Why?

Moving back to Greece is always at the back of my mind but I cannot quite formulate a decision yet. Working in the UK has greater benefits and offers more opportunities in my field while the Greek marketplace is an unknown quantity for me. With the nature of the job being what it is I would love to work from Greece but with my existing clients in the UK. I love the Greek lifestyle which is much more laid back, but I prefer the English work style which is more goal driven and rewarding if you commit yourself.

Theodoropoulou in State of Web Design in Greece

Michael Sfictos, Graphic & Web designer:

Q: As a very talented and successful Web designer could you share the sources of inspiration that work for you?

To be honest, it’s hard to pin inspiration down to a few subjects. My inspiration comes from everything that surrounds me, and in most cases comes in the most unexpected moments. I’m sure all the other designers have the same answer. Music is what helps me concentrate and keeps me focused. Furthermore I watch a lot of imagery on various websites, I love looking at other artists and designers work. Photography and typography are objects that I really value and they have been proved, so far, as great helpers.

Sfictos in State of Web Design in Greece

Petros Dimitriadis, Freelancer Greek Web designer:

Q: You’ve been a successful freelancer in Greece for many years. What do you think of freelancing in Greece? Do freelancers get paid enough?

I have been a freelancer Web designer for the last 4 years. Some people told me that if you survive two years then you are out of the danger zone. So far so good then. Beeing a freelancer in Greece has its ups and downs. It’s relatively a new kind of occupation and a lot of people and companies look at you with suspicion. It’s kind of difficult to get big jobs because of the small market but if you are good at it it’s difficult not to succeed. There are plenty of “freelancers” out there but if you want something done right than do it with a pro!

Dimitriadis in State of Web Design in Greece

Nassos K., Art & Creative Director:

Q: You are a well known graphic and Web designer. What’s to leave a big agency to pursue your dreams as freelancer in Greece?

Design in Greece is a really tricky issue to discuss and a major topic is to choose whether to work in an agency, a small group or as a freelancer. With 10 years of experience, spending the last 5 in two big agencies in Athens as an Art and Creative Director, I choose a different perspective. As a freelancer (and a member of a creative collectible) I believe I have more freedom on scheduling, designing and producing projects that interest me, contrary to the pressure of “must-have clients” that you have to deal as an employee. It’s freedom and hard work against restrictions and money.

Nassosk in State of Web Design in Greece

Lea Verou, Front-end engineer:

Q: Please, share your experience on Web and education in Greece. Where are we? What do you think of the way markup and design principles are being taught?

The situation in Greece in regards to Web design & development education is pretty bad, even today. Most colleges & relevant seminars teach obsolete material that is useless to anyone who wants to create something modern and standards-compliant. Tables & frames for …layout, presentational markup and obtrusive JavaScript is at the core of most Web design-related courses. In Athens University of Economics and Business we tried to design a model course from scratch, in which only the standards and modern principles are being taught. We even managed to put in some cutting edge technologies, such as HTML5, CSS3 and ECMAScript 5. I extensively described my experience on teaching such a course in my blog. As far as I know, it’s the only attempt for something similar in Greece. Even in universities abroad I rarely see courses that are as up-to-date as ours, which is quite sad.

Verou in State of Web Design in Greece

Zaharenia Atzitzikaki, Web Designer & Developer:

Q: You are a web standards evangelist and a recent freelancer. Do you think clients in Greece care about Web standards? Would they pay more for a well structured website?

Clients in Greece are no different than clients worldwide — lots of them don’t know about standards and won’t really care until you explain them simply why they should. If you focus on how their website may be a bit pricier now but will be easier and cheaper to maintain in the future, they’ll understand and appreciate it and will dismiss cheaper solutions. Most of them know that you get what you pay for, even in Web design, and if they don’t, well, at least you tried, right?

Atzitzikaki in State of Web Design in Greece

Gerasimos Tsiamalos, Web designer & developer:

Q: You’re about to launch a new service: Premium themes for WordPress and not only. What made you make that move? Do you think Greek designers/developers have the potential to succeed in such demanding markets?

Greeks, living in Greece, are natural problem solvers. They have to be like that in order to survive in this little corner of the earth. Simple. Greek designers/developers have the potential to succeed in any market. Examples? Odesk.com About the premium WordPress themes arena, it’s true that i’m about to enter a saturated market. In the way we know this market anyway. As with any market/product though, differentiation is the key to make heads turn your way and a realistic scenario to solve their problems. Time will tell, but I’m pretty sure I have found how to be different from the competition and I can definitely provide the second one (a realistic scenario to solve their problems).

Tsiamalos in State of Web Design in Greece

Greek Web Agencies & Freelancers

The following list is an indicative guide to some of the most successful and active agencies and creative professionals in Greece:

Atcom is a big, well known agency in Greece. Its huge portfolio includes some of the most important Greek portals among others.

Atcom in State of Web Design in Greece

OgilvyOne, the Greek branch of the brand, specialises in creative work with great results and several awards.

Ogilvy in State of Web Design in Greece

aeraki specialises in Flash. It has a beautiful website with very interesting projects.

Aeraki in State of Web Design in Greece

Beetroot is a very creative agency. Many famous Flash projects and TV commercials have been made by these guys.

Beetroot in State of Web Design in Greece

Zefxis is a small but well known company that cares both about creativity and Web standards.

Zefxis in State of Web Design in Greece

Upset! is a creative agency full of fresh ideas.

Upset in State of Web Design in Greece

Nomint. Another creative agency specialising in Flash projects.

Nomint in State of Web Design in Greece

Wedia. A new but dynamic agency with some beautiful projects.

Wedia in State of Web Design in Greece

Generation Y. Modern solutions from a very active agency.

Generationy in State of Web Design in Greece

Fabulous!. A well known company specialising in beautiful Flash websites.

Fabulous in State of Web Design in Greece

Tria. Bold and sometimes experimantal design.

Paretria in State of Web Design in Greece

Komrade. A very interesting website for an active and solid agency.

Komrade in State of Web Design in Greece

Digitalbox is consisted by a small but very agile team and it has an interesting portfolio.

Digitalbox in State of Web Design in Greece

Antonis Kyriazis. A great Flash designer with a rich portfolio.

Kyriazis in State of Web Design in Greece

Konstantinos Penlidis. Very talented and experienced Web designer.

Penlidis in State of Web Design in Greece

Thanos Papavasiliou. Wireframe Plus is a Web service which turns your ideas into wireframes.

Papavasiliou in State of Web Design in Greece

Helen Gizi. Vector stories designs fabulous illustrations for your next best website.

Gizi in State of Web Design in Greece

Showcase of Greek Web Designs

Here comes a list of beautiful designs in different areas. We focused on design no matter the technology behind. Many websites included are based on Flash but there also many which use great HTML & CSS.

Our list could not include all beautiful Greek websites of course. However this is a good sample of what Greek Web designers can do. Go ahead and visit them. The vast majority of these websites include a version in English.

Kiku Japanese Restaurant
A Japanese restaurant in Athens. Amazing art direction and atmosphere.

Kiku in State of Web Design in Greece

Yokaboo
Yokaboo lets you create your own online store with ease. It focused on creative people but practically anyone can start using it.

Yokaboo in State of Web Design in Greece

Den einai paramythi
“Den einai paramythi” means “It’s no fairytale”. A sweet interactive game for kids about recycling. Beautiful concept and execution.

Deneinaiparamithi in State of Web Design in Greece

6 keys
Great imagery and creative direction for the website of 6 keys hotel in Volos, Greece.

6keys in State of Web Design in Greece

Lakis Gavalas
The official website of Lakis Gavales, a famous Greek fasion designer. Classy and elegant.

Gavalas in State of Web Design in Greece

The Clockwork Man
The Clockwork Man website is about the relevant hidden object game which is designed & developed in Greece. The illustration is just amazing.

Cm in State of Web Design in Greece

Squad
A strange yet very creative approach for Squad, an advertising agency in Greece.

Squad in State of Web Design in Greece

I pitta tou pappou

“I pitta tou pappou” could be translated as “Grandfather’s pie”. The beautiful website is about the well known restaurant with traditional Greek food such as gyros and souvlaki.

Pitta in State of Web Design in Greece

DeviceOne
A very well designed online shop for people who like sports.

Deviceone in State of Web Design in Greece

Ipomnima
A lovely website in black and white about an art gallery in a beautiful greek island, Lesvos.

Ipomnima in State of Web Design in Greece

just dot
Very impressive and original approach for a company specialising in mobile apps and not only.

Justdot in State of Web Design in Greece

This is Athens
This website is actually a nice photostream to show to everyone around the globe that Athens is a beautiful city. The photos included there can prove it.

Thisisathens in State of Web Design in Greece

KFC
The Greek approach of the famous Kentucky Fried Chicken food chain.

Kfc in State of Web Design in Greece

Neoset
Furniture for adults and kids. The relevant website is clean, crisp and greatly designed. Overall, this is a great presentation.

Neoset in State of Web Design in Greece

Lipton Ice Tea
A micro website for an online contest for Lipton Ice Tea. A smart and joyful approach.

Lipton in State of Web Design in Greece

Deloudis
Style and luxury in modern living. The website reflects these two characteristics of the brand.

Deloudis in State of Web Design in Greece

Salt&Pepper
Salt&Pepper specialises in packaging and graphic design. The website is warm and elegant. You can spend much time in there.

Salt Pepper in State of Web Design in Greece

Fena Stock
This website is all about a huge online shop. It is designed with taste and style despite its size.

Fenastock in State of Web Design in Greece

Lacta – Love at first site
An interactive love story/game which changes according to your decisions. Excellent idea and execution.

Lacta in State of Web Design in Greece

Bank of Greece – Virtual gallery
The Bank of Greece presents its art collection in a beautiful way. A virtual tour through the recent history of Greece.

Bank in State of Web Design in Greece

Sébastien Nikolaou
The personal website and portfolio of the graphic designer, Sébastien Nikolaou. A modern and creative one page website with some beautiful samples of work.

Nikolaou in State of Web Design in Greece

Piramatiki Skini
This website is about an art stage in Thessaloniki, Greece. What’s special about it is the perfect equilibrium between function and form.

Piramatikiskini in State of Web Design in Greece

Thessaloniki360
An online interactive way to find all interesting places to visit in Thessaloniki Greece.

Thessaloniki360 in State of Web Design in Greece

lexx
A very creative and fresh weblog design.

Lexx in State of Web Design in Greece

Your Thoughts on Greece

Please feel free to share with us your thoughts on Greece with us in the comment section below.

(ik)


Get Started Developing For Android With Eclipse, Reloaded

Advertisement in Get Started Developing For Android With Eclipse, Reloaded
 in Get Started Developing For Android With Eclipse, Reloaded  in Get Started Developing For Android With Eclipse, Reloaded  in Get Started Developing For Android With Eclipse, Reloaded

In the first part of this tutorial series, we built a simple brew timer application using Android and Eclipse. In this second part, we’ll continue developing the application by adding extra functionality. In doing this, you’ll be introduced to some important and powerful features of the Android SDK, including Persistent data storage, Activities and Intent as well as Shared user preferences.

To follow this tutorial, you’ll need the code from the previous article. If you want to get started right away, grab the code from GitHub and check out the tutorial_part_1 tag using this:

1 Starting Point in Get Started Developing For Android With Eclipse, Reloaded

$ git clone git://github.com/cblunt/BrewClock.git
$ cd BrewClock
$ git checkout tutorial_part_1

Once you’ve checked out the code on GitHub, you’ll need to import the project into Eclipse:

  1. Launch Eclipse and choose File → Import…
  2. In the Import window, select “Existing Projects into Workspace� and click “Next.�
  3. On the next screen, click “Browse,� and select the project folder that you cloned from GitHub.
  4. Click “Finish� to import your project into Eclipse.

After importing the project into Eclipse, you might receive a warning message:

Android required .class compatibility set to 5.0.
Please fix project properties.

If this is the case, right-click on the newly imported “BrewClock� project in the “Project Explorer,� choose “Fix Project Properties,� and then restart Eclipse.

Getting Started With Data Storage

Currently, BrewClock lets users set a specific time for brewing their favorite cups of tea. This is great, but what if they regularly drink a variety of teas, each with their own different brewing times? At the moment, users have to remember brewing times for all their favorite teas! This doesn’t make for a great user experience. So, in this tutorial we’ll develop functionality to let users store brewing times for their favorite teas and then choose from that list of teas when they make a brew.

To do this, we’ll take advantage of Android’s rich data-storage API. Android offers several ways to store data, two of which we’ll cover in this article. The first, more powerful option, uses the SQLite database engine to store data for our application.

SQLite is a popular and lightweight SQL database engine that saves data in a single file. It is often used in desktop and embedded applications, where running a client-server SQL engine (such as MySQL or PostgreSQL) isn’t feasible.

Every application installed on an Android device can save and use any number of SQLite database files (subject to storage capacity), which the system will manage automatically. An application’s databases are private and so cannot be accessed by any other applications. (Data can be shared through the ContentProvider class, but we won’t cover content providers in this tutorial.) Database files persist when the application is upgraded and are deleted when the application is uninstalled.

We’ll use a simple SQLite database in BrewClock to maintain a list of teas and their appropriate brewing times. Here’s an overview of how our database schema will look:

+-------------------------------------+
| Table: teas                         |
+------------+------------------------+
| Column     | Description            |
+------------+------------------------+
| _ID        | integer, autoincrement |
| name       | text, not null         |
| brew_time  | integer, not null      |
+------------+------------------------+

If you’ve worked with SQL before, this should look fairly familiar. The database table has three columns: a unique identifier (_ID), name and brewing time. We’ll use the APIs provided by Android to create the database table in our code. The system will take care of creating the database file in the right location for our application.

Abstracting the Database

To ensure the database code is easy to maintain, we’ll abstract all the code for handling database creation, inserts and queries into a separate class, TeaData. This should be fairly familiar if you’re used to the model-view-controller approach. All the database code is kept in a separate class from our BrewClockActivity. The Activity can then just instantiate a new TeaData instance (which will connect to the database) and do what it needs to do. Working in this way enables us to easily change the database in one place without having to change anything in any other parts of our application that deal with the database.

Create a new class called TeaData in the BrewClock project by going to File → New → Class. Ensure that TeaData extends the android.database.sqlite.SQLiteOpenHelper class and that you check the box for “Constructors from superclass.â€�

2 Create Teadata Class1 in Get Started Developing For Android With Eclipse, Reloaded

The TeaData class will automatically handle the creation and versioning of a SQLite database for your application. We’ll also add methods to give other parts of our code an interface to the database.

Add two constants to TeaData to store the name and version of the database, the table’s name and the names of columns in that table. We’ll use the Android-provided constant BaseColumns._ID for the table’s unique id column:

// src/com/example/brewclock/TeaData.java
import android.app.Activity;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.DatabaseUtils;
import android.provider.BaseColumns;

public class TeaData extends SQLiteOpenHelper {
  private static final String DATABASE_NAME = "teas.db";
  private static final int DATABASE_VERSION = 1;

  public static final String TABLE_NAME = "teas";

  public static final String _ID = BaseColumns._ID;
  public static final String NAME = "name";
  public static final String BREW_TIME = "brew_time";

  // …
}

Add a constructor to TeaData that calls its parent method, supplying our database name and version. Android will automatically handle opening the database (and creating it if it does not exist).

// src/com/example/brewclock/TeaData.java
public TeaData(Context context) {
  super(context, DATABASE_NAME, null, DATABASE_VERSION);
}

We’ll need to override the onCreate method to execute a string of SQL commands that create the database table for our tea. Android will handle this method for us, calling onCreate when the database file is first created.

On subsequent launches, Android checks the version of the database against the DATABASE_VERSION number we supplied to the constructor. If the version has changed, Android will call the onUpgrade method, which is where you would write any code to modify the database structure. In this tutorial, we’ll just ask Android to drop and recreate the database.

So, add the following code to onCreate:

// src/com/example/brewclock/TeaData.java
@Override
public void onCreate(SQLiteDatabase db) {
  // CREATE TABLE teas (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, brew_time INTEGER);
  String sql =
    "CREATE TABLE " + TABLE_NAME + " ("
      + _ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
      + NAME + " TEXT NOT NULL, "
      + BREW_TIME + " INTEGER"
      + ");";

  db.execSQL(sql);
}

@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
  db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
  onCreate(db);
}

Next, we’ll add a new method to TeaData that lets us easily add new tea records to the database. We’ll supply the method with a name and brewing time for the tea to be added. Rather than forcing us to write out the raw SQL to do this, Android supplies a set of classes for inserting records into the database. First, we create a set of ContentValues, pushing the relevant values into that set.

With an instance of ContentValues, we simply supply the column name and the value to insert. Android takes care of creating and running the appropriate SQL. Using Android’s database classes ensures that the writes are safe, and if the data storage mechanism changes in a future Android release, our code will still work.

Add a new method, insert(), to the TeaData class:

// src/com/example/brewclock/TeaData.java
public void insert(String name, int brewTime) {
  SQLiteDatabase db = getWritableDatabase();

  ContentValues values = new ContentValues();
  values.put(NAME, name);
  values.put(BREW_TIME, brewTime);

  db.insertOrThrow(TABLE_NAME, null, values);
}

Retrieving Data

With the ability to save data into the database, we’ll also need a way to get it back out. Android provides the Cursor interface for doing just this. A Cursor represents the results of running a SQL query against the database, and it maintains a pointer to one row within that result set. This pointer can be moved forwards and backwards through the results, returning the values from each column. It can help to visualize this:


SQL Query: SELECT * from teas LIMIT 3;

+-----------------------------------+
|  _ID  |  name       |  brew_time  |
+-----------------------------------+
|    1  |  Earl Grey  |          3  |
|    2  |  Green      |          1  | <= Cursor
|    3  |  Assam      |          5  |
+-------+-------------+-------------+

In this example, the Cursor is pointing at the second row in the result set (Green tea). We could move the Cursor back a row to represent the first row (Earl Grey) by calling cursor.moveToPrevious(), or move forward to the Assam row with moveToNext(). To fetch the name of the tea that the Cursor is pointing out, we would call cursor.getString(1), where 1 is the column index of the column we wish to retrieve (note that the index is zero-based, so column 0 is the first column, 1 the second column and so on).

Now that you know about Cursors, add a method that creates a Cursor object that returns all the teas in our database. Add an all method to TeaData:

// src/com/example/brewclock/TeaData.java
public Cursor all(Activity activity) {
  String[] from = { _ID, NAME, BREW_TIME };
  String order = NAME;

  SQLiteDatabase db = getReadableDatabase();
  Cursor cursor = db.query(TABLE_NAME, from, null, null, null, null, order);
  activity.startManagingCursor(cursor);

  return cursor;
}

Let’s go over this method in detail, because it looks a little strange at first. Again, rather than writing raw SQL to query the database, we make use of Android’s database interface methods.

First, we need to tell Android which columns from our database we’re interested in. To do this, we create an array of strings—each one of the column identifiers that we defined at the top of TeaData. We’ll also set the column that we want to order the results by and store it in the order string.

Next, we create a read-only connection to the database using getReadableDatabase(), and with that connection, we tell Android to run a query using the query() method. The query() method takes a set of parameters that Android internally converts into a SQL query. Again, Android’s abstraction layer ensures that our application code will likely continue to work, even if the underlying data storage changes in a future version of Android.

Because we just want to return every tea in the database, we don’t apply any joins, filters or groups (i.e. WHERE, JOIN, and GROUP BY clauses in SQL) to the method. The from and order variables tell the query what columns to return on the database and the order in which they are retrieved. We use the SQLiteDatabase.query() method as an interface to the database.

Last, we ask the supplied Activity (in this case, our BrewClockActivity) to manage the Cursor. Usually, a Cursor must be manually refreshed to reload any new data, so if we added a new tea to our database, we would have to remember to refresh our Cursor. Instead, Android can take care of this for us, recreating the results whenever the Activity is suspended and resumed, by calling startManagingCursor().

Finally, we’ll add another utility method to return the number of records in the table. Once again, Android provides a handy utility to do this for us in the DatabaseUtils class:

Add the following method, count, to your TeaData class:

// src/com/example/brewclock/TeaData.java
  public long count() {
    SQLiteDatabase db = getReadableDatabase();
    return DatabaseUtils.queryNumEntries(db, TABLE_NAME);
  }

Save the TeaData class, and fix any missing imports using Eclipse (Source → Organize Imports). With our data class finished, it’s time to change BrewClock’s interface to make use of the database!

Modify BrewClock’s Interface to Allow Tea Selection

The purpose of storing preset teas and brew times is to let the user quickly select their favorite tea from the presets. To facilitate this, we’ll add a Spinner (analogous to a pop-up menu in desktop interfaces) to the main BrewClock interface, populated with the list of teas from TeaData.

As in the previous tutorial, use Eclipse’s layout editor to add the Spinner to BrewClock’s main interface layout XML file. Add the following code just below the LinearLayout for the brew count label (around line 24). Remember, you can switch to the “Code View� tab along the bottom of the window if Eclipse opens the visual layout editor.

<!-- /res/layout/main.xml -->

<!-- Tea Selection -->
<LinearLayout
  android:orientation="vertical"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content">

  <Spinner
    android:id="@+id/tea_spinner"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" />

</LinearLayout>

In the BrewClockActivity class, add a member variable to reference the Spinner, and connect it to the interface using findViewById:

// src/com/example/brewclock/BrewClockActivity.java
protected Spinner teaSpinner;
protected TeaData teaData;

// …

public void onCreate(Bundle savedInstanceState) {
  // …
  teaData = new TeaData(this);
  teaSpinner = (Spinner) findViewById(R.id.tea_spinner);
}

Try running your application to make sure the new interface works correctly. You should see a blank pop-up menu (or Spinner) just below the brew count. If you tap the spinner, Android handles displaying a pop-up menu so that you can choose an option for the spinner. At the moment, the menu is empty, so we’ll remedy that by binding the Spinner to our tea database.

3 Blank Spinner in Get Started Developing For Android With Eclipse, Reloaded

Data Binding

When Android retrieves data from a database, it returns a Cursor object. The Cursor represents a set of results from the database and can be moved through the results to retrieve values. We can easily bind these results to a view (in this case, the Spinner) using a set of classes provided by Android called “Adapters.� Adapters do all the hard work of fetching database results from a Cursor and displaying them in the interface.

Remember that our TeaData.all() method already returns a Cursor populated with the contents of our teas table. Using that Cursor, all we need to do is create a SimpleCursorAdapter to bind its data to our teaSpinner, and Android will take care of populating the spinner’s options.

Connect the Cursor returned by teaData.all() to the Spinner by creating a SimpleCursorAdapter:

// com/example/brewclock/BrewClockActivity.java

public void onCreate(Bundle savedInstanceState) {
  // …
  Cursor cursor = teaData.all(this);

  SimpleCursorAdapter teaCursorAdapter = new SimpleCursorAdapter(
    this,
    android.R.layout.simple_spinner_item,
    cursor,
    new String[] { TeaData.NAME },
    new int[] { android.R.id.text1 }
  );

  teaSpinner.setAdapter(teaCursorAdapter);
  teaCursorAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
}

Notice that we’ve made use of Android’s built-in android.R object. This provides some generic default resources for your application, such as simple views and layouts. In this case, we’ve used android.R.layout.simple_spinner_item, which is a simple text label layout.

If you run the application again, you’ll see that the spinner is still empty! Even though we’ve connected the spinner to our database, there are no records in the database to display.

Let’s give the user a choice of teas by adding some default records to the database in BrewClock’s constructor. To avoid duplicate entries, we’ll add only the default teas if the database is empty. We can make use of TeaData’s count() method to check if this is the case.

Add code to create a default set of teas if the database is empty. Add this line just above the code to fetch the teas from teaData:

// com/example/brewclock/BrewClockActivity.java
public void onCreate(Bundle savedInstanceState) {
  // …

  // Add some default tea data! (Adjust to your preference :)
  if(teaData.count() == 0) {
    teaData.insert("Earl Grey", 3);
    teaData.insert("Assam", 3);
    teaData.insert("Jasmine Green", 1);
    teaData.insert("Darjeeling", 2);
  }

  // Code from the previous step:
  Cursor cursor = teaData.all(this);

  // …
}

Now run the application again. You’ll now see that your tea Spinner has the first tea selected. Tapping on the Spinner lets you select one of the teas from your database!

4 Populated Spinner in Get Started Developing For Android With Eclipse, Reloaded

Congratulations! You’ve successfully connected your interface to a data source. This is one of the most important aspects of any software application. As you’ve seen, Android makes this task fairly easy, but it is extremely powerful. Using cursors and adapters, you can take virtually any data source (from a simple array of strings to a complex relational database query) and bind it to any type of view: a spinner, a list view or even an iTunes-like cover-flow gallery!

Although now would be a good time for a brew, our work isn’t over yet. While you can choose different teas from the Spinner, making a selection doesn’t do anything. We need to find out which tea the user has selected and update the brew time accordingly.

Read Selected Tea, and Update Brew Time

To determine which tea the user has selected from our database, BrewClockActivity needs to listen for an event. Similar to the OnClickListener event that is triggered by button presses, we’ll implement the OnItemSelectedListener. Events in this listener are triggered when the user makes a selection from a view, such as our Spinner.

Enable the onItemSelectedListener in BrewClockActivity by adding it to the class declaration. Remember to implement the interface methods onItemSelected() and onNothingSelected():

// src/com/example/brewclock/BrewClockActivity.java
public class BrewClockActivity extends Activity implements OnClickListener, OnItemSelectedListener {
  // …
  public void onItemSelected(AdapterView<?> spinner, View view, int position, long id) {
    if(spinner == teaSpinner) {
      // Update the brew time with the selected tea’s brewtime
      Cursor cursor = (Cursor) spinner.getSelectedItem();
      setBrewTime(cursor.getInt(2));
    }
  }

  public void onNothingSelected(AdapterView<?> adapterView) {
    // Do nothing
  }
}

Here we check whether the spinner that triggered the onItemSelected event was BrewClock’s teaSpinner. If so, we retrieve a Cursor object that represents the selected record. This is all handled for us by the SimpleCursorAdapter that connects teaData to the Spinner. Android knows which query populates the Spinner and which item the user has selected. It uses these to return the single row from the database, representing the user’s selected tea.

Cursor’s getInt() method takes the index of the column we want to retrieve. Remember that when we built our Cursor in teaData.all(), the columns we read were _ID, NAME and BREW_TIME. Assuming we chose Jasmine tea in teaSpinner, the Cursor returned by our selection would be pointing at that record in the database.

We then ask the Cursor to retrieve the value from column 2 (using getInt(2)), which in this query is our BREW_TIME column. This value is supplied to our existing setBrewTime() method, which updates the interface to show the selected tea’s brewing time.

Finally, we need to tell the teaSpinner that BrewClockActivity is listening for OnItemSelected events. Add the following line to BrewClockActivity’s onCreate method:

// src/com/example/brewclock/BrewClockActivity.java
public void onCreate() {
  // …
  teaSpinner.setOnItemSelectedListener(this);
}

That should do it! Run your application again, and try selecting different teas from the Spinner. Each time you select a tea, its brew time will be shown on the countdown clock. The rest of our code already handles counting down from the current brew time, so we now have a fully working brew timer, with a list of preset teas.

You can, of course, go back into the code and add more preset teas to the database to suit your tastes. But what if we released BrewClock to the market? Every time someone wanted to add a new tea to the database, we’d need to manually update the database, and republish the application; everyone would need to update, and everybody would have the same list of teas. That sounds pretty inflexible, and a lot of work for us!

5 Default Teas in Get Started Developing For Android With Eclipse, Reloaded

It would be much better if the user had some way to add their own teas and preferences to the database. We’ll tackle that next…

Introducing Activities

Each screen in your application and its associated code is an Activity. Every time you go from one screen to another, Android creates a new Activity. In reality, although an application may comprise any number of screens/activities, Android treats them as separate entities. Activities work together to form a cohesive experience because Android lets you easily pass data between them.

In this final section, you’ll add a new Activity (AddTeaActivity) to your application and register it with the Android system. You’ll then pass data from the original BrewClockActivity to this new Activity.

First, though, we need to give the user a way to switch to the new Activity. We’ll do this using an options menu.

Options Menus

Options menus are the pop-up menus that appear when the user hits the “Menu� key on their device. Android handles the creation and display of options menus automatically; you just need to tell it what options to display and what to do when an option is chosen by the user.

However, rather than hard-coding our labels into the menu itself, we’ll make use of Android string resources. String resources let you maintain all the human-readable strings and labels for your application in one file, calling them within your code. This means there’s only one place in your code where you need to change strings in the future.

In the project explorer, navigate to “res/values� and you will see that a strings.xml file already exists. This was created by Eclipse when we first created the project, and it is used to store any strings of text that we want to use throughout the application.

Open strings.xml by double clicking on it, and switch to the XML view by clicking the strings.xml tab along the bottom of the window.

Add the following line within the <resources>…</resources> element:

<!-- res/values/strings.xml -->
  <resources>
    <!-- … -->
    <string name="add_tea_label">Add Tea</string>
  </resources>

Here you’ve defined a string, add_tea_label, and its associated text. We can use add_tea_label to reference the string throughout the application’s code. If the label needs to change for some reason in the future, you’ll need to change it only once in this file.

Next, let’s create a new file to define our options menu. Just like strings and layouts, menus are defined in an XML file, so we’ll start by creating a new XML file in Eclipse:

Create a new Android XML file in Eclipse by choosing File → New → Other, and then select “Android XML File.â€�

Select a resource type of “Menu,� and save the file as main.xml. Eclipse will automatically create a folder, res/menu, where your menu XML files will be stored.

7 New Menu Xml in Get Started Developing For Android With Eclipse, Reloaded

Open the res/menus/main.xml file, and switch to XML view by clicking the “main.xml� tab along the bottom of the window.

Add a new menu item, add_tea.

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
  <item android:id="@+id/add_tea" android:title="@string/add_tea_label" />
</menu>

Notice the android:title attribute is set to @string/add_tea_label. This tells Android to look up add_tea_label in our strings.xml file and return the associated label. In this case, our menu item will have a label “Add Tea.�

Next, we’ll tell our Activity to display the options menu when the user hits the “Menu� key on their device.

Back in BrewClockActivity.java, override the onCreateOptionsMenu method to tell Android to load our menu when the user presses the “Menu� button:

// src/com/example/brewclock/BrewClockActivity.java
@Override
public boolean onCreateOptionsMenu(Menu menu) {
  MenuInflater inflater = getMenuInflater();
  inflater.inflate(R.menu.main, menu);

  return true;
}

When the user presses the “Menu� button on their device, Android will now call onCreateOptionsMenu. In this method, we create a MenuInflater, which loads a menu resource from your application’s package. Just like the buttons and text fields that make up your application’s layout, the main.xml resource is available via the global R object, so we use that to supply the MenuInflater with our menu resource.

To test the menu, save and run the application in the Android emulator. While it’s running, press the “Menu� button, and you’ll see the options menu pop up with an “Add Tea� option.

8 Add Teas Options Menu in Get Started Developing For Android With Eclipse, Reloaded

If you tap the “Add Tea� option, Android automatically detects the tap and closes the menu. In the background, Android will notify the application that the option was tapped.

Handling Menu Taps

When the user taps the “Add Teaâ€� menu option, we want to display a new Activity so that they can enter the details of the tea to be added. Start by creating that new Activity by selecting File → New → Class.

9 New Activity Settings in Get Started Developing For Android With Eclipse, Reloaded

Name the new class AddTeaActivity, and make sure it inherits from the android.app.Activity class. It should also be in the com.example.brewclock package:

// src/com/example/brewclock/AddTeaActivity.java
package com.example.brewclock;

import android.app.Activity;
import android.os.Bundle;

public class AddTeaActivity extends Activity {
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
  }
}

This simple, blank Activity won’t do anything yet, but it gives us enough to finish our options menu.

Add the onOptionsItemSelected override method to BrewClockActivity. This is the method that Android calls when you tap on a MenuItem (notice it receives the tapped MenuItem in the item parameter):

// src/com/example/brewclock/BrewClockActivity.java
@Override
public boolean onOptionsItemSelected(MenuItem item) {
  switch(item.getItemId()) {
    case R.id.add_tea:
      Intent intent = new Intent(this, AddTeaActivity.class);
      startActivity(intent);
      return true;

    default:
      return super.onOptionsItemSelected(item);
  }
}

With this code, we’ve told Android that when the “Add Tea� menu item is tapped, we want to start a new Activity; in this case, AddTeaActivity. However, rather than directly creating an instance of AddTeaActivity, notice that we’ve used an Intent. Intents are a powerful feature of the Android framework: they bind Activities together to make up an application and allow data to be passed between them.

Intents even let your application take advantage of any Activities within other applications that the user has installed. For example, when the user asks to display a picture from a gallery, Android automatically displays a dialogue to the user allowing them to pick the application that displays the image. Any applications that are registered to handle image display will be shown in the dialogue.

Intents are a powerful and complex topic, so it’s worth reading about them in detail in the official Android SDK documentation.

Let’s try running our application to test out the new “Add Tea� screen.

Run your project, tap the “Menu� button and then tap “Add Tea.�

Instead of seeing your “Add Tea� Activity as expected, you’ll be presented with a dialogue that is all too common for Android developers:

10 Crash in Get Started Developing For Android With Eclipse, Reloaded

Although we created the Intent and told it to start our AddTeaActivity Activity, the application crashed because we haven’t yet registered it within Android. The system doesn’t know where to find the Activity we’re trying to run (remember that Intents can start Activities from any application installed on the device). Let’s remedy this by registering our Activity within the application manifest file.

Open your application’s manifest file, AndroidManifest.xml in Eclipse, and switch to the code view by selecting the “AndroidManifest.xml� tab along the bottom of the window.

The application’s manifest file is where you define global settings and information about your application. You’ll see that it already declares .BrewClockActivity as the Activity to run when the application is launched.

Within <application>, add a new <activity> node to describe the “Add Tea� Activity. Use the same add_tea_label string that we declared earlier in strings.xml for the Activity’s title:

<!-- AndroidManifest.xml -->
<application …>
  …
  <activity android:name=".AddTeaActivity" android:label="@string/add_tea_label" />
</application>

Save the manifest file before running BrewClock again. This time, when you open the menu and tap “Add Tea,� Android will start the AddTeaActivity. Hit the “Back� button to go back to the main screen.

With the Activities hooked together, it’s time to build an interface for adding tea!

Building The Tea Editor Interface

Building the interface to add a tea is very similar to how we built the main BrewClock interface in the previous tutorial. Start by creating a new layout file, and then add the appropriate XML, as below.

Alternatively, you could use Android’s recently improved layout editor in Eclipse to build a suitable interface. Create a new XML file in which to define the layout. Go to File → New, then select “Android XML File,â€� and select a “Layoutâ€� type. Name the file add_tea.xml.

11 New Layout Xml in Get Started Developing For Android With Eclipse, Reloaded

Replace the contents of add_tea.xml with the following layout:

<!-- res/layouts/add_tea.xml -->
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:orientation="vertical"
  android:padding="10dip">

  <TextView
    android:text="@string/tea_name_label"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" />

  <EditText
    android:id="@+id/tea_name"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"/>

  <TextView
    android:text="@string/brew_time_label"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"/>

  <SeekBar
    android:id="@+id/brew_time_seekbar"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:progress="2"
    android:max="9" />

  <TextView
    android:id="@+id/brew_time_value"
    android:text="3 m"
    android:textSize="20dip"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:gravity="center_horizontal" />
</LinearLayout>

We’ll also need to add some new strings to strings.xml for the labels used in this interface:

<!-- res/values/strings.xml -->
<resources>
  <!-- … -->
  <string name="tea_name_label">Tea Name</string>

  <string name="brew_time_label">Brew Time</string>
</resources>

In this layout, we’ve added a new type of interface widget, the SeekBar. This lets the user easily specify a brew time by dragging a thumb from left to right. The range of values that the SeekBar produces always runs from zero (0) to the value of android:max.

In this interface, we’ve used a scale of 0 to 9, which we will map to brew times of 1 to 10 minutes (brewing for 0 minutes would be a waste of good tea!). First, though, we need to make sure that AddTeaActivity loads our new interface:

Add the following line of code to the Activity’s onCreate() method that loads and displays the add_tea layout file:

// src/com/example/brewclock/AddTeaActivity.java
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.add_tea);
}

Now test your application by running it, pressing the “Menu� button and tapping “Add Tea� from the menu.

12 Add Tea Interface in Get Started Developing For Android With Eclipse, Reloaded

You’ll see your new interface on the “Add Tea� screen. You can enter text and slide the SeekBar left and right. But as you’d expect, nothing works yet because we haven’t hooked up any code.

Declare some properties in AddTeaActivity to reference our interface elements:

// src/com/example/brewclock/AddTeaActivity.java
public class AddTeaActivity {
  // …

  /** Properties **/
  protected EditText teaName;
  protected SeekBar brewTimeSeekBar;
  protected TextView brewTimeLabel;

  // …

Next, connect those properties to your interface:

public void onCreate(Bundle savedInstanceState) {
  // …
  // Connect interface elements to properties
  teaName = (EditText) findViewById(R.id.tea_name);
  brewTimeSeekBar = (SeekBar) findViewById(R.id.brew_time_seekbar);
  brewTimeLabel = (TextView) findViewById(R.id.brew_time_value);
}

The interface is fairly simple, and the only events we need to listen for are changes to the SeekBar. When the user moves the SeekBar thumb left or right, our application will need to read the new value and update the label below with the selected brew time. We’ll use a Listener to detect when the SeekBar is changed:

Add an onSeekBarChangedListener interface to the AddTeaActivity class declaration, and add the required methods:

// src/com/example/brewclock/AddTeaActivity.java
public class AddTeaActivity
extends Activity
implements OnSeekBarChangeListener {
  // …

  public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
    // TODO Detect change in progress
  }

  public void onStartTrackingTouch(SeekBar seekBar) {}

  public void onStopTrackingTouch(SeekBar seekBar) {}
}

The only event we’re interested in is onProgressChanged, so we need to add the code below to that method to update the brew time label with the selected value. Remember that our SeekBar values range from 0 to 9, so we’ll add 1 to the supplied value so that it makes more sense to the user:

Add the following code to onProgressChanged() in AddTeaActivity.java:

// src/com/example/brewclock/AddTeaActivity.java
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
  if(seekBar == brewTimeSeekBar) {
    // Update the brew time label with the chosen value.
    brewTimeLabel.setText((progress + 1) + " m");
  }
}

Set the SeekBar’s listener to be our AddTeaActivity in onCreate:

// src/com/example/brewclock/AddTeaActivity.java
public void onCreate(Bundle savedInstanceState) {
  // …

  // Setup Listeners
  brewTimeSeekBar.setOnSeekBarChangeListener(this);
}

Now when run the application and slide the SeekBar left to right, the brew time label will be updated with the correct value:

13 Seekbar in Get Started Developing For Android With Eclipse, Reloaded

Saving Tea

With a working interface for adding teas, all that’s left is to give the user the option to save their new tea to the database. We’ll also add a little validation to the interface so that the user cannot save an empty tea to the database!

Start by opening strings.xml in the editor and adding some new labels for our application:

<!-- res/values/strings.xml -->
<string name="save_tea_label">Save Tea</string>
<string name="invalid_tea_title">Tea could not be saved.</string>

<string name="invalid_tea_no_name">Enter a name for your tea.</string>

Just like before, we’ll need to create a new options menu for AddTeaActivity so that the user can save their favorite tea:

Create a new XML file, add_tea.xml, in the res/menus folder by choosing File → New and then Other → Android XML File. Remember to select “Menuâ€� as the resource type.

Add an item to the new menu for saving the tea:

<!-- res/menus/add_tea.xml -->
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
  <item android:title="@string/save_tea_label" android:id="@+id/save_tea" />
</menu>

Back in AddTeaActivity, add the override methods for onCreateOptionsMenu and onOptionsItemSelected, just like you did in BrewClockActivity. However, this time, you’ll supply the add_tea.xml resource file to the MenuInflater:

// src/com/example/brewclock/AddTeaActivity.java
@Override
public boolean onCreateOptionsMenu(Menu menu) {
  MenuInflater inflater = getMenuInflater();
  inflater.inflate(R.menu.add_tea, menu);

  return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
  switch(item.getItemId()) {
    case R.id.save_tea:
      saveTea();

    default:
      return super.onOptionsItemSelected(item);
  }
}

Next, we’ll add a new method, saveTea(), to handle saving the tea. The saveTea method first reads the name and brew time values chosen by the user, validates them and (if all is well) saves them to the database:

// src/com/example/brewclock/AddTeaActivity.java
public boolean saveTea() {
  // Read values from the interface
  String teaNameText = teaName.getText().toString();
  int brewTimeValue = brewTimeSeekBar.getProgress() + 1;

  // Validate a name has been entered for the tea
  if(teaNameText.length() < 2) {
    AlertDialog.Builder dialog = new AlertDialog.Builder(this);
    dialog.setTitle(R.string.invalid_tea_title);
    dialog.setMessage(R.string.invalid_tea_no_name);
    dialog.show();

    return false;
  }

  // The tea is valid, so connect to the tea database and insert the tea
  TeaData teaData = new TeaData(this);
  teaData.insert(teaNameText, brewTimeValue);
  teaData.close();

  return true;
}

This is quite a hefty chunk of code, so let’s go over the logic.

First, we read the values of the EditText teaName and the SeekBar brewTimeSeekBar (remembering to add 1 to the value to ensure a brew time of between 1 and 10 minutes). Next, we validate that a name has been entered that is two or more characters (this is really simple validation; you might want to experiment doing something more elaborate, such as using regular expressions).

If the tea name is not valid, we need to let the user know. We make use of one of Android’s helper classes, AlertDialog.Builder, which gives us a handy shortcut for creating and displaying a modal dialog window. After setting the title and error message (using our string resources), the dialogue is displayed by calling its show() method. This dialogue is modal, so the user will have to dismiss it by pressing the “Back� key. At this point, we don’t want to save any data, so just return false out of the method.

If the tea is valid, we create a new temporary connection to our tea database using the TeaData class. This demonstrates the advantage of abstracting your database access to a separate class: you can access it from anywhere in the application!

After calling teaData.insert() to add our tea to the database, we no longer need this database connection, so we close it before returning true to indicate that the save was successful.

Try this out by running the application in the emulator, pressing “Menu� and tapping “Add Tea.� Once on the “Add Tea� screen, try saving an empty tea by pressing “Menu� again and tapping “Save Tea.� With your validation in place, you’ll be presented with an error message:

14 Invalid Tea in Get Started Developing For Android With Eclipse, Reloaded

Next, try entering a name for your tea, choosing a suitable brew time, and choosing “Save Tea� from the menu again. This time, you won’t see an error message. In fact, you’ll see nothing at all.

Improving the User Experience

While functional, this isn’t a great user experience. The user doesn’t know that their tea has been successfully saved. In fact, the only way to check is to go back from the “Add Tea� Activity and check the list of teas. Not great. Letting the user know that their tea was successfully saved would be much better. Let’s show a message on the screen when a tea has been added successfully.

We want the message to be passive, or non-modal, so using an AlertDialog like before won’t help. Instead, we’ll make use of another popular Android feature, the Toast.

Toasts display a short message near the bottom of the screen but do not interrupt the user. They’re often used for non-critical notifications and status updates.

Start by adding a new string to the strings.xml resource file. Notice the %s in the string? We’ll use this in the next step to interpolate the name of the saved tea into the message!

<!-- res/values/strings.xml -->
<string name="save_tea_success">%s tea has been saved.</string>

Modify the code in onOptionsItemSelected to create and show a Toast pop-up if the result of saveTea() is true. The second parameter uses of getString() interpolate the name of our tea into the Toast message. Finally, we clear the “Tea Name� text so that the user can quickly add more teas!

// src/com/example/brewclock/AddTeaActivity.java
// …
switch(item.getItemId()) {
 case R.id.save_tea:
   if(saveTea()) {
     Toast.makeText(this, getString(R.string.save_tea_success, teaName.getText().toString()), Toast.LENGTH_SHORT).show();
     teaName.setText("");
   }
// …

Now re-run your application and try adding and saving a new tea. You’ll see a nice Toast pop up to let you know the tea has been saved. The getString() method interpolates the name of the tea that was saved into the XML string, where we placed the %s.

16 Valid Save in Get Started Developing For Android With Eclipse, Reloaded

Click the “Back� button to return to the application’s main screen, and tap the tea spinner. The new teas you added in the database now show up as options in the spinner!

User Preferences

BrewClock is now fully functional. Users can add their favorite teas and the respective brewing times to the database, and they can quickly select them to start a new brew. Any teas added to BrewClock are saved in the database, so even if we quit the application and come back to it later, our list of teas is still available.

One thing you might notice when restarting BrewClock, though, is that the brew counter is reset to 0. This makes keeping track of our daily tea intake (a vital statistic!) difficult. As a final exercise, let’s save the total brew count to the device.

Rather than adding another table to our teas database, we’ll make use of Android’s “Shared Preferences,� a simple database that Android provides to your application for storing simple data (strings, numbers, etc.), such as high scores in games and user preferences.

Start by adding a couple of constants to the top of BrewClockActivity.java. These will store the name of your shared preferences file and the name of the key we’ll use to access the brew count. Android takes care of saving and persisting our shared preferences file.

// src/com/example/brewclock/BrewClockActivity.java
protected static final String SHARED_PREFS_NAME = "brew_count_preferences";
protected static final String BREW_COUNT_SHARED_PREF = "brew_count";

Next, we’ll need to make some changes to the code so that we can read and write the brew count to the user preferences, rather than relying on an initial value in our code. In BrewClockActivity’s onCreate method, change the lines around setBrewCount(0) to the following:

// src/com/example/brewclock/BrewClockActivity.java
public void onCreate() {
  // … 

  // Set the initial brew values
  SharedPreferences sharedPreferences = getSharedPreferences(SHARED_PREFS_NAME, MODE_PRIVATE);
  brewCount = sharedPreferences.getInt(BREW_COUNT_SHARED_PREF, 0);
  setBrewCount(brewCount);

  // …
}

Here we’re retrieving an instance of the application’s shared preferences using SharedPreferences, and asking for the value of the brew_count key (identified by the BREW_COUNT_SHARED_PREF constant that was declared earlier). If a value is found, it will be returned; if not, we’ll use the default value in the second parameter of getInt (in this case, 0).

Now that we can retrieve the stored value of brew count, we need to ensure its value is saved to SharedPreferences whenever the count is updated.

Add the following code to setBrewCount in BrewClockActivity:

// src/com/example/brewclock/BrewClockActivity.java
 public void setBrewCount(int count) {
   brewCount = count;
   brewCountLabel.setText(String.valueOf(brewCount));

   // Update the brewCount and write the value to the shared preferences.
   SharedPreferences.Editor editor = getSharedPreferences(SHARED_PREFS_NAME, MODE_PRIVATE).edit();
   editor.putInt(BREW_COUNT_SHARED_PREF, brewCount);
   editor.commit();
 }

Shared preferences are never saved directly. Instead, we make use of Android’s SharedPreferences.Editor class. Calling edit() on SharedPreferences returns an editor instance, which can then be used to set values in our preferences. When the values are ready to be saved to the shared preferences file, we just call commit().

With our application’s code all wrapped up, it’s time to test everything!

Run the application on the emulator, and time a few brews (this is the perfect excuse to go and make a well-deserved tea or two!), and then quit the application. Try running another application that is installed on the emulator to ensure BrewClock is terminated. Remember that Android doesn’t terminate an Activity until it starts to run out of memory.

When you next run the application, you’ll see that your previous brew count is maintained, and all your existing teas are saved!

Summary

Congratulations! You’ve built a fully working Android application that makes use of a number of core components of the Android SDK. In this tutorial, you have seen how to:

  • Create a simple SQLite database to store your application’s data;
  • Make use of Android’s database classes and write a custom class to abstract the data access;
  • Add option menus to your application;
  • Create and register new Activities within your application and bind them together into a coherent interface using Intents;
  • Store and retrieve simple user data and settings using the built-in “Shared Preferencesâ€� database.

Data storage and persistence is an important topic, no matter what type of application you’re building. From utilities and business tools to 3-D games, nearly every application will need to make use of the data tools provided by Android.

17 Brew Up in Get Started Developing For Android With Eclipse, Reloaded

Activities

BrewClock is now on its way to being a fully functional application. However, we could still implement a few more features to improve the user experience. For example, you might like to develop your skills by trying any of the following:

  • Checking for duplicate tea name entries before saving a tea,
  • Adding a menu option to reset the brew counter to 0,
  • Storing the last-chosen brew time in a shared preference so that the application defaults to that value when restarted,
  • Adding an option for the user to delete teas from the database.

Solutions for the Activities will be included in a future branch on the GitHub repository, where you’ll find the full source-code listings. You can download the working tutorial code by switching your copy of the code to the tutorial_2 branch:

# If you’ve not already cloned the repository,
# you’ll need to do that first:
# $ git clone git://github.com/cblunt/BrewClock.git
# $ cd BrewClock
$ git checkout tutorial_2

I hope you’ve enjoyed working through this tutorial and that it helps you in designing and building your great Android applications. Please let me know how you get on in the comments below, or feel free to drop me an email.

Thanks to Anselm for his suggestions and feedback!

(al)


© Chris Blunt for Smashing Magazine, 2011. | Permalink | Post a comment | Smashing Shop | Smashing Network | About Us
Post tags: , ,


A Crash Course in Typography: The Basics of Type

Advertisement in A Crash Course in Typography: The Basics of Type
 in A Crash Course in Typography: The Basics of Type  in A Crash Course in Typography: The Basics of Type  in A Crash Course in Typography: The Basics of Type

Typography could be considered the most important part of any design. It’s definitely among the most important elements of any design project. And yet it’s often the part of a design that’s left for last, or barely considered at all. Designers are often intimidated by typography, which can result in bland typographical design or a designer always using one or two “reliable” typefaces in their designs.


This series aims to change that. If you’re intimidated by typography, or even just aren’t quite sure where to start, then read on. We’ll break down typographic theory and practice, starting with the basics (so that everyone starts on the same page).

In this part, we’ll talk about the basics of typographic theory, including the different kinds of typefaces (and how typefaces and fonts differ), as well as the basic anatomy of a typeface. And each part will also offer more resources for delving deeper into typography.

1-heightsandlines in A Crash Course in Typography: The Basics of Type

Typefaces vs. Fonts: Difference?

A lot of people use the terms “typeface” and “font” interchangeably. But they’re two very distinct things. Before we get started talking about typography, let’s get our terms straight.

A typeface is a set of typographical symbols and characters. It’s the letters, numbers, and other characters that let us put words on paper (or screen). A font, on the other hand, is traditionally defined as a complete character set within a typeface, often of a particular size and style. Fonts are also specific computer files that contain all the characters and glyphs within a typeface.

When most of us talk about “fonts”, we’re really talking about typefaces, or type families (which are groups of typefaces with related designs).

Classifying Type

There are a number of different ways to classify typefaces and type families. The most common classifications are by technical style: serif, sans-serif, script, display, and so on. Typefaces are also classified by other technical specifications, such as proportional vs. monospaced, or by more fluid and interpretational definitions, such as the mood they create.

Serif

Serif typefaces are called “serifs” in reference to the small lines that are attached to the main strokes of characters within the face. Serif typefaces are most often used for body copy in print documents, as well as for both body text and headlines online. The readability of serifs online has been debated, and some designers prefer not to use serifs for large blocks of copy.

1-serif in A Crash Course in Typography: The Basics of Type

Within the serif classification, there are many sub-types. Old Style serifs (also called humanist) are the oldest typefaces in this classification, dating back to the mid 1400s. The main characteristic of old style characters is their diagonal stress (the thinnest parts of the letters appear on the angled strokes, rather than the vertical or horizontal ones). Typefaces in this category include Adobe Jenson, Centaur, and Goudy Old Style.

1-oldstyleserif in A Crash Course in Typography: The Basics of Type

Transitional serifs date back to the mid 1700s, and are generally the most common serif typefaces. Times New Roman and Baskerville are both transitional serifs, as are Caslon, Georgia, and Bookman. The differences between thick and thin strokes in transitional typefaces are more pronounced than they are in old style serifs, but less so than in modern serifs.

1-transitionalserif in A Crash Course in Typography: The Basics of Type

Modern serifs, which include typefaces like Didot and Bodoni, have a much more pronounced contrast between thin and thick lines, and have have a vertical stress and minimal brackets. They date back to the late 1700s.

1-modernserif in A Crash Course in Typography: The Basics of Type

The final main type of serif typeface is the slab serif. Slab serifs have little to no contrast between thick and thin lines, and have thick, rectangular serifs, and sometimes have fixed widths. The underlying characters hapes often more closely resemble sans serif fonts.

1-slabserif in A Crash Course in Typography: The Basics of Type

Sans-Serif

Sans-serif typefaces are called such because they lack serif details on characters. Sans-serif typefaces are often more modern in appearance than serifs. The first sans-serifs were created in the late 18th century.

1-sansserif in A Crash Course in Typography: The Basics of Type

There are four basic classifications of sans-serif typefaces: Grotesque, Neo-grotesque, Humanist, and Geometric. Grotesques are the earliest, and include fonts like Franklin Gothic and Akzidenze Grotesk. These typefaces often have letterforms that are very similar to serif typefaces, minus the serifs.

1-grotesquesansserif in A Crash Course in Typography: The Basics of Type

Neo-grotesque typefaces include some of the most common typefaces: MS Sans Serif, Arial, Helvetica and Univers are all neo-grotesques. They have a relatively plain appearance when compared to the grotesques.

1-neogrotesquesansserif in A Crash Course in Typography: The Basics of Type

Humanist typefaces include Gill Sans, Frutiger, Tahoma, Verdana, Optima, and Lucide Grande. These are more calligraphic than other sans-serif typefaces, and are also the most legible (hence the popularity of some of them for website body copy). They’re more calligraphic than other sans-serifs, meaning they have a greater variation in line widths.

1-humanistsansserif in A Crash Course in Typography: The Basics of Type

Geometric sans-serifs are more closely based on geometric shapes. Generally, the “O”s in geometrics will appear circular, and the letter “a” is almost always simple, just a circle with a tail. They’re the least commonly-used for body copy, and are also the most modern sans-serifs, as a general rule.

1-geometricsansserif in A Crash Course in Typography: The Basics of Type

Script

Scripts are based upon handwriting, and offer very fluid letterforms. There are two basic classifications: formal and casual. Formal scripts are often reminiscent of the handwritten letterforms common in the 17th and 18th centuries. Some scripts are based directly on the handwriting of masters like George Snell and George Bickham. There are modern creations, too, including Kuenstler Script. They’re common for very elegant and elevated typographical designs, and are unsuitable for body copy.

1-formalscript in A Crash Course in Typography: The Basics of Type

Casual scripts more closely resemble modern handwriting, and date back to the mid-twentieth century. They’re much less formal, often with stronger strokes and a more brush-like appearance. Casual scripts include Mistral and Brush Script.

1-casualscript in A Crash Course in Typography: The Basics of Type

Display

Display typefaces are probably the broadest category and include the most variation. The main characteristic is that they’re unsuitable for body copy and are best reserved for headlines or other short copy that needs attention drawn to it. Display typefaces can be formal, or informal, and evoke any kind of mood. They’re more commonly seen in print design, but are becoming more popular online with the use of web fonts.

Also included among display typefaces are blackletter typefaces, which were the original typefaces used with the first printing presses. Since that time, better, more readable fonts have been developed.

1-display in A Crash Course in Typography: The Basics of Type

Dingbats and Specialty Typefaces

Dingbats are specialty typefaces that consist of symbols and ornaments instead of letters. Wingdings is probably the best-known dingbat font, though there are now thousands, often created around themes.

1-dingbats in A Crash Course in Typography: The Basics of Type

The typeface above is Jellodings.

Proportional vs. Monospaced

In proportional typefaces, the space a character takes up is dependent on the natural width of that character. An “i” takes up less space than an “m”, for example. Times New Roman is a proportional typeface. In monospace typefaces, on the other hand, each character takes up the same amount of space. Narrower characters simply get a bit more spacing around them to make up for the difference in width. Courier New is one example of a monospace typeface.

1-proportionalvsmonospaced in A Crash Course in Typography: The Basics of Type

Mood

The mood of a typeface is an important part of how it should be used. Different typefaces have strikingly different moods. Commonly used moods include formal vs. informal, modern vs classic/traditional, and light vs dramatic. Some typefaces have very distinct moods. For example, Times New Roman is pretty much always going to be a traditional font, which is why it’s so commonly used for business correspondence. Verdana, on the other hand, has a more modern mood.

Some typefaces are more transcendent, and can convey almost any mood based on the content and the other typefaces they’re combined with. Helvetica is often considered one such font.

1-mood in A Crash Course in Typography: The Basics of Type

Weights & Styles

Within the majority of typefaces, you’ll find more than one style and/or weight. Weights are often classified as “light”, “thin”, “regular”, “medium”, “bold”, “heavy”, or “black”. Each of these refers to the thickness of the strokes that make up the characters:

1-weights in A Crash Course in Typography: The Basics of Type

There are three general styles you’ll find with many typefaces: italic, oblique, and small caps. Small caps are often used for headings or subheadings, to add variety to your typography if using a single typeface.

Italic and oblique are often confused or used interchangeably, but are two distinct styles. Oblique type is simply a slanted version of the regular characters. You could create this using the “distort” function in Photoshop, although sometimes a separate oblique font is included within a typeface. Italics are slanted like obliques, but are actually a separate set of characters, with their own unique letterforms.

1-styles in A Crash Course in Typography: The Basics of Type

The Anatomy of a Typeface

The different letterforms within a typeface share a few common characteristics. These characteristics can be important in determining whether two (or more) typefaces work well together, or clash. Here are the most basic parts of a typeface:

1-heightsandlines in A Crash Course in Typography: The Basics of Type

The above image shows the different guidelines that are generally present in a typeface. The baseline is the invisible line that all the characters sit on. Rounded letters sometimes sit just a tiny bit under the baseline, and descenders always drop below this line. A given typeface will have a consistent baseline.

The meanline is the height of most of the lowercase characters within a typeface, and is generally based on the lowercase “x” if there are varying heights among the lowercase characters. This is also where the term “x-height” comes from. The cap height is the distance between the baseline and the top of uppercase letters like “A”.

1-stembarbowl in A Crash Course in Typography: The Basics of Type

The above illustration shows three common parts to letterforms. The stem is the main upright of any letter, including the primary diagonal. It’s could be considered the anchor of the character. The bar is any horizontal part, which are sometimes also called arms. The bowl is the curved part of a character that creates an interior empty space. The inside of a bowl is a counter.

1-ascenderdescender in A Crash Course in Typography: The Basics of Type

The ascender of a lowercase character is any part that rises above the meanline, such as the uprights on the letters “d”, “h”, and “b”. Descenders are the parts of a lowercase character that drop below the baseline, such as in a “p”, “q” or “g”.

1-serifs in A Crash Course in Typography: The Basics of Type

Serifs are the extra flourish at the end of a stroke on serif typefaces. Some typefaces have very pronounced serifs, while others are barely distinguishable.

1-apertureearhairline in A Crash Course in Typography: The Basics of Type

The aperture of a character refers to the opening at the bottom of some characters, such as the uppercase “A” or lowercase “m”. An ear is a decorative extension on a letter, as highlighted on the “g” above. Hairlines are the thinnest part of a serif typeface.

1-crossbarterminalloop in A Crash Course in Typography: The Basics of Type

Crossbars are horizontal strokes, as found on the uppercase “A” and “H”. Terminals are only found on serif characters, and are the end of any line that doesn’t have a serif. Loops are found on some lowercase “g” characters, and can be fully closed or partially closed.

1-spurlinkspine in A Crash Course in Typography: The Basics of Type

Spurs are tiny projections from curved strokes, such as on some uppercase “G” characters. Links connect the top and bottom bowls of a double-stacked lowercase “g”. The spine is the curved stroke found on the letter “s”.

1-tailfinialshoulder in A Crash Course in Typography: The Basics of Type

Tails are sometimes-decorative descending strokes, as seen on an uppercase “R”. Finials are the tapered endings of some strokes. Shoulders are any curved stroke that originate from a stem.

In Part 2…

Next Monday we’ll discuss paragraph composition and using special typographic characters, like ligatures and hyphens. We’ll dive right into basic typographic layouts, and how to decide on a typeface for your project. Stay tuned!

Additional Resources

(ik)


Architecture Sources of Inspiration

Advertisement in Architecture Sources of Inspiration
 in Architecture Sources of Inspiration   in Architecture Sources of Inspiration   in Architecture Sources of Inspiration

Architecture surrounds us everyday, and because of that we sometimes overlook it as a potential source of inspiration. But architecture and interior design can inspire us for virtually any project. There are dozens of architectural styles out there, both formal and informal, to appeal to almost every taste.

We’ve rounded up more than forty great resources for you that should make finding inspiration in architecture child’s play. If you don’t feel like looking at your local architecture for inspiration or simply don’t have the time, turn to one of these sources instead!

Flickr Groups

There are literally hundreds of Flickr groups dedicated to architecture and interior design. And as it is with all Flickr groups, some are of higher quality than others. Below are ten of the more interesting Flickr groups dedicated to architecture and/or interior design.

Holga Architecture

The images featured in this group were taken with Holga (or Holga-style) cameras, resulting in a very interesting visual style that adds to the inspirational nature of the subjects.

Holga-Architecture2 in Architecture Sources of Inspiration

! Interior Design & Architecture

The ! Interior Design & Architecture Flickr group is one of the more diverse architecture groups on Flickr. The group’s pool has over 10,000 photos, including everything from interior and exterior shots of homes to design sketches and photos of churches and other public buildings.

Interior-design-architecture2 in Architecture Sources of Inspiration

Sydney Architecture

The Sydney Architecture group includes more than 4,000 images of the city of Sydney, Australia. Both interior and exterior spaces are included.
Flickr-Sydney-Architecture2 in Architecture Sources of Inspiration

Architecture (Clean Shots)

This is another diverse group that showcases architecture from around the world, with a definite focus on exterior shots. Virtually every style is included, from Classical to Modern, in the more than 15,000 photos in the group.

The-Architecture-Pool2 in Architecture Sources of Inspiration

1950s Interior Design and Residential Architecture

If you’re inspired by mid-century modern and other styles common on the ’50s, this is the group for you. Images include both authentic photos and sketches from the era as well as more modern images of 50s style.

1950s-Interior-Design1 in Architecture Sources of Inspiration

Cinema Architecture

The Cinema Architecture group on Flickr showcases theater and cinema architecture from around the world. There are currently over 12,000 photos included.

Cinema-architecture1 in Architecture Sources of Inspiration

Victorian Interior Design and Residential Architecture

This Flickr group focuses on the design of Victorian-era homes, with images of everything from entire houses to architectural details.

Vicotrianhouselovers1 in Architecture Sources of Inspiration

Details of Modern Architecture

The Details of Modern Architecture group includes more than 36,000 close-up images of modern architecture details.

Details-of-Modern-Architecture1 in Architecture Sources of Inspiration

Architecture – Rationalism

The Architecture – Rationalism group features more than 1400 images of rationalist architecture, including both photos and sketches.

Architecture-Rationalism1 in Architecture Sources of Inspiration

Brutalist Architecture

This group showcases brutalist architecture from around the world. Brutalism was a direct response to the early modernists that focused largely on smooth white walls; brutalist structures focused on architectural honesty and exposing the raw materials a building was constructed with.

Brutalist-Architecture1 in Architecture Sources of Inspiration

Architecture & Interior Design Blogs

There are thousands of architecture and interior design blogs online. Some focus on general architecture with a wide variety of styles, while others serve very specific niches. What the best ones all have in common, though, are the beautiful images and perspectives they serve up on a regular basis. Perfect for finding inspiration.

Desire to Inspire

Desire to Inspire covers largely interior design. They include mid-century modern, eclectic, modern and some traditional designs, with plenty of images in every post. Their alphabetically ordered blogroll provides you with many additional sources, should you need them.

Desiretoinspire in Architecture Sources of Inspiration

Velvet & Linen

Velvet & Linen is the blog of Giannetti Home, an interior design firm based in Los Angeles. Their blog covers high-end interior design, often with a focus on antiques beautifully presented in high resolution photography. Be sure to check out their extensive blogroll for more architecture and interior design sites.

Velvetandlinen in Architecture Sources of Inspiration

Materialicious

Materialicious aggregates content from a variety of other blogs and focuses on both architecture and interior design, with occasional features on other areas of design. Recent posts have included the 100th anniversary of Alfa Romeo, paper shoes, technology in spas, and the H2ome Yachting Villa. Be prepared to recieve multiple inspirational thrusts a day.

Materialicious in Architecture Sources of Inspiration

CubeMe

CubeMe is a blog focused entirely on modern architecture and design. They cover furniture, residential and commercial architecture, home accessories, artwork, and more. Exceptional curiosities make the site worth a regular visit.

Cubeme in Architecture Sources of Inspiration

Design Milk

Design Milk covers art, architecture, interior design, and more, with a decidedly modern slant. They also have features on technology, fashion and style.

Designmilk in Architecture Sources of Inspiration

Inhabitat

Inhabitat covers green architecture and related products and technology. They often feature some of the most extreme green and sustainable architectural concepts out there. The majority of their posts come with tons of photos and images, perfect for inspiration.

Inhabitat in Architecture Sources of Inspiration

DigsDigs

DigsDigs showcases mostly interior design, with a focus on products, though they also feature plenty of photo posts showing interior and exterior spaces. A regular feature shows off small space interiors, mostly apartments. Get ready to discover some really astounding ideas.

Digsdigs in Architecture Sources of Inspiration

Archinect

Archinect includes feature articles, image galleries, discussions and other architecture-related content. They cover both interior and exterior design, as well as products and interviews with prominent people in the industry. Those interested in more might want to check out the site’s literature section.

Archinect in Architecture Sources of Inspiration

A Daily Dose of Architecture

A Daily Dose of Architecture showcases beautiful buildings from around the world. The focus here is definitely on exteriors, though they occasionally feature other content.

A-daily-dose-of-architecture in Architecture Sources of Inspiration

BLDGBLOG

BLDGBLOG got it’s start back in 2004. They showcase architecture as well as interesting projects and products related to interior and exterior design (like “The Migration of Mel and Judith”, an entire narrative told on the inside of a lamp shade).

Bldgblog in Architecture Sources of Inspiration

Apartment Therapy

Apartment Therapy showcases the best in small-space living, mostly focusing on interior design. They cover products, design concepts, and room designs, and occasionally feature video content.

Apartmenttherapy in Architecture Sources of Inspiration

Design*Sponge

Design*Sponge focuses largely on interior design, with a definite focus on more handcrafted items and designs, though still with a modern flair. Each post is filled with inspiring images, often of interiors that juxtapose unexpected elements.

Designsponge in Architecture Sources of Inspiration

Design Observer

Design Observer features all areas of design and culture. They regularly feature architecture and interior design, including their regular “Accidental Mysteries” feature, which showcases oddities on a weekly basis.

Designobserver in Architecture Sources of Inspiration

Modern Architecture & Design News

Modern Architecture & Design News showcases the best new modern design from around the world. Their posts are filled with images to inspire, and they post new content a couple times each day.

Modernarchdesignnews in Architecture Sources of Inspiration

Earth Architecture

Earth Architecture covers buildings created from natural, earth-based materials from all over the world. According to the site, “One half of the world’s population, approximately 3 billion people on six continents, lives or works in buildings constructed of earth.”

Eartharchitecture in Architecture Sources of Inspiration

Contemporist

Contemporist covers architecture, furniture, interiors and other design-related topics. As the name suggests, the focus is primarily on contemporary and modern designs.

Contemporist in Architecture Sources of Inspiration

Tumblr Blogs

Tumblr often has some of the most forward-thinking blogs (or tumblogs) out there on any given topic, and architecture is no different. There are literally hundreds of fantastic architecture and interior design Tumblr blogs. Often there’s little commentary associated with posts, just beautiful image after beautiful image. Here are some of the best:

Picture Perfect Home

Picture Perfect Home showcases both interior and exterior design, with no real with no real style theme other than the fact the homes featured are beautiful.

Pictureperfecthome in Architecture Sources of Inspiration

Harmony in Design

Harmony in Design showcases a variety of interior and exterior images, mostly with a traditional style, though there are some modern gems interspersed.

Harmonyindesign in Architecture Sources of Inspiration

My Little House

My Little House showcases mostly interiors, and as the name suggests, small spaces.

Mylittlehouse in Architecture Sources of Inspiration

Architizer

Architizer features some of the most interesting modern and conceptual architecture out there, with a focus on buildings that break traditional boundaries.

Architizer in Architecture Sources of Inspiration

Simplypi

Simplypi offers daily posts on architecture, arts, design, product design, and more, though there seems to be a definite slant toward architectural images.

Simplypi in Architecture Sources of Inspiration

Architectural Models

Architectural Models showcases amazing models of architecture in a variety of styles and materials. It’s a departure from more traditional architecture blogs, which adds even more potential for inspiration.

Architecturalmodels in Architecture Sources of Inspiration

Architectural Inspiration

This Tumblr blog showcases interior and exterior photos, as well as detial shots of particular architectural details. A wide variety of architectural styles are included.

Architectureinspiration in Architecture Sources of Inspiration

Cabbage Rose

With a name like Cabbage Rose, you’d probably expect a blog focusing on “Shabby Chic” or similar country interiors. But you won’t find that here: this Cabbage Rose focuses on mostly modern and eclectic interiors.

Cabbagerose in Architecture Sources of Inspiration

The Architecture Blog

The Architecture Blog showcases residential and commercial architecture, with both interior and exterior shots. Most of the buildings featured are modern, though there are a few more traditional images.

Thearchitectureblog in Architecture Sources of Inspiration

Loftylovin

Loftylovin showcases open-plan living spaces from around the world, including both modern and more traditional interiors.

Loftylovin in Architecture Sources of Inspiration

Interior Decline

Interior Decline showcases beautiful interiors. There are a variety of styles included, though they all have one thing in common: luxury.

Interiordecline in Architecture Sources of Inspiration

Baan

Baan, which means house or home in Thai, features gorgeous interiors and designs from around the world. There’s a definite organic feel to most of what they feature, though the styles are eclectic.

Baan in Architecture Sources of Inspiration

Home Sweet Home

A huge variety of styles are featured on the Home Sweet Home tumblog. Images include interiors and exteriors, most of which have a very “homey” feel to them, as would be expected by the title.

Homesweethome in Architecture Sources of Inspiration

My Ideal Home

My Ideal Home features a variety of home styles, with both interior and exterior photos. Many of the images are light and airy, and there seems to be an abundance of interiors in mostly white.
Myidealhome in Architecture Sources of Inspiration

Nice*Room

Nice*Room shows off interior images, most of which are fairly traditional and casual.

Niceroom in Architecture Sources of Inspiration

If you have any other favorite architecture inspiration resources, please share them in the comment section below!

(sp) (ik)


Photo Retouching Tips And Tricks In Photoshop

Advertisement in Photo Retouching Tips And Tricks In Photoshop
 in Photo Retouching Tips And Tricks In Photoshop  in Photo Retouching Tips And Tricks In Photoshop  in Photo Retouching Tips And Tricks In Photoshop

Two weeks ago we published the first part of Photoshop tips and tricks for photo retouching. Today, we’ll be presenting the rest of the article. We hope that these techniques will be quite useful for your workflow. You may know some of them, but hopefully not all of them. We have had articles on various tools in Adobe Photoshop but this one is focused more on the techniques rather than the tools provided. Please note that all images used in this article were purchased and are used according to their licenses.

Here is a short overview of the techniques we’ll be covering in this follow-up:

Defining Colors

If you want to redefine the foreground and background colors, use the Eyedropper tool to select the foreground color, and then switch the position with the background color, maybe by using the shortcut X, and pick up the next color. But there is an easier way. First, define the foreground color just as you’re accustomed to, but then define the background color by holding the Alt/Option key. Instead of changing the foreground color, you’ll redefine the background color with just one click.

30-tips-and-tricks22 in Photo Retouching Tips And Tricks In Photoshop
Define foreground and background colors.

Controlling Folders

Folders give structure to layers, which is especially important if you’re working on demanding compositions. Folders are often collapsed, so you can’t see the contents at first sight. This conserves space but it’s not always desirable. If you want nested layers to reveal their contents and offer a quick overview, hold the Control/Command key and click on one of the triangles to expand. All folders at the first level will expand. You can collapse them again using the same trick. To expand all nested folders inside the folders as well, hold the Alt/Option key as well as the Control/Command key.

30-tips-and-tricks25 in Photo Retouching Tips And Tricks In Photoshop
Hold the Control/Command key to expand the folder.

Split-Toning Effect

Create two new gradient maps via Layer → New Adjustment Layer → Gradient Map. You could, for example, create a gradient from dark-blue to beige and another from dark-brown to white. To change a gradient, click on it to open up the “Gradient Editorâ€� dialog box. There, click on your chosen color patches and open up the color picker via the “Color field.â€�

30-tips-and-tricks17a in Photo Retouching Tips And Tricks In Photoshop
Blending Options: This Layer

Confirm with “OK,� double-click the layer with the second gradient map and, under “This Layer,� move the right slider to the left. To make the transition a little smoother, click on the slider while holding down the Alt/Option key and move it to the right. Confirm with “OK.�

30-tips-and-tricks17b in Photo Retouching Tips And Tricks In Photoshop
Split-Toning Effect

Flexible Vignette

To create a non-destructive vignette, go to New Adjustment Layer → Levels. Darken the image completely by, for example, setting the Highlights down to 80. Now use the Brush tool with black color to paint the light center into the layer mask. Instead of using a brush to paint the area, you could use the Elliptical Marquee tool and fill the selection with black.

30-tips-and-tricks16a in Photo Retouching Tips And Tricks In Photoshop
Adjustment Layer: Levels

You can use the Move tool to adjust the vignette’s position any time, or blur it using the “Gaussian Blur.� You can also increase or decrease the darkening. To do so, open the Levels Adjustment dialog box again.

Skin Retouching In Camera Raw

Again, open a photo in Camera Raw (for example, by using the right mouse key from Bridge and clicking “Open in Camera Raw�). In general, you can use the Spot Healing Brush tool and all other tools and sliders to improve the image. When you’re happy with it, hold the Shift key and click on “Open Object.� The image will be put on a new layer as a Smart Object.

You could also click the blue link at the bottom of the screen, which opens the “Workflow Options� dialog window. From there, you can control some other settings as well. Make sure to check the “Open in Photoshop as Smart Object� checkbox, and then confirm with “OK� to open the images (without having to holding Shift).

30-tips-and-tricks4a in Photo Retouching Tips And Tricks In Photoshop
Here, layers are smart objects.

Right-click on the layer and choose “New Smart Object via Copy,� and then open the Camera Raw dialog box again by double-clicking the layer icon. Set the “Clarity� value to -100 and confirm with “OK.� Hold the Alt/Option key and click on the “Create Layer Mask� button, then use a soft brush to paint over the optimized skin. Use the opacity slider to control the amount of retouching.

30-tips-and-tricks4b in Photo Retouching Tips And Tricks In Photoshop
Here is optimized skin with the help of Camera Raw.

Setting Lights

If you want to do some virtual re-positioning of your strobes, then neutralize the shot first. Go to Select → Color Range, and set Select option to “Highlights.â€� Copy the selection content to a new layer by hitting Control/Command + J. Activate the background layer again, and select the “Shadowsâ€� this time. Bring those to their own layer, too, with Control/Command + J, and then set the blending mode to “Screenâ€� and the highlights to “Multiply.â€�

30-tips-and-tricks13a in Photo Retouching Tips And Tricks In Photoshop
Highlights and shadows

Reduce the opacity to about 30%, depending on the image content. “Shadows/Highlights� might also help. On a new layer, filled with a neutral gray and its blending mode set to “Overlay,� paint in the desired light quality with the Dodge and Burn tools. Alternatively, add a new layer and set its blending mode to “Soft Light� or “Overlay� and, with a low opacity brush, paint black and white on this layer.

30-tips-and-tricks13b in Photo Retouching Tips And Tricks In Photoshop
The lights were neutralized a bit.

Distinguished Paleness

For a distinguished paleness, copy the background layer and set its blending mode to “Screen.â€� Use Image → Adjustments → Desaturate or “Black & White,â€� then “Shadows/Highlightsâ€� to increase the effect. The exact adjustment options can vary according to your image content.

30-tips-and-tricks2a in Photo Retouching Tips And Tricks In Photoshop
Here’s the layer after creating the mask.

The effect will cover the entire image unless you click on the “Create Layer Mask� button while holding the Alt/Option key, and then paint the pale areas with the brush tool and white color. You can control the effect’s strength with the opacity slider.

30-tips-and-tricks2b in Photo Retouching Tips And Tricks In Photoshop
Distinguished paleness.

Dodge And Burn Look

Copy the reduced layers to a new layer with Shift + Control/Command + Alt/Option + E, and then set the blending mode to “Vivid Light.â€� Use Control/Command + I to invert the layer content, and apply Filter → Blur → Surface Blur with a radius of about 70 pixels and a threshold of 40 levels. Press Shift + Control/Command + Alt/Option + E again, delete the layer below, and set the blending mode to “Overlay.â€� Apply a “Gaussian Blurâ€� to make the contours a little softer, and then click Image → Adjustments → Desaturate.

30-tips-and-tricks9 in Photo Retouching Tips And Tricks In Photoshop
Dodge and Burn Look

Bright Eyes

To make eyes appear brilliant, click on New Adjustment Layer → Exposure. Fill the layer mask with black (or invert the mask), and paint with white over the irises and with black over the pupils. Set the blending mode of the adjustment layer to “Luminosity.â€� Increase the exposure in concert with the gamma value to give the iris structure more contrast. Also, try changing the “Offset slider.â€�

30-tips-and-tricks11 in Photo Retouching Tips And Tricks In Photoshop
Create beautiful eyes with exposure.

The Orton Effect

With the Orton effect, sharp and blurred versions of a photo are mixed together. Copy the background layer with Control/Command + J, and click on Image → Apply Image. Change the blending mode to “Screenâ€� and click “OK.â€� Copy the current layer again with Control/Command + J. Apply a Gaussian Blur to this copy by clicking Filter → Blur → Gaussian Blur. The value will depend on the size of the image. The shapes should always blur slightly. Set the blending mode for the layer to “Multiply.â€�

30-tips-and-tricks15 in Photo Retouching Tips And Tricks In Photoshop
The Orton effect creates contrast and depth.

Optimizing Lasso Selections

Many users (even professionals) prefer the Lasso Selection tool to the Path tool for uncomplicated selections. To switch to the Polygon Lasso tool for a short stretch, hold the Alt/Option key while working. To switch back to the regular Lasso tool, just release the Alt/Option key while depressing the mouse button.

30-tips-and-tricks28 in Photo Retouching Tips And Tricks In Photoshop
Switching between the Lasso and Polygon Lasso tools is easy.

It often happens that, during a zoom, you hit the edge of the work area while making a selection. Just keep the space bar pressed to switch to the Hand tool, and you can quickly change the displayed image section.

Aligning Layer Contents

Some areas in Photoshop are hardly ever noticed. This is one of them. If you activate the Move tool, you’ll see some mysterious symbols to the right called Align tools, in the option bar next to Auto-Select and the Transform controls (which are basically equivalent to Free Transform).

30-tips-and-tricks29 in Photo Retouching Tips And Tricks In Photoshop
Align tools

If you activate just one layer, the Align tools won’t do anything, but if you select two or more layers by holding the Control/Command key, then you can align the layer’s contents with these buttons. Choose from options such as “Align Top Edge� and “Align Vertical Center.�

Restoring Selections

Often, while in the middle of working on a tricky selection, you’ll accidentally deselect it by clicking once too often. You can restore the lost selection by pressing Shift + Control/Command + D. This will get the ants marching again. You can also undo (Control/Command + Z) the action, and even perform multiple undos with Control/Command + Alt/Option + Z.

By the way, you can hold the Alt/Option key to subtract elements from the selection at any time, or hold the Shift key to add to the selection. Pressing a combination of both keys creates a selection intersection. Important selections that you might need later can be saved by going to Select → Save Selection.

30-tips-and-tricks30 in Photo Retouching Tips And Tricks In Photoshop
Restore lost selections.

More Tips and Tricks to Improve Your Workflow:

(al) (vf) (ik)


© Dirk Metzmacher for Smashing Magazine, 2011. | Permalink | Post a comment | Smashing Shop | Smashing Network | About Us
Post tags:


  •   
  • Copyright © 1996-2010 BlogmyQuery - BMQ. All rights reserved.
    iDream theme by Templates Next | Powered by WordPress