Scott Guthrie’s ASP.NET team have released an ASP.NET wiki (currently in beta).
[Personally, I think it definitely looks like a Beta and could do with better navigation and layout but I’m sure that will come.]
Thanks to Mike Minutillo for the heads up.
admin
For a Few How to’s more… Windows CE .NET 4.2 and Pocket PC Resources
Microsoft Windows CE .NET 4.2 Alphabetical List of How-to Topics: http://msdn2.microsoft.com/en-us/library/ms918395.aspx
Articles about .NET Compact Framework at Pocket PC Developer Network: http://www.windowsmobiledn.com/sections/dotnet.html. Many of these articles are quite old, but they do contain the odd useful snippet.
Optimise Your .NET Compact Framework 2.0 Development
Optimize Your Pocket PC Development with the .NET Compact Framework
This MSDN webcast covers quite a few topics, and most will be familiar, but it’s a good, commonsense refresher: Optimizing Your .NET Compact Framework 2.0 Applications for Performance (Level 200)
There is a large collection of Mobility Webcasts here.
.NET Compact Framework version 2.0 Performance and Memory Working Set FAQ.
Thinking of using the Compact Framework for ‘real’-time applications? Chris Tacke’s January 2008 article, “Performance Implications of Crossing the P/Invoke Boundary” is an interesting read.
Using Log4Net with the .NET Compact Framework 2.0 SP2
Log4Net is a simple and effective logging solution for .Net applications. If you want to use it with the .NET Compact Framework, you just need to recompile the source code that is part of the standard 1.2.10 (zip) download package. Open the solution file (.sln), make sure build is set to Release, and compile with symbols NETCF and NETCF_1_0 defined in the log4net project properties [don’t forget to update the assembly references to point to the Compact Framework 2.0 SP2 DLLs, rather than the standard framework ones]
(Note: although we are compiling for CF 2.0 there is no NETCF_2_0 symbol to define)
What are the differences between the Compact and Standard versions? http://logging.apache.org/log4net/release/framework-support.html
SitePoint CSS Reference
If you haven’t already seen it, the good folks at SitePoint have put together a CSS Reference and made it publicly accessible here.
“In this free online reference, the entire CSS language is clearly and concisely explained, including browser compatibility, working examples, and easy-to-read descriptions.
The reference has been written by two of the world’s most renowned CSS experts — Tommy Olsson and Paul O’Brien — so you know it’s accurate, up to date, and best practice.”
Its other nice feature is the ability to accept user contributed notes.
C# Code Snippet: Download a File Over HTTP
This code snippet was adapted from one of Jim Wilson’s excellent “How Do I?” tutorials. It works with .NET Framework 2.0 (including the .NET Compact Framework CF 2.0 SP2), and I’ve successfully tested it on a Windows CE 4.2 device. You will probably want to add a bit more error handling:
///
/// Download a file from a URL to a local folder on a windows mobile device
/// Note: Don't forget that mobile folders do not start with a drive letter.
///
/// e.g. http://www.someaddress/downloads/
/// e.g. filetodownload.exe
/// e.g. \temp\
///
public static long FromHttp(string uri, string filename, string localFolder)
{
long totalBytesRead = 0;
const int blockSize = 4096;
Byte[] buffer = new Byte[blockSize];
if (!Directory.Exists(localFolder))
{
Directory.CreateDirectory(localFolder);
}
try
{
HttpWebRequest httpRequest =
(HttpWebRequest)WebRequest.Create(Path.Combine(uri, filename));
httpRequest.Method = "GET";
// if the URI doesn't exist, an exception will be thrown here...
using (HttpWebResponse httpResponse = (HttpWebResponse)httpRequest.GetResponse())
{
using (Stream responseStream = httpResponse.GetResponseStream())
{
using (FileStream localFileStream =
new FileStream(Path.Combine(localFolder, filename), FileMode.Create))
{
int bytesRead;
while ((bytesRead = responseStream.Read(buffer, 0, buffer.Length)) > 0)
{
totalBytesRead += bytesRead;
localFileStream.Write(buffer, 0, bytesRead);
}
}
}
}
}
catch (Exception ex)
{
// You might want to handle some specific errors : Just pass on up for now...
throw;
}
return totalBytesRead;
}
Comments welcome.
A Few Useful Links for .NET Compact Framework Targeted Mobile Development
OpenNETCF have a free community edition of their extension library:
http://www.opennetcf.com/Home/tabid/36/Default.aspx
(among other things, contains a useful FileSystemWatcher which is missing from CF 2.0 SP2)
This Microsoft site has a few great tip and tricks:
http://msdn2.microsoft.com/en-us/netframework/bb495180.aspx
.NET Compact Framework Team
http://blogs.msdn.com/netcfteam/
Chris Tacke’s SDF Samples
http://blog.opennetcf.org/ctacke/CategoryView,category,SDF%20Samples.aspx
Neil Cowburn’s blog:
http://blog.opennetcf.com/ncowburn/
Jim Wilson’s Blog
http://www.pluralsight.com/blogs/jimw/
Peter Foot’s Blog:
http://www.peterfoot.net/CategoryView,category,NETCF.aspx
Mike Hall’s Blog:
http://blogs.msdn.com/mikehall/
Also, Issue 14 of the Architecture Journal has a mobile device focus:
http://www.msarchitecturejournal.com/pdf/Journal14.pdf
Make: The Best of: 75 projects from the pages of MAKE
- Tools
- Electronics
- Microcontrollers
- Toys & Games
- Robots
- Music
- Flight & Projectiles
- Photography & Video
- Cars & Engines
http://www.oreilly.com/catalog/9780596514280/
Developing for the Symbol MC1000 with CF 2.0 SP2
My foray into mobile development, after a hiatus of several years, got off to a very slow start with the Symbol MC1000! The previous project had targeted a Telxon device which is now discontinued and if I recall correctly had a 1MHz(!) processor, just 1MB of non-volatile RAM for both code and data, ran a cut down version of DOS, had absolutely no integrated debugging experience and was entirely developed in C with only minimal library support. It was an enjoyable, if not protracted, challenge building a disconnected warehouse inventory application for that device, which required good performance and usability.
The Symbol MC1000 is a much more modern affair, with an Intel XScale 312 MHz processor, running Windows CE 4.2, 32MB of RAM and 32MB of flash ROM.
After a few Google searches I discovered that I would be able to target the Compact Framework 2.0 SP2 and use C# in Visual studio 2005 (SP1) to develop and debug the new application. Joy!
I’m almost embarrassed (*blush*) to admit that it took me a while to get the right version of the Compact Framework installed! I got it into my head that an “Intel XScale processor” meant I needed the x86 version of the Compact Framework. It doesn’t! It needs the ARM version. The Symbol web site could certainly benefit from better usability and content. Thank goodness for forums and the people who give up their time to answer questions on them. It seems everyone I have mentioned this to after the fact thought it was obvious, so it must be common knowledge in this sphere.
So what about the debugging experience? It is great! Just install Microsoft’s ActiveSync 4.5 and the other downloads listed below and you will be off to a flying start.
I’m currently running Compact Framework 2.0 SP2 in RAM: I haven’t quite figured out the Platform Builder route to installing it into ROM, and the Symbol site is pretty quiet on the whole matter. Small steps…
Helpful links:
Mark Prentice blog has this very useful post: Developing .NET Compact Framework applications for Windows CE 4.2 Devices
Downloads:
.NET Compact Framework 2.0 Service Pack 2 Redistributable
ActiveSync 4.5
Symbol Mobility Developer Kit v1.6 for .NET
Windows Mobile 5.0 SDK for Pocket PC
Perth .NET User Group meeting: ASP.NET MVC with Michael Minutillo
Join us at the Perth .NET Community of Practice, February 7th to hear Michael Minutillo present on Microsoft’s ASP.NET MVC framework. In this session, Michael will give an introduction to this new Microsoft technology. ASP.NET MVC is a presentation framework being developed by Microsoft to provide an alternative to Web Forms for web-application development. Leveraging the well-known Model View Controller design pattern it enables developers to create robust, maintainable web sites.
TOPIC: ASP.NET MVC with Michael Minutillo
DATE: 7th February, 5:30pm
VENUE: Excom, Level 2, 23 Barrack Street, Perth
COST: Free. All Welcome.
MVC is a framework methodology that separates an application’s implementation into three component roles: models, views, and controllers. One of the benefits of using a MVC methodology is that it helps enforce a clean separation of concerns between the models, views and controllers within an application. Maintaining a clean separation of concerns makes the testing of applications much easier, since the contract between different application components are more clearly defined and articulated.
I will be giving away a few goodies: a Resharper license, a copy of the book “The ASP.NET Anthology” and a few T-shirts. If you want a seat, try to arrive early!
