Archive | Code

Tags: , , , ,

Hell-o world WebOS

Posted on 01 September 2010 by Alexander Viken

Building native apps in HTML/Javascript and CSS. The idea is good, and it just might some day rid us of the programming language fragmentation…. Some day…

But not quite yet. Not in my opinion anyhow, after giving WebOS from Palm a try.  My previous experience with HTML/Javascript/CSS based native apps was by using PhoneGap in an iPhone application, that actually works the way I expected, with the “look and feel” of how i would create any other ordinary web/html application.  With WebOS and the Palm WebOS SDK there’s a different way to do it….

Firstly, you download and install the SDK and the VirtualBox WebOS emulator. To start a new project you fire up a command prompt or terminal window and type the generate command: Continue Reading

Comments (0)

Tags: , , , , ,

Creating a Cellular Line (GPRS) Modem from code

Posted on 11 March 2010 by Alexander Viken

Here’s a code snippet i just found really usefull. I was getting 20 MC75 pda’s ready for a customer pilot project and we’ve developed a solution but hadn’t design any deployment system for getting the devices ready, so it was all manual work.

The solution uses the network through GPRS/Edge and each of the devices needed to have a cellular (GPRS) Line modem connection defined. Doing this on 20 devices by browsing to Settings -> Connections -> Add new modem connection, then add the same data for APN, username, password was just to much of a pain.

An easier way of doing this is to use the ConfigurationManager, found in the Microsoft.WindowsMobile.Configuration namespace. My purpose was to just make sure there was a cellular modem connection defined  with a working configuration. I wanted this to be the first to be done, and i wanted this to be re-run at application launch each time to reset any “mis”-configuration done by end users thorough the pilot period.

Firstly i defined a method that would give me a string with xml data. – This could also have been done a bit more elegantly or smooth, but it works for me this way. Continue Reading

Comments (0)

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Finger friendly UI controls for Windows Phone

Posted on 26 November 2009 by Alexander Viken

When it comes to application development on the Windows Phone platform things are on the move. Lessons are being learned from the iPhone and its usability experience, from the Android platform etc. The lesson learned is that you need to pay extra attention to how your application looks and feel.

You should not under estimate the possibility of usability and design being the selling point in a purchase decisions before feature richness in a case  where two  similar featured apps are compared, where one looks and feels good, and the other has an extra amount of features beyond the core functionality it should handle.

As i am on the look out for a UI toolkit to standardize our enterprise development at work  on I´ll compile a list of libraries that could do the job as i find them. The criteria for the search is ease of use and finger friendliness. Hopeful others also find this list useful. Continue Reading

Comments (7)

Tags: , , , , , , , , , , , , , , , , , , , ,

Setting up a maintainable windows phone development project in Visual Studio 2008

Posted on 14 October 2009 by Alexander Viken

In this post i share what is my experience, and what i have found to work for me as a best practice for setting up my projects and software structure when developing windows phone applications in Visual Studio 2008.

Basically I am  applying some Model-View-Presenter principles tweaked for simplicity and dividing the different parts into separate projects.

The Model-View-Presenter software design pattern is in my opinion the easiest pattern to use. It is also easy to get going with if you`re not familiar with the jungle of three or four letter acronym patterns and support frameworks available.

Patterns are important and you should use them! By applying, in this case a MVP pattern we can easily handle the rapid changes in new hardware, screen form factors, UX requirements and connectivity requirements to back-end systems. Continue Reading

Comments (2)

Tags: , , , , , , , , , , , , , ,

How to use the MSDN managed code gesture wrapper in a Windows Mobile 6.5 device project

Posted on 02 October 2009 by Alexander Viken

Here´s a short how-to for getting started with gestures in your Windows Mobile applications. First how you set up your device project, and then i explain how it works using the managed gesture wrapper from MSDN.

First of all you need to consider if you would like to do it the “hardcore” way? by doing all the P/Invoke native calls yourself (then this documentation on MSDN is really useful) or if you just want to get gestures working and use the managed wrapper available in the MSDN code library, - You can also find the source code for the  wrapper there if you later need to find out how it really works. I haven´t  investigated the wrapper library yet, so I am not sure if it  encapsulates all the native functionality that is available.

First of all; Start Visual Studio 2008 and create a new device application solution. There is no specific Windows Mobile 6.5 application template so you just choose a Windows Mobile 6 project. Next you need to do is to add a reference to Microsoft.WindowsMobile.Gestures.dll (assuming now that you have downloaded the dll file) in your WYSIWYG in VS08.

  1. Visual Studio 2008 toolboxRight click on the General tab in the toolbox and select “choose items…”
  2. In the “Choose toolbox items” dialog select the browse button in the “.NET Framework Components” tab
  3. Browse to where you extracted the Gestures dll file and select it.
  4. A component called “GestureRecognizer” has it´s checkbox checked and selected.  Click the OK button.
  5. Continue Reading

Comments (0)

Tags: , , , , , , , , , , , , , , , , , , ,

WM 6.5 gestures and physics engine

Posted on 25 September 2009 by Alexander Viken

wm65emulatorIt’s friday and time for some fun, and having a look at the gesture and physics engine of WM 6.5 qualifies as such . Googling for developer references i found that on august 26th and september 2nd 2009 Microsoft through Alex Yakhnin and Ron Buckton hosted two developer webcasts (level 400) on the gesture and physics engine of Windows Mobile 6.5.

This was a really useful intro on how to implement this your own .netcf applications. Gestures are supported in the existing standard ListView, Listbox, WebView, TreeView and Tab controls. and you get this characteristics just by running the application on a WM 6.5 device. But to programmatically control the gestures you need to handle the Select, Scroll, Pan, Hold and DoubleSelect events.

A detailed guide on how for the gesture apithis can be found on MSDN here. To fully understand this you need to be familiar with P/Invoke and native calls. Continue Reading

Comments (1)

Tags: , , , , , , , , ,

.netcf code on the iPhone

Posted on 15 September 2009 by Alexander Viken

mt-logo

Norwegian online paper digi.no (Norwegain article) has an interesting article today about an anouncement from the open source project MONO. They have completed a SDK called MonoTouch. MonoTouch is the Mono edition for Apple’s iPhone and Apple’s iPod Touch devices.  MonoTouch allows developers to create C# and .NET based applications that run on the iPhone and can take advantage of the iPhone APIs as well as reusing both code and libraries that have been built for .NET as well as existing skills. MonoTouch also includes XCode integration.

Md_hw_iphone8MonoTouch is not open source and comes with some quirks when it comes to application distribution and licensing but it is a good step in the right direction.

MonoTouch comes in three version Personal for $399, Enterprise for $999 and Enterprise 5 for $3 99. Continue Reading

Comments (0)

Tags: , , , , , , , , ,

Subscribe to form events with Dexterra

Posted on 27 July 2009 by Alexander Viken

When you work with the Dexterra framework, you don’t really have access to any of the notification engines you normally would have on the front end of an application. This became a major problem for us in a project we were working on.

Our goal was that we had a details screen for data with a button that would take you to a form with a list of selectable items. When an item was selected from the list, we wanted to show the selection in our details screen without having to send the data back into the dexterra business objects from the list screen, and then read the updated data from the database into the detail screen.

We were using Dexterra version 5.6.1 for our development and the solution we found was this.

We have two forms DetailsScreen and ListScreen inheriting from the Dexterra.Framework.Screen class.
Inside the ListScreen we have an public event named ListItemSelectedEvent and on the DetailsScreen we have a button named btnListSelection. Continue Reading

Comments (1)

About the author, Alexander Viken
Working as Chief Mobility Consultant at Creuna Norway. I received MSFT MVP for Device Application Development in June 2010 and are interested in mobility trends, the market, technology, software development for Windows Phone, iOS and Android mostly, but not exclusively. Scrum master that fights to keep it lean.
Advertise Here

Me on Twitter