Back to mobile programming!!!
Years ago, I used to work for a small (yet great!) software company called Dooblo, where we developed apps for Pocket PCs using the .NET Compact Framework. That was fun and challenging!
Now, after I taught courses and published a book about developing 2D/3D computer games with Microsoft XNA for PC and Xbox 360, and when the Windows Phone 7 is almost ready (rumors say December 2010..), I decided it is wise to at least add to my book a chapter or two about developing games for the Windows Phone 7, which is yet (smartly enough by Microsoft) another platform for running XNA-based games (along with PC, Xbox 360 and Zune).
Games for the WP7 are developed using XNA 4.0 framework, which is a game development and runtime framework that extends the .NET Compact Framework, both installed on the device. The IDE is currently Microsoft Visual Studio 2010 Express for Windows Phone – CTP.
So, it’s time to create my first Windows Phone 7 game, using XNA 4.0!
I decided to blog about it, so i’ll have the important things, that I’ll encounter as I go, documented for myself and for the developers community :)
NOTE: This post is for developers which are familiar with basic XNA development concepts. Having said that, I think that even if you are not one, following my posts will make sense and should help you create your own XNA games for WP7.
So, here is what I have to tell you so far. The rest will be in the following posts.
- I tried to install the Windows Phone Developer Tools CTP - April Refresh.
After the quite long installation process (30 minutes) ended, It showed an error regarding the installation of Silverlight 4.0. Whiile digging through the setup log I found this line:
[20/06/10,12:34:56] Microsoft Silverlight 4.0: ***ERRORLOG EVENT*** : Error code 1502 for this component means "The event log file is full."
As blogged in Aaron Stebner's WebLog, unfortunately, this error message is misleading, and it will not help to try to clear out your event logs in this scenario.
The workaround (until a fix will be available in the next release of the CTP), is to uninstall Silverlight and then re-run the CTP installation (or even better, in case you read this post prior to your installation, just uninstall Silverlight before you run the CTP installation :)
To uninstall Silverlight just go to ‘Programs and Features’ control panel, locate the item named ‘Microsoft Silverlight’, right-click it and select ‘uninstall’.

- After a successful installation, I run the IDE (Microsoft Visual Studio 2010 Express for Windows Phone), and Created a new project of type Windows Phone Game (4.0).
I got the initial project with the familiar Game1 class, almost similar to the one you get when you create a new Windows Game project in XNA 2.0/3.0 Game Studio. Hitting F5 starts the Windows Phone 7 emulator, and after a few seconds, I got the expected CornflowerBlue screen, which means that the game is running and all is good :)
- When I came to do the next step, which is obviously to render a nice
“Hello WP7-XNA World” sprite on the screen, the first thing I noticed is that the Content folder (known to XNA developers since XNA 1.x) is gone, and instead we have a WindowsPhoneGame1Content project, which is referenced from the WindowsPhoneGame1 project’s Content References folder. This is a nice new approach to help us reuse built resource
assemblies between games.
So, I dragged my HelloWorldMsg.png file –
straight into the WindowsPhoneGame1Content project, added the basic necessary lines of code in order to draw this texture as a sprite using the good old Texture2D class, Content.Load<Texture2D> method and the spriteBatch, there I had it – My first “Hello WP7-XNA World” game!
[a real-size screenshot. The HelloWorldMsg.png image’s dimensions are 350 x 50]
The necessary code lines I added to the out-of-the-box Game1 class are:
- // Declaring a class memeber to reference the sprite’s texture:
Texture2D m_T2DHelloWorld; // (line 23)
- // At the end of the LoadContent method:
m_T2DHelloWorld = Content.Load<Texture2D>("HelloWorldMsg");
- // At the end of the Draw method:
spriteBatch.Begin();
spriteBatch.Draw(m_T2DHelloWorld, new Vector2(60, 60),
Color.White);
spriteBatch.End();
The next step will be to convert my Infrastructure XNA project (which contains basic infrastructure for XNA games, familiar to my students and the readers of my book), to become an XNA 4.0 project, and to use it to make the game actually do something (movements, collision detection, and of course - retrieving user input...)
Have you ever wanted your C:\Users\YourUserName folder to reside in a different drive (other than the C: drive which you will need to re-format and re-install the OS occasionally..)?
Well, in Vista you can relocate the special sub-folders (i.e. Documents, Pictures, Videos, etc.). In Windows 7, we have the ‘Libraries’ features. But neither one of these OSs let you actually relocate the entire C:\Users folder or even on of the C:\Users\YourUserName folder to a different drive as a hole.
The need is obvious – You want to be able to easily re-install (or sometimes upgrade) your system drive, while keeping your data, which is not only documents, videos and pictures but also AppData (where the outlook.pst files reside for example), your Received Files folder and other data which is all under your user folder.
If only the C:\Users\YourUserName folder was D:\Users\YourUserName , life was much easier..
Well, after many hours of reading blogs and forums, I came across a few solutions for relocating the users folder, but no solution found for re-using the relocated user folders after re-installing the OS. Meaning – lets say I was able to relocate my user folder to D:\Users\MyUserName. The problem is that after I formated the system drive (c:) and re-installed the OS, re-creating a MyUserName account, than removing the created user folder and re-referencing the OS to the old D:\Users\MyUserName, the OS do not recognize this folder as a legitimate folder of the the newly created account. Either it loggs you off right after you try to login to your account or it creates a temporary account whenever you try to login.
Finally, I found a solution for that, so I figured it is worth blogging about.
I’ll summarize the list of steps you need to perform in order to relocate your user folder to a different drive, including the steps for re-referencing this folder after re-installing your OS!
Steps for Moving the C:\User\YourUser to D:\User\YourUser :
- Install the OS, and create your user. We’ll call it ‘YourUser’
- Create a temp user (with administrative privileges). We’ll call it ‘TempUser’
- Login with TempUser account
- Make sure you configured your windows explorer to list hidden and system files (Folder options)
- Move (cut/paste) the entire C:\User\YourUser folder to a different drive, for example to D:\User\YourUser .
- Create a HardLink from C:\User\YourUser to D:\User\YourUser , so when the OS looks for C:\User\YourUser it will find it in D:\User\YourUser . To create this hard link, open the cmd window with administrator privileges
and type:
mklink “C:\User\YourUser” “D:\Users\YourUser” /j
(make sure there is no C:\Users\YourUser folder before you create the link, and that you run the cmd.exe as administrator) - Restart the computer and login as YourUser, and there you have it. Your entire user folder is located in D: drive.
- Remove the tempUser account.
Steps for re-using your D:\User\YourUser folder, after re-installing the OS:
- Install the OS, and create your user. We’ll call it ‘YourUser’
- Create a temp user (with administrative privileges). We’ll call it ‘TempUser’
- Login with TempUser account
- Make sure you configured your windows explorer to list hidden and system files (Folder options)
- Browse to C:\User\YourUser (the newly created user folder), and copy all the hidden files which starts with ntuser* (should be 7 files
- Paste these files to your old D:\User\YourUser (override the ones which resides there)
- Delete the C:\User\YourUser folder
- Create the hardlink as explained before.
- Configure YourUser to be the owner of the D:\User\YourUser folder:
Right-Click ‘YourUse'r’ folder –> Properties –> Security –> Advanced –> Owner.. - Restart the computer and login as YourUser, and there you have it. Your entire user folder, located in D: drive, is now re-used.
- Remove the tempUser account.
יותר משנה באיחור, נתקלתי (לגמרי במקרה) בפרסום של ה- ARCast של רון ג'ייקובס שהתארחתי בו שנקרא CAB in the Real World.
זה היה במסגרת ה- Microsoft Developers Academy 2007 בסינמה סיטי. רון ג'ייקובס אירח אותנו (אוהד ישראלי, אלי קורא ואנוכי) בפאנל בנושא ה- Composite UI Application Block.
הפאנל הוקלט וצולם וכעבור חצי שנה (!) פורסם באתר של רון בתור ARCast.TV.
אני השתתפתי מתוקף היותי ארכיטקט בסימיגון שהטמיע והתמחה ב- CAB כחלק מפיתוח המוצר העיקרי של סימיגון- SIMbox, שמוטמע בהצלחה ברחבי העולם.

Test 1,2,3 for the body.
Here is a picture (this is the most interesting feature for me, i hate to upload photos to the gallery before integrate them in the body):
Nice, you can add shadows and photo paper effect.
You can also easily control the text flow arround the picture which is also nice.
You can also easily add photo effects like sepia tones.
Rotating is also very easy. (pure bird..)
הזדמנות מדהימה מבית היוצר של Xceed (חברה מובילה לפיתוח קומפוננטות UI):
קומפוננטת DataGrid בטכנלוגיית WPF (ראשונה בגרסת release אם אני לא טועה!), ולא סתם, אלא חינם!
 |
בלי שום מלכודת או catch משום סוג. זה פשוט חינם. כל מה שצריך לעשות זה להירשם (שם ואי-מייל, זה הכל) ואתם מקבלים רשיון למוצר הזה לתמיד! כולל עידכונים ותיקוני באגים.
הם מבטיחים שגם כשהם יתחילו למכור את המוצר בתשלום, הרשיון החינם שלכם יישאר בתוקף.
זאת הדרך שלהם לדריסת רגל בשוק ה- WPF.
אני כבר הורדתי, ניסיתי ובגדול אהבתי. יש להם דוגמאות מתועדות מאוד ובגדול ה- API מאוד נוח.
אגב, הרשיון החינמי הוא גם Royalty Free. פשוט מתנה. |
תהנו.
יותר ויותר אתרים עוברים לטכנולוגיית XBAP.
מעבר לזה שזה עושה עוד ועוד חשק לזרוק על מישהו שמעצבן אותך את כרטיס המסך הלא חדש שלך (שלא ממש עוזר לצרכי GPU) זה בפירוש מאוד מרענן ונותן עוד ועוד רעיונות לשימוש בטכנולוגיה הסקסית הזאת.
המובילים כרגע הם (איך לא) היפנים, אז לא הכל קריא ליהודים, אבל הכוונה ברורה.
נסו את הלינק הזה - http://www.dosv.jp/parts_assembler/PartsAssembler.xbap
זהו אתר יפני, חנות חומרה וירטואלית לרכישת חומרה למחשב כולל בניית מחשב שלם מחלקים, טיילור מייד כמו שנאמר. שימו לב לפונקציונאליות של הגלגל של העכבר, ולהפיכה של הכרטסות בתוך כל מוצר (לחיצת עכבר).
אהבתי.
רשימה נוספת של דברים חמודים, שקצת פחות עשו לי את זה:
אני עדיין לא סגור על איך להחליט מה לפרסם כאן ומה לא. בעיקר מהשיקול של "האם לא כתבו על זה קודם איפשהוא באינטרנט? הייתכן שאני הראשון שכותב על זה!?"
מעבר לזה, אני פרפקציוניסט, אז אני נוטה לא להתחיל כלום בלי שאני יודע שהוא יסתיים פרפקט :)
את הפוסט הזה החלטתי לכתוב משתי סיבות:
1. זה העסיק אותי במשך שלושה ימים (ברוטו). היה קשה למצוא לזה את הפיתרון.
2. לא מצאתי לזה תשובה בשום מקום באינטרנט. רק אחרי התכתבות עם בריאן, ראש הצוות שפיתח את ה- TFS ופרסום הודעות בכמה פורומים קיבלתי תשובה (דווקא בריאן וציוותו לא עלו על הבעיה!).
אתמצת בעברית ואח"כ אפרט באנגלית:
הבעיה:
אחרי ביצוע Branch לפרוייקט ב- Source Control (אתם רואים כמה זה מעצבן לכתוב POST טכני בעברית?!), שינויים בשני הענפים ונסיון לביצוע Merge (שכמובן מכיל Conflicts), הכפתור "Auto Merge All" במסך Resolve Conflicts לא פעיל, ובמסך הבא (שמופיע אחרי לחיצה על כפתור Resolve) שתי האפשרויות הראשונות לא פעילות אף הן. (בקיצור, אין אפשרות לבצע merge בשום דרך).
הפיתרון:
מסתבר שהאופציה File Merging עבור קבצים מסוג cs. (ובמקרה שלנו, עבור כל סוגי הקבצים) הייתה במצב disabled. כדי לשנות מצב זה:
VS 2005 Main Menu -> Team -> Team Foundation Server Settings -> Source Control File Types
Now in english:
The problem:
After creating a branch for a project, modifying a file in both branches, check-in, then comming to perform a merge from the branch to the original source, both the "Auto Merge All" butto, the "Merge changes for me" and the "Merge changes in merge tool" where disabled :(
Bottom line, no merge capabilities in the TFS were enabled, which practically means: No branching can effectively be done in the source control.
The following dialog appears when you come to merge and there are conflicts (say in the program.cs file):

When you click on the "Resolve..." button, the following dialog appears:

The solution:
Enable "File Merging" options for the relevant file types:
VS 2005 Main Menu -> Team -> Team Foundation Server Settings -> Source Control File Types...


Why?
Guy Burstein sounded very assertive when he tried to talk me into opening a blog when we last met at the Microsoft Developer Academy at the Cinema City.
So, after a quick correspondence with dear Mr Taguri (thanks for the quick replies even from Redmond), here it is :)
Who?
I teach Computer Science (B.Sc) courses in serverl academic institutes (MTA, IDC, HIT)
I Work as a technology and architecture advisor for IT companies (Orange/Partner, Intel, DGroup, SimiGon, Overwolf)
I Worked at SimiGon as a system architect for the past few years and currently working with Overwolf as the system architect and development lead.
I specialize in C#, .NET techonolgies, XNA and Software Engineering in general.
I wrote and published two text books:
- "Developing with .NET Technologies and C#" (Office-Depot / Diunon)
- "Developing 3D Computer Games with XNA" (Office-Depot / Diunon)
This is the list of courses I teach:
- "Developing with .NET Technologies and C#" (MTA)
- "Software Engineering and C#" (IDC)
- "Advanced OO Programing with .NET Technologies and C#" (HIT)
- "Practical Programming with Design Patterns and C# 3.0" (MTA)
- "Developing 3D Computer and Xbox360 Games with XNA" (MTA, HIT, IDC)
- "Object Oriented Programing using C++" (MTA)
What?
My main current interests and expertises are:
- Programming, Software Architecture, Design Patterns, SCRUM
-
- .NET Technologies
SimiGon's and Overwolf's products are developed in C#.NET

-
- Developing 2D/3D Computer and Xbox360 Games with XNA
- Composite UI Application Block (CAB)
- I created a comprehensive infrastructure and and wrapping layer over it for the use of SimiGon's main product UI infrastructure (already in use by our world-wide clients)

-
- I investigated the CAB, Smart Application Software Factory, and the Guidance Automation Extentions/Toolkit for over a year (since the early CTP days)
-
- Microsoft Team Foundation Server (TFS) (2005, 2008, 2010)
- As part of my work, I am in charge of maximizing the use of the TFS to help our development procedures and lifecycle.
- I developed a complete alternative client for the TFS (with improved grid functionalities and filter options)

-
- Visual Studio 2005, 2008, 2010
-
I hope to keep and post relevant and interesting stuff.
I also hope it will not kill too much of my (non) spare time J
-
Njoy!