Expression<TDelegate>.Compile() on Windows Phone 8 - windows-phone-8

As stated in the doc, this method is not supported on WP8. But I tried it anyway and it works in the emulator. I dont have a test device right now, has anybody tried it already?

Expression.Compile was not supported in WP7, since it depended on Reflection.Emit which was not included in WP7. WP8 however now supports Expression.Compile. The Simple Injector IoC framework for instance, makes use of this internally and supports WP8 and Windows Store Apps.

Related

Is indexedDB available on Windows Phone 8.1?

Maybe a weird question as you would probably say, just Google it but I can't find a clear statement. When I do window.indexedDB or windows.msIndexedDB I get an undefined error. That would imply it's not available.
However, when I look at this page: http://msdn.microsoft.com/en-us/library/windows/apps/jj553412.aspx I get the feeling it should be available. Also when I check here: http://docs.phonegap.com/en/3.5.0/cordova_storage_storage.md.html#Storage it says that indexedDB is available on Windows Phone 8 (no mention of 8.1 though). So it seems to be supported or is it only supported when using PhoneGap? Or was it supported in version 8 and did they remove it in 8.1?
IndexedDB is not yet supported by Windows Phone 8.1, but there is a cordova-plugin-indexeddb shim based on WebSql.
To install the plugin use
cordova plugin add com.msopentech.indexeddb
Their WebSQL plugin works well too. It seems to implement WebSQL pretty well. The only difference I've noticed so far is that they don't support the readTransaction method (only transaction).

EventHandlerList does not exist on Windows Phone

i bumped into issue when I wanted to use EventHandlerList in Windows Phone application. Errro occured telling me it was not found even though msdn claims it is supposed to exist on WP platform. http://msdn.microsoft.com/pl-pl/library/system.componentmodel.eventhandlerlist%28v=vs.110%29.aspx Do you happen to know what I;m doing wrong?
The link you provided does not mention support of Windows Phone anywhere in the documentation.
Please be aware that Windows Phone 8 uses a subset of the .NET 4.5 framework, so not everything is present.

Using Flash Player in Windows HTML5 app

While looking over the Adobe Flash Player/AIR Roadmap (found here) I saw this:
"Flash Player release and debug players are available and supported for Windows 8 Desktop and Modern UI experiences on both x86/64 and ARM platforms."
Which got me thinking about a potential method that apps for Windows 8 might be able to be released using Flash Player.
Currently, using AIR, you can build apps for Android and iOS, as well as for Windows Desktop. But Windows 8 Modern UI and Windows Phone 8 are both unsupported platforms.
So the idea was this. If IE 10 for Modern UI supports Flash Player, and if HTML5 Modern UI Windows apps use IE under the hood in order to run, then supposedly you could wrap a Flash Player app inside of an HTML5 app, and then, voilĂ , you'd have a Windows Modern UI app running off of ActionScript. (Though it still wouldn't work for Windows Phone 8.)
Well, I have tested this, and (sadly) it doesn't work. I would almost bet that this isn't because the functionality isn't there, but rather it is because of some switch on the backend that prevents this functionality from being used.
So, finally, here is my question, mainly to sate my curiosity on the subject. Does anyone know whether or not such a backend switch exists, and if so, is there a way to switch it?
I have tried the same thing as you and no, I don't think such a switch exists.
I can only assume Microsoft has purposely blocked off ActiveX controls on purpose, since Silverlight also does not work in HTML5 apps.
It is sort of possible that with Windows 8.1 Update 1, they may change this, but I believe it opens up a lot of problems for them from a security / app store catalogue perspective, so would be unlikely.

Starting with audio in Windows Phone 8

I recently started doing some development in the Windows Phone 8 OS I'm pretty new on this. I was doing some searching about the fact to create an app who play any audio for some specific events/actions.
I was reading the Windows Phone API reference from Windows Phone Dev Center http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff626516%28v=vs.105%29.aspx#BKMK_Win32andCOMAPIforWindowsPhone
But it seems a little confusing to me at first glance and I have the doubt of which one of the following should I use to accomplish my task.
The .Net API for Windows Phone
Win 32 and COM API
... or the Windows Phone Runtime API
Any help would be very appreciate
It really depends what you're trying to do. If you're writing a native application or are interested in cross-compatability with Windows 8 then XAudio2 or the WinRT APIs are definitely the way to go. If you just want to play some infrequent sounds (say, when you pop up a warning dialog) from within a XAML app then I have seen a number of approaches, teh easiest of which is probably just having a MediaElement in your XAML that you use to play the audio.

Windows Phone 8 - Simulate touchscreen events

What would be the best approach to simulate a user tapping on a touchscreen of a Windows Phone 8 device?
One approach I could imagine is to use native code to call the Win32 API functions which control the mouse events. This would assume that touchscreen events are more or less the same as mouse events, and that these API functions are accessible. Does anyone know if this is the case on WP8?
Another approach would be to have something like the Android ADB for the Windows Phone. On Android, one can use ADB to control the device from the PC and also simulate touch screen events (e.g. via Monkeyrunner). I haven't found any information if there is a tool like ADB for Windows Phone 8.
The purpose of finding a solution for this is the integration of Windows Phone 8 devices in an automated testing process.
I found out that there is a DLL file named InputInjection.dll in the System32 folder of the Windows Phone 8 (at least in the simulator image I mounted).
This library contains the following functions:
ApiInjectInitialize
ApiInjectTouchEvent
ApiInjectButtonEvent
ApiInjectEnableExclusive
ApiInjectUninitialize
Doing some research, I found out that there are official ways to simulate touch input for Windows 8 development:
http://social.technet.microsoft.com/wiki/contents/articles/6460.simulating-touch-input-in-windows-8-preview-versions-using-touch-injection-api-en-us.aspx
http://msdn.microsoft.com/library/windows/desktop/hh802896(v=vs.85).aspx
However, the functions used for Windows 8 development are not available on Windows Phone 8. But the functions are named similarly to the ones I found in InputInjection.dll:
InitializeTouchInjection similar to ApiInjectInitialize
InjectTouchInput similar to ApiInjectTouchEvent
(...)
I wasn't able to find any documentation on InputInjection.dll and its functions. These functions also don't appear in the header files of the SDK. Maybe Microsoft uses these functions internally for their own tests during Windows Phone development.
The question is: Is it possible to access this library and call these functions somehow? This would be similar to using "Private APIs" on iOS, I guess. I tried several ways to achieve this with a Windows Phone 8 app using native C++ code, but I had no luck so far (the basic reason is that the apps run sandboxed on Windows Phone). Is there any way to get a binary running on Windows Phone (maybe via a debug bridge or something)?
You can access all those API's From Win32 Service/ Kernel Driver. Include the header file to your source code and Library of injection method it will work