TamsPPC - the PocketPC Blog

The PocketPC news and opinion source

April 19th, 2008

Free developer training for US citizens, courtesy of M$

The folks at Microsoft’s have always been known for their excellent developer support - in fact, MSDN is so excellent that it sometimes is hard to find just what you need amidst all the other useful information.

Anyways, a Microsoft Employee called Jason Langridge has posted a note to his blog announcing that free spaces are left in the so-called “Developer Mobility Events”. People interested in one or more of the topics in the list below(and who live in the US or can fly there cheaply) are invited to pop over to his web page and register at a city close to them:

  • All About Windows Mobile
  • Windows Mobile for Line of Business
  • The Tools
  • Managed Development
  • Data Management Strategies
  • Performance and Optimization
  • A Whole New Level

Get the full scoop here:
http://blogs.msdn.com/jasonlan/archive/2008/04/15/free-developer-mobility-events-in-the-us.aspx

P.S. In case anyone of you manages to get there: PLEASE send videos or at least pictures and a short report to Tamog@gmx.at!

March 26th, 2008

Resco releases Audio for .NET CF

The folks at Resco’s have recently begun to offer add-ins and controls for Visual Studio. Their recently-announced Resco Audio makes most of the features found in Resco’s award-winning Audio Recorder available for your .NET CF application.

Currently, Resco Audio can do the following:

  • Audio playback — play files or streams containing audio data.
  • Audio recording — record your voice into audio data.
  • Supported file types — supports the well-known audio formats: .wav, .ogg, .spx, .raf.
  • Support for mp3 format will be added to the full version.
  • Quality — Customize the quality of recorded voice by choosing the amount of channels, sample rate, bits per sample and the compression algorithm.

An evaluation version of the library can currently be downloaded from the product’s home page:
http://www.resco.net/developer/mobileformstoolkit/audio.aspx

P.S. All people who currently have a subscription to Resco’s MobileForms will get a free full version when the product finally ships in June 2008!

February 13th, 2008

Code reuse for Pocket PC and Smartphone

I am currently working on “porting” my VB.NET test application from Pocket PC to Windows Mobile Smartphone(two binaries, but one code base) and have found the following links very useful. Treat it as a “collection of resources” for now - a detailed writeup comes in the near future!

Share Source Code Across Platforms (Devices)
This article gives you a broad overview at what’s needed.

Verify Platform Support for Code in Device Projects
A single line can kill your app - this article tells you how to tell the VB compiler to make sure that no “unedible” code is compiled.

Change Platforms in Device Projects
This little writeup tells you how to switch your Visual Studio between the two “platforms”…

If you find any other useful resources, please post them here!

February 9th, 2008

Create Numeric text boxes with .NET CF

Sometimes, UI designs demand text boxen to accept only numeric data(aka no characters) - after all, entering abc as a delay time value most definitely won’t make much sense. While the Palm OS allows developers to create so-called “numeric text fields” that only accept numbers, the .NET CF does not include this feature…

The code below restricts user input to the characters 1234567890 - no decimal points/commas can be entered:

Private Sub TxtX_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TxtX.KeyPress, TxtY.KeyPress
e.Handled = True
If Char.IsNumber(e.KeyChar.ToString) Then
e.Handled = False
End If
End Sub

Just paste it into the form’s code, and add the names of all numeric text boxen instead of TxtX and TxtY(you can have 1 to n).

Enjoy your numeric text box…

February 8th, 2008

PhatUpdate SDK released for Windows Mobile

Recently, many software houses have begun offering components(used in their applications) to third-party developers(take Resco as an example). The US-based company PhatWare has decided to follow suite by offering its OTA-updating utility to developers:

PhatUpdate SDK for Microsoft Windows Mobile offers an easy and convenient way to provide updates for installed software products and offer additional products compatible with the user’s device. In addition to product updates, the application can also be configured to offer trial versions of other 1st and 3rd party software and provides links to download and purchase the software directly from the device. The SDK includes royalty-free redistribution license, one year maintenance and updates, and two hours of engineering support via phone or email.

The system will work on touchscreened and touchscreenless Windows Mobile 5 or 6 devices. Purchasing it(599$) entitles you to 2h of free tech support and unlimited distribution rights(aka you can use it in all your apps, forever). Additionally, you are entitled to free updates for one year after your initial purchase.

February 3rd, 2008

ArianeSoft on PPL obfuscation and piracy

Each and every .NET CF developer is perfectly aware of the pains involved in obfuscating applications in order to keep their source code safe. ArianeSoft’s Pocket Programming Language is another development solution for PocketPC (it IMHO has quite a few advantages over .NET CF) - here’s what they have to say on security:

Please tell us a bit more about yourself
My name is Alain Deschenes, I live in Montreal, Quebec, Canada with my wife and daughter. I have been programming for the past 20 years. I started on an Apple IIGS in 1986 in Basic, then Pascal, Assembly, C and C++. I am the president of ArianeSoft Inc. and the author of PPL (Pocket Programming Language) and DataMite.

Do you consider piracy an important issue in the mobile computing space?
Yes. Most, if not all, mobile applications and games are cracked these days. It is a big problem. If a little company wants to stay alive and healthy, it needs to work on anti-piracy features in their programs.

Has ArianeSoft itself ever had piracy problems?
Yes, we are always working on tightening our security. We know we cannot win this game but at least we try. It is very unfortunate that people, even today, don’t realize that the sales we are loosing as a small company, really impacts on our future. The mobile community is like when I started on the Apple II, they were mostly small companies developing softwares. We have to work harder and protect our softwares better without causing too much troubles to our customers.

What does ArianeSoft do to help its customers stay safe?
We follow the warez scene closely and make sure our products stay protected, we have multiple methods for protecting them and change them every once in a while so that cracks only work for one version.

.NET CF has recently gotten under fire because applications created with it are easily disassembled. Is this possible with PPL, too?
Not unless you know how to. There are encryption, compression involved and then you need to know how the undocumented PPL’s bytecodes works. We are not saying it is impossible but until PPL really becomes a major player with critical applications developed with it, there should be no worries.

Does ArianeSoft plan to offer a “signed app” program in the future; thereby hindering pirates to run unsigned code on their machines?
No plans yet, maybe in the future.

Some developers have considered virii an effective deterrent to piracy. Do you think that their idea could work out theoretically?
I don’t think so. We need to protect the customers. We need to make sure the program is not going to think you are an illegal user and do something bad to your device or your data. The only thing your program should do in the event of piracy is stop functioning.

Do you think that device manufacturers are interested in reducing piracy?
I don’t think they care and they have no reasons to. They should care about making better devices and the software developers should worry about piracy. Unless they find a hardware solution to piracy, then that would be an amazing feature.

Will ArianeSoft ever offer a “disassembler” or release the specifications for its intermediate language to the public?
No.

Anything else you would like to add
We are starting work on version 2.0 of PPL. There is still a long road ahead but PPL 2.0 will bring major improvements to the visual form builder with a complete object-oriented control library. Thank you for considering us for an interview.

January 14th, 2008

Autorun/autostart applications from a memory card on a Windows Mobile device

Palm OS handhelds have a lovely feature - whenever you insert a memory card, they look for a file called Start.prc and - if they find it - execute it automatically(sort of like the Autostart feature found on CD and DVD media). Windows Mobile devices can do that, too - but it is a bit more difficult.

Autostarting an application on a PocketPC can be accomplished by creating the following file/folder structure on a memory card:
/2577/autorun.exe

The application file must always be called autorun.exe. The 4-number folder name defines the processor architecture(always 2577 for PocketPC) - here are numbers for other processor architectures:

HITACHI_SH3 10003 // Windows CE
HITACHI_SH3E 10004 // Windows CE
HITACHI_SH4 10005 // Windows CE
MOTOROLA_821 821 // Windows CE
SH3 103 // Windows CE
SH4 104 // Windows CE
STRONGARM 2577 // Windows CE - 0xA11
ARM720 1824 // Windows CE - 0x720
ARM820 2080 // Windows CE - 0x820
ARM920 2336 // Windows CE - 0x920
ARM_7TDMI 70001

Files are copied to the /windows/ folder and are then run from there - your Autorun application should thus be able to stand on its own….

Further information here:
http://www.informit.com/guides/content.aspx?g=security&seqNum=91&rl=1

December 31st, 2007

Obfuscating .NET Compact Framework(.NET CF) applications - or - an insane pain in the butt

I recently met a person thinking:

Microsoft’s .NET framework is beautiful. MSIL(it’s assembly language) is even nicer. Not being able to precompile CF applications is even nicer. Thank you, Microsoft, for making my job easy. - Joe Cracker.

And indeed, applications compiled to MSIL can be decompiled, giving people who have access to your exe file access to your source code. We had something like that with Visual Basic 3 - but apparently, some people at Microsoft’s are very warm to the idea of open sourcing applications by force.

How else can you explain that it apparently is impossible to obfuscate an application in the build process? Yes, you can link a cab project to a regular one; and create a nice little cab file for deployment. Sounds easy…but Joe Cracker has a great time decompiling it.

If you feel like protecting your intellectual property, you instead need to break up the process into three pieces according to this MSDN discussion. First, you create the .exe file from Visual Studio. After that, you need to manually open DotFuscator - and after that, you need to get back to Visual Studio in order to generate a CAB file using the obfuscated file(NOT the project’s standard output). Got it? No? I am still struggling with it, too….

In the end, it is very impressive to see that a company like Microsoft(who appears to be very worried about people copying its wares) is completely unmotivated when it comes to protecting its developers. Obfuscating must be built into the compiler IMHO - forcing developers to make multiple steps by hand is an unacceptable procedure.

Probably, someone at Microsoft’s is living by the German mantra of keeping his own door clean - as long as it’s just third parties getting fu**ed, its not my problem. I can only hope that someone at Microsoft’s finally gets off his hide and makes obfuscation easy - millions of developers would instantly love him forever…

P.S. For all those of you who don’t have too much existing .net CF code yet(and don’t wish to give it out to Joe): AFAIK, ArianeSoft’s PPL is free of obfuscation issues…

November 30th, 2007

The UI evolution of Windows Mobile or Can’t someone finally axe the goddamn toolbar?

A thread on PocketNow.com comparing the home screen of various versions of the Windows Mobile UI have made me think about what really disturbs me about Windows Mobile. After quite a bit of thinking,. I think that I have found my culprit…it’s the annoying top and bottom toolbars which IMHO are way to wide(especially in landscape mode):

If the image above wouldn’t be so sad, one could laugh about it for hours. A spreadsheet cell is tinner than the bottom toolbar, and the same is valid for the bottom one.

My personal request to the Windows Mobile team can be expressed easily - but the toolbar size by half. They are still tappable(case frames aid inaccurate users) - and we could get a nice extra bit of information on-screen!

November 25th, 2007

Why version 2 of the .NET Compact Framework isn’t in the ROM of most Windows Mobile 5 devices

While the following bits of information won’t really help pissed-off developers like me implement a setup routine that installs version 2 of the compact framework onto their client’s devices; it could still offer a bit of explanation on the motivations behind the omission.

This podcast was recorded at a Microsoft conference some time ago, and has Robert Levy(a Windows Mobile project manager) talk about .NET CF 2 and also about why it isn’t included in the WM5 ROM. Cutting a long story short: the reason is timing. The framework simply wasn’t finished in time…

Anyways, get the full scoop here(makes a good listen while on a commute):
http://blogs.msdn.com/mikehall/archive/2005/05/03/414495.aspx

November 19th, 2007

Determine a font’s line height in .NET CF(.NET compact framework)

Determining the line height of a font is very important thing for programmers creating applications that use changing texts as part of their UI. However, Microsoft(for some reason) decided to remove the .Height attribute from the .net CF Font object.

However, the height and width of a text can still be determined - if your code has access to a Graphics object. The object’s MeasureString method returns a SizeF parameter containing the height and the width of the string passed in….the values, of course, are in pixels!

The code example below creates a moving bar that permanently changes its color. In the middle of the bar, the text contained in drawString is displayed in white - this animated GIF simulates the effect:


ElseIf Globals.Globals.TextMode = textmode_enum.series60 Then
Dim drawString As String = TextParser.getDateText
Dim myFont As New Font(System.Drawing.FontFamily.GenericSansSerif, 12, FontStyle.Regular)
Dim myTextBrush As New SolidBrush(Color.White)
Dim myBackBrush As New SolidBrush(Color.FromArgb(Int((254 * Rnd())), Int((254 * Rnd())), Int((254 * Rnd()))))
Dim y As Integer = Int(((MainForm.Height - 4 - gfx.MeasureString(drawString, myFont).Height) * Rnd()))
gfx.FillRectangle(myBackBrush, 0, y, MainForm.Width, 4 + gfx.MeasureString(drawString, myFont).Height)
gfx.DrawString(drawString, myFont, myTextBrush, (MainForm.Width-gfx.MeasureString(drawString, myFont).Width)/2, y + 2)
End If

Enjoy!

P.s. If anyone of you knows how the MS boys format the code that they put onto their blogs so neatly….PLEASE let me know!
P.s.2 If anyone knows WHY Microsoft removed the Font.Height property from .NET CF, please let me know too!

November 16th, 2007

.net CF example code dump

While stumbling across the net in order to find a way to pick fonts in .net CF, I stumbled upon the following site offering a variety of interesting code samples:
http://samples.gotdotnet.com/quickstart/compactframework/doc/default.aspx

While the page’s formatting probably is horrible, the examples found on it could potentially be helpful!

Do you know other pages containing .net CF sample code? If yes, please give us a holler!

November 14th, 2007

A color picker for .NET CF

The lack of a color picker dialog in the .NET CF(yes, the desktop framework has a ColorPicker class - but .NET CF doesn’t contain it) has annoyed hell out of me for quite some time - even the 10yr old Palm OS contains a well-done color picker. Anyways, problems are here to be solved - please allow me to present you my own ColorPicker(running in .NET CF 2.0 on a hp rx4240, blots are due to GIF compression):

Using this is very simple - just download the form file here and integrate it into your project like you would do with any other form.

Then, do the following to make the user pick a color:

Dim colorX as color
colorX = ColorPicker.getcolor()

Feel free to do with this code whatever you feel like. However, no warranties are given on anything….and posting a link to an app that uses it always is appreciated!

October 23rd, 2007

Windows Mobile 6 for HTC Blue Angel - part 3: missing applications

After your upgrade to Windows Mobile 6, you still miss some applications which weren’t included in the upgrade. In the lower part of this site, there are two packages with this software. You have to download them from the German uploading service Rapidshare.

Package 1 - Contents:

  • Adobe Reader LE
  • Arcsoft MMS 4.2.8.1
  • HTC Audio Manager
  • HTC Bluetooth Printing Plugin
  • Midlet Manager
  • Windows Live 10.6.30.2100
  • HTC Network Plugin (virtual folder for Windows network resources)
  • Microsoft PowerPoint Mobile
  • Remote Desktop Mobile
  • HTC Streaming Player
  • MS VoIP addon
  • Windows Update
  • Settings needed if you have Windows Vista (Device Center)
  • Sound Fix (if you have sound problems)

Package 2 - Contents:

  • another Arcsoft MMS 4.2.8.1
  • enabling MMS messaging
  • enabling Windows Update
  • additional resources for MDA III in Windows Vista

In the next parts of this article we will write how to install certain apps, how to fix bugs that appear often, and solutions and tricks for other problems.

October 8th, 2007

Windows Mobile 6 for HTC Blue Angel - part 2: the flashing process

In the first article about WM6 for Blue Angel, you learnt how to prepare the upgrade. Today, we will have a look at the flashing itself. You can read the documentation in the xda-developers wiki here:

http://wiki.xda-developers.com/index.php?pagename=HTC_Blueangel_WM6_Home

Even if your flashing process will be successful, there are many bugs yet. So better have a look at the xda-developers forum, wiki and the following parts of this article.

According to this wiki page, I downloaded an archive which contains the update program. The SD card has to be removed. Then you must start your device in the bootloader mode (hold and press the power button, the button for voice records on the left site, and then the reset button). Now put your device into the cradle. To play it safe, I also deactivated ActiveSync on my computer. The update installer detects some data of your device and then flashs it.

The flashing process is the most dangerous part. If something goes wrong, your device could be damaged. Don’t disconnect your mobile from your computer or your computer from power supply. Also, all applications on your computer should be closed in order to reduce the possibility of a crash which could interrupt the flashing process. And make sure that your phone’s battery is full. In most cases, 50% and more (in other cases: 100%) are recommended.

bawm6_01.jpg

After flashing you have to do a hardreset. Three options (”Enable KITL”, “Clean Registry Hive” and “Format Storage”) should appear. The first one has to be “No”, the second and the third one “Yes”. This can’t be done using touchscreen - you need the two keys (Camera and Voice Record) on the left side. One key will change the option, the other one its value. Once you are ready, press the mail button. You can find a detailled description here.

bawm6_02.jpg

First you should see a white screen for about half a minute, then Windows Mobile 6 should boot on your phone. As soon as the coloured stripes appear, your device is booting. After ~ 10 seconds a “Windows Mobile” screen should appear. After another 10 - 15 seconds you can set up your device using the Welcome application.

bawm6_03.jpg bawm6_04.jpg bawm6_05.jpg bawm6_06.jpg bawm6_07.jpg bawm6_08.jpg

If Windows Mobile 6 is not running correctly or you have problems during the flashing process, have a look at the Wiki pages mentioned above. If you can’t find a solution, ask in the xda-developers forum.

The next parts of this article will show you how to install missing software, how to fix certain bugs of this ROM image and other tips and tricks.