Run function in app from ms band - c#

So I've had a look around and I cant seem to find an answer anywhere so here goes. Is it possible with the MS Band SDK to run a function within my app when the user taps a button?

Currently (at the time of writing) there is no way for the user to directly interact with a tile-app and thus pass a response to the application installed on the phone*
Your options are (as I see it):
To use the sensors to define 'gestures'**
Guide the user to use Cortana to provide speech commands ***
*This might change, but due to the very little storage capacity on the band if this was added I would assume only very basic interaction such as yes/no/cancel dialogos etc. and simpler responses using the keyboard when/if it becomes available for third party tiles.
**There is currently a bug with background work so you might have to prevent the lock screen from locking while receiving and interpreting sensor data on the phone which will impact the battery on the phone. This is expected to be fixed soon.
*** Speech commands are well supported on Windows Phone but I'm unsure how well supported they are on iOS and Android

Related

Put the calculator on TopMost C# [duplicate]

I'm developing a Windows 10 Universal app (UWP).
Is it possible to set application as TopMost (always on top)? Like WPF or Winforms (TopMost property).
Thanks
A feature called CompactOverlay mode was added in the Creators Update that supports this type of functionality. When an app window enters compact overlay mode it’ll be shown above other windows so it won’t get blocked. This allows users to continue to keep an eye on your app's content even when they are working with something else. The canonical example of an app taking advantage of this feature is a media player or a video chat app.
A blog post describing the feature can be found here
https://blogs.msdn.microsoft.com/universal-windows-app-model/2017/02/11/compactoverlay-mode-aka-picture-in-picture/
Short answer is no, there is no way as of today to make the application modal.
There is a petition going around asking for this functionality, which was requested last December but given the amount of votes it got (35 at the time this answer was written), it doesn't look like it will be taken into consideration anytime soon.
As mentioned in the comments, this functionality would be PC only so even if it was added, my assumption would be that it wouldn't work outside of the PC mode (so no tablet, mobile or surface family device support).
It's not possible UWP apps have some restrictions compared with WPF of Win32 apps(classic apps).
With uwp apps you need enable some capabilities to do something special in your app as you can see in the link uwp apps need ask for permission or they can't access or modify files directly.
https://msdn.microsoft.com/en-us/library/windows/apps/mt270968.aspx
Best Regards

Windows 10 access keyboard light on laptop

I recently purchased a lenovo t420 laptop. I upgraded it with an SSD and did the update from 7 to 10. I then installed a clean image of windows 10, without all the bloatware. I would like to have access to the keyboard light without installing the Lenovo software. It isnt a backlight but is a single white LED next to the camera above the display. I see it come on for a split second when I cold boot the machine, I'm assuming this is part of the POST test or similar boot process and as such I would think there would be some way for me to connect to it.
I have tried using the new Lamp class in the windows 10 UWP API, and that doesnt work. I also tried using the device enumeration method and that doesnt show anything that looks like the LED.
Here is the code I tried so far, condensed a bit.
Lamp lamp = await Lamp.GetDefaultAsync();
this reults in lamp = null
string selectorString = Lamp.GetDeviceSelector();
DeviceInformationCollection devices = await DeviceInformation.FindAllAsync(selectorString);
this also results in null
this is the device enumeration code:
DeviceInformationCollection devices = devices = await light.EnumerateDevices();
This gives me about 291 different devices in the collection, none of which seem to match. I have held back on posting here as the list is long but can if requested.
Is there any way for me to access the LED through C#, if not C# than perhaps another language?
EDIT: I just found the keyboard key, I had bad info before, its Fn + Pgup. That works so i guess I dont need to write something myself but I am still curious as to why I cant find a hook to it.
As a learning exercise I would still like to know how to access the LED.
Ok, so I think this is as close as I am going to get to an answer and I would like to put it here for any future curious minds.
Here is a link to a page with a bunch of info on how to get at the ThinkLight from Linux and Windows.
http://www.thinkwiki.org/wiki/ThinkLight
And here is the important stuff in case the link breaks.
Controlling the ThinkLight with the keyboard works on all systems since it relies on the BIOS exclusively. Just press Fn+PageUp to toggle its state between on and off.
Starting with the ##30 series models (T430, T530, W530, etc), the keystroke was changed to Fn+Space in order to better accommodate the new 6-row keyboard layout. On models with backlit keyboards, there are 4 states: off, dim backlit, full backlit, and full backlit w/ ThinkLight. Models without backlit keyboards only have ThinkLight on and ThinkLight off, which can be obtained by disabling the backlit keyboard in the BIOS of models with backlit keyboards installed.
Software Control via thinkpad-acp
Software Control via thinkpad-acpi
Support for controlling the light with ACPI is provided by thinkpad-acpi. After installing it, a simple
# echo 255 > /sys/class/leds/tpacpi\:\:thinklight/brightness
switches it on and a
# echo 0 > /sys/class/leds/tpacpi\:\:thinklight/brightness
switches it off again.
This allows one to control the light in scripts. Unfortunately, no known ThinkPad comes with a light sensor (yet). ;)
To use these controls in scripts without root permissions, you should run
# chmod 666 /sys/class/leds/tpacpi\:\:thinklight/brightness, which is probably best done using udev.
Applications
led-notification: Pidgin plugin to use any LED to indicate new
messages. I've forked led-notification to support the ThinkLight via
thinkpad-acpi. The plugins below either weren't compatible with the
latest pidgin or didn't compile for me. The original author of
led-notification seems MIA. Another fork pidgin-led-notification to
write user defined strings (added to Gentoo/Linux)
gaim-thinklight: If you are using GAIM, the gaim-thinklight plugin
will enable you to use the ThinkLight as an indicator for new
messages. This depends on thinkpad-acpi.
gaim-lighthink: gaim-lightthink is an alternative to gaim-thinklight.
pidgin-blinklight:pidgin-blinklight is a replacement for
gaim-lighthink intended for use with Pidgin.
rocklight: rocklight is a xmms visualization plugin that makes the
ThinkLight flash to the beat of your music. The package also includes
a standalone stroboscope mode program.
thinkblinkd:[1] Thinkblinkd is a python daemon to control the
thinklight (and possibly other lights on your Thinkpad) it comes with
the daemon and a control script.
The script for theft alarm using HDAPS optionally flashes the
ThinkLight when the alarm is armed (disabled by default, to enable
set $use_light=1).
kopete-thinklight:[2] This plugin for kopete will enable the usage of
the thinklight as notifiaction for new messages. stupid little hack
to blink the ThinkLight: [3] A little C program that may be set SUID
so that you can use it from non-privileged programs that needs to do
a little notification.
thinkalert: [4] Another C program that may be set SUID to allow
non-privileged programs to manipulate the ThinkLight. Adds some
features over the "stupid little hack to blink the ThinkLight"
program.
thinklight-notification: This Evolution plugin notifies the user with
a blinking light whenever a new message has arrived.
ThinkBlink: blink.sh is an universal bash script making ThinkLight
blink. It can be used with any application.
Windows support
Likewise, controlling the ThinkLight with the keyboard works without any additional software. The Hotkey Features software from IBM/Lenovo adds OSD icons that appear when the light is turned on/off.
Software control via Hotkey Features
The Hotkey Features software exposes an interface that allows (among other things) to control the ThinkLight. See Python script for Windows to control ThinkPad features for more information

C# Windows Universal 10 TopMost Window

I'm developing a Windows 10 Universal app (UWP).
Is it possible to set application as TopMost (always on top)? Like WPF or Winforms (TopMost property).
Thanks
A feature called CompactOverlay mode was added in the Creators Update that supports this type of functionality. When an app window enters compact overlay mode it’ll be shown above other windows so it won’t get blocked. This allows users to continue to keep an eye on your app's content even when they are working with something else. The canonical example of an app taking advantage of this feature is a media player or a video chat app.
A blog post describing the feature can be found here
https://blogs.msdn.microsoft.com/universal-windows-app-model/2017/02/11/compactoverlay-mode-aka-picture-in-picture/
Short answer is no, there is no way as of today to make the application modal.
There is a petition going around asking for this functionality, which was requested last December but given the amount of votes it got (35 at the time this answer was written), it doesn't look like it will be taken into consideration anytime soon.
As mentioned in the comments, this functionality would be PC only so even if it was added, my assumption would be that it wouldn't work outside of the PC mode (so no tablet, mobile or surface family device support).
It's not possible UWP apps have some restrictions compared with WPF of Win32 apps(classic apps).
With uwp apps you need enable some capabilities to do something special in your app as you can see in the link uwp apps need ask for permission or they can't access or modify files directly.
https://msdn.microsoft.com/en-us/library/windows/apps/mt270968.aspx
Best Regards

Custom WinRT app running during lock screen (instead of default Slide show)

Any chance to make it possible to build special WinRT application that would run in lock screen mode on Windows 8 like it "works" for default Slide show option setting?
I don't think this is possible. The Win 8.1 API lets you provide an rss feed of images that fuel the lockscreen slideshow, but you don't appear to be able to provide your own app to replace the lockscreen background.
I agree this would be really useful. The lockscreen could be used to turn your device into an ambient data source. For example, custom slideshows, streams of social network posts & pictures, graphs tracking stats you care about (stocks, server load etc.), streams of trending headlines etc.
You can do things with Badges, such as outlined here and here. Unfortunately, I don't think you can do exactly what you are asking, aside from possibly disabling the Lock Screen and building a facsimile of your own, though I don't know to what extent this will be allowed in the store, and will likely be largely up to the users settings with regards to things like working on battery or not.

Want to know about the best framework available for my app

I am trying to design a new application which basically aims at providing biometric authentication services. What I want to do is that the app will present the user with an interface where the user can get his eye scanned for authentication. The most important feature I want to incorporate is that the user need not have a webcam, the app must be able to read the eye from the display device i.e. CRT or LCD screen itself.
I want info about the best framework available for this. Once successfully tested, I am planning to provide it as a webservice. Any one who will help me will get a royalty from my income.
I think you're want Microsofts new multi-eye monitors. This is a special version of Multi-Touch intended for eye validation, much like how Microsoft Surface is intended for surface finger interaction. For example, you can just lay an eye on the table, and the table can sense the eye is there and validate it, using blue-tooth or whatever. I saw a demo where this guy just shakes his eye near the table and it validated him. I was so cool. SDK's will be available for Retina, Iris, etc.
I know for a fact that there has not been a lot of work done in this area, but the potential is big. I wish you luck.
The best way to do this is to use (old) monitors with electron tubes (LCD screens are not suited for your purpose). By applying a rectifier for the electric current input, swapping the polarity of the cable set to the electron tube and focussing the electron ray to a radio button on your user interface where the user is required to stare at you can make sure that the ray hits directly his eye and is reflected back to a small canvas you need on your UI (users should look a bit cross-eyed for this purpose). The electron pressure paints the retina layout directly to the canvas and you can read it out as a simple bitmap. No special SDK required.
You might try Apple's new iEye. This fantastic, magical add-on to the iPad rests on the eye, and is operated via a single easy-to-use button at the bottom of the device. Unfortunately, it only works with the iPad, and the SDK is proprietary.
I don't get you.
How do you propose the image of the eye is collected without some kind of image capture device.
A bog standard 'display device' is an 'output device' as opposed to an 'input device' - this means there would be no signal.
Are you talking mobile phone apps, custom manufacture eye scanning devices, desktop pc's?
please elaborate.
aaah Patrick Karcher - has the correct answer. plus one for that - i should have been more prepared for coming to stackoverflow on april fool's day.
If you mean getting images from devices without using encoders and drivers, have a look at TWAIN (Technology Without Any Interface). and it's faq.
The most important feature I want to incorporate is that the user need not have a webcam, the app must be able to read the eye from the display device i.e. CRT or LCD screen itself.
are you sure it's possible with the current CRT and LCD technologies? i think you have to have a reading device.
more info from TWAIN.org:
The TWAIN initiative was originally launched in 1992 by leading industry vendors who recognized a need for a standard software protocol and applications programming interface (API) that regulates communication between software applications and imaging devices (the source of the data). TWAIN defines that standard. The three key elements in TWAIN are the application software, the Source Manager software and the Data Source software. The application uses the TWAIN toolkit which is shipped for free.
good lucks.
I know this is an April Fools, but... Actually, if you remove the condition about the fact that it must come from a CRT or LCD screen it might be possible to do it without image capture device attached to their computer.
Possibly using their facebook username and some red-eye photos of them (reflection of the flash off the back of the retina) + a lot of luck and R+D.
Authentication then might simply come from some way of proving that you are the person in the photo.

Categories