Wednesday, December 7, 2011

Importance of using a RSS Reader

RSS (Really Simple Syndication) Feeds. I guarantee that you have heard of this technology. But I don't think many of you don't use it. But I'm telling you RSS Feeds is something that is very important for a daily internet user. 

From WikipediaRSS is a family of web feed formats used to publish frequently updated works—such as blog entries, news headlines, audio, and video—in a standardized format. 

The main advantage of using a RSS Feed is that, if you add a web site to the RSS feed you don't have to revisit that website to see for new content. RSS Feed will update the RSS Reader with the new content. You can use a RSS Reader like Google Reader(my favorite), Sharp Reader, NewsGator etc. 

I'm great fan of RSS Feeds. But to understand it's importance you need to use the RSS Reader for sometime and see. The importance comes into notice when you're subscribed to a frequently updating website like Mashable, TechCrunch, Engadget. These sites are updated with fresh content in a rate where it's a tedious task to go to the website every few hours to see new content. This is where RSS Reader comes into play. 

By using a RSS Reader you can differentiate the articles you have read and the articles that you haven't read. 

As highlighted in red in below image, you can go through articles using previous and next buttons. Try today itself and see the difference. You will be amazed by the usefulness of this. 




Hello World in Windows Phone

In this tutorial we'll look at basics in Windows Phone Development and we will create a basic Hello World Application. 

1. After installing the Windows Phone Developer Tools, on the start menu open  Microsoft Visual Studio 2010 Express for Windows Phone.

2. Go to file menu and select new project. 

Here there are variety of options to choose from. To understand the basics, we will just    create a simple 'Windows Phone Application'.

3. Select 'Windows Phone Application' and give the project name (WindowsPhoneApplication1). Then select the location where you want to save your project. Press Ok. Visual Studio will create the project.

4. By default Visual Studio is divided into 3 panes. On the left you have the design view, On the middle you have XAML code and in the right you have Solution Explorer and Properties. 



The design view displays how the application will be look on the phone. You can drag and drop elements from Toolbox on to this. 

The XAML(Extensible Application Markup Language) file will be auto-generated when you're adding elements from toolbox to the design view. XAML file is a XML File which is used by visual studio to create the layout and to generate elements. For more information look at this article at MSDN


5. Let's get back to the tutorial. Now we'll add a TextBlock to display text in our application. Go to the toolbox and drag and drop a TextBlock in to the design view. Notice in the XAML that TextBlock element was added inside Grid. 


You can change these properties from either properties window or by manually adding elements to the XAML code. We'll do from properties window. 

6. Select the TextBlock you added and Increase the font size, height and text from Properties Window. You can see that XAML code is changed and elements are added accordingly.


7. Ok. Now we'll run the application. For this we will use the Windows Phone Emulator. Press F5 or go to Debug -> Start Debugging. For the first launch the emulator might take some time to load. 



In the next tutorial we will dig into some user interaction.

Sunday, October 30, 2011

Android Sri Lanka : Delivery Ordering System


One of the best apps promises to attract the food lovers of Sri Lanka. Now Delivery More Simplified

Android Operating System Versions


Recent Releases

  • 2.3 Gingerbread refined the user interface, improved the soft keyboard and copy/paste features, improved gaming performance, added SIP support (VoIP calls), and added support for Near Field Communication. Android 2.3 Gingerbread is the latest Android version that is available to phones.
  • 3.0 Honeycomb was a tablet-oriented release which supports larger screen devices and introduces many new user interface features, and supports multicore processors and hardware acceleration for graphics. The first device featuring this version, the Motorola Xoom tablet, went on sale in February 2011
  • 3.1 Honeycomb, released in May 2011, added support for extra input devices, USB host mode for transferring information directly from cameras and other devices, and the Google Movies and Books apps.
  • 3.2 Honeycomb, released in July 2011, added optimization for a broader range of screen sizes, new "zoom-to-fill" screen compatibility mode, loading media files directly from SD card, and an extended screen support API. Huawei MediaPad is the first 7 inch tablet to use this version 
  • 4.0 Ice Cream Sandwich, announced on October 19, 2011, brought Honeycomb features to smartphones and added new features including facial recognition unlock, network data usage monitoring and control, unified social networking contacts, photography enhancements, offline email searching, and information sharing using NFC.

Saturday, October 15, 2011

Introduction to Spring Framework

Spring framework is a java platform which provides comprehensive infrastructure to develop enterprise java applications. Spring handles the infrastructure for you so that you can focus on your application. 

Spring allows you to build applications from POJO (Pure Old Java Objects) and apply enterprise services to them. 

Tuesday, October 11, 2011

JTable KeyListener

First create a JFrame and add JTable with data. Create the following class. Below the JFrame's class
class jTableController implements KeyListener {

JTable table1;

public jTableController(JTable table) {
table1 = table;
}

//if you want to get selected data
private int[] getSelectedCell() {
int[] xy = new int[2];
xy[0] = table1.getSelectedRow();
xy[1] = table1.getSelectedColumn();
return xy;
}

@Override
public void keyPressed(KeyEvent e) {
System.out.println("keyPressed");
}

public void keyTyped(KeyEvent e) {
System.out.println("keyTyped");
}

public void keyReleased(KeyEvent e) {
System.out.println("keyReleased");
}
}
Inside JFrame's constructor add the following code.
       
tblMaterialSupplierDetails.addKeyListener(new jTableController(tblMaterialSupplierDetails));

That's it run the project and see.

Things to know about JTable

You might already be using JTables comes with Swing in Java but sometimes may not know theses facts, Here's an some facts about JTables.



  • JTable does not contain or cache data; it is simply a view of your data.
  • There are two JTable constructors that directly accept data (SimpleTableDemo uses the first):
    • JTable(Object[][] rowData, Object[] columnNames)
    • JTable(Vector rowData, Vector columnNames)
  • However, these constructors also have disadvantages: 
    • They automatically make every cell editable.
    • They treat all data types the same (as strings).
    • They require that you put all of the table's data in an array or vector, which may not be appropriate for some data. 
  • When adding a JTable use a JScrollpane
    • JScrollPane scrollPane = new JScrollPane(table);
      table.setFillsViewportHeight(true);
  • JTable uses a very simple concept of selection, managed as an intersection of rows and columns. It was not designed to handle fully independent cell selections.

Monday, October 10, 2011

NHibernate for .NET




Introduction to NHibernate 
When it comes to object relation mapping, writing your own code is a nightmare and not worth doing. This is because there are many frameworks written to do the same thing that you're going to do from scratch. These technologies are matured by time therefore there is no risk using them in real world applications than deploying them with your own buggy code.

NHibernate is one of the widely used Object Relational Mapping framework. You can easily use it in your projects and you can find many resources in internet about using this.


NHibernate with LINQ to SQL
LINQ to SQL is another way you can do Object relation mapping but in an easier way than NHibernate. But the problem with LINQ to SQL is that it forces you to use Class per Table kind of pattern. If you're into a small application which do not involve complex table updates and other things you can give LINQ to SQL a shot because it's fairly very easy to begin with. But when it comes to developing a complex enterprise level application, don't go with LINQ to SQL. Get start with LINQ to SQL Here.


Get Started with NHibernate
You can visit the official web site http://nhforge.org/ download the framework and deploy it in your applications. This is a starter tutorial I found on the same site http://nhforge.org/wikis/howtonh/your-first-nhibernate-based-application.aspx. use it and see the difference.


Sunday, October 9, 2011

Introducing USB 3.0




Difference between Public and Private Clouds


SAAS vs PAAS vs IAAS

This is a good explanation video i found on youtube detailing out about




Data Synchronization : Microsoft Sync

From Wikipedia, Data Synchronization is "the process of establishing consistency among data from a source to a target data storage and vice versa and the continuous harmonization of the data over time".


Here's some useful videos I find out about Microsoft Sync. The Microsoft's effort to building a sync framework. you can get more information from msdn.microsoft.com/sync.


Here's good introduction http://msdn.microsoft.com/en-us/sync/bb821992


Some of the useful Videos







Friday, October 7, 2011

MongoDB a noSQL solution



Have you ever heard about noSQL or MongoDB. Actually few days ago i stumbled upon on MongoDB and did some searching through the internet. Even though these are not widely used as it's counterpart Relational DB it has nice features in it which you should take a look on.

MongoDB is a good implementiation of noSQL. It is very simple but very effective technology. MongoDB website http://www.mongodb.org/ offers many great details and you can even download MongoDB and give it a try.

You can access the online shell in the website which gives you some nice background about how it works. It is just like JavaScript. Also when I searching through Google : MongDB Sri Lanka, I came across this video from Refresh Colombo Sri Lanka. which gives a introduction about MongoDB. I was happy to see such a video from Sri Lanka.


Thursday, September 15, 2011

My First JSON Web Service with Android

This is the first project I did using JSON. This web service accesses the Sri Lanka Railway Department JSON file for displaying routes on Android Device. It will retrieve the JSONObject parse it and assign it to a 2D String array and display in a ListView in Android Application.

Technologies Used:

  • JSONObject - This is how routes are saved in railway department json file
  • ListActvity - To display the route list
  • HttpGet and HttpResponse (To retrieve the file from url)



Friday, September 2, 2011

Introduction to JSON with Android


JSON (JavaScript Object Notation) is a light-weight data interchange format. JSON is easy for humans to read and write. It is also very easy to code with them and parse. JSON is also language independent.



An object is an un-ordered set of name/value pairs




An array is an ordered set of values

JSON With Android

Android includes a library called org.json. Developers can easily use this library to work with JSON. this package contains 4 main classes. 
  • JSONArray
  • JSONObject
  • JSONStringer
  • JSONTokener

Try the example appears at this link (http://www.vogella.de/articles/AndroidJSON/article.html) It gives you a good intro of how to use JSON with your mobile application. It is very straight forward and most important thing is you have nothing much to learn.

Wednesday, August 10, 2011

Unit Testing and Mocking

What is it?

Simply unit testing is testing your code with some test data. Unit tests are used to test the behavior and functionality of the system. Unit testing makes testing your data automated and repeatable. It is also can be identified as Test Driven Development (TDD) Method. The idea behind unit testing is to create a set of tests for each software component. unlike manual tests, it's cheap to perform them repeatedly.

Mocking

Mocking is primarily used in unit testing. An object under test may have dependencies on other (complex) objects. To isolate the behavior of the object you want to test you replace the other objects by mocks that simulate the behavior of the real objects. This is useful if the the real objects are impractical to incorporate into the unit test.
In short, mocking is creating objects the simulate the behavior of real objects.
Some Mocking frameworks

Monday, April 4, 2011

ASP.NET Web Forms

ASP.NET Web Forms is a part of the ASP.NET Web application framework. It is one of the two different programming models you can use to create ASP.NET Web applications, the other being ASP.NET MVC.

Web Forms are pages that your users "request" through their browser directly or indirectly and are User Interface (UI) elements that give your Web applications their look and feel. These pages are written as HTML and server controls along with server-side logic or code. The page is compiled and when requested by your user will execute on the server and generate the HTML that your user’s browser can render.

With ASP.NET Web Forms, you use HTML, "server controls" and code to create the page. This page is compiled and when requested by your user will execute on the server and generate the HTML that your user’s browser can render.

Within Visual Studio you can create ASP.NET Web Forms using a productive IDE. This allows you to drag-and-drop server controls, for example, when designing your Web Forms page. You can then easily set the properties, methods and events for that control or for the Web Form to define the behavior, the look-and-feel or other attributes. When you add server-side code to handle the logic for the page, you can program against a .NET language such as Visual Basic or C# using an associated page called a code behind.

ASP.NET Web Forms offer:

  • Separation of HTML interface from application logic
  • A large and rich suite of server side controls for various common or complex tasks
  • Rich data binding, empowered by tools
  • Support for enabling Ajax without knowledge of Javascript

What is web development? (Beginner)

Web development is a broad term for the process of writing a web page or site. Web pages are written with HTML, CSS and JavaScript. These pages can be simple text and graphics that resemble a document. Pages can also be interactive or display changing information. Interactive server pages are a little more complex to write, but they enable richer web sites. Today, most pages are interactive and provide modern online services like shopping carts, dynamic visualizations, and even complex social networks.

Source: MSDN