Archive for the ‘Windows Phone 7’ Category

Below are two applications that do exactly the same thing, but one was a whole lot easier to create. Can you guess which one? As an end-user it’s impossible to tell but in this article we examine how similar and yet different the development experience is for each of the apps. One of the apps below (on the right) is coded inAndroid 2.2 (aka Froyo) and the other using Windows Phone 7 Beta SDK. I tried to keep both projects as simple as possible so that people can understand the fundamentals over the design.

Download Sample Project Code Files

To get started with Windows Phone 7: http://developer.windowsphone.com, download the necessary software and Windows Phone SDK from the link listed. These tools will be used to run the examples; namely Visual Studio 2010, Windows Phone 7 Beta SDK, and Microsoft Expression Blend (optional).

The sample provided is just a small application which can convert between Fahrenheit, Celsius, and Kelvin.

I want to begin by addressing the similarities between the Android and Windows Phone 7 platforms. Both platforms have adopted the approach to separate design from logic. In Android, developers are used to coding “Layouts” and in Windows Phone 7 the equivalent is called a “Page”. Both of these layout methodologies involve creating an XML based layout. WP7 uses a mutated version of XML called XAML (pronounced “Zamel”). In both the Layouts and the Pages of each platform there is code behind that connects to your layout.

main.xml (Android)
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout android:id="@+id/widget0"
    android:layout_width="fill_parent" android:layout_height="fill_parent"
    xmlns:android="http://schemas.android.com/apk/res/android">
</AbsoluteLayout>
MainPage.xaml (WP7)
<phone:PhoneApplicationPage
    x:Class="TemperatureConverterSample.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"
    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">
    <!--LayoutRoot contains the root grid where all other page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
         
    </Grid>
</phone:PhoneApplicationPage>

The equivalent of an Android “Activity” would be best described by the C# class which is connected to your XAML page and extends Microsoft.Phone.Controls.PhoneApplicationPage.

Android Activity
public class MainActivity extends Activity {
        // Code behind goes here…
 }
WP7 Page
 public partial class MainPage : PhoneApplicationPage
 {
       // Code behind goes here…
 }

Okay so its clear that there are similarities in terms of the core fundamentals of each platform, not to mention Java and C# are like brothers from another mother.

Phone Controls

The Windows Phone 7 equivalent to Android Widgets are called Controls and are a part of the System.Windows.Controls namespace. These “UIElements” are used in much of the same way that Widgets are. For instance the “Convert” button used in the apps is defined as such in  Android and WP7 respectively:

Android
<Button
android:id="@+id/calculateButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Convert"
android:layout_x="106px"
android:layout_y="292px"
>
</Button>
WP7
 <Button Content="Convert" Height="83" HorizontalAlignment="Left" Margin="24,487,0,0" Name="calculateButton" VerticalAlignment="Top" Width="400" Click="calculateButton_Click" />

Listeners vs Events

To handle a Button click in Windows Phone 7 we would use a Click Event rather than an Android Event Listener.

Android Click Listener
this.closeButton = (Button)this.findViewById(R.id.calculateButton);
        this.closeButton.setOnClickListener(new OnClickListener() {
          @Override
          public void onClick(View v) {
     }
}
WP7 Button Click Event
Xaml Event name specified
<Button Content="Convert" Height="83" HorizontalAlignment="Left" Margin="24,487,0,0" Name="calculateButton" VerticalAlignment="Top" Width="400" Click="calculateButton_Click" />
C# Event Method Definition
private void calculateButton_Click(object sender, RoutedEventArgs e) {
      // Code for button
}

The Layout of your Apps

Similar to Androids Layout Views, Windows Phone 7 supplies developers a set of objects to layout Controls. There are Grids, StackPanels, Canvas and so on which have various methodologies of displaying UIElements. You can write your own as well. The reference for all of these such layouts can be found on the Microsoft MSDN reference pages.

hello-linearlayout

The equivalent for a LinearLayout in Android would be the StackPanel in WP7.

Differences Between the Platforms

So far we have yet to discuss the differences between the platforms. The main difference between Android and WP7 is in the development tools. In terms of coding, Android may be built on Java which is an open source platform with a ton of available code but C# is a very strong programming language with many nice features of its own. For instance, data binding to Controls in Silverlight is a really nice standard feature. After coding your app you can style it up in Microsoft Expression Blend 4. User interface designs can be “templated” which provides a CSS stylesheet type logic for programming your user interfaces on the phone.

Behaviors in Microsoft Expression Blend 4 allow people to build games use physics like a physics engine without even doing any code. Any Control in Silverlight can have a custom style. For instance, you can have a button which fades out or changes to all the colors of the rainbow when clicked. Whatever your imagination can think up is possible in an easy and highly customizable fashion.

Conclusion

The Android Platform and Windows Phone 7 share a lot of commonalities. It will take a while to get used to migrating from Android + Eclipse to Windows Phone 7 + Microsoft Visual Studio + Expression Blend but in the end it is a much smoother development experience. The tools which Microsoft provide add a wealth of ease to the lives of us developers.

Source: The Dirty Developer

Today we are publishing the first in our training content led by our MVPs.  Rob Miles and Andy Wigley led an incredibly well received live training course about a month ago, focused on getting developers trained up on building amazing applications and games for Windows Phone 7.

We recognize that providing as much technical content as we can for the full range of developers is what developers deserve. While we plan on having more live training sessions in the coming weeks and months, we are also committed to making that content available as quickly as possible to as many developers as possible. Since this round of content is based on Beta Windows Phone Developer Tools, we will not be localizing it.  For our non-English speaking developers, we will be providing localized training once we have released the final developer tools.

Andy and Rob provide a good bit of humor along with their incredible depth of knowledge on the topic of building apps and games for Windows Phone 7. We think they have covered a fair amount ground, but if there are topics you feel we need to cover more in depth, don’t hesitate to let us know.

There are 12 sessions in total, each about :50 minutes in length. Think of this as a semester’s worth of class time to help you in your quest to be an awesome Windows Phone 7 developer. It’s self-paced, and both Rob and Andy are pretty approachable. Head on over to their blogs if you want to get more plugged into what they are doing.

Continue…

Source: Windows Phone 7 Training

Windows® Phone 7 lets you make the most of every moment by connecting and playing with friends wherever you are, using your Xbox LIVE® avatar and gamer profile to keep track of scores and wins.

Games on the go
Xbox LIVE, the award-winning online gaming and entertainment service for Xbox 360, is coming exclusively to a Windows Phone 7 near you this holiday. Whether you’re waiting for the bus, enjoying time out of town or just relaxing on the couch, the phone designed to keep your life in motion puts Xbox LIVE and mobile gaming in your pocket.

Always be in the game with the only phone
that lets you take Xbox LIVE mobile.

Xbox LIVE on Windows Phone 7

Connected and Accessible
Xbox LIVE on Windows Phone 7 unlocks a world of games, friends and fun for Windows Phone 7 users around the world. The Games hub brings together many popular Xbox LIVE gaming and community features:

  • Be omnipotent. View, access and launch your full game library from one easy-to-navigate hub.
  • Get mad props. Earn, view and track Achievements, view Xbox LIVE leaderboards and build your Gamerscore every time you play an Xbox LIVE title.
  • Release your inner Mini Me.Connect to your Xbox LIVE profile and Avatar, or easily create a new one right from the phone.
  • Get tricky. Access Spotlight feeds, including the latest game titles, breaking news from Xbox LIVE, game tips and tricks, and more.
  • Play before you pay. Easily find, try and buy the games you want, either in the Marketplace or Games hub.
  • Flaunt your skills. Invite, connect and play against friends on other Windows Phone 7 phones or PCs with turn-based (asynchronous) multiplayer gaming.

Windows Phone 7 featuring Xbox LIVE lets you connect and play games with your friends. Use your Xbox LIVE profile to access your avatar, gamerscore, and achievements. Share scores and earn recognition for your accomplishments across the phone, web, and Xbox. You can even earn achievements on Windows Phone that add to your Xbox LIVE gamerscore.

Windows Phone 7 Marks a New Era in Mobile Gaming

At gamescom 2010, Microsoft premiered the first wave of Xbox LIVE games launching on Windows Phone 7 this holiday. With even more games and applications to come, Windows Phone 7 is putting the power of Xbox LIVE into the palm of your hand—from Xbox LIVE Avatars to staying connected with friends, Xbox LIVE is now at your fingertips, anytime, anywhere. Read more …

Games Lineup
The first wave of games announced in the launch portfolio of Xbox LIVE games on Windows Phone 7 has something for every mobile gamer:

  • 3D Brick Breaker Revolution (Digital Chocolate)
  • Age of Zombies (Halfbrick)
  • Armor Valley (Protégé Games)
  • Asphalt 5 (Gameloft)
  • Assassins Creed (Gameloft)
  • Bejeweled™ LIVE (PopCap)
  • Bloons TD (Digital Goldfish)
  • Brain Challenge (Gameloft)
  • Bubble Town 2 (i-Play)
  • Butterfly ( Press Start Studio)
  • CarneyVale Showtime (MGS)
  • Crackdown 2: Project Sunburst (MGS)
  • De Blob Revolution (THQ)
  • Deal or No Deal 2010 (i-Play)
  • Earthworm Jim (Gameloft)
  • Fast & Furious 7 (i-Play)
  • Fight Game Rivals (Rough Cookie)
  • Finger Physics (Mobliss Inc.)
  • Flight Control (Namco Bandai)
  • Flowerz (Carbonated Games)
  • Frogger (Konami Digital Entertainment)
  • Fruit Ninja (Halfbrick)
  • Game Chest-Board (MGS)
  • Game Chest-Card (MGS)
  • Game Chest-Logic (MGS)
  • Game Chest-Solitaire (MGS)
  • GeoDefense (Critical Thought)
  • Ghostscape (Psionic)
  • Glow Artisan (Powerhead Games)
  • Glyder 2 (Glu Mobile)
  • Guitar Hero 5 (Glu Mobile)
  • Halo Waypoint (MGS)
  • Hexic Rush (Carbonated Games)
  • I Dig It (InMotion)
  • iBlast Moki (Godzilab)
  • ilomilo (MGS)
  • Implode XL (IUGO)
  • Iquarium (Infinite Dreams)
  • Jet Car Stunts (True Axis)
  • Let’s Golf 2 (Gameloft)
  • Little Wheel (One click dog)
  • Loondon (Flip N Tale)
  • Max and the Magic Marker (PressPlay)
  • Mini Squadron (Supermono Limited)
  • More Brain Exercise (Namco Bandai)
  • O.M.G. (Arkedo)
  • Puzzle Quest 2 (Namco Bandai)
  • Real Soccer 2 (Gameloft)
  • The Revenants (Chaotic Moon)
  • Rise of Glory (Revo Solutions)
  • Rocket Riot (Codeglue)
  • Splinter Cell Conviction (Gameloft)
  • Star Wars: Battle for Hoth (THQ)
  • Star Wars: Cantina (THQ)
  • The Harvest (MGS)
  • The Oregon Trail (Gameloft)
  • Tower Bloxx NY (Digital Chocolate)
  • Twin Blades (Press Start Studio)
  • UNO (Gameloft)
  • Women’s Murder Club: Death in Scarlet (i-Play)
  • Zombie Attack! (IUGO)
  • Zombies!!!! (Babaroga)

Microsoft_game_studios_logo

Just ahead of Gamescom and their reported multiple gaming announcements, Microsoft is evidently launching Mobile Gaming Studio, under the umbrella of the larger Microsoft Game Studios.

The information comes from, where else, a job posting, which details

Microsoft Games Studios is establishing a new Studio – MGS Mobile Gaming – focused on bringing games and entertainment to the mobile life that people lead. Our vision is to deliver games and entertainment so good that people will want them always with them, on a service that makes them social, connected and relevant anywhere their life goes. The Mobile Gaming team is building industry leading products that showcase our Windows Phone platform as well as emerging mobile platforms, and will help realize Microsoft’s connected entertainment vision. The Mobile Gaming studio will be the hub for MGS franchises and titles on mobile devices and a center of excellence for mobile games.

That bit about "…emerging mobile platforms" sounds a lot like tablet aspirations, no? It’s not a stretch to think that Microsoft envisions you playing games on your Xbox, PC, phone and someday your tablet–we’re down with that. We’re also hoping that "MGS franchises" bit refers to some Halo/Gears of War mobile action.

The only shocker here is that Microsoft is doing this now, as opposed to say last February? We’re going to go on a limb here and say (hope?) that Microsoft already has a mobile-gaming team in place, cranking out some titles for the Fall.

Well, here it is folks, just in time for Monday morning–the HTC Schubert, which is expected to be one of the first GSM phones featuring Windows Phone 7 to hit the market.

Part of the device’s sexy looks comes form the aluminum unibody design, much like the Android-based HTC Legend (see more on that here).

Unfortunately while we have pictures, we don’t have any specifications for the device, though you can bet on at least a 1GHz processor and ample RAM like all WP7 Chassis 1 devices.

Watch the full video after the break and here are some screenshots below. Thoughts? Lets us know in comments.

Source: 247 Windows phone via Solo Palmari

stopwatch

In an interesting twist, it seems that at least for sometypes of programs written for Windows Phone 7, multitasking or rather, the simulation of multitasking is completely possible.

Over at clr-namespace.com, the author whipped up a stopwatch application which you can start, then "minimize" then return to the app and it appears to have be running the whole time.

Of course in reality, it’s not. It’s "tombstoning" the application, which is a process by which

…the operating system maintains state information about the application. If the user navigates back to the application, the operating system restarts the application process and passes the state data back to the application, where the user will be able to continue seamlessly from his last interaction point with the application

In this case, the stopwatch does pause, but when restarted it counts back up from the original start time, giving the illusion that it has been "counting" while paused. This all happens without the user even knowing, making it a bit of a kludge, but a good one for this application.

How can this be applied to other programs? We’re not really sure but it goes to show with some ingenuity, programmers can get around some of these "limitations".

Source: WMExperts