Capture screen of Windows store App - windows-runtime

Is it possible to capture the contents of running Windows store app? I need to capture the entire screen or a user defined rectangular area.
The application will provide share option
When the application is running and share option is selected, I want to get the screen shot periodically say 4 times in a second
This screen shot image will be posted to server, which will store the same

It's now possible in Windows 8.1 to capture the screen of a Store App. You need to use the RenderTargetBitmap class.
You can find an example here:
http://mariusbancila.ro/blog/2013/11/05/render-the-screen-of-a-windows-store-app-to-a-bitmap-in-windows-8-1/
Hope it helps.

You can't capture screen programatically. See the below threads from MSDN.
Programmatically take snap shot Windows RT.
How to capture screen in Metro app?

There is no built-in mechanism to render Windows 8 XAML UI to a bitmap in Windows 8.0. Depending on how complicated your UI is you could implement your own composition engine to render your UI to a bitmap using Direct2D or use the WinRT XAML Toolkit WriteableBitmap.Render() method implementation which has a limited support for doing what you ask (it doesn't render all types of controls, doesn't support RenderTransform, etc.). You could update it though to add support for the missing features.
Windows 8.1 APIs include the new 'RenderTargetBitmap' class that allows to render to a bitmap with its RenderAsync methods.

Related

windows phone 8.1 music library get current media queue

How to get current media queue in windows phone 8.1 (runtime) as in windows phone 8 MediaPlayer.Queue
Is it available or we have to implement?
Similarly IsShuffled functionality is there ?
The MediaPlayer API belongs to the Microsoft.Xna.Framework.Media namespace which is no longer available for WinRT components. So you can't use it but you can implement your own logic for it using the MediaElement API which has sufficient properties for a media player except for the logic of queuing etc.
The explanation here and the msdn-code-sample would surely help you out.
For background music player you should use the SystemMediaTransportControls API and attach the events that occur when your app is running in background.
This link has a background audio explanation. Seems helpful.

Is it possible to create a headless accessibility tool for windows phone?

We've just successfully created an accessibility app for android (think screen reader) that works across all applications without needing to first launch a specific app, via the accessibility service.
Is it possible to create an equivalent headless service for Windows Phone? UIAutomation is available for WinRT but I don't think it's available for Windows Phone 8.1 or 10 in the same way. How could I achieve something like this?
It's currently not possible to build a system-wide accessibility app on Windows Phone 8.x (or 10 for that matter). Please consider adding a suggestion on UserVoice.

Where has App.Current.Host gone in Universal Windows Phone 8.1 apps?

Trying to handle multi-resolution images in a Windows Phone Universal App I came across this article from Microsoft.
Unfortunately it only applies to Windows Phone 8 and Windows Phone Silverlight 8.1.
When using the code samples they mention of:
private static bool IsWvga
{
get
{
return App.Current.Host.Content.ScaleFactor == 100;
}
}
In this case App.Current doesn't have a Host property - Host presumably being the SilverlightHost property mentioned here.
Has anyone found a way to do the equivalent in an 8.1 Universal App?
If you want to handle image scaling then it is handled by folder name in Windows Phone 8.1 Universal Apps. Here is how:
To use these images in XAML you just give the file name and the OS does the rest.
<Image Grid.Row="1" Grid.Column="0" Source="wpimages/resolution.jpg" VerticalAlignment="Top" Width="100"/>
An additional method is simply to have multiple copies of the image at different scales and to name them in the same way as the folders i.e resolution.scale-100.jpg, resolution.scale-240.jpg. You still name the file the same in your XAML.
I will share an article on that in the future.
Quick update about Universal Windows Apps (UWP, Apps for Windows 10).
Microsoft extended the automatic scaling support in UWP and now supports more different scales (probably the most complete list is here - around 16 different, from 100% to 500%).
According to the article Porting Windows Runtime 8.x XAML and UI to UWP you just need to use 100/200/400:
Providing assets at 100%-scale, 200%-scale, and 400%-scale (in that priority order) will give you excellent results in most cases at all the intermediate scale factors.
Additionally, UWP supports different qualifiers (languages, scales, etc).
Please read How to name resources using qualifiers (XAML)
On the personal side, I prefer to keep images in one folder, just to make life easier. It is easy to check if you have all the resolutions, it is easy to manage images (copy/delete/etc). Folders is way to go for Android, filenames - for iOS, Windows 10 supports both ways and it's great!

trying to load page with WinJS controls into IE 10.0

From VS2012, I right click on default.html page and choose to run this page in IE (10.0). Problem is that any WinJS controls that I have on the page aren't been displayed. I get a warning about Allowing ActiveX script where I allow to run the ActiveX script. Can windows 8 store app build with javascript should be able to run in IE 10.0?
WinJS is not meant to be a browser based application.
Windows Store apps are meant solely to be run in the WinRT environment.
If you explore WinJS, you'll see it calls into the Windows namespace which are the actual WinRT JavaScript projections - ie the translations from the C++ COM based API into in this case JavaScript.
So then the next question is what are you trying to accomplish? If you have a common code base to run in the browser, then don't have dependencies on WinJS or the built in style sheets.
Remember though,Windows Store apps have specific design recommendations that may not be the best for a browser based application, although thats your call.
If you post separately what you are trying to accomplish though to run in the browser and in your Windows Store app, we can try to help you make the best design decision.
Since that is a separate question than what's provided here, I'd say sign up for App Builder http://aka.ms/stackbuilder and check out the free design guidance you get from there, plus check my profile, I'm available for free time each week (oHours) and would be happy to go over this with you via skype, phone, etc
Unfortunately you can't, firstly due to licence of winjs (details here: http://social.msdn.microsoft.com/Forums/en-US/winappswithhtml5/thread/dbdabf29-206d-4d93-a491-b5e8fcd6a920/) and secondly because winjs is rather tightly coupled with winrt.
One alternative I found is http://www.bluesky.io/ which allows you to run winjs compatible code in browser. Not sure how it works in practice though.

Flash Builder: Mobile AS3 Project or Mobile Flex Project?

This month I started to play with Flash Builder because I don't have a mac to create native iPhone apps.
I have made a Flex Mobile Project and an AS3 Mobile project. Both do mostly exact the same and I see great differences in operation speed (AS3 version is much faster). Also the size of the AS3 version is less than the size of the Flex version when I deploy the project.
But one thing disappoints me, the size of a deployed AS3 app (Android) is still about 8MB. I think that is quite huge for a simple app, or is it normal? I did not test the iOS version because I am not an Apple Developer member (is there a trick to deploy an iOS app with fake certificates)?
Resources I have used in the apps:
Two images approx. 35kb in size
A StageWebView
I want to know:
What is the average size of a simple app when it is a native app (apk file)?
What is the difference between an AS3 app and a Flex app except the libraries that re used?
Is the AS3 app converted to C or another language?
Why is the apk so huge (IMO)?
Is there a trick to deploy an iOS app with fake certificates? (just for testing)
Thanks for the answer(s).
What is the average size of a simple app when it is native app (apk file)?
I have no idea. When you were comparing sizes; did you export a release build or a debug version? The full version of my app; using Captive Runtime is 12MB. That includes all the embedded images. I thought that roughly 8MB is the size of the embedded runtime. Of course, if you don't use Captive Runtime then the app will be smaller; but it will have a depency on the user having the runtime installed.
What is the difference between an AS3 app and a Flex app except the libraries that are used?
For all intents and purposes nothing. The Flex Framework will need to execute code to setup the framework and such. In theory this 'impact' is offset by the value that the framework brings.
- Is the AS3 app converted to C or other language?
Not for Android or Playbook. It relies on the Mobile AIR Runtime--which I assume is written as a native app somehow. For iOS there is a more in depth conversion taking place; but no on knows the exact magic sauce; but it the process is much more intensive than Android or Playbook and people believe that your code and the AIR Runtime is converted to Objective C somehow in a way that is not in violation of the Apple licensing agreement.
Why is the apk so huge (IMO)?
Huge is open to interpretation. Without seeing your full app code; it's tough to judge.
Is there a trick to deploy an iOS app with fake certificates? (just for testing)
I don't think so; although there may be possibilities on unlocked devices.
You would like to use Mobile AS3 Project if you want you apps to be smaller and your GUI mainly contains vector graphics and Mobile Flex Project if you prefer to use standart GUI Controls that comes together with Flex framework but adds overhead in size because of controls that come with it.
As of the other questions:
the size of the apps is different on mobile platforms. Typical iOS app is about 2MB - 20MB. It really depends on resources you store with your app. What might be important to you is not to overcome 20MB if not needed because 20MB+ apps require Wi-Fi connection to be downloaded.
(However you should export release build version only as mentioned by www.Flextras.com)
there is no fundamental difference between AS3 and Flex apps - they both compile to the same instructions that executes on targeted mobile platform.
as far as I know (being iOS developer myself) there is no workaround to deploy an iOS apps. You need to use Mac and become Apple Developer to deploy with valid certificate.
to make your app smaller try to pai special attention to the resources you add to the project. Although I believe the size is so big because of framework itself, you would like to use more vector graphics vs. bitmaps when compiling apps with Flash/Flex.
When you export for Android you have an option of embedding the air framework in the application, that way your users don't have to download air. you can export your application without air embed which will result in a much lighter application, however your users will need to download air runtime. http://cookbooks.adobe.com/post_How_do_I_create_an_AIR_application_for_Android_tha-19299.html