Archive for category Codeing
HTML 5, whats to know
Posted by Matt in Codeing, Web Design on May 23, 2010
The new web standards HTML 5 and CSS 3 seem to be getting a lot of good press at the moment. So what’s out there for the working web dev to learn from?
Some very interesting demo’s of what can be done are available around the web but I’m in need of some good tutorial recommendations. So what you got that offers more than http://www.w3schools.com/html5/html5_reference.asp
Please share your links in the comments
Setting up an android development enviroment on FC10
Posted by Matt in Codeing, Linux, Mobile Web on March 7, 2010
A newbie guide to android development
One of the reasons I wanted an Android based smart phone was that I was feeling the need to try something different from the daily php based work . It was time to learn something new , something a little exiting and on the forward edge.
Any time access to the web from mobile platform’s is without doubt the culmination of the dream. This is the killer app aspect of the Internet and people are waking up to this reality. Smart phones , net book’s and in the near future pad style devices will change the way we interact with the cloud. By its open nature I believe android will play a big part in this.
First task then was to get the environment set-up.
To do this we need two pieces of software installed eclipse the popular cross platform IDE and the Android SDK. You will also need to ensure you have Java installed and set-up on your machine.
I tried to set this up using the version of eclipse available to FC10 via Yum but encountered real issues late in the process so I downloaded the classic version from the eclipse website http://www.eclipse.org/downloads/, which just needs extracting and then runs with out any futher installation .
Download the Android SDK from Google and install it
This is easy enough just unpack the download into a directory. Like eclipse the software runs in place
Set up your path
While not an essential step adding the location of the CLI android tools to your path will probably make life a little easier.
To do this edit your ~/.bashrc file and add a line to the bottom:
export PATH=${PATH}:/home/matt/android/android-sdk-linux_86/tools
Install the Android Development Tools (ADT) for Eclipse
Firstly launch Eclipse.
Follow the excellent instructions at http://developer.android.com/sdk/eclipse-adt.html to install the development tools.
Install packages for eclipse
Next you need to install a bunch of packages . In Eclipse, click “Window->Android SDK and AVD Manager.” In the resulting window, on the left-hand side will be an “Available Packages” option. Click that, then click the checkbox beside the “repository.xml” package to select all available packages and then click “Install Selected“. Once this has completed your ready to begin developing your first android application
Create you first application
The traditional starting point for learning any new language is the humble ‘Hello world’ and is android is no different. Follow the tutorial at
http://developer.android.com/guide/tutorials/hello-world.html for a nice introduction to the android architecture.
Set up a connection to your hardware
The hello world tutorial introduces you to the emulator included with the SDK. But if you have an Android powered handset you’ll find it a lot less pain to set up a debug/test connection to your hardware.
To do this first, set your phone for USB debugging.
In your Android phone, go to Settings -> Applications -> Development menu, and make sure “USB debugging” is checked (activated).
Connect the phone to your computer via USB cable.
In a terminal type the lsusb command to list all USB devices.
Identify the VendorID and ProductID of your device
Bus 001 Device 065: ID 22b8:2d66 Motorola PCS
VendorID in my case is 22b8 the ProductID is 2d66
As root type
vi /etc/udev/rules.d/51-android.rules
to create a new file and paste the following rule into the file
UBSYSTEMS=="usb", ATTRS{idVendor}=="22b8", ATTRS{idProduct}=="2d66", MODE="0666"
Re-connect your phone.
Your phone should be detected if you unplug and reconnect it to the computer.
Restart the ADB server
adb kill-server
adb devices
You should see your device listed.
You can now access your phone from the Eclipse IDE and run/debug applications on it.
Useful links
http://www.mattcutts.com/blog/install-android-on-ubuntu/
http://developer.android.com/guide/tutorials/hello-world.html
http://www.futuredesktop.org/developing_android_apps_on_ubuntu.html
Hello android
Posted by Matt in Codeing, Linux, Mobile Web on March 5, 2010
Six useful tips and tools for web developers
Posted by Matt in Codeing, Web Design on March 2, 2010
As part of my day to day working and reading I often come across useful tips and tools which I add to my Delicious bookmarks. I share these automatically in the right hand bar of this site. From time to time I will highlight some of the best and most useful of these links.
Use JavaScript to move items between two select lists
Html multiple selects are probably the most unfriendly form elements in the html specification as they provide no visual clues on how to interact with them. By applying some JavaScript however you can use them to create an intuitive user experience for selecting multiple values. The link below will take you to a nice tutorial with code samples and downloads that can easily be integrated with some CSS and back end scripting to produce a powerful select control.
http://www.mredkj.com/tutorials/tutorial_mixed2b.html
Fixing your footer with CSS
One of the most frustrating aspects of CSS based layout is getting the footer of a site to stick to the bottom of the page no matter the screen size or content on the page. This link will take you to a great article that describes how to achieve this in a cross-browser friendly way. It even works with IE6.
http://fortysevenmedia.com/blog/archives/making_your_footer_stay_put_with_css/
Fixed table headers
Tables are an essential tool for displaying data in web applications but can become difficult to understand and interpret if you have to scroll down to see lots of data. By fixing the header if a table in place and just scrolling the data your tabular data will be far more user friendly and easier to understand. The example located at this link will show you how to achieve this by applying some CSS to your table header and body.
http://www.imaputz.com/cssStuff/bigFourVersion.html
Toggle visibility of a page element
Some times you need to make the display of information optional . This link illustrates a number of methods to do this.
http://www.dustindiaz.com/seven-togglers/
Maximum and Minimum height and width support in Internet Explorer
IE6 doesn’t support them and IE 7 only supports them when you declare a strict DocType. This article describes how you can use some proprietary IE features to simulate these incredibly useful features.
Test your PHP regular expressions
Regular expressions are a powerful programming tool . I’ve used many test platforms when creating regular expressions but for designing expressions for use with PHP’s regular expression functions this tool rocks.
http://www.spaweditor.com/scripts/regex/index.php
Do you have a useful tool or tip you’d like to share? Why not add a link into the commonts of this post.
php cli script for automatically updating your dynamic DNS record.
So I brought my son an Xbox 360 for Christmas and after a few teething troubles with the hardware he now comes home from school and jumps onto the Xbox live service to chat and play with his friends. I’m cool with this however it did cause a few problems on the network level.
Firstly Xbox live makes use of port 80 and every time he turned it on my web server, with this site on it, would drop out despite the port forwarding rules set-up in the router. This was solved by editing the httpd.conf so that the server only listened for requests on port 80 of the servers internal ip address.
The other problem encountered was that every so often the Xbox live service would just die and the only way to get it back was to restart the router. This in turn would lead to the isp assigning a new public IP address. At this point obviously my DNS record would become stale. Getting rather fed up with losing access to the server while at work I decided to write a php cli script that would run every 15 minutes via cron to check the public IP address of the connection and if needed update the remote dynamic DNS service I use. Read the rest of this entry »























Recent Comments