Apr 21
Microsoft has released the icons that will be used in its Windows Phone 7 OS. The download page explains that the pack is meant for application developers writing software for the OS. There are 64 icons in the pack, 32 light and 32 dark, in .png format, with a vector-graphics option for import into Microsoft Blend.
Jan 25

This series of Web seminars will lead you through common application development scenarios in Windows Mobile 6.5. From “hello world” to embedded databases, from sending a simple SMS messages to using the new touch-screen enabled Gesture APIs, these sessions will get you started developing custom applications for your Windows Mobile 6.5 device.

 

Link is here

 

Jan 05

There’s been quite a bit of talk since the early CTP/Beta release of Visual Studio 2010 regarding the lack of support for Windows Mobile development. However, what most people fail to pick up on is that you can build Windows Mobile Widgets using either Visual Studio 2008 or Visual Studio 2010 (in fact you can probably do it using earlier versions of Visual Studio but I haven’t tried it). Interestingly an update to the Developing Widgets for Windows Mobile 6.5 MSDN article talks about coming support within Visual Studio for doing widget development:

Starting with Windows Mobile 6.5.3, developers can create Windows Mobile widgets using Visual Studio.

Given that you can already do most of the development within Visual Studio this would suggest better IDE support for perhaps debugging or packaging your widget…. This is pure speculation but if you want to get a bit of a heads up on widget development using Visual Studio, try the following posts from Nick's blog:

The version of Windows Mobile mentioned in the MSDN article and by Mary Jo in Is Microsoft (slowly) picking up the pace with Windows Mobile? must be a reference to some of the leaked builds.

 

Tags: |
Oct 31

Looking for a quick way to get the basics of Windows Mobile development? Try the RampUp “Develop Windows Mobile 6 Applications” e-learning.  Whilst this focuses on Windows Mobile 6 using VS2008, a lot of the points covered actually apply to all versions of the Windows Mobile platform.  Topics include the following:

Level 1: Mobile Development Introduction
Level 2: Device Emulators
Level 3: Mobile Windows Forms Development
Level 4: Advanced Mobile Windows Forms Development
Level 5: SQL Server CE Introduction
Level 6: Security and Deployment
Level 7: Mobile Web Development

Tags:
Aug 02

Couple of days ago, in one of the communities I follow, a question was asked if there is a way to integrate a map into a  integrating the Bing Map (javascript) Control into a Windows Mobile Widget.  Whilst the javascript engine in Windows Mobile 6.5 has been given a massive injection of life, I was very skeptical that the javascript control would work out of the box. I was proven wrong with the map working with no modifications.  The following code is taken out of the online visual sdk, with the only change being the height and width of the map div to fit into the widget.

<html>
   <head>
      <title></title>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <script type="text/javascript" src="
http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2"></script>
      <script type="text/javascript">
          var map = null;
          function GetMap() {
              map = new VEMap('myMap');
              map.LoadMap();
          }  
      </script>
   </head>
   <body onload="GetMap();">
      <div id='myMap' style="position:relative; width:240px; height:260px;"></div>
   </body>
</html>

The only issues I found with the javascript control relate to the gesture support within the widgets in Windows Mobile 6.5. When you pan your finger within a widget it attempts to scroll the widget itself.  Unfortunately this means that you can pan the map by dragging your finger across the map.  Instead you have to use the navigation control in the top left corner.

 
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 18

Windows Mobile 6.5 is done and that’s a good opportunity to provide a quick jump-start to developers wishing to learn more about the OS.

Microsoft has a tendency to overload developers with abundant API of its various platforms and technologies. Windows Mobile is no different. Managed and native API, .Net, MFC, ATL, Win32… it’s all there for the confused developer. Luckily, Microsoft has recently published an article discussing APIs for Windows Mobile 6 and later, and how to select the best fit for your application needs. BTW, don’t be tempted to choose managed .Net API before fully understanding the functional requirements from your application and the devices it needs to run on. Win32 is better if you wish the application to run on as many devices as possible. 

A good place to learn Windows Mobile development is MSDN’s ramp up which is a community-based learning program, teaching various aspects in development for WM. Another excellent source for learning and help is blogs of mobile gurus. I recommend subscribing to the following blogs: Raffaele Limosaniblog, Alex Yakhnin, Christopher Fairbairn, Windows Mobile team blog, Reed and Steve blog, the Moth, and finally, Chris Craft (especially his 30 days of .Net series).

OK. You’ve done your reading and fill ready to start developing? hold on. Make sure you took into account globalization and localization issues. Simon Judge lists many of them.

Once done development, you need to QA your application. If your application aims for numerous devices in many countries, involving different networks, you should consider using DeviceAnywhere or maybe even Mob4Hire.

Finished the cycle? congratulation! Now you can go and publish your application on Windows Marketplace.

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.

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: |
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

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 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 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
 

Aug 05
A while ago I was working on Web Parts and their personalization futures so I worked with custom editors and editor zone. As you know, editor zone is displayed at a fixed location. But for users it is really handy to have editor zone on top of the each corresponding webpart, please check your igoogle page and try to edit one of the widgets. You will see what I mean.  

So at the beginning I searched for injecting editor zone into webpart. But after really complicated and dirty code, it didn’t work efficient. Later on I made a little investigation on rendered HTML page with IE Developer Toolbar. I found out that every webpart has a table identified as “WebPart_” + WebPartID. So if we have an HTML table than it is a piece of cake to inject a div (editor zone) into it with javascript.  

Here is the javascript that positions the editor zone on the selected webpart.

<script language="javascript" type="text/javascript">
          function PositionEditor(part) {
                if (document.getElementById('EditorZone2') != null) {
                       
var tr = document.getElementById('WebPart_' + part).insertRow(1);
                        var td = tr.insertCell();
                        td.appendChild(document.getElementById(
'EditorZone2'));
                      }
          }
</script> 
 

And for sure, we need to register that function call on the page render as fallows: 

protected void Page_Prerender(object sender, EventArgs e)
{
    
if (WebPartManager1.SelectedWebPart != null)
            
ScriptManager.RegisterStartupScript(this, typeof(Page), Guid.NewGuid().ToString(), "PositionEditor('" + WebPartManager1.SelectedWebPart.ID + "');", true);
}


That’s it.


kick it on DotNetKicks.com
Tags: | |
Aug 04
Published by Microsoft: http://download.microsoft.com/download/3/B/D/3BDDC5D5-E8CF-4031-A12A-B072ECA27C42/VS2008PETopTenFSEMEA.doc
Tags: |
Apr 02

OpenXML artık bir ISO standardı . 87 Üye Ülkenin katılımıyla gerçekleşen standartlaşma süreci bugün itibarıyla nihayete erdi ve Open XML açık dosya saklama standardı olarak ISO tarafından onaylandı. Open XML 87 Ülkenin %86'sı gibi büyük bir çoğunluğunun desteğini aldı.

ECMA'nın konuyla ilgili açıklamasına http://www.ecma-international.org/news/TC45_current_work/ISO_and_IEC_approve_Office_Open_XML.htm linkinden erişebilirsiniz.

Microsoft'un basın duyurusuysa http://www.microsoft.com/presspass/press/2008/apr08/04-01OpenXMLVotePR.mspx linkinde yer almakta.

Tags:
Mar 04

While Microsoft's Flash competitor Silverlight is still not available for Windows Mobile (except Microsoft internal Betas), Nokia today announced plans to make Microsoft Silverlight available for S60 on Symbian OS smartphones as well as for Series 40 devices and Nokia Internet tablets. Adding support for Silverlight will extend opportunities for developers to create rich, interactive applications that run on multiple platforms in a consistent and reliable way.
Silverlight is a cross-browser, cross-platform plug-in for delivering next-generation media experiences and rich interactive applications.

Silverlight is already powering thousands of applications around the world and organizations including Entertainment Tonight, the NBA and NBC Universal to deliver superior Web-based experiences to their customers. The arrangement with Nokia will substantially extend the reach of Silverlight by making the platform available for hundreds of millions of devices, including S60 on Symbian smartphones from a range of manufacturers, as well as Nokia Series 40 devices and Nokia Internet tablets.

Microsoft will demonstrate Silverlight on S60 during the opening keyote at Microsoft's MIX08 conference on March 5 in Las Vegas. Silverlight is intended to be available to S60 developers later this year with initial service delivery anticipated shortly thereafter for all S60 licensees. This will allow S60 application developers to use an even wider range of development environments for S60 on Symbian OS than today. Today S60 developers can use: C++ (using native Symbian OS APIs and Open C providing subset of standard POSIX libraries), S60 Web Run-time (supporting standards-based web technologies such as Ajax, JavaScript, CSS and HTML), the Java language, Flash Lite from Adobe, and Python.

Microsoft Silverlight availability for Nokia Series 40 devices and Nokia Internet tablets will be confirmed later. When will Microsoft announce Silverlight's Windows Mobile availability?

Software Blogs TopOfBlogs