300 likes | 396 Views
Software Development. Chapter 3 – Your first Windows 8 app. Contents ❷❸. Getting ready Visual Studio's first time setup Acquiring a Windows 8 developer license Your first program: Hello world! Assignments Questions and answers. Review: needed tool.
E N D
Contents ❷❸ • Getting ready • Visual Studio's first time setup • Acquiring a Windows 8 developer license • Your first program: Hello world! • Assignments • Questions and answers
Review: needed tool • Youwillneed at least the followingtools to develop Windows 8 applications • Computer with a Windows 8 operating system • It is also recommened to have a touchscreen device, but it is not required • Developmenttools • Development tools • Internet connection
Getting ready • We will assume Windows 8 has already been installed on your work computer • Before starting, you should ensure that: • You have functional internet connectoin, downloading Visual Studio may take a long on a bad or slow connection • Windows has been properly updated and security fixes are installed (use the Windows Update service)
Download Visual Studio 2013 Express • Visual Studio 2013 Express for Windows 8 is a freeproductavailable at http://www.visualstudio.com/downloads/download-visual-studio-vs • Download theexpress versiondesigned forWindows 8development
Installing Visual Studio • Visual Studio 2013 Express installation file is titled winexpress_full.exe. • Launch the installation file by double clicking on its icon. • The installer's first screen will appear • Accept the license terms and click Install
Installation • After clicking Install, you just need to wait for 10-20 minutes depending on your computer processing power • You will be notified when the installation has finished successfully. • A Launch button will appear on the bottom of the window.
Visual Studio's first time setup • When Visual Studio is launched for the first time, you will be asked to sign in. • Signing in is required to develop Windows 8 applications • The process is easy, just click on the Sign In button and follow instructions • You may also sign in later
Acquiring a developer license • A developer license is required so that you will be able to install the programs you've developed • A free developer license is valid for 30 days and a paid license for 90 days at a time • After expiration the license can be automaticalle renewed through Visual Studio
Your first application • The easiest way to learn Windows 8 programming is through trial and error • Let's write a simple Hello World program • You can continue developing the application on your own • You will need • A computer with Windows 8.1 operating system • Visual Studio 2013 installed and registered
Starting a new project • A Windows 8 application consists of a collection of different files called a project • Launch Visual Studio, and choose File/New Project • The New Project window will open
Acquiring a developer license • If you're starting a new project in Visual Studio without a developer license, the program will prompt you to get one • Getting a temporarylicense is free • This kind of license has noaccess to the WindowsStore
Hello World interface • Visual Studio includes a code editor and a visual interface design view • In Toolbox on the left side of the window you will find the component needed to build your interface. • Drag'n'drop two components into the MainPage.xaml interface: TextBlock and Button
Writing code • The Button will change the displayed text when the button is activated • In Visual Studio code is written in the code editor • You can open the code editor be double-clicking the Button component • You may name the TextBlock component by using the Properties window
Component and code • Youcanchange a component'sname in the Propertieswindow • Once the TextBlockhasbeennamed, for example as ”textblock”, youcantype the followingcodestring into the Button component'seventmanager: textblock.Text= ”Hello, World!”;
Running your application • You can launch your application through Visual Studio by clicking the Start button in the middle of the toolbar
Running your application • Building and launching the application will take a few seconds • The screen will turn black and your application interface will appear • Touch the button, and the text should change
Closing the application • As Windows 8 applicationrun in fullscreenmode, youmustknowhow to return to Visual Studio • Thereareseveralways • Touchscreen: swipedownfrom the top of the screen to close the application • Press Alt+F4 on yourkeyboard • Press Windows+D, to return to Visual Studio. Thenclick the red Stop Debuggingbutton on the toolbar
Assignments • Find out the hardware requirements of Visual Studio Express 2013 for Windows. Will the studio run on oldercomputers? • Explainwhy Windows 8 developersneed a developerlicense. • Visual Studio is delivered with fourprogramtemplates. Describe the situationswhereyouwoulduseeachtemplate and give an example of an applicationsuitable for eachtemplate. • 4. Find out howyoucaneasily open Blenddirectlyfrom Visual Studio. Can Visual Studio beopeneddirectlyfromBlend?
Questions and answers 1 • Do I need a touch-screencomputer, laptop, ortablet to beable to develop Windows 8 apps. • Notnecessarily, buthaving a touchscreendevicehasmanyadvantages. • Visual Studio comesequipped with a Windows 8 simulator, with whichyoucantest on a mousehowyourprogramwouldwork on a touchscreen. • The applicationwillthinkthatit is run with a touchscreen.
Questions and answers 2 • My computerhas Windows 7 installed. How can I startdeveloping Windows 8 apps • Youmustupgradeyour Windows to Windows 8 in order to use and develop Windows 8 apps. • Ifyourcomputer is at most a coupleyearsold and runswell on Windows 7, youwillmostlikelybeable to upgradeyou operating system. • Ifyourcomputer is old and slow, itwouldbebest to buy a new computer, for example a touchscreenlaptop. Theseareavailable for under 400 euros.
Questions and answers 3 • I havecreated a Windows 8 app and want to copy it for my friend/colleague. How can I copy my program to anothercomputer? • Ifyourfriendorcolleaguehas Windows 8 and Visual Studio, youcansendhimyourprogram'ssourcecode and ask to compileit on hiscomputer. • Ifthis is notpossibleoryouwant to keep the sourcecode, youcancreate an applicationpackage for distribution in Visual Studio, and then copy thispackage to anothercomputer. • The applicationpackagecanbecreatedbyclicking on the Store menu and thenclicking on CreateAppPackages. Yourfriendorcolleaguecanthenacquire the requireddeveloperlicense with the PowerShellcommandGet-WindowsDeveloperLicense.