I want to add analytics to my Windows Phone 8 app and that's all fine except I now want to trace when my background agent triggers a specific event.
Does App Insights support this?
I'd like to say that Application Insights does support the scenario you are describing. Recent versions of the Application Insights should support background tasks. However, you should use the "core" package, and not the full platform package.
This core package provides all the APIs needed to send telemetry to AppInsights. It doesn't provide any of the automatic context or telemetry collection, and hence doesn't have any dependencies (for example on the dispatcher) which allows it to work on a background task.
We would love to hear more about how this scenario is working out for you.
Related
I'm working on a UWP app (C++/WinRT) that must communicate extensively with a background process. Unfortunately, the background process must remain a full trust "Win32" process. Both are packaged in an MSIX.
For performance and programmability reasons, my first choice would be to turn the background process into an out-of-process WinRT component. App Services is a possibility but not ideal.
I've found numerous code samples for creating an OOP WinRT component via WRL. However, activation is performed via CoreApplication::RunWithActivationFactories(), which (as far as I know) requires an AppContainer.
I know I can consume a WinRT component in a Win32 process. Can I create one? If so, what would activation look like in C++/WinRT?
Yes, from the Windows 10 Version 1903, May 2019 Update, the windows have added support for non-packaged desktop apps to make use of user-defined (3rd party) Windows Runtime (WinRT) Components, which means that we can consume a Winrt component from the Win32 process directly. To successfully reference a C++ Windows Runtime component from a Win32 app, you need to use C++/WinRT to generate projection header files of your component. You can then include these header files in your app code to call your component.
For the detailed information, please refer to this article:
https://blogs.windows.com/windowsdeveloper/2019/04/30/enhancing-non-packaged-desktop-apps-using-windows-runtime-components/.
For the detailed sample, please refer to here:
https://github.com/microsoft/RegFree_WinRT/tree/master/Cpp.
Thanks.
I am developing a widget/app for the gear s3 smartwatch. In particular, I would like to build something similar to the Alarm widget that comes pre-installed on the gear.
What I can't find is any information about is connecting to the phone and getting alarm info. There are android java api's for doing this (on a phone device), but, again, I can't find anything for a native tizen app on the gear s3.
Any info, pointers, etc. greatly appreciated.
TIA
ken
(PS: I do know that the tizen IDE comes with a sample alarm widget, but it is only a GUI, no functional code. That's what I need.)
Sorry guys. I guess I wasn't clear enough: 1) I have built the "alarm widget" sample- it is mostly the GUI part (see #2); 2) the "alarms" that you have pointed out are really just "timed callbacks". They have nothing to do with the alarms available on the phone's clock app.
I did find something about "com.android.alarmclock" on github (here). How does one get access to something like that via tizen c?
See this link on how to develop Tizen Wearable Native Widget Application.
https://developer.tizen.org/development/training/native-application/getting-started/creating-your-first-tizen-wearable-native-widget-application
Alarm Sample Overview with code hint
https://developer.tizen.org/development/sample/native/AppFW/Alarm
API: The Alarm API allows setting an "alarm clock" for the delivery of a notification at some point in the future.
https://developer.tizen.org/development/api-references/native-application?redirect=/dev-guide/latest/org.tizen.native.mobile.apireference/group__CAPI__ALARM__MODULE.html
I found this on github (https://github.com/aosp-mirror/platform_packages_apps_alarmclock/tree/master/src/com/android/alarmclock) This is pretty much what I need. Now I just have to translate from android/java to tizen/c. For the latter this (https://developer.samsung.com/galaxy/accessory) will also be useful, although it might not look so.
Just to clarify and maybe help with the next poster: I really should have been more careful when using the word "alarm". I know about the alarm api's in tizen, but as mentioned these are specific to one app instance. I really wanted to communicate with an app running on the connected phone - ie, the alarmclock app.
Recently I began working in WinRT for Windows Store Apps (and the upcoming Windows 10 Universal Apps) using C#. After working in .NET for awhile previously, I was excited to work with .NET on mobile devices, only to find that WinRT did not feel like home at all.
Constantly I find myself having to search for alternatives to certain classes that I'm familiar with in .NET since often they're not the same or even implemented in WinRT. I figure that the lack of implementation derives from the fact that WinRT at its core is unmanaged, even though the CLR binds to it from managed code.
My question is: What is stopping Microsoft from allowing developers to import and use all of the familiar .NET classes from managed code, even with WinRT running from behind? I know it's not a limitation of the device because my Surface Pro can run desktop .NET apps just fine and the Mono project has succeeded in porting almost the entire .NET API to devices of every kind.
Thanks for your input!
This is a big topic but there are three basic reasons why you don't get the full .NET API from a Windows Store app.
The APIs don't fit on smaller devices like phones. Since the purpose of the Universal Windows Platform is to have apps that can run everywhere, it can't include APIs that are too resource-intensive (disk, memory, CPU, etc.) to run on smaller devices. (Note that even if the managed API appears to be small, it might have a dependency on a large underlying Win32 API).
The APIs aren't compatible with the Store app model. Many APIs that require permissions not granted to Store apps fall into this category, as do APIs that would enable apps to do "unwanted" things to your machine (the degree of "unwantedness" is subjective).
The APIs are deprecated or there are newer alternatives. This was the case with a lot of APIs in Windows 8, where things like file-system access and network sockets were blocked from Store apps because there were newer WinRT equivalents.
Note that Microsoft is always open to re-evaluating whether a specific API should be included or not. For example, Windows 10 brings back many APIs that were banned from Windows 8.1 (such as System.IO and System.Net.Sockets) and has expanded the capabilities granted to apps. You can file feedback via the Windows Feedback app or on UserVoice if you want additional APIs brought back (adding detailed justification never hurts).
I have created a Flex Desktop Application with Adobe Air.
I need to protect the application from being captured. By changing the window display affinity of the application, the application can be protected from being captured.
How to use win API in flex?
Is there any other way to protect the window from being captured?
First you have to make sure that the main window does not have the WS_EX_LAYERED Windows style. That style makes SetWindowDisplayAffinity fails with code 8 (ERROR_NOT_ENOUGH_MEMORY), at least on my machine (Seven Pro 64 bits). In your -app.xml file, set the value to false for the node <transparent> under <initialWindow>.
Second, you have to choose how to inject a regular C DLL in the application process, as the API will fail with error 5 (ERROR_ACCESS_DENIED) if you try to change the affinity of a window not living in the caller process.
One possible injection method is using the SetWindowsHookEx API. Google will give you many hits about that one. Feel free to ask for some details. You obviously needs cooperation of another process, here (and some Win32 APIs practice).
Another possible way is coding an 'ACTIONSCRIPT® Extensions for ADOBE® AIR®' (PDF).
The later seems preferable:
No collaboration from an external process needed.
Adobe AIR does the DLL loading for you.
C/C++ code much more simple.
I used the first technique, as I am more fluent in raw Win32 APIs about DLL, than I am with AIR and Action Script...
I successfully tested that first technique with a very simple "Hello World" AIR Desktop application, and get a nice "All Black" image after Print Screen.
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.