Archive for the ‘Programming’ Category

Au Weather Android full steam ahead (for now)

Friday, August 13th, 2010

Wow, it’s been a hectic two week stint!   A few weeks ago I started developing an Android Weather app to display Australian weather sourced from the Bureau of Meteorology purely because the Android weather app I was using did not display the correct rainfall values: it said  no rain, while I was getting drenched !  Now I have an Android Market app (Au Weather) including widget, almost 500 installs, product pages, a hosted server, the list goes on.

Since I released Au Weather on the Android Market two weeks ago, I’ve been working almost non-stop on it in my free time (birthdays are such an inconvenient waste of time – jk!). Finally I’m getting time to come up for air, but not too much, I’m aiming for another update this weekend.  It will hopefully be the last for a while.

It’s still in the beta stage and I still have to decide if it’s going to be worthwhile developing and supporting it.  The biggest issue is that Google currently doesn’t support Australian developers to sell their apps through the Android Market.  Currently I’m hoping to generate some revenue with ad support – we’ll see how that goes.

As with any software there’s a never ending wish list of features.  Some of mine includes at least two more widgets: a compact 1×1 and a wide 4×1 widget that shows forecast values, satellite images, radar images, select station from map, slicker interface etc.  Maybe these will come in a future, possibly paid, version?

It’s been a while!

Friday, July 30th, 2010

Well I’ve been busy at work with my contract that started in February!  I feel bad for neglecting my blog like I did.  Oh well, it happens to the best of families and hopefully I’ll be back a bit more frequently.

Anyway, exciting time for me.  I have dived into a bit of Android development.  I’m almost ready to publish the beta version of my Australian weather app.  The app displays weather readings from the closest weather station and also has a homepage widget.  I’ll be putting it up for download on the main site soon.

I’ll also try to make some posts on Android development and some of the GIS development I have been involved recently.

I almost forgot: I have recently been approached by an environmental consulting firm to develop a web based ASP.NET integrated GIS interface.  I’ll be using MapServer as image server engine and native ASP.NET and AJAX.

Exciting times indeed.

Retrieving XML value pairs into a collection

Thursday, March 25th, 2010

Retrieving value pairs from an XML file based on an XML defined property (in this case production/test) is shown below:

Example XML file:

<?xml version=”1.0″ encoding=”utf-8″?>
<configuration>
<appSettings>
<add key=”env” value=”test” />
</appSettings>
<production>
<add key=”abc_Server” value=”produvtion” />
<add key=”abc_Port” value=”5560″ />
<add key=”abc_User” value=”abcdba” />
<add key=”abc_Password” value=”xxx” />
<add key=”abc_Version” value=”DEFAULT” />
<add key=”DBName” value=”prod” />
<add key=”DBUserName” value=”abcdba” />
<add key=”DBPassword” value=”xxx” />
</production>
<test>
<add key=”abc_Server” value=”dev_env” />
<add key=”abc_Port” value=”6169″ />
<add key=”abc_User” value=”abcdba” />
<add key=”abc_Password” value=”xxx” />
<add key=”abc_Version” value=”DEFAULT” />
<add key=”DBName” value=”dev” />
<add key=”DBUserName” value=”abcdba” />
<add key=”DBPassword” value=”xxx” />
</test>
</configuration>

Retrieve value pairs into a NameValueCollection (remember to reference System.Collections.Specialized) and reference an item:

Dim elem As XmlElement = CType(XmlDoc.SelectSingleNode(“//appSettings/add[@key='env']“), XmlElement)
Dim currentEnv As String = elem.GetAttribute(“value”)
Dim nodeList As XmlNodeList = XmlDoc.GetElementsByTagName(currentEnv)

Settings = New NameValueCollection

Dim oNode As XmlNode
Dim oKey As XmlNode
For Each oNode In nodeList
For Each oKey In oNode.ChildNodes
Settings.Add(oKey.Attributes(“key”).Value, oKey.Attributes(“value”).Value)
Next
Next

ConnectionString = “Data Source=” & appSettings(“DBName”) & “;”

GIS Development and Environmenal Solutions in Australia

Monday, February 15th, 2010

Web based GIS , environmental, health and safety solutions and business driven web applications are just some of the exciting services that Infinite Digital Solutions offers.

For more information visit the Infinite Digital Solutions website.

Using jQuery UI DatePicket in ASP.NET

Thursday, January 14th, 2010

After spending numerous frustrating hours (OK maybe minutes) to get a decent example of implementing the jQuery UI date picker in ASP.NET I decide to jot it down here.  First download it if you don’t have it yet here.

First you want to reference the stylesheet:

<link href="CSS/ui-lightness/jquery-ui-1.7.2.custom.css" rel="stylesheet" type="text/css" />

(I selected the ui-lightness theme when I downloaded and placed it in the CSS folder I created – this should go into the HEAD section of your aspx page)

Next you need to reference the script files (in the aspx body section):

<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script src="js/ui/ui.core.js" type="text/javascript"></script>
<script src="js/ui/ui.datepicker.js" type="text/javascript"></script>

(I copied the scripts to a the js folder I created)

Now add a textbox to the page that will pop-up the calendar when selected receive the date selected, I named mine txtValue1.  Also set the CssClass:

<asp:TextBox ID="txtValue1" runat="server" CssClass="ui-datepicker" Visible="true"></asp:TextBox>

Finally you need the JavaScript to pop the date picker (I added it to the top of the page in the body section after the previous script references):

<script type="text/javascript">
$(document).ready(function() {
$("#<%=txtValue1.ClientID %>").datepicker();
});
</script>

And that’s about it!

If you have hassles, make sure that the stylesheet and script files are correctly referenced.