(X) Hide this
    • Login
    • Join
      • Say No Bots Generate New Image
        By clicking 'Register' you accept the terms of use .

Windows Phone 7 - Part #1: Getting Started

(11 votes)
Andrea Boschin
>
Andrea Boschin
Joined Nov 17, 2009
Articles:   91
Comments:   9
More Articles
11 comments   /   posted on Jan 19, 2011
Categories:   Windows Phone

Last November Microsoft released its brand new Windows Phone 7 operating system, and many of you may have already bought one of the many models it can be found on the market. If you are, like me, passionate of tech-toys, probably you have already started to play with it, downloading tons of applications from the marketplace and you have permeated your life with the beautiful features of this phone. Now, since if you are reading this pages probably you are also passionate about programming with Silverlight, it is the right moment to get deeply in touch with your phone discovering how you can write your own applications, test them on your device and finally publish them to the marketplace to possibly start earn some money, I'm pretty sure you will use to buy your next toy. 

Starting with this article we will follow a path to discover one by one all the aspects of this device. I know for sure you may have already read something on Internet but from here I will start from scratch trying to give a full and complete view about what this phone can do and about what you can do with this phone.

This is the planned Table of Contents for the whole series. If you recommend adding another topic to the TOC - please feel free to comment below the article.

Windows Phone 7 Part #1: Getting Started
Windows Phone 7 Part #2: Your first app
Windows Phone 7 Part #3: Understanding navigation
Windows Phone 7 Part #4: The application lifecycle
Windows Phone 7 Part #5: Panorama and Pivot controls
Windows Phone 7 Part #6: Advanced interaction
Windows Phone 7 Part #7: Understanding Push Notifications
Windows Phone 7 Part #8: Using Sensors
  

Knowing the Phone

So, the first thing you need to know about your phone, is the phone itself. When you bought the device, you probably have on your side right now, you may have noticed that all the models, also if they come from many different brands, are pretty similar. All have a big screen, three buttons on the bottom, a camera and if you go deep inside the technical sheet you also know that there may be some little differences in memory size or in camera resolution but the main specs are really equal. This come from the choice Microsoft made of giving a number of fixed technical specification a phone must match to being able to run the operating system. I know you are aware you have 1 GHz processor, a minimum of 8 gb memory, an 800x480 screen and a fixed number of buttons. These and other strong limits are very important when you have to develop with this phone, because you may be sure that it does not matter what is the device that will run your application, it will runs equally everywhere. Since Microsoft does not want to start to build hardware, trying to put some limit to the creativity of the manufacturers should avoid many of the problems of the previous Windows Mobile platform.

CaptureAt the basis of the Windows Phone 7 operating system there is a new edition of the .NET Compact Framework v3.7. Please close the browser windows you have already popped out to search for a redistributable download. This release is not public and, at now, it is only mounted on the Windows Phone 7 devices. And please keep track that, as a developer, you will not be able to use any API of the NETCF. As you can see in the following scheme the CLR take great part in the development of the platform but the developer tools does not have any connection with it. All the underlying ecosystem, the kernel, the sensors, the important integration to the cloud and much more, are completely insulated and wrapped by the CLR and on top of it there are three blocks that refer to HTML/Javascript, XNA and Silverlight. These are the sole "architectural handles" we can use to develop application for our phone. So, if you develop applications for the browser you will use Javascript and HTML and for gaming options you will rely on the XNA framework. But for the most part of the applications you will find that Silverlight is the sole and unique toolset available.

See the light, the silvery one...

After a great circle we are now in touch with what we would like to know. Silverlight on the Windows Phone 7 is the tool we need to develop applications. Particularly we have here the full version 3.0. It is important to know that wherever you will find an API that is in common with the desktop edition it should function exactly the same way. This does not means you have the entire Silverlight 3.0 on your Phone. There is a number of features that have been taken down for security reasons or for lack of support or signifiance.  One for all, if you explore the assemblies you will find a Socket class but it has been made private so you cannot use it directly. The same way there is a number of assemblies that have been added to support the phone-only features but we will see at them during the next parts of the series. Another thing to remember is that Silverlight on the phone is a native development environment and it doesn't have anything to do with the browser. If a page hosts a Silverlight application it can't be run into the phone's browser.

An application, to run on the phone must be developed with Visual Studio 2010, compiled to a XAP file and loaded into the phone using Visual Studio itself or the Marketplace. It may seem a straightforward path, but there is some subtle thing you need to know. First of all the development tools. As I've already said you need Visual Studio 2010. There is a free express version available or a set of tools you can add to the full version. It is the same setup you can download from here: https://www.microsoft.com/express/Phone/

Included in the toolset there is also a version of Blend 4.0 and a tool that can be used to unlock the phone. This leads to the problem of the installation of the applications. Normally it is not possible to install anything on the phone that do not comes from the Marketplace. The phone is a closed environment and a normal user must crawl the Marketplace from inside the phone and download the applications from it. Obviously, as a developer, you need to side load your XAPs but for doing this you need to activate a developer account on the http://create.msdn.com/ website. To open this account you have to pay an annual fee that enable you to unlock up to three devices and install up to 10 application on each one. The same account let you publish your applications and have the Marketplace deliver your XAPs to the other users phones. To be clear, you can start immediately to develop your applications, because the developer tools includes an useful emulator, but before you decide to publish your applications it is required to unlock your phone to try the application on a real device because it is impossible to completely test it on the emulator.

To have your development environment to connect successfully to the phone you need also to download and install the Zune 4.7 software. This software is required because it serves as a bridge between the phone and your pc. So when you are developing you must have the zune running. It is a good excuse, to have good music playing while you are writing code.

Unlock, deploy and run

CaptureOnce you have the entire toolset installed and your markeplace account created, you can try to unlock the phone. First of all connect the device to the PC using the USB cable. Then starts the Zune software if it does not run automatically. Then go to the settings page of the phone and change the option that automatically lock the screen of your phone after a while. I usually put this option to "never" while I'm developing because, to successfully deploy your apps, you need to have the phone unlocked. Remember to set the option again once you have finished a development session to avoid high battery comsumption.

Then you can open the unlock tool from the start menu (see the figure on the side), and enter the windows live id credentials you have used to register to the marketplace. Sometimes the tool fails the unlock process, perhaps due to communication issues, but in one or two attempts you will have your phone ready for your next application.

Now, just to be sure all has been done fine, open Visual Studio 2010 and create a new Windows Phone application. Once you selected the New Project option in the Start Page  you will be presented with a series of project types. For this first test select "Windows Phone Application". This is a minimal application for your phone and a good starting point for your training. Once Visual Studio has finished building the project it is displayed into the solution explorer. We will go deep in every file of the project in the next article, for now just locate the Grid called "ContentPanel" in the MainPage.xaml file and add inside it the following markup:

<TextBlock 
    Text="Hallo Windows Phone" 
    FontSize="32" 
    HorizontalAlignment="Center" 
    VerticalAlignment="Center" />
If you have the designer active you will see immediately the element you just added to the markup. If you want to see your application running just hit F5 and it will be deployed to the emulator and then it run as shown in the figure.

Capture1Surprisingly, also if your phone is connected your application runs on the emulator. By default when you create a new project it is set to deploy the projects to the emulator. To change this you have to search for a combo box in the middle top of the Visual Studio 2010 toolbar and you will find the option "Windows Phone 7 Device" to be selected in place of "Windows Phone 7 Emulator". Just remember always to have the phone connected, the Zune active and the phone lock screen opened then hit again F5 and the IDE will deploy the solution to the device and will starts the application attaching it for the debug. Now you can put breakpoints in your code and debug the application running into the device in an enviroment really easy and productive.

What's next?

The goal for this article was to put in place all the basics to make everyone that is reading, ready to follow the next, and more complicated, examples with a common knowledge base. We have started from a very very basic example, but now we are ready to make, the very first steps into the Silverlight programming for Windows Phone 7 as you expect.

 

About the Author

Andrea BoschinAndrea Boschin is 41 years old from Italy and currently lives and works in Treviso, a beautiful town near Venice. He started to work in the IT relatively late after doing some various jobs like graphic designer and school teacher. Finally he started to work into the web and learned by himself to program in VB and ASP and later in C# and ASP.NET. Since the start of his work, Andrea found he likes to learn new technologies and take them into the real world. This happened with ASP.NET, the source of his first two MVP awards, and recently with Silverlight, that he started to use from the v1.0 in some real projects.


Subscribe

Comments

  • ppopadiyn

    RE: Windows Phone 7 - Part #1: Getting Started


    posted by ppopadiyn on Feb 03, 2011 14:57

    Hi Andrea,

    First of all great series of articles. I have the following question. Do you know if it is possible to do private distribution of wp7 applications. For example, I want to develop applications that should be available only for the people from my company. I have lg and there are applications that are available only for the lg holders. Obviously this is possible for the manufactures. But is it possible for the common developers like me ?

  • -_-

    RE: Windows Phone 7 - Part #1: Getting Started


    posted by Andrea Boschin on Feb 03, 2011 15:07
    Unfortunately at the moment there is not any way to do what you asking. I think it is a point they have to solve asap because it is important for the success of the platform. But at the moment the WP7 device is to be considered consumer-only.
    bye
  • -_-

    Silverlight 4 Exam (70-506)


    posted by DR on Feb 23, 2011 05:03

    Is Blend is also part of Silverlight 4 Exam (70-506)? If yes, is it available in Express edition?

  • ppopadiyn

    RE: Windows Phone 7 - Part #1: Getting Started


    posted by ppopadiyn on Feb 28, 2011 14:25

    Hi again, :-)

    Are you planning to post an article demonstrating how to create a trial application ? I don't have any "know-how" in this area and wondering what are the best practices, are there any specifics (that have to be considered) when you design your application, etc.

  • -_-

    RE: Windows Phone 7 - Part #1: Getting Started


    posted by Andrea Boschin on Feb 28, 2011 15:04
    It is a good suggestion. Please send it to the team sending them an email or a tweet to @silverlightshow. Thanks
  • -_-

    RE: Windows Phone 7 - Part #1: Getting Started


    posted by Salam on Mar 07, 2011 09:04

    One of the best series of articles on Windows phone 7 programming.

    Thank you for sharing with us, really enjoyed reading it.

  • BeeOShop

    Re: Windows Phone 7 - Part #1: Getting Started


    posted by BeeOShop on Apr 29, 2015 14:34

    Mau info toko tas online di Bandung yang menjual berbagai macam tas untuk keperluan wanita dan anak-anak seperti tas-tas wanita yang branded dari berbagai merek terkenal seperti Louis Vuitton, PradaBrussels, Furla, Chanel, Hermes, dan banyak lagi tas branded wanita lainnya dengan bermacam model seperti dompetslingbaghandbag dan tote bag, yang trendy dengan harga yang terjangkau? Silahkan cek di Bee Bagshop grosir tas online di Bandung yang menjual tas-tas dengan moel dan warna yang bervariasi dengan harga yang murah. Selain tas wanita, kami juga menjual tas sekolah anak model selempang dan ransel yang juga branded tiruan seperti jansport dan kipling dengan banyak variasi model dan warna, dijamin putra-putri anda menyukainya.

    Bagi yang ingin merawat kulit wajah tanpa harus repot dan mahal, simak tips kecantikan berikut yang mudah dan murah. Coba Sabun Amoorea. Manfaat sabun ajaib amoorea ini diantaranya untuk berbagai permasalahan kulit anda, seperti jerawat, scars (bekas jerawat), mengencangkan kulit, membuat kulit tampak lebih cerah dan segar, mengatasi lingkar hitam di bawah mata (mata panda), dll. Untuk melihat review sabun amoorea ini klik di sini. Simak juga testimoni yang sudah menggunakan sabun ini, simak selengkapnya. Meski harga sabun amoorea ini cukup terjangkau, produk ini aman, karena terbuat dari 100% bahan alami dan sudah ada ijin dari BPOM sehingga anda tidak perlu khawatir dan ragu memakainya. Jika aman (tidak berbahaya) apakah memakai sabun amoorea ada efek sampingnya? Reaksi apa yang timbul saat pertama menggunakannya? Simak info lengkapnya di sini.

    How To Get Rid Of Acne and Scars site generally tell about  tips for beauty and health skin, and especially tell anything about acne, myths, acne and scars treatments , not only on your face (including acne and scars on your body such as chest and back)which may help you to war against acne and the scars to leaves on your face and body (back and chest), through naturally, home remedies, and medical treatment. Some people believe that natural treatment is most safe. But its seems would take time longer then medical treatment. In my oppinion, using medical treatment is more effective and you'll see the result faster. To find what the best treatment for your acne, better you understand what causes of acne. The following are some factors which can cause acne: Hormones, diet, stress, medication, clothing, environment factors, genes, and cosmetics. For back or chest acne cases, it may caused by your tight clothes. To get rid of acne on back or chest, it's good to wear synthetic loose clothing, such as cotton linen, to prevent excessive rubbing and irritation on the skin. Another treatment that can help you to get rid of back or chest acne is keep your body always clean, with take a bath regularly, preferably with an anti-bacterial soap or a salicylic acid-based cleanser is highly recommended. When acne goes, it will leaves behind the red on skin, and seems impossible to heal it fast overnight. So, it would be better to do something which may offer some remarkable effects on the redness from acne. If you choose naturally treatment,  just take a cube of ice, garlic, or lemon juice mixed with rose water, choose one of them, then apply to your reddish part of your face for a while. Do this continously and measured, then see the result. Below this, some good habits which may help you to get rid of acne scars naturally and fast are: first, drinking lots of water to makes your skin well hydrated, and finally make you skin regenerate faster.  Second, eat the food that containing much the essential vitamins and mineral to help repairing scars skin from the inside. Third, naturally treatment to get rid of acne scar, by applying aloe vera on scars, may help to avoid more scarring, soothe inflamation, and make your skin keep smooth. Fourth, treat your acne scars with natural ingredient, tomato. Its containing much vitamin A, which very efficient in repairing scars skin.  If you want to get rid of acne scars ons faster than naturally or home remedies treatments, using the latest product of technology, such as laser treatment and chemical peeling, or even you can choose microdermabration that guaranteed more effective than other treatments.

    Ada banyak bermacam permasalahan kulit di wajah, salah satu yang paling menggangu adalah jerawat, apalagi jika yang muncul adalah jerawat batu yang ukurannya besar dan menyebabkan rasa sakit. Solusi mengenai berbagai cara menghilangkan jerawat batu ini banyak sekali ditemukan, mulai dari pengobatan alami, maupun secara medis. Untuk kasus jerawat batu ini, sebaiknya anda bisa mengambil tindakan pengobatan yang tepat, untuk kasus jerawat batu disarankan langsung saja ambil perawatan medis, karena beresiko tinggi meninggalkan bekas berupa bopeng di wajah, jika salah menangani. Dengan langsung mengambil tindakan medis, setidaknya akan meminimalisasi resiko timbulnya scars bopeng di wajah yang mana scars jenis ini relatif sulit dihilangkan. Tidak seperti scars berupa noda/ flek hitam. meski tidak mudah juga, namun berkali-kali lipat jauh lebih mudah dan murah dibandingkan dengan mengatasi bopeng bekas jerawat. Perawatan alami yang dapat anda tempuh untuk mengobati jerawat ataupun scars yang berupa noda hitam/ flek bekas jerawat, anda dapat mencoba dengan menggunakan bahan alami misalnya jeruk nipis atau madu yang sudah sangat terkenal khasiatnya yang untuk kesehatan dan kecantikan kulit. Dengan perawatan alami, cenderung lebih aman, hanya saja untuk perawatan ini biasanya dibutuhkan waktu yang lebih lama serta ketelatenan untuk mengatasinya. FYI, Jeruk nipis ini yang tidak hanya dapat memudarkan flek hitam di wajah, tetapi juga dapat memutihkan dan mencerahkan kulit anda. Namun jika anda tidak memiliki cukup kesabaran, sebaiknya langsung saja konsultasi dengan dokter. Untuk menentukan metode pengobatan jerawat dan scars ini biasanya dokter akan melihat tingkat keparahan dari jerawat/ scars anda, bisa dengan pemberian obat minum seperti anti biotik, obat oles (salep), peeling, mikrodermabrasi, laser atau metode pengobatan lainnya. Namun sebelum anda memutuskan menggunakan salah satu treatment tersebut sebaiknya telah jelas terlebih dahulu mengenai efek samping yang ditimbulkan.

    Seiring dengan semakin tingginya pengguna internet dari waktu ke waktu, hal ini menciptakan peluang bisnis tersendiri. Diataranya peluang bejualan tas murah secara online, buatan konveksi-konveksi lokal. Di Bandung cukup banyak konveksi tas yang membuat beraneka macam tas dan dompet tiruan atau kw. Model-model dari tas wanita ini kebanyakan menjiplak tas dan dompet wanita dari brand terkenal luar negeri seperti merek-merek LV atau Louis Vuitton, Hermes, Chanel, Furla, dll yang sangat terkenal. Tas tiruan seperti ini familiar disebut tas replika/ kw, dengan beraneka tingkatanya: Kw I, Kw II, dll. Tas-tas wanita branded ini di Bee Bagshop dijual dengan harga yang bevariasi antara 66-300 ribuan. Pembelinya berasal dari kalangan anak SMA, anak kuliah, pekerja kantoran, serta ibu-ibu muda. Untuk tas sekolah dan kuliah anak, kebanyakan modelnya meniru model tas branded seperti kipling, dan jansport, dengan model tas punggung/ ransel ataupun model selempang. Untuk harga tas-tas branded kw dijual dengan harga yang jauh di bawah harga aslinya, sehingga bisa dipastikan kualitasnya pun berbeda dengan yang original. Di Bee Bagshop sendiri kisaran harga untuk tas jansport tiruan ini dijual dengan harga 60-80 ribuan, sementara harga barang original mungkin sekitar 800-900 ribuan, bahkan mungkin ada juga yang lebih mahal. Untuk tas ransel branded tiruan ini kebanyakan pembelinya berasal dari anak sekolah dan kuliah.

    Jika anda wanita yang terlalu sibuk bekerja, dan selalu bingung bahkan tidak sempat untuk sekedar memikirkan menu masakan sehari-hari untuk keluarga anda, silahkan kunjungi situs Aneka Resep dan Cara membuat Masakan Praktis Khas Indonesia, situs ini berisi kumpulan resep masakan yang menggunakan bahan-bahan umum seperti ayam, daging sapi, serta beraneka seafood (udang, cumi, ikan), dan juga bahan-bahan makanan yang tidak asing bagi  masyarakat Indonesia seperti tahu, tempe, serta nasi, . Selain itu ada juga resep cemilan khas nusantara, yang dapat anda jadikan inspirasi untuk menu masakan dan makanan ringan keluarga anda di rumah. Seperti resep membuat masakan khas suatu daerah seperti soto ayam lamongan, ataupun masakan khas lebaran seperti opor ayam, beraneka masakan berbahan dasar ayam ataupun bahan makanan lainnya, yang pastinya praktis dan mudah dibuat.

  • GHFHFGH

    Re: Windows Phone 7 - Part #1: Getting Started


    posted by GHFHFGH on May 13, 2015 11:16
  • wardoyoming

    Re: Windows Phone 7 - Part #1: Getting Started


    posted by wardoyoming on May 17, 2015 12:56
    smaller quarters can be easily turned into larger hom harga besi wf baja bersirip ke it an ideal candidate for commercial applications, and there are ovImprovemen Pabrik Besi beton ulir 13 mm 12 m Sulawesi Tenggara ing the ladderWashington State regulations mandate that a "compecture If you hav distributor besi beton ulir 16 mm 12 m dan ukurannya master steel e liquid inside remains cold (or hot) Since there needs to be an openlooking for toko besi beton polos 10 mm gunung garuda jual besi bajarce: http://EzineArticles com/?expert=Kyle_Arthur0 Comments | Leave aesWord coun harga besi h beam 300 x 300 x 10 x 15 x 12 m untuk kontraktor he surface Ensure also that the floor surface and roof surface are sturdy etant agen besi beton polos 22 mm 12 m afalan
  • wardoyoming

    Re: Windows Phone 7 - Part #1: Getting Started


    posted by wardoyoming on May 17, 2015 12:57
    uthor Platinum Author | 31 ArticlesJoined: July 30, 2010 United States4 Rea kursus website bekasi kunjungi website

Add Comment

Login to comment:
  *      *       

From this series