設為首頁收藏本站

艾歐踢論壇

 找回密碼
 立即註冊

QQ登錄

只需一步,快速開始

搜索
熱搜: 活動 交友 discuz
查看: 1185|回復: 0
打印 上一主題 下一主題

5 Steps to an Ideal Windows 10 App Development

[複製鏈接]
跳轉到指定樓層
樓主
發表於 2015-10-22 10:58:02 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
5 Steps to an Ideal Windows 10 App Development
1. Start with a Clean SlateThe Windows 10 SDK works best on a Windows 10 OS. You have a variety of ways to install the OS on your system.
I had several problems upgrading a Windows 8.1 box, so I elected to install the Windows 10 ISO on a clean hard drive.
The next issue that I ran into was how exactly do I create a bootable USB drive that doesn’t require “diskpart”. I quickly found a program called, “Rufus” that will allow you to create a bootable USB drive with just a couple of clicks. As a matter of fact, the only thing that I had to change was just to point to the .ISO file that I downloaded earlier.

I was now able to insert the USB drive into my PC and select it to boot first and start with a fresh installation of the Windows 10 Insider Preview.
You can install the Windows 10 SDK on Windows 8.x, Windows 7, Windows Server 2012, Windows Server 2008 R2. But be aware that not all tools and functionality exists on these platforms though.   
Visual Studio 2015 RCAfter the OS is installed, you will obviously need Visual Studio 2015 RC. I chose the Enterprise edition, but the Community Edition will work as well. If you download the Enterprise edition, make sure the “Universal Windows App Development Tools” in the “Optional features to install section” is checked before proceeding.

2. Enable Developer Mode for Windows 10Now that Visual Studio 2015 is installed, it is time to create a new Windows Universal App. You can do so by going to Visual C# -> Windows -> Windows Universal and selecting the “Blank App” template.

If you immediately run the application, then you will be greeted with this error message :

There are a couple of fixes available, but the suggested fix in the dialog box didn’t work for me. Instead it simply crashed the app. I was able to correct this error by adding the registry keys in regedit.
I created the following keys and gave the DWORD value to 1:
  • HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock\AllowAllTrustedApps
  • HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock\AllowDevelopmentWithoutDevLicense
There are other ways to enable this using gpedit or powershell, and I’d encourage you to check out the document located here.
If you run the project after adding the registry keys, it should deploy successfully to your local machine.
With the recently released 10122 build – fast ring, you can enable this setting without changing registry keys, etc. The fast ring isn’t for everybody, so know what you are doing before upgrading.   
3. Download the Windows 10 Mobile EmulatorsGreat! Now that you have deployed your app to your local device, how would it look on the phone? I immediately selected the drop down and noticed that it said “Download New Emulators”. Wait… what? By default you will need to download the Windows 10 Mobile Emulators before they show up.
After you download the installer, it will ask you were you want to install it. I would suggest leaving it at the default for the preview.

Close and relaunch Visual Studio 2015 and you will now see the emulators from the drop down as shown below:

If you run the same app that we’ve been working on with an emulator selected, then you will see the following:

Make sure you check your system requirements as running the emulator as it will require Hyper-V to be turned on and your BIOS will need to have enabled:
  • Hardware-assisted virtualization;
  • Second Level Address Translation (SLAT);
  • Hardware-based Data Execution Prevention (DEP).
The only one that I had to manually turn on was the hardware-assisted Virtualization.
Most modern PCs have Hardware-assisted Virtualization. You just need to turn it on. As far as Hyper-V goes, it is turned on by default.   
4. Deploy your App to a Physical Device running Windows 10 MobileThe first thing that I needed to do was check from the approved list of Windows Phones that are supported. Once I learned that my Lumia 920 was supported, I downloaded the Windows Insider App from the App Store and signed up for the Preview. I went ahead and decided to change channels to the “Fast Ring” to get the latest build as soon as it comes out.

You will need to make sure that you have selected “Device” and that the target output is either “ARM” or “Neutral”. Then click the run button. If you get an error, open the “Windows Phone Developer Registration 8.1” tool and log in to allow apps to be installed on your device. You will then able to deploy Windows Universal Apps to your phone running Windows 10 Mobile.

Please don’t upgrade your only Windows Phone to try out Windows 10 Mobile. If you have a spare use that or search Ebay or Amazon for a cheap device to do testing on.   
5. Developer Assistant for Visual StudioBegin by downloading and installing the Developer Assistant for Visual Studio 2015 RC. The Developer Assistant offers three ways to help:
  • API Assistant – Allows you to find code samples for APIs while you are coding in Visual Studio. In this example, I’ve created a TextBlock on my MainPage.xaml and began setting properties in code behind. As I am typing, you can see that it automatically uses Bing to pull in code-snippets for the TextAlignment property.

  • Programming Task Assistant – This provides you with code samples that span the web and even includes sample projects and relevant samples from GitHub. In this example, I did a quick search on how to parse JSON in WinRT though Visual Studio 2015!

  • Compiler Error Assistant – Helps you resolve various compilation errors. In this example, I’m missing a namespace.

    If you take a look at the error below, you can right-click on it and it will bring up the “Bing Contexual Search”.

    This will display a bing search of several sites that will help you resolve the issue.


The Developer Assistant for Visual Studio also works with other versions of Visual Studio and is not just limited to VS 15 RC!
分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 轉播轉播 分享分享 分享淘帖
回復

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即註冊

本版積分規則

小黑屋|Archiver|手機版|艾歐踢創新工坊    

GMT+8, 2024-6-1 13:17 , Processed in 0.330250 second(s), 24 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表