Welcome to Red Kite Web


Well I have finally moved to the dark side.  Had been developing my own CMS in .NET but due to writing the code in .NET 4 and the hosting I have already not supporting .NET 4 I have decided to move over to using Word Press.  This may change in the future but for not word press it is.

Any how welcome to the blog the main aim will be to publish posts on various topics on web and android development but basically will be a diary on progress on various projects that I am working on covering the problems/issues that I encounter on during the development of these projects and the methods I have employed to resolve these problems.


TDD and JavaFaces.

Recently I have read about Test Driven Development and wanted to investigate this more. I wanted to look at creating a walking skeleton of a java server faces web application. This at first looks like an easy process to do as unit testing is relatively easy as with java server faces the backing beans are just standard java classes and so can be unit tested in the normal way.
The issue that I encountered was with end to end testing where I wanted to test as if I was using a browser requesting content from a web server. After several google searches I found the jsf-test component by richfaces that seems to be quite easy to set up to test most web applications.
To include the component in a maven project just add the following to the pom.xml file.


To make it easier to locate the document root of the web application the following is added to configure the sure-fire plugin to add the ‘webapp’ parameter to the system parameters.


To use the component any tests should extend the class AbstractFacesTest and override the setupWebContent method.

public class FacesUnitTest extends AbstractFacesTest {

protected void setupWebContent() {
final String webAppDirectory = System.getProperty("webapp");
if (null == webAppDirectory) {
throw new TestException("The 'webapp' system property does not set");
final File webRoot = new File(webAppDirectory);
facesServer.addResourcesFromDirectory("/", webRoot);

The richfaces component also includes the htmlunit component as a dependency that can be used to connect to html pages using a client then by finding links, buttons etc can be used to navigate the application as if a user was clicking the buttons, links and filling in forms.
Within the test class in each individual tests the a new WebClient can be created and used to get pages from the facesServer.
The following snippet connects with the web client and gets the “index.jsf” file from the root context of the facesServer finds the anchor with the id homeLink on the page and clicks this link returning a new page homePage.

final WebClient webClient = new LocalWebClient(facesServer);
final HtmlPage page = webClient.getPage("http://localhost/index.jsf");
final HtmlAnchor homeLink = (HtmlAnchor)page.getElementById("homeLink");
final HtmlPage homePage = homeLink.click();

The AbstractFacesTest could also be used to extends a helper class that would allow tests to be placed in separate test classes with methods within the helper class to do particular functions such as logging in, logging out, registering new users, viewing articles in a blog etc.

Maps and G+

Due to the slow loading of the XML I have changed the way the bird list is maintained, it is now contained within a database within the asset directory which using SQL populates the application’s database which is much quicker as the XML method was taking nearly 30 mins with all the birds that needed to be loaded.
I have added maps to the view list, bird sighting summary and individual sighting screens also there are now landscape and portrait versions of these screens so that they are more useable when in these orientations.
On the individual sighting screen there is now a G+ button to allow posting the sightings to Google+ to allow others see the sightings.

UI thread changes

All database access has now been removed from the UI thread hopefully this should make the application UI more responsive.  Also app sizes have been checked to make sure that the units are as Google suggest all view sizes, margins and padding are in do and all font sizes are is sp.  This does now make the app look a bit different so need to review the font sizes used and change where necessary.
The next bit of work that needs to be carried out is a supporting web site that allows for the XML file of bird names to be maintained.  This will allow for additional birds to be added easier as currently the XML has to be maintained by hand which is very slow.

Thoughts after app published

So now I have published the Bird Sighting List app it is time I took stock of the application and reviewed my findings.
Firstly the app appears to work quite well at least on my phone but I have found a few issues:

  1. My nexus 10 does not have the hardware buttons that my phone does and so the menu options can not be accessed on the nexus 10 or any other device without hardware buttons so I think changes from the menu to use the action bar should be made.
  2. Although it is not causing issues on my phone the app does access the database on the ui thread which may cause the app to be unresponsive so I will change this in the next version.
  3. Although I had given the app some thought about how it would work and the basic functionality to be included in the first draft I made not given any thought to promotion of the app. Posts have been made on Facebook, Google+, twitter and on this site but that is not really aiming at the target audience for the app so need to think on how to address this.

Bird List starts to take shape

The main functionality of the Bird List application has been completed.  The users can now create lists, add sightings and view sightings.
The view sighting shows the time of the sighting and draws a map with a pointer to show where the sighting was made from. The user can also add notes to sightings.
With the ability to add notes to sightings l have found that when adding a sighting the app should navigate to the view sighting screen so notes can be added once the sighting has been created.

Bird List

Been toying with doing this project for a while.
I am a birdwatcher and have been thinking of creating a database of my sightings. But realized that a mobile app would be much more useful as it could capture location Information, date and time much more conveniently than using a notepad and pen.
So my thoughts were that I could and categorise these sightings by allowing the app too have multiple lists that filter through to a “Life List” that is an overall list of all sightings.
Information to be captured would be bird name (Entered in either common name or latin), date time and location. On top of this notes could also be attached, number of birds, sex and either juvinile or adult.
The actual app itself would appear to be quite straight-forward to write to capture the information noted above but what dawned on me was that what might be quite useful would be the ability to save thy data to a web site so that multiple users data would be available in such a way that analysis of sightings from anonymouse data could highlight He spread of different birds etc.
One bit of functionality that I have though about is attaching images to the sightings but due to the cameras on smartphones I have decided that this may not be worth doing for any first versions.
Maintaining the list of birds that can be selected may be a problem too as this would need to have all the birds of the world in the list which would obviously be quite a large list. This could be helped by adding regions that birds could be seen in but this would not be very useful for recording rarities so needs some thinking about.  Also having a large list makes selecting the bird trickier as entering names would provide a larger selection of possibilities. Ohe solution here would be to list birds from the region you are in first in the list.

The Redesign Preperation

After reading the documentation on buddy press a new strategy has been used during the redesign of the community flats website.

Firstly I do not need to copy all the files from the buddy press default theme as I had assumed as we only need to create ones to override the default ones if the theme is created correctly.

So to start I created a new directory called theflat.  Inside this we create the style.css file which has a header this is the key into creating a theme that inherits from the default theme.  The header should look as follows:
Theme Name: The Community Flat
Theme URI: http://www.redkiteweb.co.uk/index.php/category/projects/theflat/
Description: The Community Flat Theme for Buddy Press
Version: 1.0
Author: RedKiteWeb
Author URI: http://www.redkiteweb.co.uk/
Template: bp-default
Tags: buddypress, two-column, grey, dark

This has the details of the theme.  A breakdown of these lines is as follows:

  1. Theme Name: The name of the theme.
  2. Theme URI: The location of the details.
  3. Description: The description of the theme.
  4. Version: The version of the theme.
  5. Author: The Author of the theme.
  6. Author URI: The location of the authors site.
  7. Template:  This detail of the header is important as this is the details of the parent template that will be used.  In the above case bp-default is the buddy press default theme.
  8. Tags: This is a list of features of the theme.  IMPORTANT if the theme is to be used as a buddy press theme the list of tags must include the tag BuddyPress.

Once this style sheet has been created we can start to change the theme itself.

First steps

The old posts have now been added to the site, along with the plugin “Category Sticky posts” this allows posts to be made features of categories.

So now the prep work has been completed I can start to make changes to the design of the site.

The first things to do will be to take a copy of the original theme and make a copy of if renaming it with a more appropriate name.

The header image will ge designed and uploaded ready for use.

In keeping with the old site there will be quite a few CSS modifications for colour changes as the old site was a dark theme we want to keep this new theme as a dark theme but the default design we are using is a light theme.

The flat project initiated

So the old site has now been backed up.  Word press installed along with the buddy press plugin.

There are still a couple of changes that need to be made first these being the restoration of previous articles into the word press site along with the upload of the images that were uploaded into the old site.

Once these tasks are completed the redesign can start to take place.