Windows Phone 7 startup thread

Coordinator
Jun 3, 2011 at 3:31 PM
Edited Jun 3, 2011 at 3:53 PM

Dear all,

We've been trying to get find some WP7 developers who want's to volunteer for doing an app for WP7 phones. So far, Sarah (sarahkjork) and Henric (subskipper) have joined us (hello!). And, as mentioned, Danwei Tran has shown interest in joining later this summer. This means that a WP7 team is slowly taking form, however, as I know how much time it actually takes to get something solid out there, 1-2 extra dev's could be nice to ensure that it also FUN to work with this, also given the time frame (equation: festival start - (summer + sun + vacation) = not much time). :o)

The WP7 development is the least mature part of our project. Some basic code has been made by one developer, but this code hasn't been added to the code repository yet. I'll find out on Tuesday if the code is stable and good enough for checking in - I'll keep you posted. But that's about it.

Inspired by the iPhone development, what needs to be done to bootstrap the WP7 development is (roughly):

  • The WP7 team needs to take a look at the feature set from the Android 2010, which can serve as inspiration for the feature set of WP7 2011. (Given the equation above, try to be be realistic - a few solid features are better than many hasted through development)
  • Someone from the WP7 team needs to take on the role of team lead, and insert / manage the selected features in the issue tracker. 
  • Aside from the app features, work needs to be done on the server side. We use sqlite DB's with content in the Android / iPhone apps, but as WP7 does not support this (AFAIK), we need to dump data in another form (XML). The tool for fetching data needs to be extended, and the service which exposes data updates also needs to be extended.
  • As the iPhone team, the WP7 team will work rather autonomously - my time is pretty booked with project management, Android and server / tools development.

Furthermore, for the new members, I'd like to remind about the developer guidelines and the rough project plan.

Developer
Jun 3, 2011 at 7:23 PM

I'm looking into the sql lite port to WP7 (http://wp7sqlite.codeplex.com/) to see if it is stable enough for us to use. It it is we should be able to do with the same database for all devices.

Cross your fingers ;)

I'll post back when I've tried it.

Developer
Jun 3, 2011 at 8:54 PM

Will be interesting to hear what you find. Doesn't look too good on the discussion board though. At least one rather serious issue from the looks of it.

Developer
Jun 6, 2011 at 8:16 PM

After applying this fix http://stackoverflow.com/questions/5594661/windows-phone-7-sqlite/5595688#5595688 and recompiling sqlite project I'm able to open/close the database multiple times.

At least it works for simple selects so far, havent tried much more yet.

Developer
Jun 7, 2011 at 6:37 AM

Cool, might be a viable option then. I'll download it and try it out as well. Who makes the tech calls btw? christerdk? 

Coordinator
Jun 7, 2011 at 9:41 PM

Well, sort of, I'm pretty open for most tech suggestions, and this sounds fine to continue with.

Björn and I have talked about this sqlite for WP7 thing, and he will check in the code (incl. the applied patch) for us to use. Furthermore, Björn also volunteered for taking team lead, and will take on the work of setting up features in the issue tracker, in cooperation with you, Henric, and the rest of the WP7 team (Sarah and later Danwei).

Also, I talked to Henrik today, who, as mentioned, has made some basic WP7 project setup. The code will most likely be checked in tomorrow - if not, maybe one of you can go ahead and make a base project for WP7? 

Developer
Jun 8, 2011 at 7:08 AM

I've checked in the patched assemblies for sqlite on wp7 into dotnet/externals.

Here's an example of using it + the concerts.sqlite found in trunk\Java\Malmofestivalen\res\raw\. Just add concerts.sqlite to the project, then it must be copied to isolated storage before its possible to open it.

string FileName = "concerts.sqlite";
            StreamResourceInfo streamResourceInfo = Application.GetResourceStream(new Uri(FileName, UriKind.Relative));

            using (IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication())
            {
                if (myIsolatedStorage.FileExists(FileName))
                {
                    myIsolatedStorage.DeleteFile(FileName);
                }

                using (IsolatedStorageFileStream fileStream = new IsolatedStorageFileStream(FileName, FileMode.Create, myIsolatedStorage))
                {
                    using (BinaryWriter writer = new BinaryWriter(fileStream))
                    {
                        Stream resourceStream = streamResourceInfo.Stream;
                        long length = resourceStream.Length;
                        byte[] buffer = new byte[32];
                        int readCount = 0;
                        using (BinaryReader reader = new BinaryReader(streamResourceInfo.Stream))
                        {
                            // read file in chunks in order to reduce memory consumption and increase performance
                            while (readCount < length)
                            {
                                int actual = reader.Read(buffer, 0, buffer.Length);
                                readCount += actual;
                                writer.Write(buffer, 0, actual);
                            }
                        }
                    }
                }
            }

            using (var sqlConnection = new SqliteConnection("Version=3,Uri=file:concerts.sqlite"))
            {
                sqlConnection.Open();
                using (var cmd = sqlConnection.CreateCommand())
                {
                    cmd.CommandText = "select * from acts";
                    var reader = cmd.ExecuteReader();                    
                }
            }

Coordinator
Jun 8, 2011 at 6:02 PM

No WP7 project code in yet. I think you guys should start this development by committing an empty WP7 project, and take it from there.

Developer
Jun 8, 2011 at 7:03 PM

Hang on I will upload a first version later tonight 

Coordinator
Jun 8, 2011 at 7:22 PM

Alright, cool!

Developer
Jun 8, 2011 at 9:11 PM

Awesome guys, I hope to get stuck in this weekend.

Developer
Jun 8, 2011 at 10:01 PM
Edited Jun 8, 2011 at 10:04 PM

The first version is commited. It can be found under dotnet/wp7. 

Compiling the first time

The application uses a resource file (Content/Resources/Labels.resx). I am using Guy-Smith Ferriers resource code generator to make the constructors public.

See http://www.guysmithferrier.com/post/2008/09/Silverlight-And-Strongly-Typed-Resource-Classes.aspx

The tool can be found under:

externals\Tools\Resource Provider Code Generators. 

Labels.resx should then have Custom Tools set to PublicResourceCodeGenerator 

 

What is included?

The sln contains a basic mainpage view/viewmodel that uses the pivot control. Ninject is used for IoC and Mvvmlight is used for mvvm.

I have included the code above for Sqllite and tested with the event view. 

Was thinking about using a micro orm like dapper.net instead of using the raw sql. Any ideas?

 

 

Coordinator
Jun 9, 2011 at 4:43 AM

Cool! :)

Developer
Jun 9, 2011 at 6:32 AM

Excellent Henrik! Haven't worked with dapper.net before so can't really advise on that. :)

Developer
Jun 9, 2011 at 6:55 AM
Edited Jun 9, 2011 at 6:55 AM

Cool! :)

I had the same idea about dapper. Would really like to try that, however, silverlight doesnt have IDbConnection?

Or atleast I saw in the sqlite client that it doesnt have any of the ado.net interfaces. So I don't think dapper will work out of the box, we could probably just make it work for SqliteConnection instead of IDbConnection and IDbCommand. Don't know how much work that is though :) 

Developer
Jun 9, 2011 at 7:10 AM

Ooh... worse than I thought.

"The .NET Compact Framework does not support the System.Reflection.Emit namespace."

Theres a lot of emit in dapper :(

This is a really nice overview of whats supported (approx 12%) in the compact framework vs the "full" framework: http://msdn.microsoft.com/en-us/library/2weec7k5.aspx

Developer
Jun 9, 2011 at 7:41 AM
Edited Jun 9, 2011 at 7:42 AM

Started to port dapper to WP7 yesterday.

I solved the first part with IDbConnection etc in an ugly way. Just aliased the code to SqlliteConnection etc.   

Refelction.Emit and System.Data will be part of the Mango release, so that should solve most of the other porting problems.

In the mean time I am using Mono.Cecil.Cil instead of reflection.emit. Should work fine on WP7.   

Need some experts on IL :-) to fix this though.

 

I will add the dapper code that I have ported so far tonight.  

Developer
Jun 9, 2011 at 12:52 PM

Haha cool! :)

The IL stuff that dapper does is just to speed up things, right? We could use plain old reflection?

Developer
Jun 9, 2011 at 7:18 PM

Really nice work Henrik!

I've just updated my working directory and was able to compile without changing anything about custom tool. Really nice setup! NInject? Never used that one but we do need an IOC.

What do you think about dapper? Should we continue with your fake classes and just switch to dapper later or if we can't make it work just do raw sql. As long as the implementation is hidden we could always just substitute it later. We all agree to map to objects right? No DataSets etc.

I think we need to prioritize the features to make sure that we are able to deliver the most prioritized feature in time for the festival ;)
I'm gonna have a look at the features and try to sort them in some kind of order and then we could discuss and move each feature up/down. 

Developer
Jun 9, 2011 at 7:31 PM
Edited Jun 10, 2011 at 7:00 AM

OK, here's an attempt to prioritize the features of the 2010 Android App (+ list by categories). I've really tried to kept it to a minimum. I would like us to make an application that is working and has the basic features that the user would like the most. Then if we feel like we have more time we could always add more features. That way we can feel that we can deliver an app with a few features that are working 100% instead of delivering 100% of the features that are working 80% ;)

Remember this list is just to get a discussion going! It's not final in any way and if you have a different opinion please say so.

What we must have


 

Start activity

Shows icons to the other features. Maybe we could show upcoming activities here directly?

Current and upcoming events activity

Shows all scenes / places sorted by name, and under these scenes / places the 3 next events (actually the current and the two next, to be precise). A click on an event will lead the user to the Event Detail activity.

Event Detail activity

Shows Name, short description, link to malmofestivalen.se and the start / stop date of the event.

 

Nice to have


List events per category activity

Shows a list of categories and a click on a category will list the events in that category. A click on the event will take the user to the event detail activity.

Scene map activity

Shows all scenes / places as pins. A click on a pin transfers the user to the Scene detail activity. There's a "Follow my position", made as a checkbox, that, when checked by the user, will turn on GPS and show the users position on the map.

Scene Detail activity

Shows name of scene and all events on that scene, grouped by festival day. Also, it's possible to show the scene on a map.

Lets wait with this


Scene list

It was possible to see all scenes in list form. (note: This feature is now deprecated, now it's a menu option under the "Scenes / Places" activity.)

Favorites activity

Shows a list over all favorites, including playtime. A click on an event transfers the user to the Event Detail activity.

Search result list

Shows result list of text search from the Start activity. A click on an event will transfer the user to the Event Detail activity.

Import favorites

A simple import, where the user enters his/hers username and password to malmofestivalen.se. Activating the import feature would request the favorites from the site, and insert them in to the local favorites database. 

 

EDIT:

 2011-06-10: Moved List events per categories higher up in the nice to have feature

Coordinator
Jun 9, 2011 at 9:19 PM
Nice work on the breakdown.

I agree with the major classifications of the Must/Nice/Later. Only comment, after seeing this work in the Android app, is to move "browse by categories" further up within the Nice classification (not moving it to Must). It really works well to drill down by interest / category, and seeing what is in store during the festival.
Developer
Jun 10, 2011 at 7:01 AM

Yes I agree, have moved the list events per categories activity to the top of the nice to have features.

Are there any other new features that are new in the 2011 version thats not listed in the documentation tab that you feel should be added?

Coordinator
Jun 10, 2011 at 10:44 AM
Yep, there are new features, but none that are in the Must category above. You guys can go ahead with the Must stuff, and meanwhile I'll try to update the documentation tab, depicting the changes / new features, so that's it's ready if / when you get to the Nice category.
Developer
Jun 14, 2011 at 5:23 PM

I got held up by other stuff this weekend, but will get the code onto my local machine this evening. Do we have a Task List to work off of?

Developer
Jun 14, 2011 at 6:58 PM

Hi,

Just commited a repostiory base class which helps with the database access. It is a port of the Massive project (https://github.com/robconery/massive).

I have also added code to download the database and checking for updates. The database access seems slow when running on a device, need to check if it is the SQLite.NET implementation or the repository.

Next thing I want to try out is the new async/await task. Is that ok with you guys?

If we all agrees you need to install the CTP (http://msdn.microsoft.com/en-us/vstudio/gg316360). I will do the refactoring locally.

Björn has made a list in an entry above. Start with the must have features, such as the event details list and so on.

Coordinator
Jun 14, 2011 at 7:15 PM

I don't mind testing the async/await stuff, as long as we try to be feature / release oriented as well. What I mean with that is that if it gives us extraordinary much trouble or risk, we should be able to abandon. Apart from that, have fun! :o)

I think Björn was planning to take the tasks from the post above and put them into the issue tracker. If you're waiting for that to happen to get to work, feel free to put in the task yourself. Just add component, status and who's working on it. Remember that the general rule is to have task numbers in the commit message, so let's try to do that in the future, even for infrastructural code (add such work as tasks as well). It means a lot that we can see who's working on what at any given time... especially when work so much virtual. 

My plan is to get into updating the documentation tab on Sunday, but not much to add there with regards to the Must have features, so go right ahead. 

Developer
Jun 25, 2011 at 4:59 PM

Sure go ahead as long as it will run on an ordinary wp7 phone ;) Not requiring mango or something like that.

I'll create the tasks in the issue tracker now.