Advertisemen
Introduction:
In this first part, I am going to explain nearly fifty windows 10 Universal Windows Platform(UWP) app development questions. And in next part i will introduce more advanced UWP questions. Please correct me if any questions having any mistakes in a content and also please note that for accuracy purpose, I adapted some content from MSDN .
1. What is Universal App Development?
From Windows Phone 8.1 OS, Microsoft introduces an important change in the Windows Phone developer ecosystem is called universal app concept. In this release, Windows Phone converges with the Windows Store apps platform into a single developer platform that runs the same types of apps i.e Windows Runtime apps. Windows Phone and Windows Store app developer platforms truly have become one, single development platform.
In single world, Universal app is a single development platform for windows phone and windows store apps.
2. What is Windows store App?
A Windows Store app (former "Metro-style app") is a new type of application that only runs on Windows Tablets. A Windows Store app resembles the apps that are run on smartphones. The user interface is very different compared to traditional desktop apps user interfaces, and without a touchscreen they can sometimes be more difficult to use than a desktop app. The biggest advantage of a Windows Store app is when it's used on a tablet computer or on a laptop computer with touch sensitive screen - then it can use its full potential.
3. What is Windows App store?
Windows store is the place where you can Install/purchase apps for Windows and windows phone devices.In order to get any Windows/WindowsPhone apps, including free apps from windows store you’ll be prompted to set up a Microsoft account, or use your existing Microsoft email to start using Windows store apps. Once you set up an account, with an email and password, you can start using the Windows app store.
For more info following details are major mobility platform store places:
a. Windows Phone/Windows: Windows Store
b. Android: Google Play
c. IOS/iPhone: Apple store
4. Silverlight windows phone vs WinRT windows phone?
- Windows Phone 7, Windows Phone 8 & Windows Phone 8.1 (Targeting Silverlight) uses Silverlight API's. And how Windows Phone 8 & Windows Phone 8.1 relate to Silverlight, well they use the Silverlight API's that are available for mobile application framework.
- Windows 8 & Windows 8.1 both target WinRT API's. And Windows Phone 8.1 also support WinRT API's. So, if you want to create Windows 8.1 & Windows Phone 8.1 applications that you can do by creating a Universal application targeting both the platforms (They have convergence of 90%).
From windows 10 OS Microsoft introduce a major change in mobility platform is called Universal Windows Platform (UWP). And which is available across all Windows device families(Mobile,Desktop,Xbox,Surface Hub, Holographic, IOT..etc), you can reach all these devices and look great on them all using one store and one code base.
6. What is UAP & UWP, Is there any difference?
UAP is stands for Universal App Platform and UWP is stands for Universal Windows Platform. Both meant for same thing that will enable Windows 10 developers to write one app for 'All Windows Platform family devices.'
7. What are the major development differences between WinRT universal app & Windows 10 UWP?
There are so many improvements on Unviersal Windows app development for Windows 10 from Windows 8.1 experience.
8. Can Windows 10 SDK work with below OS versions like Windows 8.1/Windows 8.0/Windows 7..etc?
Yes, but windows 10 SDK (Which is available with Visual Studio 2015 update 1 or later IDE) works best on the Windows 10 operating system and it is also supported on: Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2, but not all tools are supported on these operating systems.
9. LifeCycle Of windows store apps:
Life-Cycle means a specific sequence of the application from start to finish of the application.
UAP is stands for Universal App Platform and UWP is stands for Universal Windows Platform. Both meant for same thing that will enable Windows 10 developers to write one app for 'All Windows Platform family devices.'
7. What are the major development differences between WinRT universal app & Windows 10 UWP?
There are so many improvements on Unviersal Windows app development for Windows 10 from Windows 8.1 experience.
- Previously in windows 8.1 universal app project, we need to create two different app packages (.APPX) for windows phone & Windows, but now no more than one app package and we can use only one app package that can run across all Microsoft platforms (Mobile,Desktop,Xbox,Surface Hub, Holographic, IOT..etc)
- Now no need to create two separate projects for windows phone and windows, with windows 10 sdk now build one Universal Windows app that runs on all Windows 10 devices.
- We no longer need a developer license with Windows 10. But we must Enable Developer Mode to your device for development.
8. Can Windows 10 SDK work with below OS versions like Windows 8.1/Windows 8.0/Windows 7..etc?
Yes, but windows 10 SDK (Which is available with Visual Studio 2015 update 1 or later IDE) works best on the Windows 10 operating system and it is also supported on: Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2, but not all tools are supported on these operating systems.
9. LifeCycle Of windows store apps:
Life-Cycle means a specific sequence of the application from start to finish of the application.
So there are four important states in the life cycle of a Windows Store app. They are as follows:
a. Not Running: In this state an application is not running at all. An application might go into this state due to various reasons. For example, a user might have just installed the application but has never launched it. Another possibility is that a user might have ended the application using the Task Manager or might have just restarted the computer.This state is helpful in preparing the initial UI of your application.
b. Running: When user launch an app from app list,then it changes its state from Not Running to Running. Such an app is the one that the user is interacting with at a given point of time and the OS has allocated required resources for it.
c. Suspended: The OS suspends your app whenever the user switches to another app or to the desktop or Start screen. In this state an app in the Running state can enter the Suspended state
d. Terminated: If there are no adequate system resources, the OS may terminate a suspended app in which case it will enter the Terminate state.
10. What is Suspension Manager in Windows Phone 8.1?
It is a kind of helper class and provides the necessary properties and methods to load and store the state when the windows phone store app is terminated.
Note: This class is automatically added to the solution if we use the Hub App, Grid App, and Split App project template or add to an existing project a BasicPage or any other Page item template other than BlankPage.
11. What are the Programming Languages for Windows App Development?
Preferred languages on priority based:
a. Not Running: In this state an application is not running at all. An application might go into this state due to various reasons. For example, a user might have just installed the application but has never launched it. Another possibility is that a user might have ended the application using the Task Manager or might have just restarted the computer.This state is helpful in preparing the initial UI of your application.
b. Running: When user launch an app from app list,then it changes its state from Not Running to Running. Such an app is the one that the user is interacting with at a given point of time and the OS has allocated required resources for it.
c. Suspended: The OS suspends your app whenever the user switches to another app or to the desktop or Start screen. In this state an app in the Running state can enter the Suspended state
d. Terminated: If there are no adequate system resources, the OS may terminate a suspended app in which case it will enter the Terminate state.
10. What is Suspension Manager in Windows Phone 8.1?
It is a kind of helper class and provides the necessary properties and methods to load and store the state when the windows phone store app is terminated.
Note: This class is automatically added to the solution if we use the Hub App, Grid App, and Split App project template or add to an existing project a BasicPage or any other Page item template other than BlankPage.
11. What are the Programming Languages for Windows App Development?
Preferred languages on priority based:
- C# & Xaml (Native or Xamarin cross platform)
- Visual Basic
- Visual C++/CX(CX is the component extensions to the C++ language)
- HTML5 , JavaScript and CSS (Using Cordova, phonegap..etc)
From WinRT windowsphone 8.1 sdk, old windowsphone 8.0 "WMAppManifest.xml" file is renamed to "Package.appxmanifest" which is very similar to the Windows Store apps . Package.appxmanifest is xml file that included all info of our application such as targeted app OS version,App display name,App icons,capability permissions to run app,Start page to be App launch..etc .
13. What are the differences between .Xap and .Appx Package file?
To sell or distribute your Windows Phone/ Windows Store app to other users, you need to create an build package for them. So Silverlight Windows phone app can generate .xap package which as part of the normal build process. And they don’t have a separate packaging step.
When we run the Windows Store app, during the compilation process app package will be installed with file extension of app package(.appx) which will contain all the necessary packages to deploy to devices with each processor architecture.
14. What are the different architecture configurations for creating packages in Windows 10 UWP App?
To sell or distribute your Windows Phone/ Windows Store app to other users, you need to create an build package for them. So Silverlight Windows phone app can generate .xap package which as part of the normal build process. And they don’t have a separate packaging step.
When we run the Windows Store app, during the compilation process app package will be installed with file extension of app package(.appx) which will contain all the necessary packages to deploy to devices with each processor architecture.
Framework | Visual Studio Project Type | Package Type | Package Built |
---|---|---|---|
Silverlight | Windows Phone Silverlight 8.0 | Xap | With project |
Windows Phone Silverlight 8.1 | Xap | With project | |
Universal | Windows 8.1 | Appx | By Store menu |
Windows Phone 8.1 | Appx | By Store menu | |
Shared | N/A | N/A |
14. What are the different architecture configurations for creating packages in Windows 10 UWP App?
- x86(32 bit processors, emulator )
- x64(64 bit processors, emulator)
- ARM ( It is for RT device)
- Neutral(all architectures.)
With UWP app packages, you cannot simply install an app to your device like Desktop apps. Typically, you download these apps from the Store and that is how they are installed on your device. But you can sideload apps to your device without submitting them to the Store. This lets you install them and test them out using the app package (.appx) that you have created. If you have an app that you don’t want to sell in the Store, like a line-of-business (LOB) app, you can sideload that app so that other users in your company can use it.
16. what is maximum size of .Appx file?
- .appxbundle: 25 GB maximum per bundle
- .appx packages targeting Windows 8.1: 8 GB maximum per package
- .appx packages targeting Windows 8: 2 GB maximum per package
- .appx packages targeting Windows Phone 8.1: 4 GB maximum per package
- .xap packages: 1 GB maximum per package (in silverlight windows phone).
Make sure to enable developer mode for windows 10 devices, before .appx deployment. Otherwise you will get below error
"Error : DEP0001 : Unexpected Error: To install this application you need either a Windows developer license or a sideloading-enabled system. (Exception from HRESULT: 0x80073CFF)"
Step to enable Developer Mode:
Go into the Settings of a Windows 10 phone device and search for Update & Security category and turn on Developer Mode.
18. How to get the device platform on Windows 10 UWP App?
From Windows 10, now no more than one app package and we can use only one binary package that can run across all Microsoft platforms (Mobile,Desktop,Xbox,Surface Hub, Holographic, IOT..etc). So you might want to get the device platform type from your app using c#. And you can use the DeviceFamily property defined in the Windows.System.Profile.AnalyticsInfo.VersionInfo class.
1 | public void GetPlatformType() |
2 | { |
3 | var WindowsPlatformFamily = Windows.System.Profile.AnalyticsInfo.VersionInfo.DeviceFamily; |
4 | } |
19. What are the different application running modes in Windows App Development?
When you compile an application, you usually choose between below two modes:
Debug: Debug mode pads the executable file with extra information used for debugging purpose. After your application is bug-free and feature-complete, there's no longer any need to keep the debug information.
Release: Compiling in Release mode gives you a more compact (and even slightly faster) executable that doesn't include unnecessary internal debugging symbols
Note: Before submitting our windows app to windows store, You need to set target platform as ARM while creating .APPX in release mode because mobile phone have ARM processors so they will need .APPX build on ARM configuration. x86, X64 is for emulators only.
20. What is App package manifest in UWP?
The package manifest is an XML document that contains the info the system needs to deploy, display, or update a Windows app. This info includes package identity, package dependencies, required capabilities, visual elements, and extensibility points. Every app package must include one package manifest.
The package manifest is an XML document that contains the info the system needs to deploy, display, or update a Windows app. This info includes package identity, package dependencies, required capabilities, visual elements, and extensibility points. Every app package must include one package manifest.
21. What is the difference between GridView and ListView in Windows App Development?
- The ListView and GridView controls are so similar, you can think of them as a single control. The major difference between the two is the manner in which they lay out their items, and it’s easy to change the layout so each control emulates the other.
- The ListView control displays its data stacked vertically, much like a standard list box. Use this control to display an ordered list of data, like a list of email messages, a list of contacts, or search results.
- The GridView control displays its data stacked horizontally in rows (although you can alter this behavior and have it displayed in columns first, as well). You use this control when you need more space for rich visualization of each item to be displayed.
- The item container for a ListView is ListViewItem and the item container for a GridView is GridViewItem. But we can customize item container by setting the ItemContainerStyle property.
22. What is CollectionViewSource in Windows App?
CollectionViewsSource is XAML markup, it can group all data list objects and bind them to the corresponding controls all in XAML. It has a property called Source that defines the collection of objects or data to bind to the control which is usually set it in code(C#) behind.
23. What is VisualStateManager in Windows 10 UWP?
In Windows 10, the VisualStateManager class has two new mechanisms with the help of which you can implement a responsive design in your UWP applications. And it is used to define, manage, and transition between different states of controls on a page.
VisualStateGroup: it is having group of Visual States, where each VisualState has a name that is representative of a UI state that can be changed by the user, or changed by control logic. A VisualState consists mainly of a Storyboard.
GoToState: GoToState method is very useful to manage/transition between Visual States. When we call GoToState to change the visual state of a control, VisualStateManager can determined whether a state that matches stateName exists.If exist,corresponding storyboard will begins and If not exist, nothing happens and the method returns false.
24. What does StateTriggers in Windows 10 UWP?
StateTriggers is property of VisualState, which can defines a rule in Xaml that specify when a particular VisualState is to be applied. And it allows the developer to check certain conditions like the window height or window width and then the VisualState.Setters property define visual states in response to those certain conditions.
25. What does AdaptiveTrigger in Windows 10 UWP?
AdaptiveTrigger can help you create a dynamic responsive UI based on the height or width of the device or screen. It has two important properties: MinWindowWidth and MinWindowHeight.
<Page>
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup>
<VisualState>
<VisualState.StateTriggers>
<!--VisualState to be triggered when window width is >=750 and windows height is >=900 effective pixels.-->
<AdaptiveTrigger MinWindowWidth="750" MinWindowHeight="900" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="myPanel.Orientation" Value="Horizontal" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<StackPanel x:Name="myPanel" Orientation="Vertical">
<TextBlock Text="text block 1. "/>
<TextBlock Text="text block 2. "/>
<TextBlock Text="text block 3. " />
</StackPanel>
</Grid>
</Page>
From above code, StateTriggers property with an AdaptiveTrigger to create a declarative rule in XAML markup based on window size. By default, the StackPanel orientation is Vertical. When the window width is >= 750 and the windows height is >=900 effective pixels, the VisualState change is triggered, and the StackPanel orientation is changed to Horizontal.
26. Can it possible to make Custom Triggers in UWP?
Yes we can create our own triggers by creating a custom class inheriting from StateTriggerBase.,Custom triggers helps the developers to change the state of the Visual state of the App based on certain conditions like App size changes and change the controls to fit in to the app’s layout and need to change the controls sizes when the user uses the app in either mouse mode or touch mode and so on.
27. What is RelativePanel in Windows 10 UWP?
The RelativePanel eases the process of rearranging elements by defining relationships between elements, which allows you to build more dynamic UI without using nested layouts.
28. What is SplitView control in Windows 10 UWP?
The new SplitView control gives you a way to easily show and hide transient content. It’s commonly used for top-level navigation scenarios like the "hamburger menu", where the navigation content is hidden, and slides in when needed as the result of a user action.
29. What does URI schemes?
You can use URI (Uniform Resource Identifier) schemes to refer to app files that come from the app's package, data folders, or resources.
general form of URI scheme in WinRT
<scheme>://<domain name>/<path>
some of examples:
a. App package: (ms-appx: & ms-appx-web:)
To access files from your application package, you can use either a direct or a logical file path to refer to the resource.
some of examples:
- "ms-appx:///images/logo.png"
- "ms-appx-web:///assets/text.html"
b. App data: (ms-appdata://)
To access files stored in the app data, use the ms-appdata: scheme. App data may be stored in a local folder, a roaming folder, or a temp folder.
some of examples:
- //Local folder
- <Image Source="ms-appdata:///local/images/logo.png" />
- //Roaming folder
- <Image Source="ms-appdata:///roaming/images/logo.png" />
- //Temp folder
- <Image Source="ms-appdata:///temp/images/logo.png" />
c. App Resource: (ms-resource:)
Assuming MyImage.png is content (not embedded resource) in your MyAssembly it would be like this:
"ms-resource://MyAssembly/Files/Images/MyImage.png"
30. How to load local html files using WebView control in Windows 10 UWP App
WebView control loads the html content from the application’s package using ms-appx-web:// using network http/https. We can load the html in three ways using Source property, using Navigate method and using NavigateToString.
30. How to load local html files using WebView control in Windows 10 UWP App
WebView control loads the html content from the application’s package using ms-appx-web:// using network http/https. We can load the html in three ways using Source property, using Navigate method and using NavigateToString.
- //Load local file using 'Source' property
- WebBrowserName.Source = new Uri("ms-appx-web:///HTMLPage.html");
- //Load local file using 'Navigate' method
- WebBrowserName.Navigate(new Uri("ms-appx-web:///HTMLPage.html"));
- //Load html string using 'NavigateToString' method
- WebBrowserName.NavigateToString("<Html><Body><h1>Load local html string in windows phone winrt app.<h1><Body></Html>");
1 | StorageFile ObjStorageFile = await StorageFile.GetFileFromApplicationUriAsync( |
2 | new Uri( "ms-appx:///Assets/MyImage.png" )); |
3 |
4 | await ObjStorageFile.CopyAsync(ApplicationData.Current.LocalFolder, "MyImage.png" ); |
In above code while referencing your application image from asset folder, you must prefix application path with "ms-appx".
32. What is the major difference between URI Association and App services in Windows 10 UWP?
Both URI Association and App services are useful for UWP app can interact with another UWP application. But only difference is URI Association used when both the applications are foreground,App services are used in background task and in that case client application must be in foreground and available to use App service.
33. What is the difference between {x:Bind} and {Binding} in UWP?
x:Bind and Binding can does nearly the exact same thing. But having some below few differences:
- x:Bind lacks some of the features of {Binding}, but it runs in less time and less memory than {Binding} and supports better debugging.
- x:Bind defaults to Mode=OneTime whereas Binding will default to Mode=OneWay
- x:Bind does not use the DataContext as a default source, Binding assumes, by default, that you're binding to the DataContext of your markup page.
- {x:Bind} executes special-purpose code, which it generates at compile-time, Where {Binding} used reflection at runtime to handle binding.
34. What is x:Phase in Windows 10 UWP?
x:Phase is a new features introduced in Windows 10, it provides the ability to prioritize the rendering of XAML controls within a data template. A common scenario for this is when using a long list that has images and text, it would most likely make more sense to load the text first and then the image second. Not only would this make the page look better while scrolling but if a user scrolls quickly enough it could save having to render the images at all and improve the overall speed of the app.
35. What does SemanticZoom control in Windows 10 UWP?
The SemanticZoom control enables the user to zoom between two different views of the same content so that they can quickly navigate through a large data set. The zoomed-in view is the main view of the content. You show the complete data set in this view. The zoomed-out view is a higher-level view of the same content. You typically show the group headers for a grouped data set in this view. For example, when viewing an address book, the user could zoom in on a letter and see the names associated with that letter.
36. Why we need to use Model-View-ViewModel(MVVM) pattern?
The Model-View-ViewModel pattern can be used on all XAML platforms. Its intent is to provide a clean separation of concerns between the user interface controls and their logic.
•It is easy to redesign the UI of the application without touching the code because the view is implemented entirely in XAML. A new version of the view should work with the existing view model.
•If there is an existing implementation of the model that encapsulates existing business logic, it may be difficult or risky to change. In this scenario, the view model acts as an adapter for the model classes and enables you to avoid making any major changes to the model code.
it’s a very popular MVVM (Model-View-ViewModel) framework created by the Patterns & Practices division in Microsoft, with the goal to help developers to implement the MVVM pattern in their application and to support the most common scenarios.
Note: Now prism can support for UWP app from Prism 6 version.
40. What are different type of UI elements in UWP?
41. What are different type of Layouts in UWP?
The Model-View-ViewModel pattern can be used on all XAML platforms. Its intent is to provide a clean separation of concerns between the user interface controls and their logic.
Benefits:
•During the development process, developers and designers can work more independently and concurrently on their components. The designers can concentrate on the view, and if they are using Expression Blend, they can easily generate sample data to work with, while the developers can work on the view model and model components.
•The developers can create unit tests for the view model and the model without using the view. The unit tests for the view model can exercise exactly the same functionality as used by the view.•It is easy to redesign the UI of the application without touching the code because the view is implemented entirely in XAML. A new version of the view should work with the existing view model.
•If there is an existing implementation of the model that encapsulates existing business logic, it may be difficult or risky to change. In this scenario, the view model acts as an adapter for the model classes and enables you to avoid making any major changes to the model code.
37. What are the MVVM toolkits and frameworks available in Windows 10 UWP?
As per my knowledge, below are the most popular MVVM Toolkits that can also support for Windows 10 UWP app:- Prism 6
- MVVM Light
- Caliburn Micro
it’s a very popular MVVM (Model-View-ViewModel) framework created by the Patterns & Practices division in Microsoft, with the goal to help developers to implement the MVVM pattern in their application and to support the most common scenarios.
Note: Now prism can support for UWP app from Prism 6 version.
39. What is use of ICommand in UWP?
Typically, when you write an application without using the MVVM pattern, to manage the user’s interaction with the user interface (for example, he clicks on a button) you subscribe to a event handler: this way, a new method will be generated in code (C#) behind, which will contain the code that will be execute when the event is raised.
Typically, when you write an application without using the MVVM pattern, to manage the user’s interaction with the user interface (for example, he clicks on a button) you subscribe to a event handler: this way, a new method will be generated in code (C#) behind, which will contain the code that will be execute when the event is raised.
This approach is that it creates a strong connection between the View and the code: event handlers can be managed only in code behind, but you can’t simply move it to a ViewModel. The solution is to use commands, which are special objects (that implement the ICommand interface) that define the operation to perform when the command is executed.
Note: The Windows Runtime offers only the basic interface to support commands, which is ICommand: a developer, typically, would have to create its own class to implement this interface. However, all the MVVM frameworks usually offer it and Prism makes no exception: in this case, the class is called DelegateCommand.
40. What are different type of UI elements in UWP?
In UWP, Each page has a user interface, made up of three types of UI elements: navigation, commanding, and content elements.
A. Navigation elements help users choose the content they want to display. Examples of navigation elements include tabs and pivots, hyperlinks, and nav panes.
B. Command elements initiate actions, such as manipulating, saving, or sharing content. Examples of command elements include button and the command bar. Command elements can also include keyboard shortcuts that aren't actually visible on the screen.
C. Content elements display the app's content. For a painting app, the content might be a drawing; for a news app, the content might be a news article.
Windows 10 XAML framework provides different ways of layout system to make responsive UI.
- Fluid layout: Use layout properties and panels (Canvas, Grid, RelativePanel and StackPanel) to provide different ways to size and position their childrens.
- Adaptive layout: can help you create a dynamic responsive UI based on the height or width of the device or screen. Ex: AdaptiveTrigger
- Tailored layout: A tailored layout is optimized for a specific device family or range of screen sizes. Within the device family, the layout should still respond and adapt to changes within the range of supported window sizes. For exmple with Continuum for Phones, users can connect their phones to a monitor, mouse, and keyboard. This capability blurs the lines between phone and desktop device families.
In a VariableSizedWrapGrid, elements are arranged in rows or columns that automatically wrap to a new row or column when the MaximumRowsOrColumns value is reached. The Orientation property specifies whether the grid adds its items in rows or columns before wrapping.
If Orientation value is vertical:
Item 1 | Item 4 | Item 7 |
Item 2 | Item 5 | Item 8 |
Item 3 | Item 6 | Item 9 |
Item 1 | Item 2 | Item 3 |
Item 4 | Item 5 | Item 6 |
Item 7 | Item 8 | Item 9 |
Auto: Takes as much space as needed by the contained control. And it will make the each row/column size so it can fit whatever is contained in it.
"Star(*)": means stretch row/column size to fill the available space, and is a fraction, so if one row is * and the other row is 2* then the second row will be twice the size of the first row.
So for example, you may have two rows, bottom row has a button and is Auto (only as high as the button) and the top row is "*" - stretches to the remaining space available.
<Grid>44. How to make sleep for specific time in UWP App Development?
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Button Content="Test" Grid.Row="1" />
</Grid>
Previously in Silverlight windows phone, Thread.Sleep() Method was used to suspends the current thread for the specified amount of time, but it is not available for Windows 10 UWP App framework. So alternative is to use the Task.Delay() method instead.
For example to make app to sleep for 5 seconds, we can write below code in UWP:
1 | await Task.Delay(TimeSpan.FromSeconds(5)); |
45. What is Contextual Sensing in Windows 10?
Contextual Sensing introduced With Windows 10, now developers can build apps with newly available APIs that can sense user activities such as walking, driving and working out.
There are several APIs available for contextual sensing
Detection APIs: These APIs attempt to detect activity states based on current motion of your customer, such as Walking, Running, In Vehicle, Biking, Stationary, and Idle.
Pedometer API: which counts the user’s steps both when walking and running. As with activity detection, you can access history details for up to 30 days.
Barometer API: it can reports atmospheric pressure.
Proximity API: that can enable a device to wake up or log off based upon the user’s proximity, turn off the display during a phone call, ignore pocket clicks made then the device is in the user’s pocket, and detect gestures.
Altimeter API: that reports relative altitude i.e. changes in elevation.
46. What is Light Sensor In Windows 10 Universal App?
light sensor is a type of environmental sensor that allow apps to respond to changes in the user's environment.
47. How to display text on console in UWP on Windows 10?
We can write text to console by using Debug.WriteLine() method which is available System.Diagnostics namespace
1 | System.Diagnostics.Debug.WriteLine ("Your Message Here "); |
48.What is Data Virtualization in Windows 10 UWP?
When we want to work with large set of data, it is not best practices to store all large date in memory at one time and you would be face out of memory issue or which can lead to poor performance.
In this case, you can use data virtualization to get only a subset of the data to work on demand. By default, the ListView and GridView controls support UI virtualization of the elements in the list.
49.When can UI virtualization behavior breaks in Windows 10 UWP?
Make sure you keep these two things in mind when using ListView and GridView, which can cause UI virtualization to break:
- Don't place ListView/GridView inside of a ScollViewer control. Becuase by default ScrollViewer’s child elements completely expand to take as much space as they need. It can breaks the UI virtualization behavior, as all items will be realized.
- If you provide a custom ItemsPanel Template to change layout behavior of ListView/GridView then make sure you use a virtualizing panel such as ItemsWrapGrid and ItemsStackPanel. If you use VariableSizedWrapGrid, WrapGrid, or StackPanel, then you will not get virtualization.
System.Net.Http.HttpClient: It is available from Windows, Windows phone 8 onwards,we can use this If you are going to develop app with cross platform such as iOS, Android. This API sppports Xamarin IOS and Android development.
Windows.Web.Http.HttpClient: It was first introduced in Windows 8.1 and was available on Windows Phone 8.1 as well. So primary focus it can support all windows store languages(C#, VB, C++, JavaScript) into a single one that supports all the features from each of those APIs. We can use this If you are going to develop native UI or pass specific SSL certificates for Authentication.
In next part, I will explain more UWP advanced interview questions. And also suggested to read all previous windows phone (Both silverlight and WinRT) interview questions from below links
- Top Windows Phone interview questions c# - Part1
- Top Windows Phone interview questions c# - Part2
- Windows App Development Tips:Top Basics for Beginners(C#-XAML)
All the very best for your interview :)
FeedBack Note:Please share your thoughts,what you think about this post,Is this post really helpful for you?I always welcome if you drop comments on this post and it would be impressive.
Follow me always at @Subramanyam_B Have a nice day by Subramanyam Raju :)
Advertisemen
Tidak ada komentar:
Posting Komentar