How to deploy an Universal Windows Project on real device mobile?

I'm trying to debbuging my app on real device (lumia 830 with windows 10 mobile 10.0.10581.0) Developer Mode is ON on both devices (mobile and PC), but when I'm deploying my app on my device I've got an error (DEP6100 and DEP6200). Howevere i can easily emulate on emulators and my PC, couldn’t understand whats the problem.

I googled a bit and I discovered how to resolve the problem.

Visual-Studio-2105-Deploy-Real-Device

  • Create a Registry Key in: [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SirepClient] (Probably you will need to create it)
  • Create a dword with name "DisableProtocol3" and value 00000001
  • Restart Visual Studio and try deploying the solution back again.

It's a provisional solution meanwhile a patch is included in Windows 10 mobile. We will have to consider deleting this key after that.

If you want to inspect your device, connect your device via USB and open a browser and type

https://127.0.0.1:10443

And you can watch your device in action!

Windows 10 Device – Home

Windows-10-Device-Home

Windows 10 Device – App Manager

Windows-10-Device-AppManager

Windows 10 Device – File Explorer

Windows-10-Device-FileExplorer

Windows 10 Device – Processes

Windows-10-Device-Processes

Windows 10 Device – Performances (in real time!)

Windows-10-Device-Performances

Write C#. Run JavaScript.

BridgeNet

Open Source C# to JavaScript Compiler and Frameworks. Run Your App On Any Device Using JavaScript.

Use Bridge.NET to build platform independent applications for mobile, web and desktop. Run on iOS, Windows, Mac, Linux and billions of other devices with JavaScript support. Compile your C# code into native JavaScript and deploy on Billions of devices.

Try it on bridge.net or fork it on GitHub

Using SQLite in Windows 10 Universal apps

Using SQLite in Windows 10 Universal apps is really easy even in this preview phase. Even though Entity Framework 7 support for Windows 10 Universal apps is almost here, you still might decide to just continue using a lighter SQLite.Net-PCL library that you're used to since Windows Phone 8/WinRT.

If you are using Visual Studio 2015 RTM and 10240 SDK, there's now the official (no more pre-release stuff) SQLite VSIX package that you can download from SQLite.org. Search for "Universal App Platform" and you're good to go! The rest of the blog post should apply to this version as well.

sqlite-latest_wcqqnu

The next step is to add the SQLite.Net-PCL library that I already mentioned. Use the (redesigned) NuGet to do that.

sqlite_uap_2

It will add two references

  • SQLite.Net
  • SQLite.Net.Platform.WinRT

Now, remember the VSIX package (Visual Studio extension) installed earlier? It installs SQLite extensions that you need to reference by simply right-clicking on References and choosing "Add Reference..." and then finding the right reference under Windows Universal -> Extensions.

sqlite-latest-extension

And that's it! You can start using SQLite!

To test it, I defined a simple model class called User.

public class User  
{
    public int Id { get; set; }
    public string Name { get; set; }
}

And then I created a table which will hold User entities.

var path = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "db.sqlite");
 
using (SQLite.Net.SQLiteConnection conn = 
       new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), path))  
{
    conn.CreateTable<user>();
}

Adding SQLite support to Windows 10 Universal apps is really simple! After all of the extensions are added, and the ORM/client library fetched over NuGet, the usage is the same as before. This is really neat for simpler scenarios and until Entity Framework 7 officially, fully supports Windows 10 Universal apps.

Universal Windows app samples

On GitHub Microsoft have published a lot of examples for Universal Apps: the link is https://github.com/Microsoft/Windows-universal-samples

This repo contains the samples that demonstrate the API usage patterns for the Universal Windows Platform (UWP) in the Windows Software Development Kit (SDK) for Windows 10. These code samples were created with the Universal Windows templates available in Visual Studio, and are designed to run on desktop, mobile, and future devices that support the Universal Windows Platform.

Universal Windows Platform development

These samples require Visual Studio 2015 and the Windows Software Development Kit (SDK) for Windows 10 to build, test, and deploy your Universal Windows apps.

Get a free copy of Visual Studio 2015 Community Edition with support for building Universal Windows apps

Additionally, to stay on top of the latest updates to Windows and the development tools, become a Windows Insider by joining the Windows Insider Program.

Become a Windows Insider

Using the samples

The easiest way to use these samples without using Git is to download the zip file containing the current version (using the link below or by clicking the "Download ZIP" button on the repo page). You can then unzip the samples and use them in Visual Studio 2015.

Download the samples ZIP

The samples use Linked files in Visual Studio to reduce duplication of common files, including sample template files and image assets. These common files are stored in the SharedContent folder at the root of the repository and referred to in the project files using links.

For more info about the programming models, platforms, languages, and APIs demonstrated in these samples, please refer to the guidance, tutorials, and reference topics provided in the Windows 10 documentation available in the Windows Developer Center. These samples are provided as-is in order to indicate or demonstrate the functionality of the programming models and feature APIs for Windows.

Error : DEP3321 – Can’t deploy to Windows 10 Mobile

With Windows 10 being rolled out as I write this article, there will be updated sample Windows Platform apps available soon (today). It’s also time to update your projects.

However, you may find yourself not able to deploy to Windows 10 Mobile after updating your projects or older samples to Windows 10 (build 10240). This post will show you how to resolve this problem.

The problem

You’ll see an error something like this when deploying to a physical Windows 10 Mobile device:

Error : DEP3321 : To deploy this application, your deployment target should be running Windows Universal Runtime version 10.0.10240.0 or higher. You currently are running version 10.0.10166.0. Please update your OS, or change your deployment target to a device with the appropriate version.

The error is pretty clear but how do we fix it? The resolution is with the MinTargetVersion setting.

The fix

We need to drop the lowest version your app targets to the version that your device has running, we can do this in one of two ways; through the project properties UI editor or manually edit the XML of the csproj file. I will show you how to do it manually because in some cases, the UI’s MinTarget dropdown list won’t show the lowest SDK if you do not have it installed. Below are the steps to fix it.

NOTE: Skip to step 3 if your project is already unloaded (it will show (unavailable) next to the name)

1) Right click on your project in Visual Studio

2) Select “Unload Project“, it will now appears as ProjectName (unavailable)

3) Right click on the unloaded project and select “Edit projectName.csproj

4) Locate the <TargetPlatformVersion> and <TargetPlatformMinVersion> items in the first <PropertyGroup>.

Here’s the “Before” screenshot:

DEP3321-1

5) Change the TargetPlatformMinVersion to the version that the error stated you are running. In this case, it’s 10166. Here’s the “After” screenshot:

DEP3321-2

6) Now Save and Close the file

7) Right click on the project again and select “Reload Project

8) Rebuild the project and deploy to device. Now you should be up and running!

Windows 10: Changing Paradigms

windows10-evolutionWindows 10 is the main discussion topic in the online development communities. This new operating system that is currently in the technical preview (and available through the Microsoft insider program) is a milestone in the platform unification journey that Microsoft embarked upon with starting with Windows Phone and Windows 8 operating systems. With Windows 10, developers and users are introduced to one development kit, one store, one application and one binary distribution package.

Introducing Windows Core

With Windows 10, developers are introduced to the new Windows Core concept. Windows Core is the refactored common core of Windows. It is the common set of APIs, a common infrastructure, which gives a, for the first time, truly binary compatibility across different platforms.

Up until Windows 10, a lot of the operating systems shared lots of commonality. In essence, most features were re-written from scratch for different platforms by separate development teams. Windows 8 was the first attempt to create a unified core with the so-called windows 8 kernel. The Windows CE kernel that was used for Windows Phone 7 was finally replaced with the Windows 8 kernel on Windows Phone 8. Xbox platform with the same kernel joined the unified platform with the release of Xbox One.

However, even though the kernels were the same, the implementation still differed on certain features which led to the Universal App Concept. The core functionality for mobile and desktop apps were implemented in either shared libraries or windows runtime class libraries targeting certain platforms that could be reused on the separate binaries for the respective platforms.

Universal App Platform

Universal App Platform is another new concept that we, developers, will need to get acquainted with. UAP is a collection of contracts and versions. It defines the platform that is running your application and acts as a broker between the application and the operating systems. It is built on top of the Windows Core and can be described as a superset of all the APIs that are supported on different devices and platforms running Windows 10.

With this new concept, the developers’ responsibility towards the OS shifts towards the UAP and in return the operating system is responsible for providing the UAP to the applications. Targeting platforms with the UAP is as simple as a manifest declaration.

<TargetPlaform Name="Microsoft.Universal" minVersion="2.0.0.0" maxVersionTested="3.5.0.0" />

The existence of a broker between the application and the operating system also creates an OS-agnostic development experience. For instance, if/when a new version of the OS becomes available, the application does not need to be aware of the version of the OS. Only important thing is to check if the UAP version is compatible with the current application.

Extensions SDK

Extensions SDK is really what makes the device specific APIs accessible. In an object oriented analogy, if the UAP is defining the abstract classes and interfaces to all the available APIs, the extensions SDK provides the implementations for these device specific feature sets. For instance, without adding the windows phone extension SDK as a reference to your application (the extension SDKs can be added using the Add Reference link in the project menu), the UAP will not be able to provide your application the access to types like BackButtonPressed or a contract like Wallet.

API Information Metadata

Since your application communicates with the OS through the UAP, and using the implementation by the extension sdks, the easiest way to probe for a certain API or device is the foundation metadata namespace. ApiInformation static class lets developers/application probe the current platform any of the supported classes, APIs, contracts, etc.

On Windows 8.1 Universal App:

#if Windows_Phone_App

Windows.Phone.UI.Input.HardwareButtons.BackPressed += HardwareButtons_Pressed

#else

On Windows 10 App:

If(Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))

{

Windows.Phone.UI.Input.HardwareButtons.Backpressed += HardwareButtons_BackPressed;

}

Since the HardwareButtons class and the Backpressed event is infact included in the UAP, even though the runtime type does not exist in the current device, there is no need for conditional compilation.

Instead of using IsTypePresent, you can test for the presence of individual members by using IsEventPresent, IsMethodPresent, IsPropertyPresent, and similar methods.

The set of APIs within a device family is further broken down into subdivisions known as API contracts. And you can use the ApiInformation.IsApiContractPresent method to tests for the presence of an API contract. This is useful if you want to test for the presence of a large number of APIs that all exist in the same version of an API contract.

public boolean HasScannerApi

{

get

{

return Foundation.Metadata.ApiInformation

.IsApiContractPresent("Devices.Scanners.ScannerDeviceContract", 3);

}

}

Windows 10 Changes

Other than the basic concepts in the development methodology, there are also changes in the framework and app model itself.

Continuation Manager No More (Windows Phone)

The infamous continuation context and the continuation manager are completely removed from windows phone to create a more unified programming model.
The methods that provide a continuation context such as FileOpenPicker.PickSingleFileAndContinue or WebAuthenticationBroker.AuthenticateAndContinue are replaced with their Windows Runtime counter parts such as FileOpenPicker.PickSingleFileAsync, WebAuthenticationBroker.AuthenticateAsync.

Charms Bar No More (Windows)

A concept that was introduced with Windows 8, the so-called charms bar, has been removed from Windows 10. In order to support the Windows 8 applications running on Windows 10, a top navigation button is introduced to access the charm functionalities like settings or sharing contracts.

win10-windows8apponwindows10

 

 

For windows 10 applications, this top menu item does not appear. It is the developer’s responsibility to make these contracts accessible either with an app bar button or a button in the application interface.

windows10-settingsflyout

 

Another change related to the charms is that the flyouts related to the charm bar buttons, such as the settings flyout; does not appear in the side of the whole client window but rather uses the application window.

Changing Layout Concepts (Windows)

Windows application on Windows 8 two separate models of layout. First one was the full screen layout, and the second one was the snapped layout. Snapped layout was initially a fixed half window sized view but later changed to an adjustable window.

Windows 10 - Tablet Mode

Windows 10 – Tablet Mode

Windows 10 user interface can be used in two different modes. One is the tablet mode, which resembles to the previous layout and the application is visible either in snapped or full screen views. The second mode is the desktop mode, which makes the windows runtime apps visually no different than classic windows applications. On the desktop mode, the applications can be moved by the user or resized as desired.

App Bar (Windows)

App bar is still accessible and usable in Windows 10 applications. The only change is the fact that now the app bar became part of the window that is presenting your application. This change does not affect the developers directly, only directed towards the user experience.

However, windows 8 applications running on Windows 10 still display their app bar just like before.

I tried to give a quick overview of the changes related to Windows 10. Overall, Windows 10 is coming with a lot of surprises both for developers and users.
Happy coding every one,

How to roll back from Windows 10 Mobile preview to Windows Phone 8.1

It's the first preview of the universal version of Office apps, and starting with build 10080 the operating system now expands to new phone headsets, including the Lumia Icon/Lumia 930, Lumia 640/Lumia 640 XL, and HTC's One (M8), which is the first non-Lumia phone joining the Windows 10 preview program.

Although, now more users can get access to Windows 10 Mobile preview and get their hands of on the new preview of Word, Excel, PowerPoint, and OneNote, Microsoft warns that there is a significant number of bugs in this particular build for Windows phones, including a bug that could prevent users from receiving MMS messages.

So, if you happen to run into any problems or you simply are done testing the operating system, Microsoft has an application called "Windows Phone Recovery Tool" for PCs that will allow you to rollback to Windows Phone 8.1 from Windows 10 Mobile.

windows-recovery-tool-windows10

Below you'll find all the steps to help you go back safely to your previous version of the mobile operating system:

Note: Before proceeding it is worth pointing that with the release of Windows 10 Mobile build 10080, Microsoft has updated the Windows Phone Recovery Tool, now at version 2.0.3, and it is introducing support for the HTC One (M8) to Windows 10.

  1. Download and install the latest version of the Windows Phone Recovery Tool to your PC.
  2. Launch the recovery tool and connect your phone using a USB cable. If your handset isn't detected, click My phone was not detected to force the application to rescan for and detect the phone.
  3. In the next screen, click your phone, wait a few seconds, and you'll see your phone information and the software available for download to roll back to a previous operating system. To continue, click Reinstall software.
  4. Next, the recovery tool will warn you to backup all your data, settings, and apps before continuing, as the rolling back process will delete all the previous data in your phone. Click Continue to proceed.
  5. Now, the recovery tool will download the image from Microsoft's servers and replace Windows 10 Mobile that is currently on your phone. The process will take some time depending on your internet connection and the hardware in question.

After the tool completes the process, you will receive a message saying "Operation successfully completed". At this point, the phone will reboot and you will have to go through the Out-of-Box-Experience, like on any version of Windows. Then, you'll need to sign-in with your Microsoft account, select to restore your phone from backup (if this is something you prefer), and after a few additional questions, you'll be back to Windows Phone 8.1.

As you can see, Microsoft is making it very convenient to roll back to Windows Phone 8.1from Windows 10 Mobile preview, and the company is starting to add support for non-Lumia devices, which is a big plus. So you don't have to spend time searching on the internet for different tools to go back to the previous operating system.

However, you have to remember that the operating system is far from complete. Not only will you find issues, but you might also stumble upon problems trying to roll back, as I hear many users reporting issues restoring Windows Phone 8.1 on their Lumia 930. As such, you should avoid using Windows 10 Mobile preview as your primary mobile operating system, at least until it hits RTM.

windows-10-recover-download

Enable your device for development

Important  Currently you cannot enable devices installed with Windows 10 Insider Preview with the System Setting Developer Mode controls as outlined in this article. This feature is not currently supported, but will be enabled in a future release of Windows 10. So you don't need to follow the steps in the future approach in this article. But you must follow the links directly below to enable your specific Windows 10 device.

Enable developer mode

If you use Visual Studio on a Windows 10 desktop and you open a solution for a Windows 8.1 or Windows 10 app, you will be prompted to enable your device with this dialog. (You also need your device to be enabled to use the designers and debug your app.)

Enable developer mode dialog that is displayed in Visual Studio

When you see this dialog, click OK. Then follow the steps below to enable your desktop from Windows 10 Insider Preview.

For Windows 10 desktop

Use gpedit.msc to set the group policies to enable your device, unless you have Windows 10 Insider Preview Home Edition. If you do have Home Edition, you need to use regedit or PowerShell commands to set the registry keys directly to enable your device.

Dn706236.wedge(en-us,WIN.10).gifUse gpedit to enable your device

  1. Open a cmd prompt with administrator privileges.
  2. Run Gpedit.msc.
  3. Go to Local Computer Policy > Computer Configuration > Administrative Templates > Windows Components > App Package Deployment
  4. Edit the policies to enable the following:
    • Allow all trusted apps to install (Enables your device for sideloading apps)
    • Allows development of Windows Store apps and installing them from an integrated development environment (IDE) (Enables your device for development from Visual Studio)
  5. Reboot your machine.

Dn706236.wedge(en-us,WIN.10).gifUse regedit to enable your device

  1. Open a cmd prompt with administrator privileges.
  2. Run regedit.
  3. Set the value of this DWORD to 1: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock\AllowAllTrustedApps
  4. Set the value of this DWORD to 1: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock\AllowDevelopmentWithoutDevLicense

Dn706236.wedge(en-us,WIN.10).gifUse PowerShell to enable your device

  1. Run Windows PowerShell with administrator privileges.
  2. Run the following command: PS C:\WINDOWS\system32> reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
  3. Run this command too: PS C:\WINDOWS\system32> reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowAllTrustedApps" /d "1"

Future approach using System Setting Developer Mode controls

There is a different approach for development for Windows 10 devices. A developer license is no longer required for each device that you want to use to develop, install or test your app. You just enable a device once for these tasks from the settings for the device. That's it. No more renewing your developer licenses every 30 or 90 days!

If you are still using a Windows 8.1 device to develop or test your apps with Visual Studio 2013 or Visual Studio 2015, you still need to get a developer license or register your Windows Phone.

Develop your app with Visual Studio

If you use Visual Studio on a Windows 10 device and you open a solution for a Windows 8.1 or Windows 10 app, you will be prompted to enable your device with this dialog. (You also need your device to be enabled to use the designers and debug your app.)

Enable developer mode dialog that is displayed in Visual Studio

When you see this dialog, click OK. Then follow the steps below to enable your device from Windows 10 Insider Preview.

Enable your Windows 10 devices

For Windows 10 Insider Preview, you choose what tasks you want to enable on the device. This includes any devices: Windows 10 desktops, tablets and phones. You can enable a device for development, or just sideloading.

Sideloading is installing and then running or testing an app that has not been certified by the Windows store. For example, an app that is internal to your company only. (Does the Windows store allow sideloading?)

Note  If you sideload apps, you should still only install apps from trusted sources. When you install a sideloaded app that has not been certified by the Windows store, you are agreeing that you have obtained all rights necessary to sideload these apps and that you are solely responsible for any harm that results from installing and running these apps. See this privacy statement.

Dn706236.wedge(en-us,WIN.10).gifWindows 10 Desktops/tablets

  1. On your device that you want to enable, go to Settings. Choose Update & security. Then choose For developers.

    Go to Settings, choose Update and security and then choose For developers to view your options
  2. Choose the level that you need. Developer mode allows you to sideload apps too.

Dn706236.wedge(en-us,WIN.10).gifWindows 10 Phones

  1. On your device that you want to enable, go to Settings. Choose Update & security. Then choose For developers.

    From Settings on your phone, choose Update and security

  2. Choose the level that you need. Developer mode allows you to sideload apps too.

Advertsing

125X125_06

TagCloud

MonthList

CommentList