Jun 26

For an internal competition project here in Avanade, my colleagues and I implemented a location aware service works on the cloud. So I’ve many outcomes from that project and want to share them with you. Our aim was to go get the a location data, based on Latitude and Longitude but alas our HTC Touch devices don’t have GPS hardware installed in. So I decided to go for GSM CellID based location awareness and worked quite well. So here is the first step to demonstrate the basic structure on how to get GSM CellId with couple of lines C# code. I just referred to MSDN codebase the RIL_GetCellTowerInfo function in the Radio Interface Layer (RIL) API. 

 

        1.Call RIL_Initialize to get a RIL handle

        2. Call RIL_GetCellTowerInfo to get the information about the cell tower the phone is connected to

The “Cell” string that FindMe displays seems to be a combination of the dwCellID, dwLocationAreaCode and dwMobileCountryCode

       3. Call RIL_Deinitialize to release the RIL handle

 

You can find the code here. GetCellDetails.rar (24.03 kb)  I’ll add other steps to decode geo info (latitude and longitude data) from that cellID identifiers soon. Meanwhile you can check http://www.opencellid.org/ and similar services from other public or commercial vendors and get more info on GSM CellID.

 

May 22
I was quite lucky that I haven't faced with that problem. Actually I haven't implemented web services (on SSL) integration lately. But I've seen many questions, mails about that bug in Compact Framework. Thanks guys in development team, they announced a hotfix for that bug. The link is : FIX: A System.Net.WebException occurs when you run an application to send HTTPS Web requests to a server in an embedded device.
Tags: |
May 22

Peter Nowak has published a complete library on CodePlex for creating Managed Services for Windows Mobile.

Project Description

This lightweight library contains functionality for creating Windows like Services in managed code, as creating Windows Services in Windows Mobile/Windows CE isn't supported. The library is compatible with the .NET Compact Framework 2.0 and higher.

Details

The .NET Compact Framework doesn't offer any functionality for creating Windows Services in full managed code, as like on the .NET Framework. Therefore this library enables creating Service in managed code to be like Windows Services as near as possible.
This library bases on Pavel Bánský's blog post, on how to create Services in Windows Mobile in managed code.

Features

  • Easy to use library in managed code. No P/Invoke required.
  • Based on the .NET Compact Framework 2.0 for maximum compatibility.
  • Extra samples to show, how to use this library.
  • Service Launcher application to start services automatically on system start
  • Additional Service Manager Utility is available for controlling Services similar to Windows.

 

 

May 19

After a long silence on my blog, I've great news :

    Microsoft's beta My Phone service for Windows Mobile now free to all http://myphone.microsoft.com/  And for more info about My Phone, please refer to my previous blog entry Microsoft launches new mobile phone stack

Have fun

Mar 26

Chris Tacke shows in his blogpost, how to create a Screen Capture with less than 10 lines of code. Without any P/Invoke or any more hacking, it just uses managed code. Really and very simple, thanks Chris.

Feb 17
In a keynote at this week's Mobile World Congress, CEO Steve Ballmer unveiled an interim upgrade to Microsoft's mobile phone stack. To ship during the latter half of the year, Windows Mobile 6.5 brings support for two online services, including an app store and a data sync/backup service.

In the announcement, Microsoft emphasized that the new 6.5 stack uses the same tools, and has the same API (application programming interface), facilitating forward compatibility. Additionally, the tools used to develop apps for Windows Mobile 6.5 are the same as those used to write PC apps, Microsoft said, citing Visual Studio, .Net, and SQL.

Microsoft's two new services, unsurprisingly, include:
  • "My Phone," a Web-based sync service for text messages, photos, video, and contacts
    • Password-protected web interface
    • Facilitates upgrading phones without data loss
    • "Automatic" syncing and backup
    • Currently available in a limited invitation-only beta
  • Windows Marketplace for Mobile
    • Search, browse, and buy apps and widgets, from a PC (Windows Live ID required)
    • Direct-to-phone installations
    • Applications qualified by "simple" security and compatibility check from Microsoft
Additional touted new features in Windows Mobile 6.5 include:
  • New home screen "dashboard" showing new e-mails, texts, missed calls, and calendar appointments
  • More finger-friendly touch-screen interface
  • Updated Internet Explorer Mobile browser
First Windows Mobile 6.5 phones

Participating in the launch were Microsoft phone partners HTC and LG. Both pre-announced specific phone models slated to ship with the 6.5 upgrade in the second half of the year:
  • LG said its LG-GM7300 -- available first on Windows Mobile 6.1 -- will gain a 6.5 option
  • HTC flagged its Touch Diamond 2 and Touch Pro 2 as its first Windows Mobile 6.5 models

 


Slated for WM 6.5, in version "2" releases next year
(HTC Diamond Touch, Touch Pro. Click either for details)

Additional news may be about available on Microsoft's MWC partner list [.doc format], the company said.

Other announcements

Besides the big news related to Windows Mobile 6.5 and its associated services, Microsoft announced several other items. It touted a voice search technology called Recite, for Windows Mobile 6.0 or better. Currently available as a free preview, here, the technology lets users search for spoken notes and reminders using just their voice, Microsoft said.

Additionally, Microsoft announced a long list of new mobile advertising partners, including:

  • Mobistar (Orange Group) and BASE, the second and the third largest mobile operators in Belgium respectively
  • Mobile travel site WAYN
  • eFinancialNews and Private Equity News, part of Dow Jones
  • Le Parisien.fr, the mobile site of Le Parisien-Aujourd’hui en France, described as the "first" daily newspaper in France
  • La Vanguardia, a Spanish daily newspaper
  • Spanish sports newspaper El Mundo Deportivo
  • Le Post.fr, an interactive French mobile site

Microsoft said it offers advertising services in a dozen countries, delivering mobile ads on both Microsoft and partner properties.

Finally, Microsoft partners also announced mobile broadband connectivity for Windows 7, Microsoft's netbook-friendly OS, currently beta-testing. Such partners reportedly included Acer, Asus, Birdstep Technology, Dell, Ericsson, HP, Fujitsu Siemens Computers, Huawei Communications Technologies, Option, Qualcomm, Sierra Wireless, Smith Micro, T-Mobile International, and ZTE.

In a statement, Ballmer commented, "Windows phones bring together the best of the Web, the PC, and the phone.”

Jan 06

I heard many complains about slow startups of mobile applications and also got questions how to increase the startup performance. In most of the projects, the problem was a design issue, just like trying to connect a remote server on startup or populating big datasets etc.. But on the other hand, if you think your startup sequance is totaly clear and correct than you may find some more things to do in general.

Take a look at the article on how to optimize the your application's loading time.
http://blogs.msdn.com/raffael/archive/2009/01/05/netcf-improve-startup-performances.aspx

Dec 18

 Microsoft announced the general availability of the latest addition to the BizTalk Server RFID platform - BizTalk RFID Mobile, an RFID platform for mobile devices based on Windows CE and Windows Mobile. BizTalk RFID Mobile consists of a runtime engine as well as tools and components to develop, deploy, and manage RFID solutions on mobile devices.

Developers, independent software vendors and systems integrators can build device-agnostic mobile applications utilizing RFID and sensor data on devices running Windows CE or Windows Mobile 5.0, 6.0, and 6.1. Events and data can be stored on the mobile device using a SQL sink service, and then communicated to the BizTalk Server RFID platform for further analysis. Mobile devices can be discovered, queried, and managed from the BizTalk Server RFID platform. Support for industry-ratified standards like the Low-level Reader Protocol (LLRP) and the Tag Data Translation (TDT) library provides a standards-based approach to discover, provision and troubleshoot RFID devices, in addition to surfacing business-relevant attributes from RFID tags

For more information on the product, capabilities, and evaluation versions, browse to: http://www.microsoft.com/biztalk/en/us/rfid-mobile.aspx.

The documentation on how to build applications using the BizTalk RFID API can be found at: http://msdn.microsoft.com/en-us/library/dd351599.aspx.

Tags: | |
Dec 01
The Microsoft Patterns & Practices (p&p) team delivers applied engineering guidance that helps software architects, developers, and their teams take full advantage of Microsoft’s platform technologies in their custom application development efforts. Working with the Windows Mobile team the p&p team has updated their Mobile Architecture Pocket Guide, which provides real world information and best practices for mobile development. Definitely worth taking the time to give it a read.
Nov 28

Giorgio Sardo has an excellent post about tutorial on Building Graphically Advanced Applications with .NET Compact Framework 3.5.   He also has a link in his post to the source (bonus!).  Check it out.  

The article itself (linked in his post) is at: http://expression.microsoft.com/en-us/dd279543.aspx

Nov 28
Have you heard of the MSDN Code Gallery? Well here it is: http://code.msdn.microsoft.com/.

If you are a developer blogger or just want to make some code public for others to enjoy, this is an option to upload stuff without having to have a dedicated public server.
Tags: |
Nov 26

Yeni nesil Microsoft yazılım geliştirme platform ve teknolojilerine derinlemesine göz atacağımız teknik sunumlarımızın yer alacağı zirvemizde; Yazılım Geliştiriciler, geleceğin yazılım geliştirme teknolojilerini de ilk kez inceleme fırsatı bulacaklar.

3 Aralık’ta düzenlenecek Microsoft Yazılım Geliştiriciler Zirvesi’nde yerinizi ayırtın.

Yazılım Geliştiriciler’in ihtiyaç duyduğu, yaratıcılıklarını destekleyerek verimliliğini artıran, onlara zaman kazandıran birçok çok bilgiyi ve yeni teknolojileri içeren bu etkinliğimizde, birlikte derinlere dalacağımız konulardan birkaçını şu şekilde sıralayabiliriz: Yeni nesil bulut bilişimi, Windows Azure, Visual Studio 2010, Silverlight 2...

Kayit icin buraya : http://msevents.microsoft.com/cui/EventDetail.aspx?culture=tr-TR&EventID=1032396783 

Tags: |
Nov 21

 

Here’s a great article on how to use Windows Media Center with Windows Mobile to do some really cool stuff.

You end up with being able to sync recorded items off your Windows Media Center and watch them on your Windows Mobile phone!

Tags:
Nov 21
There was a discussion recently with my fellow MVPs and you can use C# 3.0 language features in a CF 2.0 app with VS 2008 and even extension methods with a small hack.

Simply create an ExtensionAttribute class:
using System.Runtime.CompilerServices
{
public class ExtensionAttribute : Attribute{}
}
Then you need to declare this attribute on each extension method in order to implement extension methods. This is because extension methods require the new ExtensionAttribute class introduced in System.Core.dll in .NET 3.5.

Daniel Moth has talked about this in depth here.
Nov 12
Windows Mobile 6.5 Windows Mobile 6.5

Jeff Kirvin came across two images that France Smartphone posted.

Looks interesting (unofficial post) – check it out.

 

Oct 30

As some of you may have already heard, Enterprise Library 4.1 was released by the Patterns & Practices group at Microsoft. I used to implement application blocks from Enterprise Library’s previous versions in my previous projects. So I decided to take a quick look for personal update.

Installing this version of Enterprise Library is much better than previous installations, as this one gives you the choice to extract AND build the different application blocks at the same time, instead of using a different installer to extract and build the source codes.  The change log for this release is available here (highly recommended to read).  If you’re looking to upgrade your skills with Enterprise Library, I strongly suggest the Hands On Labs and the Getting Started tutorials for each of the application blocks. 

For more information about Enterprise Library (resources, tutorials, news, etc.) I strongly recommend you referring to these sites:
Pieter's Blog on Enterprise Development
Tom Hollander's blog
Patterns And Practices Guidance

Oct 16

Do you have questions regarding Windows Mobile application development that you need answers to?

Spend an hour with Microsoft employees and MVPs who are experts in Windows Mobile application development.

Join us for a live chat and bring on the questions!

This chat will cover your questions about the tools and technologies used to develop both native and managed applications using the Windows Mobile operating system.

Find our Events on the MSDN Chat calendar here: http://msdn.microsoft.com/en-us/chats/default.aspx

Oct 03

Nowadays, we all hear the term “Cloud Computing”, its benefits and some baby-steps* applications going on. Google, Microsoft and Amazon are the main promoters on this game. On my side, I like Google’s services like GMail, GDocs, Agenda etc… and on Amazon’s side EC2 seems extremely cool and powerful.  

But on the other hand two hotshots defined Could Computing as stupidity and just a business fashion. Richard Stallman, founder of the Free Software Foundation and creator of the computer operating system GNU, said that cloud computing was simply a trap aimed at forcing more people to buy into locked, proprietary systems that would cost them more and more over time.

He said: "It's stupidity. It's worse than stupidity: it's a marketing hype campaign,"  

A big anti-Cloud Computing definition also came from Larry Ellison, Oracle’s CEO, as “it is just an industry fashion.” 

They think that the personal data should definitely stay personal and advice to computer users should be keen to keep their information in their own hands, rather than hand it over to a third party. The growing number of people storing information on internet-accessible servers rather than on their own machines, has become a core part of the rise of Web 2.0 applications. Millions of people now upload personal data such as emails, photographs and, increasingly, their work, to sites owned by companies such as Google. 

So what are your ideas about cloud computing on relying to a third party perspective?   


kick it on DotNetKicks.com


*
For sure the Cloud Computing applications on the market are really great but compare them to the near feature opportunities on Cloud Computing. These are relatively tiny-baby-steps.


 

Sep 26

For the software, itself, it is easier to discuss its quality by measuring its performance, memory usage, number of the bugs etc. But what if we talk about the code file, how can we write code that we are proud of.

  • Clarity
  • Number of Lines
  • Performance
  • Comments
  • Exception Management

 

And many other topics can be added to this list for code quality measurement. But we will focus on these five now.


Clarity

Probably you have seen a really “smart” code like the one below:

   1:    public static int GetNextSize(int i)
   2:    {
   3:      //multiply it by four and make sure it is positive
   4:      return i > 0 ? i << 2 : ~(i << 2) + 1;
   5:    }


At least we have a comment line; well we will discuss the comments later on. But as you see you should really focus and evaluate the code before understanding what it is doing. So hiding the code in this way, especially if you work in a team, will create big headaches for your team members and after a while, for you, too. Code should always be clear and transparent for everyone just like the one below.

 

   1:    public static int GetNextSize(int i)
   2:    {
   3:      return Math.Abs(i * 4);  
   4:    }

Steve McConnell : "Good code is its own best documentation."
 

Number of Lines 

Some developers are proud of their big number of code lines. Because this is a proof to show how big the project is. But in the other hand, this is not true. Because more lines of code means more complex, harder to maintain code base or even worse; a sing to the wrong implementation of object orientation or code reuse.  

If you consider two software which function the same, the well structured one has always the less lines of code. The one has less lines of code is easier to maintain and fix the bugs. Which means the lighter is the better. Let me quote Bill Gates: “Measuring programming progress by lines of code is like measuring aircraft building progress by weight“. 

Performance  

Of course a fast functioning program is better than its slow versions and the performance considerations are always in the front lines of the development process. But changing a clearly readable code to its complicated and fast equivalent lines is not always the brilliant idea and there is always a way to implement the same algorithm in a clearer way.  

Well, I don’t mean don’t think about performance optimization but there is always bigger chance in the overall system to optimize. It is more important to focus on the big picture and solve performance problems that are system wide, or refactor code so that changes can be made much faster, than it is to solve a performance problem in a single line of code...unless of course that line of code is being called millions times. 

Comments 

Again I am pretty sure you have seen so many uncommented or not enough commented codes. Even code, itself, is readable or not, comments are important substances. You should always keep in mind to write clear comments like telling it to someone else. Don’t type them in your way but in a common language. 

Exception Management 

Although we are just focusing on the code quality (not the architecture or the software quality) still we need to discuss the exception management. Any unexpected situation can cause the exceptions. Normally the newly started developers go to the solution directly but prefer not to think about any abnormal situation can occur in their solution. So any missing control or a direct assumption can cause a crash in your application.  

In the worst case (probably the simplest) you can catch any exception on Application Domain level and show a common error message screen. But in any case, you shouldn’t let your software crash!  

As you already figured it out, it is not really easy to balance and find the most correct way of coding. If you don’t like the code you’ve written take a step back, review it, fix it, refactor it till you are proud of. Fixing the problems in early stage will have massive returns in the long term.  Searching for the perfect coding will lead you to a better understanding of what you are doing.  

And one more quote from Martin Fowler : “Any fool can write code that a computer can understand. Good programmers write code that humans can understand.”
 

credits goes to CodeThinked

kick it on DotNetKicks.com
 
Tags:
Sep 12

Are you on Facebook? Do you use Outlook and Windows Mobile? If you answered yes and yes, get OutSync, a free app to sync your Facebook friends' photos with Outlook! It's written by Mel Sampat on the Windows Mobile team, and is free to use. Watch the 7 minute video on Channel 10, or visit Mel's website to download it.

Sep 09
Today I’m applying Microsoft Visual Studio 2008 Service Pack 1 (Installer)

and

Microsoft SQL Server Compact 3.5 Service Pack 1 for Windows Mobile

SQL Server Compact 3.5 Service Pack 1 for Windows Mobile is not included in VS 2008 SP1, but it looks like SQL CE 3.5 SP1 for the desktop is included.

I think there is going to be a lot of confusion about this, if you look carefully at the screen grab on the left, you can see the dialog only mentions SQL Server Compact 3.5 SP1 – there’s no desktop or devices distinction.

 

 

Why update to SQL Compact Edition 3.5 SP1?

I’m doing it solely for the new Transact SQL support for:

  • Nested query in FROM clause
  • CROSS APPLY and OUTER APPLY
  • CAST
  • TOP
  • SET IDENTITY INSERT

Here are the 3.5 SP1 release notes with information about the other SP1 enhancements/fixes.

Other important SQL Server Compact Edition URLs

Aug 11

We, as you the others on the globe, like blogging a lot in Turkey. Some of my friends write in English but most of the blog-writers have Turkish blogs. So it is wise to have a Turkish blog script to publish your Turkish contents. Indeed we have many scripts in Turkish, it is nice to have the BlogEngine.NET in Turkish.  Check the official site  

Thanks guys,

Tags:
Aug 08

Microsoft has announced a free tool for Windows Mobile programmers that can take stock of what resources applications are using. The "Windows Mobile API Usage Tool" performs static analysis of selected binaries, then reports on their usage of APIs (application programming interfaces) and other resources, the company says.

As a new posting on Microsoft's Windows Mobile Team blog notes, some APIs in Windows Mobile have been deprecated and may not be present in future versions of the operating system. Therefore, it's important to be aware of all the APIs an application is using.

The Windows Mobile API Usage Tool is designed to run on desktop computers running Windows Vista or XP, and requires Visual Studio 2005 or 2008. It is a command-line utility that allows selecting either a Windows Mobile application (in .CAB or .MSI format), or a directory containing multiple applications, as input. It will examine the selected code, then create a report listing its system dependences, optionally including any deprecated APIs, says Microsoft.

The tool saves its output in a SQL Compact Edition database (.SDF) file, and is said to be capable of creating a collection of useful reports. The Windows Mobile Team is encouraging developers to examine their applications with the tool, then send in copies of its reports to the company. This will aid in planning the future evolution of Windows Mobile, according to Microsoft.

To read the Windows Mobile Team's posting about the Windows Mobile API Usage Tool, see its blog, here. To obtain further background and download the tool, go to the Microsoft website, here.

kick it on DotNetKicks.com
Aug 07

As most of you know, a very nice series is going on dev102.com site for a while. Instead I was following the questions; I couldn't find any time to answer them till now. Here is this week's question “Point In Polygon” and below is my answer.  

   1:  //Solution : assume we draw a line parralel to x-axis. on CheckPoints y value, 
   2:  //from left side of the polygon to the point. 
   3:  //we need to count number of the borders intersects with this new line.
   4:  //if the number of intersections is odd, the point is inside
   5:  //if even then it is outside.
   6:  Point p1, p2;
   7:  int IntersectionCount = 0;
   8:  for (int i = 1; i < Polygon.Count; i++)
   9:  {
  10:      p1 = Polygon[i - 1];
  11:      p2 = Polygon[i];
  12:      //Check to draw the line from -infinity to the CheckPoint.
  13:      if ((p1.x < CheckPoint.x) && (p2.x < CheckPoint.x))
  14:      {
  15:          //Check if any intersection
  16:          if ((p1.y <= CheckPoint.y) && (p2.y >= CheckPoint.y))
  17:  IntersectionCount++;
  18:          if ((p1.y >= CheckPoint.y) && (p2.y <= CheckPoint.y))
  19:  IntersectionCount++;
  20:      }
  21:  }
  22:  if (IntersectionCount % 2 == 0)
  23:      Console.WriteLine("Outside");
  24:  else
  25:      Console.WriteLine("Inside");

Download the source. Program.cs (2.04 kb)

Tags:
Aug 06

As you see on the right side I’ve many widgets and planning to add some more. But I think having so many widgets, especially if they are tall, is not visually so nice and effective. I searched for anyone who had the same problem and found Chris’s blog and his a brilliant solution,  Collapsible Widgets”.

The idea is really nice but on the other hand, setting the display style directly to none or block causes sharp and graceless transition. Hence there are many js codes for animated div transitions; I decided to go for another solution to collapse/expand the widgets with animation. After a quick search I found a handy animation on DynamicDrive.

The rest of work is just to place these js files correctly into BlogEngine and configure it. To do this, fist; add these two js files into js folder (create a new folder named as js in the webroot ) in your webapplication’s root.


Then we need to add these js files into the generated pages on runtime. BlogEngine has a nice page structure and so easy to add js files with the
AddJavaScriptInclude function in BlogEngine.Core/ Web /Controls/ BlogBasePage.cs file. Add the following lines to the BlogBasePage.cs in line 89.

 

   1:  //add JS files for animatedPanel
   2:  AddJavaScriptInclude(Utils.RelativeWebRoot + "js/jquery-1.2.2.pack.js");
   3:  AddJavaScriptInclude(Utils.RelativeWebRoot + "js/animatedcollapse.js");
   4:   
   5:  //and the original code goes on
   6:  AddJavaScriptInclude(Utils.RelativeWebRoot + "blog.js");
   7:  if (User.IsInRole(BlogSettings.Instance.AdministratorRole))


Then, we need to configure widgets to toggle theirselfs to collapse/expand. Editing App_Code/ Controls/ WidgetBase.cs as following will be enough to complate our changes.

 

   1:  if (ShowTitle)
   2:     //Change the title text to an active link to toggle collapse/expand toggle
   3:     sb.Append("<a href=\"javascript:animatedcollapse.toggle('widgetContent" + WidgetID + "')\"><h4>" + Title + "</h4></a>");
   4:          
   5:     //old title
   6:     //sb.Append("<h4>" + Title + "</h4>");
   7:  else
   8:     sb.Append("<br />");
   9:   
  10:     //Change the contentDiv and give the id starts with widgetContent
  11:     sb.Append("<div  id=\"widgetContent" + WidgetID + "\" class=\"content\">");
  12:   
  13:  writer.Write(sb.ToString());
  14:  base.Render(writer);
  15:  writer.Write("</div>");
  16:  writer.Write("</div>");
  17:   
  18:  //Initialize animatedcollapsepanel for widget.
  19:  writer.Write("<script type=\"text/javascript\"> animatedcollapse.addDiv('widgetContent" + WidgetID + "', 'fade=1'); animatedcollapse.init();</script>");


That’s all, you can see the result on my widgets by clicking their titles.

I think having smooth UI transitions and animated stuff in your webpage is not bad :)


Download the codes
: AnimatedWidgets-BlogEngine.NET.rar (21.97 kb) 

kick it on DotNetKicks.com
 

Software Blogs TopOfBlogs