Jul 28 2010

Investments Extended: Infragistics on Windows Phone

Category: MobileJoel Ivory Johnson @ 07:07

Understandably some developers were a bit upset when they found out that their native Windows Mobile code couldn't be moved forward to Windows Phone 7. Their effort investment had essentially reached a dead end. While the decision to use Silverlight as a core technology for Windows Phone broght an end to the usefulness of some code it also opened the door for other existing code to become useful in the mobile space. I was playing with an accelerometer driven program that I had written and was working on making a desktop component that would let me visualize my recorded accelerometer data. I was using the Infragistic Silverlight Data Visualization Controls (version 9.2) for Silverlight 3. I couldn't help but think "Man, if I could use these controls on Windows Phone 7 then I wouldn't need to make a desktop component." Then I decided to try it. I made a simple chart in a Windows Phone 7 project and deployed it to both an emulator and a real device and to my surprise it worked!

 

I personally invested a lot more in managed code than I did native code and feel that it's nice to be able to share more of my desktop development knowledge with my mobile development activities. But I'm overjoyed to see that my Silverlight 3 investments extend into Windows Phone 7

Tags:

Jul 26 2010

Avoiding Tight Hardware Coupling

Category: Mobile | ProgrammingJoel Ivory Johnson @ 11:24

As a Software Engineer I'm interested in how tightly coupled that one piece of code is to another. Coupling is the amound of dependencies that one entity has on another and tightly coupled code tends to be less portable and adaptable. But the concept of coupling doesn't stop at software. Coupling is also applicable to the relationship between hardware and software and I'm interested in avoiding tight coupling between the hardware and software for my code too.

With real implementations of Windows Phone 7 devices floating around it would be easy for some one to attempt to write an application that is tightly couple to that implementation. In some cases these low risk associated with doing this; for example if one tightly couples to screen resolutions (and there will only be two screen resolutions) it could be some time before some one needs to address another screen resolution. I'm writing a piece of code that is going to be sensative to the sampling rate of the accelerometer. And easy but tightly coupled way to handle this would be to measure the sample rate of the accelerometer and then write my code accordingly. But if I do this then I assume quite a few things. I would be assuming that other phones have the same sample rate. I would assume that the same phone will always have the same sample rate. I don't know that either of these assumptions are true.

The time information returned in the from DateTime.Now is precise enough for me to perform the measurements that I needed. So I wrote a quick application that would measure the accelerometer sample frequency and display it in a text box.

Here is my initial code

       private Accelerometer _accelerometer;

        // Constructor
        public MainPage()
        {
            InitializeComponent();
            this.DataContext = this;

            _accelerometer = new Accelerometer();
            _accelerometer.ReadingChanged += new EventHandler(_accelerometer_ReadingChanged);
            _accelerometer.Start();
        }

        void _accelerometer_ReadingChanged(object sender, AccelerometerReadingEventArgs e)
        {
            DateTime previousUpdate = LastUpdate;
            LastUpdate = DateTime.Now;
            double period = LastUpdate.Subtract(previousUpdate).TotalSeconds;
            double frequency = 1.0/period;
            if (frequency > HighestFrequency)
                HighestFrequency = frequency;

        }

        
// LastUpdate - generated from ObservableField snippet - Joel Ivory Johnson
  private DateTime _lastUpdate;
  public DateTime LastUpdate
  {
    get { return _lastUpdate; }
      set
      {
          if (_lastUpdate != value)
          {
              _lastUpdate = value;
              OnPropertyChanged("LastUpdate");
          }
      }
  }
 //-----      
// HighestFrequency - generated from ObservableField snippet - Joel Ivory Johnson
  private double _highestFrequency;
  public double HighestFrequency
  {
    get { return _highestFrequency; }
      set
      {
          if (_highestFrequency != value)
          {
              _highestFrequency = value;
              Dispatcher.BeginInvoke(() => { OnPropertyChanged("HighestFrequency"); });
            
          }
      }
  }
 //-----


        void OnPropertyChanged(string propertyName)
        {
            if(PropertyChanged!=null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion
    }

Ofcourse there may be those that are curious as to what value a real device will currently returned. Of course publishing that type of information could result in more tightly coupled code being written. I'll post more once the code I am writing is done.

Tags: ,

Jul 25 2010

Just In: My Windows Phone 7 Hardware

Category: MobileJoel Ivory Johnson @ 08:02

LG Windows Phone 7

When I arrived at home on Friday I had a notice from Fedex that they attempted to deliver a package. Speculating that it was something from Microsoft I jumped back in my car without going into the house and immediatly drove to the Fedex to pick up the Package. It was an LG Windows Phone 7 device.

It's nice to be able to run my code on real hardware. The first thing I did was run the acelerometer example in the Windows Phone 7 page and I found a simple bug in the code that I would have never found on the emulator. The device uses an AT&T 3G radio (I am on T-Mobile USA) so I've not been able to use it in 3G mobile, only in edge. But this is more than sufficient for my purposes. I'm about to hop in my car right now to test out a location based application I had written.

Tags:

Jul 14 2010

Obfuscation Available for Windows Phone 7

Category: MobileJoel Ivory Johnson @ 08:10

PreEmtive Solutions announced that it now has support for the Windows Phone 7 variant of Silverlight for its Dotfuscator product. Dotfuscator will obfuscate ones XAP file by renaming the elements within it. While this doesn't make the assembly impossible to reverse engineer it does make the process more difficult. For some one attempting to reverse engineer your code their decompilation tools will still work but will produce something with less meaningful names. There is a cognitive component to reverse engineering and obfuscation interferes with that component of the process.  More information on the product can be found on PreEmptive's site.

Original Story: WmPowerUser.com

Tags:

Jul 14 2010

Windows Phone 7 Initial Languages

Category: MobileJoel Ivory Johnson @ 02:19

Yesterday the Windows Phone team announced the languages and countries that will see the first Windows Phone 7 devices this year. The five languages that will be supported at launch are English, French, Italian, German, and Spanish.  The 17 nations that will see the initial devices are Australia, Austria, Belgium, Canada, France, Germany, Hong Kong, India, Ireland, Italy, Mexico, New Zealand, Singapore, Spain, Switzerland, UK and United States. Also in case you missed it the first preproduction Windows Phone devices ship this upcoming Monday to developers (I'm keeping my fingers crossed and hoping that by some miracle I receive one!). 

source: Windows Team Blog

Tags:

Jul 12 2010

Windows Phone 7 Beta Tools Available

Category: MobileJoel Ivory Johnson @ 07:36

An updated version of the Windows Phone 7 tools will be available soon. The link is posted (though the files to which it refers are not yet there). You'll be able to find the download at this location.

There are some breaking changes between the CTP and the updated version. You can find the full list of those breaking changes here

Just to highlight some of the changes

  • All of the assemblies that began with Microsoft.Phone.* and the Microsoft.Device were merged into a single assembly, Microsoft.Phone
  • System.Locations was moved to System.Device
  • ListView and ListViewItem were removed.
  • A number of classes were renamed

The blog entry referenced above also contains information on exactly what you need to do to migrate your projects over from the earlier CTP to the current beta.

Tags: ,

Jun 14 2010

Videos of TechEd 2010 Available

Category: MobileJoel Ivory Johnson @ 03:32

If you weren't able to make it to TechEd 2010 and wanted to see what you missed the videos are now available online. You can find the Windows Phone sessions here. Some of the topics include building games with Windows Phone 7, building high performance 3D games on Windows Phone 7, a deep dive on the Windows Phone architecture, and an overview of the forthcoming Marketplace functionality for Windows Phone 7. 

Tags:

Jun 8 2010

New Marketplace Rules Published

Category: MobileJoel Ivory Johnson @ 07:00

An updated version of the rules for the Windows Marketplace for Mobile have been published. The most significant changes is that you can publish an unlimited number of paid apps for your 99 USD yearly registration fee. You can publish up to 5 free apps for that fee. For each additional app over that $5 the fee is 20 USD instead of 99 USD.  A trial API has also been added so that customers can try out an application at no risk. The full list of policies can be found in the Windows Phone developer portal at http://developer.WindowsPhone.com. 

 

 

Tags: ,

Jun 8 2010

Windows Phone 7 Developer Hardware Available Next Month?

Category: MobileJoel Ivory Johnson @ 06:57

I read a story on IStartedSomething.com saying that Windows Phone 7 Development Hardware may be available next month. The hardware is said to come from a number of different OEMs but will be speced similarly enough so that it won't matter. The hardware and its software won't  be retail quality, but hey, it's a start!

Tags: ,

Jun 5 2010

Building a translation application with Windows Phone 7 : Part 1

Category: MobileJoel Ivory Johnson @ 15:43

After playing with Google Translate for some time I wondered why Microsoft didn't have anything like it. After a few moments of thought I remembered that they do have something like it. The Bing webservice does translation (The very first article I ever wrote on Windows Phone was using the Bing web services, which were called Live services at the time).  Microsoft has also has made the translation functionality made the translate functionality available at MicrosoftTranslator.com/Tools.

The web serice is extremely easy to use.  So I decided to make a very simple Windows Phone application that made use of it. In the two part video below I construct the interface. The actual construction time on the code was 15 minutes (One could easily do it in ten minutes, but I code slower when I am talking about it at the same time).  My goal in this video was just to use the service and get things up and running (I've thrown user experience to the wind here). In a follow up post I'm going to address user experience and add the functionality that will make the program talk.

Since the video is more than ten minutes I've had to seperate it into two videos. You can see both of them below.

Tags:

Jun 3 2010

Did I write part of WinMoSquare (?)

Category: MobileJoel Ivory Johnson @ 14:32

Apparently I wrote part of WinMoSquare. I just got a tweet from some one a few moments ago saying that he had seen an exception of type j2i.net.WiFiPositioningError. It's been at least two years since I was in that code so I don't even remember what it means. Was interesting to hear that I've contributed to something that a decent amount of people use. Though I kind of hate that it was discovered though an exception message.

 

Tags:

May 30 2010

Visual Studio Snippets

Category: Desktop and Server | MobileJoel Ivory Johnson @ 03:11

As a developer if you are not using some type of code generation tools then you are not achieving your true potential. In addition to plugins being available such as ReSharper or CodeRush Visual Studio has had the ability to automate some code generation builtin. One of the facility provided is code snippts. A snippet is a code template. You can define your own for patterns that you find yourself implementing over and over.

If you've never used snippets and want to get started then start off by downloading this file. It's a template for making your own snippets.  Then watch this video demonstrating how to use that file to create and use your own snippets.

 

Tags: ,

May 23 2010

Reaching out to the Customers

Category: MobileJoel Ivory Johnson @ 03:11

One of the things I don't like about the Windows Marketplace for Mobile is that there's no method provided for reaching out to customers. There will be an occasional customer that has a problem using an application and it's not the application's fault. This can occur if the .Net framework failed to install, if the user is using a cooked ROM that doesn't conform to normal behavior, or the OEM has changed an API and given it non confurming behaviour causing the application to not work properly on that one phone.

When ever something like this happens the customer doens't try to determine who has responsibility for the failure. The customer will quickly conclude the application is faulty and will some times leave negative feedback on the download page for the application. And a one star rating can do significant damage to the sales of your application. Som other users may see it as a warning sign and will steer clear of your application because of it. To make matters worst you've got no way to reach out to the customer to determine what is wrong or provide any assistant to correct the issue.

Microsoft's heard the developer feedback on this issue and is said to have a solution in the works. In the mean time whether than waiting on the rollout for the solution I've got another solution implemented. I've provided a method for the users to reach me within the application.  This won't help for the instances when a user cannot start an application. But a majority of the issues Iv'e seen are not from the application ont starting so this solution provides good coverage. My thoughts on the matter are that a customer will take the easiest most visible pathway for expressing their thoughts on an application (satisficing) and providing a feedback mechanism within the application will help pre-empt negative feedback.

In putting my thoughts to the test I've included an option to provide feedback in the "FindMe" application that I submitted to the Marketplace and plan to see what type of feedback that I get. I'm not really interested in sales for this application, but at the same time I don't want to cause the sales of the two other similar applications to flatline.  So I've made the application free in the marketplace for now but plan to raise the price back up (possibly as early as this evening).

Tags: ,

May 22 2010

FindMe 3.0 in the Marketplace for Free

Category: MobileJoel Ivory Johnson @ 04:05

Update - I reached the download count that I needed so I just put a price back on the application. So it's no longer free. I'm getting some suggestion e-mails though the application already.

About a week ago I made mention to an application I made back in 2007 called "FindMe" and that I was going to put a version of it in the Marketplace. It's there now. You can grab it for free for an undisclosed amout of time. .  There will be updates to the code. The present version is actually less functional than the original (I left out the autorespond functionality because of some variance in an API implementation HTC made in the HD2).

 

 

You can grab it for free for now. I plan to put a price back on it later on. There are two similar applications in the Marketplace and I don't want to be the one to initiate the race to the bottom (for price) so I'm goint to raise the price back up (possibly as early as this evening, Eastern time). You can purchase it here.

 Update: 2010/05/23- Wow, that was fast. Up to 400 downloads. I'll let another 100 download before upping the price.

Tags: ,

May 21 2010

Chris Tacke on "Why Windows Mobile Sucks"

Category: MobileJoel Ivory Johnson @ 08:18

If you are familiar with Chris Tacke one thing you know about him is he's quite honest about what he thinks and doesn't tend to soften or sugar coat his words. One of his last post, "Why Windows Mobile Sucks" is no exception.  To keep things in perspective given any mobile operating system one can write a "Why xxxxx sucks." So I don't so much look at his article as rating Windows Mobile as inferior but instead as point out where the OS has room for improvement (and it looks like that improvement will show with Windows Phone 7).

Despite Windows Mobile being an adaptive and flexible operating system the point that Chris hits on is something that any one that has tried targeting a number of devices has encountered. In addition to Windows Mobile being adapted to several hardware configurations there are also APIs within Windows Mobile that are OEM dependent; the OEM can choose whether or not to implement certain APIs and for some of those optional APIs when they do implement them there are variances in how they will behave from one OEM to another (or even on the same device from one firmware version to another). Chris ran into this with the power management APIs. The methods he planned to use were there but calling them had no impact on the device. In trying to help him out I made use of the same APIs on a TyTn II and was able to get some of them to work as needed. 

Chris decided to leave the task alone. Trying to get the code to work reliably across a range of Windows Mobile devices was going to be too difficult. I remember encountering something like this when dealing with a graphics related problem. With the problem I encountered I found that on some devices OpenGL 1.x was the better API to use. On another OpenGL 2.0, on another DirectX and still some other devices simply were not computationally capable of performing the operations needed. I ended up deciding to abandon that project because there was too much risk in the number of different experiences that some one would have had with the program. 

With Windows Phone 7 I don't expect to run into problems like this. Microsoft is taking control of the user experience is has higher requirements on the capabilities of the devices and the operating system image on the device. 

Tags: ,