Dienstag, 27. Juli 2010

MyTrainLog getting better and better

This weekend I finally found some time to get a huge step further with MyTrainLog.
I removed the Database stuff completely as its delaying the application development to much. I just using plain old ObservableCollections right now with a (De)Serializer to store the stuff in IsolatedStorage when the app is loaded/unloaded/etc.
This approach seems to be rather fast - at least on the emulator. No real device in sight right now.
I reall dont know whats happening if the collections are going to grow too much. Is the RAM storage unified? Don't know yet. Maybe I need to go back to Database later on - but the infrastructure is there at least.
What I noticed in the Beta tools is - the lack of controls. The Pivor/Panoramic control is not officially there - an very essential part of my app. I am using the nice one from Codeplex.com so far. Perfectly ok. No Date/Timepicker, no SelectBox/Combobox for easy selection of options. No checked Listbox etc. Everything could be coded by hand but it would speed app design up alot with some help here if you dont need to do the plumbing code for each control.
Anyways - the controls will come some day or another and the devs will incorporate them to make the look and feel of the plattform unique. And the split between the native MS apps and the 3rd party stuff will be getting less and less important and visible.

So far I guess about 80% of my app is ready. Ok, 20% will take 200% of the time :)

Sonntag, 18. Juli 2010

MyDietLog gets some new features

So the new beta of the SDK was out last week. This weekend I finally had time to code some new stuff into the very early stage of the MyDietLog for Windows Phone 7 (nice title).
So its now possible to sync date from the OData service (given via the Windows 7 based MyDietLog applications) and store the data in the IsolatedStorage of your Phone 7. After that you don't need the connection anymore and you can work offline. Syncing fresh data to the client is always possible from the home screen.
Editing data of your dailies can be done too. Up to now there is no syncing back to the central store. The corresponding sync framework is not available right now - or I have to code one myself - not decided yet...
You will notice that the loading is very fast if the database is already stored. The deserialisation is astonishingly fast - about 1500 entries for the in memory database right now.
Even the syncing is rather fast, as its done in the background and during startup. It takes only 3 seconds. But thats localhost and on the same machine. But the complete databasefile on the service is only about 1MB big. So it should not take so long - even streaming via bloated Atom feed.

Here is a short video from the current version:

So far nothing hered from Microsoft about a prototype dev device. Seems these have a very high demand and my little project is not mainstream enough to get interest from MS.
Anyways - I would have to live with the emulator for a while it seems.

Technologies used in the app:
  1. OData client via Atom feed
  2. PanoramicControl from codeplex - will be replaced with the control from Microsoft when available.
  3. IsolatedStorage to save the configuration (Destination address of the OData feed) and Database (ObservableCollection)
  4. ApplicationBar for syncing with OData service

Dienstag, 13. Juli 2010

Windows Phone 7 new SDK is out

In case you missed that - the new Beta SDK for Windows Phone 7 is ready to be downloaded.

Some new features under the hood and many incompatibilities to the CTP version regarding namespaces and XAML tags. There is are nice porting guide out which helps to get your existing app rather fast over to the new version.
Microsoft stated that its more or less final reagarding the API. No mayor changes will be coming to surprise the early developer.

I tested an issue with WebServices and SOAP - and its still not working correctly if you consume a (Sun Glassfish hosted) SOAP WebService which returns an array of a little structure. For simple types like returning a string it works fine. Hope they will work on that till release.

I ported over my littel app MyDietLog. Was not bad - it only took some time to figure out, where the main app screen will be actually started. They changed alot in the app.xml.cs and manifest files.
I got even an answer from one of the OData guys gegarding complex LinQ queries. They are simply not working because WP7 currently is not supporting Linq closures (if I got it right). So he gave me the tip to just use a different approach and construct the Uri string by hand. Works nice and I could speed up the app significantly.

Last but not least - the emulator comes without the MS apps preinstalled (at least they are not activated as usual) - and it has a nice new skin (a little bit smaller). It seems to load much faster from Visual Studio too...

Sonntag, 11. Juli 2010

Windows Phone 7 continued

I tried to somehow get around the query bug in the WP7 OData provider, but have not found any way to get it working.
So I spent some time to improve the infrastructure of the app a bit more. So its now correctly driven via a main menu and going from there into the daily consumed nutritions.
You can chose a date too - so far no Date/Time Picker around in the SDK, so we have to live with a simple one right now.

Dienstag, 6. Juli 2010

OData Adventures continued

I reorganized my app totally to get used to a more panorama friendly way of presenting the data. Much easier than I had in my first approach. Finding a good gui design is not really easy :)
I'll post a new video in a few days (Germany is playing in he cup tomorrow).

OData retrieval of my daily consumed food is already be splitted up into differend day.zones. Nice to get the data from the server and easily bind it to the listviews.
BUT the odata lib seems to have some huge problems with LinQ. I could not get a simple query through without an exception.

var query = from a in context.table where a.name=="name" select a;

Not working:
var query = from a in context.table where a.name==paramName select a;

with paramName given as a function arg to the query processing function.

collection.LoadAsync(query) is failing in th esecond case. I tried to get some infos about how to fix it in the msdn forum right now.  Hope someone has an idea...

Sonntag, 4. Juli 2010

Windows Phone 7 Prototype OData consumer

I finally managed to get the OData lib "unsigned" so that the April refresh of the Phone SDK will accept it.

After that it was not very difficult to fill some ListBox with the retrieved data. It will be retrieved asynchronously. But strangely it seems to block the GUI nevertheless.
Is the WP7 collecting the network data somehow in the UI thread, even if I use AsyncRequests? Strange.

Then I tried the codeplex library for pivot and panorama control. Was rather easy to implement. Thx to the guys who wrote this :) (see http://phone.codeplex.com/ for more details).
Now it would be time to fill in some more functions like collecting and displaying data based on user input.
Unfortunately the screen realestate is a bit limited using the panoramic control. Maybe I will reduce the space of the title a bit to get more actual content on the screen...

See the video:

Keep in mind, that the phone will eat about 3000 records in the list. Its rather fast even then. But you see already the limitations of a "normal" listview, as its way to slow to get from start to end. We need some fast accessor here, where you dynamically create a scrollbar.

Samstag, 3. Juli 2010

OData Adventures

I recently encountered some new technology named OData. Really cool stuff, to get a smaller footprint compared to SOAP WebServices.
A lightweight approach to access data in the cloud. You can do all the basic stuff you can do on a SQL database via just putting some data in your URL and you will receive a XML stream in Atom compatible way (so the browser could see that as a feed).
Nice if you like to access your data from different devices, as its rather easy to implement client access to it - it is already provided for different languages. (http://www.odata.org/).

Currently I am thinking about making my MyDietLog application OData server. That was not really hard, as WCF 4.0 (Windows Communication Foundation) provides a way to even give OData feeds out in a stand alone application. I dont like to get a fully fledged ASP.NET server out there. Of cause its only in the local LAN so far. But moving the stuff out to a .Net capable internet host (maybe even Azure) would be not so difficult.

I finally managed to get my OData hosted on a stand alone WPF/WCP app. Nice. Even the clientaccesspolicy is working and the OData feed spills out (of the browser). Was not easy as its not really well documented (was Binging all day lol).
So I tried the OData lib for WP7 and managed to create the proxy classes (hope this will possible through the service menu of VS 2010 in the final release).

Now the problems started. Deployment failed on the Phone (emulator of cause).

I read that there might be some signing issues with the OData assembly. As there is unfortunately no source ready for the OData access classes, I tried to remove the signing (some powershell script) - but it claims that no scripting is allowed on my machine - I gave up for the day...

Lets see if I get motivated to start again today. But now you see the problems if you use CTP stuff - but thats what we all love, right?

If anyone is interested in some source examples on how to do a OData host in a stand alone WCF app, give me a note. I'll try to help.