Blog Home  Home Feed your aggregator (RSS 2.0)  
Peter Nowaks Mobile Blog
Windows Phone in the cloud
 
 Monday, August 30, 2010

Neben der wpzone, welche bereits einiges an WP7 Informationen und Hilfe zum Thema Entwicklung und Co bietet, gesellt sich seit heute das offizielle deutsche WP7 MSDN Forum dazu. Somit wird das bereits bestehenden Windows Mobile MSDN Forum und Windows Embedded MSDN Forum komplettiert.

Monday, August 30, 2010 5:57:19 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [0]   wp7dev  |  Trackback

Am 10.09. findet wieder einmal die NRW Conf in diesem Jahr in Wuppertal statt.

Auch ich darf dieses Jahr mit dabei sein und haben einen Leckerbissen für euch dabei: Sofern ihr bereits eine WP7 Anwendung habt, die mal auf einem echten WP7-Gerät getestet werden soll, so habt ihr hier die exklusive und meines Wissens nach erste deutsche Möglichkeit dazu. Die Session hierzu findet zwischen 10 und 11 Uhr statt.

Ich freue mich bereits auf euch.

Update: Teilnehmer der NRW Conf haben die Möglichkeit jeweils ein von 2 Gutscheinen für unser kommend erscheinendes Buch zu gewinnen. Mitmachen lohnt sich also.

banner125x125

Monday, August 30, 2010 5:45:55 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [0]   wp7dev  |  Trackback
 Friday, August 27, 2010

WP7_BuchCoverImmer wieder wurde es angedeutet, doch heute darf ich es offiziell sagen: Patrick Getzmann, Simon Hackfort und ich schreiben ein Entwicklerbuch. Wie sollte es denn dann auch anders sein, dass es sich um das Thema Entwicklung mit dem Windows Phone 7 handeln wird, an dem wir bereits seit mehren Monaten arbeiten. Natürlich wird es dabei um Silverlight für Windows Phone 7 und das XNA Framework gehen, doch schweigen wir uns noch ein wenig über den exakten Inhalt aus. Soviel sei bereits gesagt: Es werden Themen enthalten sein, die man in anderen Büchern so nicht finden wird. Als kleinen Leckerbissen wird es bereits gegen Ende September eine kleine Preview geben.

Erscheinen wird das ca. 650 Seiten umfassende Buch bei der MS Press. Erscheinen wird es im Dezember.
Es ist bereits auf Amazon vorbestellbar:

Bezugsquelle: Amazon.de
ISBN-10:
3866454627
ISBN-13:
978-3866454620

Preis: 39,90 €

Kleiner Tipp am Rande: Wer die NRW-Conf am 10.09.2010 besucht, hat die Möglichkeit 1 von 2 Gutscheinen für dieses Buch zu gewinnen.

Und weiter geht es mit dem Schreiben…

Friday, August 27, 2010 6:21:39 AM (W. Europe Standard Time, UTC+01:00)  #    Comments [0]   WP 7 Buch | wp7dev  |  Trackback
 Thursday, August 12, 2010

Ben Gracewood from New Zealand released a few weeks ago a One time image cacher. I liked the basic idea, but having static images only being downloaded one time, was too static. It shall be checking for updates periodically.
Thinking about a social networks, those include often profile pictures, which get updated from time to time, but can stay under the same file name.

Working with the ETag

Requesting Images from a webserver includes often a ETag HTTP Response Header, which is a type of a ID. I was pointed to this by Ingo Rammer from Thinktecture.
If requesting the same picture again, including a If-None-Match HTTP Header within the WebRequest the Server returns a HTTP Status 304 (not modified) with nearly no data, or the picture itself, if modified.
Requesting the same picture all the time wouldn’t make much sense. Therefore the Expires Header is checked as well. If not present, on a per day basis the image is checked for modification.
The best thing about this is, that the information on when requesting is persisted as well.

The code

I liked Bens idea on using a ValueConverter for caching those images. It enables the possibility on including this functionality even with Blend and no additional line of sourcecode:

<phone:PhoneApplicationPage 
x:Class="WPImageCacher.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ic="clr-namespace:WPImageCaching;assembly=WPImageCaching"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
shell:SystemTray.IsVisible="True">

<phone:PhoneApplicationPage.Resources>
<ic:ImageCacheConverter x:Key="imageCacheConverter" />
<BitmapImage x:Key="imageSource" UriSource="http://www.microsoft.com/austria/athome/works/images/w_home-head.jpg" />
</phone:PhoneApplicationPage.Resources>
<!--LayoutRoot contains the root grid where all other page content is placed-->
...
<Image HorizontalAlignment="Left"
Margin="0"
Name="image1"
Stretch="Uniform"
VerticalAlignment="Top"
Grid.Row="1"
Source="{Binding Source={StaticResource imageSource},Converter={StaticResource imageCacheConverter}}" />

...

As you can see for using this – it is pretty simple.

But what happens behind the scenes?
An additional Store contains the info, which images have already been loaded, including an experation value as well as an ID from the ETag, if included and of course the URL.
The images get stored with a hashed file name. The reason for this is, that you could have multiple sites using the same image name.

The downside of using a ValueConverter is, that the call has to be completed synchronous. Downloading the image via WebRequest is only possible asynchronously. Therefore using a little bit of a trick with a transfer object and the BitmapImage itself helps to get the functionality working.

The attached Sourcecode includes german annotations. Sorry for that.

WPImageCacher.zip (22,54 KB)
Thursday, August 12, 2010 7:26:54 AM (W. Europe Standard Time, UTC+01:00)  #    Comments [0]   wp7dev  |  Trackback
 Saturday, August 07, 2010

Wie? Sie haben von der WP Zone noch nichts gehört?
Ist auch nicht verwunderlich: Die WP Zone ist ja auch erst einen Tag alt, bzw. 2 Tage, wenn man von der Idee aus geht.

Was ist die Idee hinter der WP Zone?
Schaut man sich aktuell in Deutschland zum Thema Windows Phone 7 um, ist der verbreitete Inhalt rar und zerstreut. Hier mal etwas aus Twitter, da mal was im Facebook, dort mal etwas in einem Blog, den man nicht abonniert hat. Und wen spricht man eigentlich an, wenn man eine Frage hat? Oftmals kennt man die Personen vielleicht auch gar nicht.

Die Idee hinter der WP Zone ist schnell beschrieben: Es geht um Zentralisierung. WP Zone, so der Gedanke, soll eine zentrale Anlaufstelle rund um das Thema Windows Phone 7 in Deutschland werden. Das ist eigentlich auch schon die Idee, um nicht in den weiten des Internets suchen zu müssen.

Was bringt mir die WP Zone?
Es gibt aktuell verschiedene Ideen. So sollen nicht nur WP 7 spezifische Blogs von Experten entstehen, sondern auch Tutorials, Hilfestellungen und vieles, vieles mehr. Um das zu erreichen haben sich schon viele bekannte Experten gefunden, die hier mithelfen wollen.
Ganz besonders ist auch die Idee von Coding Dojos hervorzuheben, in welcher es darum gehen soll, eigenständig oder mit Hilfe von Forenmitgliedern zu lösen.
Doch auch hier muss man bedenken: Nicht nur das Bereitstellen von Informationen ist hier gefragt – auch Sie können etwas beitragen, denn eine Community lebt auch nur vom Mitmachen. Dies soll mittels Wiki dann ganz einfach möglich sein. Auch Snippets und eigene Tutorials werden gern gesehen.

Was bietet die WP Zone bereits?
Kurzum: Es gibt bisher ein Forum. Wer mich kennt, kennt auch den Begriff “entwicklerschön”, was bedeutet, dass das Forum aktuell bereits existiert und funktional ist, jedoch optisch noch aufgewertet werden muss. Dies ist aber bereits in Arbeit. Doch genau das ist die Chance: Sagen Sie uns, was Sie sich wünschen. Noch ist alle warm und frisch und wir können flexibel auf viele Wünsche eingehen.

Wo finde ich die WP Zone?
Nichts einfacher als das: http://www.wpzone.de/forum
Unter Twitter findet man die WP Zone uch unter @wpzone_de, sowie unter Facebook, ebenfalls unter der WP Zone.



An dieser Stelle mag ich mich noch bei Karsten Samaschke bedanken, welcher das Thema so schnell aus dem Boden gestampft hat.

Saturday, August 07, 2010 10:00:46 AM (W. Europe Standard Time, UTC+01:00)  #    Comments [0]   Windows Phone 7  |  Trackback
 Tuesday, July 13, 2010

I’ve just stumbled over the method IsolatedStorageFile.GetFileNames("searchPattern”).

Lets take the given code:

try

            {

IsolatedStorageFile file = IsolatedStorageFile.GetUserStoreForApplication();

 

                file.CreateFile("test1.txt").Close();

                file.CreateFile("test2.txt").Close();

                file.CreateFile("test3.txt").Close();

                file.CreateFile("test4.txt").Close();

                file.CreateFile("test5.txt").Close();

                file.CreateFile("leer1.txt").Close();

                file.CreateFile("leer2.txt").Close();

                file.CreateFile("leer3.txt").Close();

                file.CreateFile("leer4.txt").Close();

                file.CreateFile("leer5.txt").Close();

 

string[] files = file.GetFileNames();

                files = file.GetFileNames("test*.txt"); //Returns 10 entries, instead of 5

 

            }

catch (IsolatedStorageException ios)

            {

            }

 

This shows that GetFileNames with search patterns fails in CTP and current beta returning in the sample with 10 entries, instead of 5.

If you use the sample including a subfolder, the values returned are correct.

 

SO, forr now, beware using this method on the Isolated Storage base folder.

Tuesday, July 13, 2010 3:58:39 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [0]   Windows Phone 7 series development  |  Trackback

If you still haven’t heard of it: The Visual Studio 2010 Express for Windows Phone Beta has been released yesterday.

For installing this beta version, it is necessary to uninstall the April CTP.

In general it is a good thing to have a VM running the bits, as you can install them fresh. But there are sometimes circumstances that this isn’t possible, which leads a couple of times, that the uninstall fails of several reasons.

Ginny Caughey, as well a Device Application Development MVP, sharred a linkt to the US forums, which gives a few good advices and tipps, how to come around some uninstallation issues. The forum post can be found here.

Thanks Ginny!

Tuesday, July 13, 2010 3:49:51 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [0]   Windows Phone 7 series development  |  Trackback
 Wednesday, July 07, 2010

As playing around a bit with the WP7 functionality, I wanted to create a small sample, which loads XAML Elements dynamically into the Page. No magic here.

The XAML fragment to be loaded has been extracted to a file called XamlFragment.xaml. I set in the Properties window of VS 2010  the Build Action to Content and deleted the value for the Custom Tool.

The idea was to package the file withe the XAP file and deploy it, so the SL App could read the file directly.

What I totally forgot about was the fact, that SL Apps have only access  to the Isolated Storage. But the Isolated Storage in fact is a subfolder of the Apps folder, where the XAP files get deployed. So how to access the file?

After searching a bit around I found out, that XNA has the same issue on accessing files like textures etc., which are packed within the XAP.

Therefore the Assembly Microsoft.Xna.Framework contains the static class TitleContainer.

Executing “TitleContainer.OpenStream(‘XamlFragment.xaml’)” returned an object of type stream, which could be accessed by my StreamReader.

(Please keep in mind that this stream is readonly)

 

More info on the TitleContainer class can be found here.

Wednesday, July 07, 2010 10:06:34 AM (W. Europe Standard Time, UTC+01:00)  #    Comments [0]   Windows Phone 7 series development  |  Trackback
 Monday, July 05, 2010

image Es ist ja mittlerweile ein offenes Geheimnis, dass Patrick Getzmann (MVP für Device Application Development), Simon Hackfort und ich an einem Entwicklerbuch (in Deutsch) zu Windows Phone 7 arbeiten.
Wer der Publisher ist und welche Inhalte es in diesem Buch geben soll, werden noch nicht verraten.
Das Veröffentlichungsdatum steht noch nicht 100%-ig fest, da hier mehrere Faktoren einen Einfluss darauf haben. Es soll jedoch noch dieses Jahr sein.

Wir für unseren Teil haben bereits eine Agenda an Themen festgelegt, welche das Buch behandeln soll. Doch wir sind an der Stelle noch ein wenig flexibel. Somit stellt sich die Frage: Was würden Sie sich als Inhalt für so ein Buch wünschen?
Es könnte sein, dass wir noch ein wenig Zeit haben werden auf die Wünsche einzugehen, geben aber keine Garantie, dass wir diese auch berücksichtigen könne.
Hinterlassen Sie somit ein Kommentar in diese Blog und wir werden schauen, was noch möglich ist im Buch unterzubringen…

P.S.: Vielen Dank an Alex Januschewsky (MVP für Windows Mobile) von http://mobilitynews.net/ für das WP7-Metro Logo, welches er uns zur Verfügung gestellt hat.

Monday, July 05, 2010 10:53:16 AM (W. Europe Standard Time, UTC+01:00)  #    Comments [10]   WP 7 Buch  |  Trackback
 Thursday, July 01, 2010

Da nun bereits die TechTalk Reihe von Microsoft zum Thema Windows Phone 7 Entwicklung durch ist, freue ich mich umso mehr selbst einen Vortrag zu dem Thema bei der netug Niederrhein halten zu dürfen. Ich freue mich sehr darauf aus dem Nähkästchen der aktuellen CTP erzählen zu können und ein paar nette Samples zeigen zu dürfen.

Datum: Mittwoch, 14. Juli 2010

Zeit: 18:30 - 21:30

Ort: AUTOonline GmbH Informationssysteme

Straße: Hammfelddamm 6

Stadt/Ort: Neuss, Germany

Veranstalter: http://www.netug-niederrhein.de/

 

Ich würde mich freuen, euch vor Ort begrüssen zu dürfen.

Thursday, July 01, 2010 12:30:36 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [2]   Windows Phone 7 series development  |  Trackback
Copyright © 2010 Peter Nowak. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.