Aug 13 2010

Try Windows Phone 7 on your computer using an emulator - step-by-step

Category: EN | Windows Phone 7Domagoj @ 15:53

It is not like you have a real device in your hand, but you can get some look and feel of Windows Phone using an emulator. If you have touchscreen monitor, your experience will be much better, but that’s not a requirement. You don’t need anything else installed on your system, not even Visual Studio 2010 :-)

I have tried this steps on Windows 7 machine, it should work on Vista as well. I’ve read there are some issues on Windows XP, please let me know if you try it.

  1. If you don’t have Windows Phone 7 Developer Tools installed, please do the following:
  2. If you have Windows Phone 7 Developer Tools installed, please check version (you should have June/July 2010 version)
  3. Download unlocked Windows Phone 7 ROM (92 MB), remember the folder you’ve put it in (I’ll use “C:\")
  4. Run one of the following lines on your command prompt (save it to batch file for future use) – change the folder you’ve put you BIN file in!
    • "C:\Program Files\Microsoft XDE\1.0\XDE.exe" "C:\WM70C1-6414-unlocked.bin" /VMID {E575DA31-FC47-4766-853F-018D823B9EE6}
      OR
    • "C:\Program Files (x86)\Microsoft XDE\1.0\XDE.exe" "C:\WM70C1-6414-unlocked.bin" /VMID {E575DA31-FC47-4766-853F-018D823B9EE6}
  5. Have fun! :-)

This walkthrough is based on Windows Phone 7 Developer Tools beta published in July 2010.
Please let me know if any link stops working :-)

image image image image image

I didn’t invent this - thank goes to En1gma and RustyGrom at XDA-Developers (where else? :-)).

Tags:

Aug 13 2010

How to open application (XAP) in Windows Phone 7 Emulator without Visual Studio running and/or source files?

Category: EN | Windows Phone 7Domagoj @ 14:42

image You’ve developed your first Windows Phone 7 application and you want to share it with your friends or colleagues? Just follow this simple steps:

  1. Copy all files from “Bin\Release” folder of your project. Move it to target machine.
  2. Have the Windows Phone 7 SDK installed on target machine (comes with Developer Tools)
  3. Open “XapDeploy.exe” in “C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v7.0\Tools\XAP Deployment” (actual path may vary on your system, but you get the idea)
  4. Select “Windows Phone 7 Emulator” as Target
  5. Browse for XAP file on your disk (the one you’ve copied from “Bin\Release” folder)
  6. Deploy

That’s it!

Tags:

Jul 4 2010

Circular Progress Bar in Silverlight

Category: EN | SilverlightDomagoj @ 15:23

In one project I’m working on for a few months now I got the request to show progress bar in the form of circle – empty circle would mean 0%, and filled circle stands for 100%. It seemed like and interesting challenge, so I think I’ve found the simplest solution to the problem.

Let’s build it together...

First of all, we need a Path element with one ArcSegment and one LineSegment:

image

It will draw something like this – StartPoint is on the right, (A), ArcSegment draws half a circle to get to the point B, LineSegments goes to circle center C and since we have set parameter IsClosed to true, it draws another LineSegment to close the drawing in the point A, even if we didn’t write it explicitly.

image

We will bind this circular progress bar to a slider, as this is the simplest way to show how it works. You can, obviously, bind this to something else – the important thing is to get a value between 0 and 1 (0% – 100%).

image

This is the base that we need to have defined in XAML – the rest of the work will be done from code behind. We have named ArcSegment to be able to change its properties, namely Point and IsLargeArc.

First of all, we need circle radius and an angle that will represent a part of circle we want to show. Radius is equal to ArcSegment size (width or height, doesn’t matter), and the angle is full circle (360 degress or  2*PI) * percentage. When we have this two variables, you can use the following formula to calculate the point on the circle that corresponds to our percentage.

image

If the angle is more than PI (more than 180 degrees), we should set IsLargeArc to true, otherwise we will end up with this:

image

Unfortunately, were not quite there yet – there is a problem (I would dare to call it a bug) with 100% status, when the second point of ArcSegment is the same as the first one. In that case, even if you set IsLargeArc to true, you will not get a full circle:

image

So, we must use a hack – when a percentage reaches 100%, that means that the angle is equal to 2*PI, we will decrease the Y coordinate of the point by some small number, like 1/1000. By doing this, the second point will not be equal to the first one, but since the difference is very, very small, we will not be able to see it on the screen.

image

One last thing before the end – it is more common to see the circle fill from the top point, probably because that’s the way analog clock works. So, you can use rotation transform to fix this:

image

Now we’re done. You can check the demo here, and download sample project here. In those samples I’ve added another white circle on the top, to achieve the “donut” effect.

Tags:

Jun 21 2010

First season of Web User Group

Category: Events & publications | ENDomagoj @ 21:51

P1210108 Web User Group is the youngest user group in Croatian MS Community. I’ve founded it in December 2009 with support of Microsoft Croatia. Meetings are scheduled on the third Thursday of each month (except during the summer, in July and August).

Web User Group covers wide range of topics in the web-development area, including design, slicing, server and client technologies, tools and server software, services and libraries. The main focus is on Microsoft ASP.NET and Silverlight, but many standard technologies supported by Microsoft tools and platform are covered as well, like HTML, JavaScript and jQuery. Our wide topic area allows us to be appealing for a wide range of people, including web-designers, front-end and back-end developers, system engineers as well as decision makers.

Online

Untitled The group’s official web site can be found on www.webug.com.hr (in Croatian). Users and visitors can subscribe to the mailing list. Via mailing list, we inform people about meetings, benefits for user group members and availability of post-meeting materials.

Every meeting is recorded both video and audio and the video and screencast are available on our web site about a week after the meeting. There is also a Silverlight application that plays two synchronized streams at the time (video and screencast) – application is called Dual Streaming and it is developed especially for Web User Group.

PowerPoint presentations and photos from each meeting are available on official web site as well.

During every meeting we provide free online participation using LiveMeeting for people outside Zagreb and neighboring countries.

Collaboration

We work closely with DPE department of Microsoft Croatia and they support our activities with logistics, funding (beer and pizzas) and ideas. LiveMeeting broadcast and meeting recording is powered by Microsoft Innovation Center in Varaždin, and we give away their vouchers and discounts as door prizes.

We are full member of INETA Europe and integral part of Croatian MS Community. We work closely with them on promotion (for example, activities during WinDays conference in April) and organize shared group meetings (with SharePoint group in March and SQL/DEV group in April), in order to promote each other.

We collaborate with many other organizations and companies, especially event organizers. We are trying to arrange benefits for our members, like discounts, free vouchers, books, subscriptions and other deals. In seven months, we had more than 20 arrangements of that kind.

Our work is supported by several IT media in Croatia and numerous bloggers.

Meetings and people

7 Meetings are held in Microsoft Croatia office in the biggest room called Dante, which can accommodate up to 50 people and it is usually full. Registration system allows registration for 70 people, since some of them cancels in the last minute or simply do not show up. Usually, the interest exceeds the capacity of the room (the record was 95 registrations in February 2010, unfortunately, 25 of them on the waiting list didn’t have an opportunity to come). Currently, this is the biggest user group in Croatia.

Our mailing list has more than 350 active and valid subscribers that regularly receive announcements (not more than three times a month, two times on average).

Tags:

Jun 16 2010

WordPress on SQL Server and SQL Azure

Category: Unsorted | EN | ProjectsDomagoj @ 13:44

WordPress on Microsoft_1276688038774 Although I don’t use WordPress on my blog, I find very interesting that now it can store data in SQL Server database, either free SQL Server Express or some advanced version. PHP is still a requirement (I’m pretty sure that this will not change), but now you don’t have to install MySQL database on Windows (although it’s quite straightforward, using Web Platform Installer). But, the key point here is a support for SQL Azure – scenario that can enable high-traffic sites to use Wordpress with no performance issue (at least not from the database point of view).

Several months ago a few friends and I were thinking about providing SQL Server support by writing a driver based on PG2WP plug-in that enables WordPress with PostgreSQL database. Unfortunately, we didn’t find enough time to do it, so the project was abandoned. Lucky for us, because all the hard would be wasted now that we have this patch.

There are also quite a few interesting articles on this topic:

For more info, installation procedure and getting started articles, check out this site. Can’t wait to use it, here is the direct link to download section.

Tags:

Jun 2 2010

Silverlight 5 Wishlist

Category: Silverlight | ENDomagoj @ 23:08

Customer Feedback for Developer Community_1275511885440 Less than two months ago Silverlight 4 RTW was released and there are no official information about the next version, but I’m pretty sure guys in Redmond are already preparing something cool. If you want to suggest a feature or vote for one, you should check this site. It is the official page for feature suggestions and a lot of features requested there made their way to Silverlight 4.

Currently, the most voted ideas are the following:

  • full databinding support
  • implement Silverlight on more platforms
  • 3D support
  • encoding and streaming to Media Server / IIS
  • report controls

There are also some very interesting ideas later on the list. My personal favorites are:

  • local database support
  • JPEG encoder/decoder
  • minimize to SysTray in OOB
  • HTML control inside browser (not only in OOB) – a must!
  • custom mouse cursor images
  • multitouch gesture and intertia support
  • setting filename for SaveFileDialog
  • application patching functionality
  • BMP and GIF image support
  • vector printing

And last, but not the least – I’m guessing that the first public beta of Silverlight 5 will be available in November 2010, during PDC conference. Wanna bet? :-)

Tags:

Jun 2 2010

Browsers market share in Croatia

Category: EN | UnsortedDomagoj @ 22:29

ie6nomore-logo Inspired by an article on CNN that claims that IE6 is under 5 percent market share, I’ve looked into web statistics of Croatian sites I have access to. I cannot tell which sites I’m talking about, the important thing is that there are normal, mainstream sites visited by general audience (in comparison to, for example, IT portal Bug Online, that is visited by geeks and IT professionals, and statistics are much different).

Unfortunately, Internet Explorer 6 in Croatia is still around 12% market share (57% use IE, 23% of IE users have version 6). Here are some pies – first one shows browser market share, and another one Internet Explorer usage by major versions.

Browsers - Google Analytics_1275510116535 Browsers - Google Analytics_1275510176036

Browser- - Google Analytics_1275510210101 image

Users, please stop using older version of browsers, especially Internet Explorer 6.
Web-developers, please stop supporting Internet Explorer 6 in your projects – ignore it, just like its users ignore its security issues.

Tags:

May 24 2010

DoubleClick in Silverlight

Category: EN | SilverlightDomagoj @ 15:56

doubleclickdemo As you probably know, Silverlight does not support double click event, not even a single click event on most elements (I think there is an event called Click only on Buttons). Single click can be emulated via MouseLeftButtonDown and MouseLeftButtonUp, but it is wrong to bind it to only one out of these two. “Real” Click event combines MouseLeftButtonDown and MouseLeftButtonUp and both of them must be raised over the same element to form the click. If you still want to use only one event and you are aware that it is not the best solution, than you should use MouseLeftButtonUp.

Before going into double click scenario, let me point out that double click is not “natural” on the Web and you should not use it there if you want your application to be user friendly. This is just a proof of concept, an example that it can be done, but it is generally not a good idea to implement a double click in a web application.

Double click is a bit more complicated than single click. In this case, you should catch four events in total – two MouseLeftButtonDowns and two MouseLeftButtonUps, and they all should be fired above the same element, in a short period of time (less than 400 milliseconds) and the mouse cursor should not change its position. It is not as complicated as it sounds and I have prepared a small class (source and demo are at the bottom of the post) you can use freely in your projects (I’m using it in one and it works like a charm).

But, there is one more problem you should be aware of – after the first click (the first pair of MouseLeftButtonDown and MouseLeftButtonUp) we don’t know will the user stop clicking, or will he click once more to produce a double click. Since we expect him to do it under 400 milliseconds, the decision whether this is a single or double click can be made 400 ms after the first MouseLeftButtonUp. This amount of time can seem small enough to ignore it, but in real life scenario this will be noted by user and he will feel that single click is not responsive enough. For example, if you put SingleClick and DoubleClick events on an element, and the user clicks on it once, he will wait 400 ms for an application to respond to a SingleClick event.

There are several things you can do to solve this issue:

  1. don’t use SingleClick and DoubleClick on the same element
  2. use SingleClick and DoubleClick for complemental actions – for example, like in Windows Explorer, single click will select a file, and double click will open it
  3. show to the user that you have “captured” his single click, but don’t execute it’s command just yet, wait to be sure that double click timeout is over

In my DoubleClick class there are three events you can attach to:

  • SingleClick – fires when the user clicks on an element (does one MouseLeftButtonDown and one MouseLeftButtonUp); fires every time, even if user double clicks!
  • SingleClickDelayed – fires when user clicks on an element (does one MouseLeftButtonDown and one MouseLeftButtonUp) and doesn’t do the other pair of Down&Up, so you can be sure that this is no double click
  • DoubleClick – fires when user double clicks (two MouseLeftButtonDowns and two MouseLeftButtonUps) on the same position, clicks must be produces under 400 ms

What events should you use?

  • if you need only single click, use SingleClick
  • if you need only double click, use DoubleClick
  • if you need both, but actions are complemental (see scenario no. 2), use SingleClick and DoubleClick
  • if you need both, but actions are not complemental, use SingleClickDelayed and DoubleClick – please be aware that there will be a noticable delay between user click and the moment when SingleClickDelayed fires; you can use SingleClick event to let the user know that the click was detected (show a progress bar, change the color or something) and SingleClickDelayed to do the action

How to use this class? It is pretty straightforward:

  • add using Dizzy.DoubleClick;
  • extend the element and hook up events:
    DoubleClickExtender dce = new DoubleClickExtender(rect1);
    dce.SingleClick += new MyEventHandler(dce_SingleClick);
    dce.SingleClickDelayed += new MyEventHandler(dce_SingleClickDelayed);
    dce.DoubleClick += new MyEventHandler(dce_DoubleClick);

doubleclickcode

Here you can find a demo project (full source, includes the class doubleclick.cs) and here you can see it in action. Happy programming!

The basic idea behind this approach is based on Mike Snow’s blog post – thanks!

Tags:

May 17 2010

Što je novo u Silverlightu 4? (trening)

Category: Događaji i radovi | HRDomagoj @ 23:07

[English summary: announcing Silverlight 4 training with hands-on-labs in Varaždin, Croatia.]

Sljedeći tjedan u Microsoftovom inovacijskom centru u Varaždinu na rasporedu je trening koji će vam pokazati što sve novoga ima u konačnoj inačici Silverlighta 4. Ideja je proći što više stvari s naglaskom na praktični dio – dan će obilovati raznim hands-on-labovima tako da ćete sve spomenuto moći proći i sami.

Dio vremena posvetit ćemo i razvoju aplikacija za nadolazeći Windows Phone 7, a kao posebna poslastica najavljujemo multi-touch monitore, pomoću kojih se može puno realnije doživjeti emulator tog još neizašlog operativnog sustava za telefone.

Vidimo se tamo! Trening je na rasporedu 26. svibnja, traje cijeli dan, a više informacija možete pronaći na ovoj adresi gdje se ujedno možete i prijaviti.

Tags:

May 17 2010

DORS/CLUC 2010 and Seth Godin event in Zagreb – powered by Wall of Silver

Category: Wall of Silver | ENDomagoj @ 23:01

Just a quick photo-reminder of two events that used my twitter wall application to show tweets on the wall.

DORS/CLUC 2010 – Open system days / Linux users conference was held on May 5th, on Faculty of electrical engineering and computing in Zagreb, and they’ve used Wall of Silver on a Linux powered notebook, with Moonlight 2.2 installed.

Wall of Silver was turned on again on May 13th, during the event featuring Seth Godin (via videoconference) and Alex Hunter. It was especially useful during the panel discussion.

05052010037x2_1531321

Looking forward two more events in June that will be using Wall of Silver. You can use it on your event too, for free!

Tags: