Prize winner in Competition "Android Development Competition"

Introduction

I have been designing and developing mobile applications for less than 1 year, though I'm a professional software developer for 10 years or so, and this new mobile era makes me feel excited. As of today there are two and a half major platforms gaining pretty well reputation by the mobile users. Two of them are iOS (formerly known as iPhone OS) and Android and the half is long debated Windows Phone 7.

In this tutorial article I will try to introduce you to the general development principles of Android by building a real calculator application (TouchCalculator). By the end of this tutorial you will be able to build Android applications with simple user interfaces and backing business logic.

Preparing Yourself and The Development Environment

Before you get started, if you are totally new to Android I would suggest you to read the What is Android? section from the Android Developers site and I would also suggest you to have a look at Android Developers Blog.

If you have not configured an Android development environment already, please follow the instructions in this link.

TouchCalculator MockUp

TouchCalculator, our sample and simple calculator, is a standard calculator supporting four arithmetic operations and three mathematical functions (namely square root, reciprocle and percentage) along with a memory buffer.

Let's start with the mockup of our calculator. Below is a color coded sketch of our application. I've seperated the UI into locigal parts and each part is represented with a color highlight. There is a reasoning behind the conceptual seperation and this will be evident in the next sections of the tutorial.

More...


Posted in: Android , CodeProject , Mobile  Tags:
PragmaSQL was named as Best General Database Tool by The Code Project’s members.
Members were asked to rate their favorites on CodeProject. The Code Project staff then compiled the highest rated listings, awarding the highest ranked in each product category. The results reflect actual perceptions of what developers value. Each codeproject.com member decides which companies or products deserve recognition, based on in-the-field experience.  

Posted in: CodeProject  Tags:

Introduction

Cuyahoga provides module developers with a simple to use wrapper classes for full text indexing with Lucene.NET.
Although wrapper classes are easy to use these classes are not generic in nature. I mean
we, as module developers, have to convert our custom content (be it static or dynamic)
to a SearchContent object so that wrapper classes can index that content. Another similar limitation is when we perform search on the indexed content we can only get collection of SearchResult objects. I also want to mention that we, as module developers, have no control over which fields will be stored/unstored, which fields will be used as keywords or which fields will not be indexed while wrapper objects build the full text index.

In this article I will try to show you how we can make Cuyahoga.Core fulltext indexing capabilities more generic by providing a seperate extension assembly.
More...


Posted in: .NET Development , CodeProject , Cuyahoga , Lucene.NET  Tags:
aliozgur posted on February 18, 2008 14:24

Introduction

Cuyahoga framework has very nice approach to Web development. It has bunch of built-in modules and you can develop your own modules in a
couple of hours. If you have some experience with NHibernate and/or some other web framework your module development
may even take less than an hour. My product site PragmaSQL Online runs on top of Cuyahoga framework and it took
me just a couple of hours to bring this site up and running. Although Cuyahoga is a very nice framework and I love Cuyahoga development
I shall admit that you may experience some problems while applying some advanced topics like Ajax to Cuyahoga. In this article
I will show you a simple and structured way to add Ajax support to your Cuyahoga web site.
More...


Posted in: .NET Development , CodeProject , Cuyahoga , NHibernate  Tags:
aliozgur posted on February 6, 2008 14:28

Audit logging is an important issue while building enterprise systems. Simplest form of audit logging is recording
who and when created/updated an object, or a record in the database respectively. We perform four basic operations
on a domain object. These are

Load
Update
Save
Delete


Data access layer is a good place to perform automated audit logging
whenever one of the operations above is executed. NHibernate provides us with
IInterceptor interface plus ILifecylce interface. You can read this article for more
information about Nhibernate entity lifecyle management.

In this article we will try to perform simple logging that meets the
following minimal requirements

1- We will log who performed insert/update and when this operation was performed
2- Log data will be written to the same database and table as our domain object
More...


Posted in: .NET Development , CodeProject , NHibernate  Tags:
aliozgur posted on January 7, 2008 14:15

Motivation

PragmaSQL started as part time development effort and by time PragmaSQL evolved to a commercial product.
Today PragmaSQL has a dedicated web site (PragmaSQL Online) build on Cuyahoga Framework.
PragmaSQL Online was primarly designed to meet very simple requirements like

  • Host simple advertorial content introducing PragmaSQL
  • Host downloads ( PragmaSQL Application, 3rd party add-ins and other open source material)
  • Licences distribution and validation via some web services.


As the number of people using PragmaSQL increased PragmaSQL Forum was added to enable users to communicate
with each other and with PragmaSQL developers. PragmaSQL forum was the only place where people submitted bugs,
support and new feature requests. But as the number of posts increased managing all this content became a real pain for
me. It was hard to group and keep track of the posts, for example i could not know exactly how many bugs were posted
and how many of these bugs are waiting, in progress or already resolved.
Forum approach to maintainance was also inefficient for the users , they had no clue about the status of their posts
because Forum Module did not provided custom post attributes and the communication model was very loose. Forum module
did not have any mechanism to notify users about the status changes of their posts.
More...


Posted in: .NET Development , CodeProject , Cuyahoga , NHibernate  Tags:
aliozgur posted on December 5, 2007 11:50

In this article we show how to develop a very common utility with ProcessStartInfo and Process classes included in System.Diagnostics namespace for PragmaSQL editor.

PragmaSQL T-SQL editor has very extensive add-in support. External Tools add-in presented in this article has two goals

    1- Serve as PragmaSQL add-in development example.
    2- Provide a very common feature included in all development IDEs and editors.

IC#Code Add-In Architecture Overview

PragmaSQL makes use of IC#Code's Add-In architecture. This architecture provides
fantastic fatures that enables us to develop plugins for our applications easily thus
making our applications extendable. IC#Code Add-In architecture provides

    1- Simple and neat XML add-in definition via .addin files
    2- Loading of add-in assemblies
    3- Expose add-in functionality through menus and toolbars of the host application
    4- And many utility services like MenuService and MessageService

For details about the architecture please refer to SODA - SharpDevelop Open Development Architecture by Mike Krueger

PragmaSQL Services Overview

PragmaSQL exposes many of the built-in host features to the add-in developers with a core librarary.
Exposed features include
More...


Posted in: CodeProject , PragmaSQL AddIns  Tags:
In this short article i want to give a sample code describing how you can retreive statistical information about the T-SQL statements executed over a SqlConnection.

Background

While i was developing PragmaSQL T-SQL editor, guys using the initial versions wanted to know how many rows were affected as a result of a T-SQL statement (DML) executed.My first attempt was tracing the T-SQL statements sent by Management Studio to the server. But this was helpless, since Management Studio is not sending any extra statements to figure out how many rows were affected. My second attemtp was wiring-up to SqlInfoMessageEventHandler and inspecting info messages returned by the server. But sql server was not sending any extra information about the executed statements via this event. Then while i was looking to the SqlConnection properties i noticed StatisticsEnabled property and this was the property that would meet my requirement.

Using the code

Retreiving statistical information over SqlConnection is very simple. Here is the sample code



//

// Sample T-SQL execute code

//  

private void ExecuteSql(SqlConnection conn, string scriptText)

{

    SqlCommand cmd = null;

    try

    {

        conn.StatisticsEnabled = true;

        conn.ResetStatistics();

        cmd = new SqlCommand(conn, conn);

        cmd.ExecuteNonQuery();

        

        // Here is the sample wrapper to process statistics.

        ProcessConnectionStatistics(conn.RetrieveStatistics());

    }

    finally

    {

        conn.StatisticsEnabled = false;

        if(cmd != null)

         cmd.Dispose();

    }

}


// Sample function to process SqlConnection statistics

// This function only extracts the entry with name IduRows.

// to reflect the rows affected.

private void ProcessConnectionStatistics(IDictionary stats)

{

  foreach (object key in stats.Keys)

  {

    object statVal = stats[key];

    if (key == null || key.ToString().ToLowerInvariant() != "IduRows".ToLowerInvariant())

      continue;


    string statValStr = statVal.ToString();

    if (String.IsNullOrEmpty(statValStr) || statValStr.Trim() == "0")

      continue;


    MessageBox.Show(String.Format("( %s ) rows affected.",statValStr);

  }

}



Posted in: .NET Development , CodeProject  Tags:
In previous article NHibernate Best Practices with ASP .NET, Generics and Unit Tests by Bill McCafferty NHSessionManager is configured via App/Web config simply to work with NHibernate core assembly. Since NHSessionManager and other assemblies (Core, Data and Test) are located in the same solution this simple way is enough for all practical purposes. But for sake of code resuse we can think to reorginize NHibernate utility classes (NHSessionManager, DomainObject, NHGenericDao) and interfaces (IGenericDao) in a seperate solution/project. When this is the case we need a more generic way to specify NHSessionManager configuration. Another article Using NHibernate with Multiple Databases again by Bill McCafferty is a very good example how to extend configuration system of .NET
More...

Posted in: .NET Development , CodeProject , NHibernate  Tags:

In previous CodeProject.com article NHibernate Best Practices with ASP .NET, Generics and Unit Tests by Bill McCafferty
Core project contains DAO interfaces and domain objects while Data project contains implemetation of DAO interfaces.
For performance reasons, since we do not want to iterate over collections to find a matching object, we use DAO and thus
NHibernate to query for objects we are interested.More...


Posted in: .NET Development , CodeProject , NHibernate  Tags: