Intel XDK QRCode Scanning Issue - web

So am trying to use the barcode scanner in XDK and it WORKS except when am scanning a QRCode that contains more than one line of plain text.
For example:
If this is in the QRCode:
hey you
It gets scanned without any issues
BUT if this is in the QRCode:
hey
you
It fails. The app reacts as if nothing was scanned. Nothing is outputted.
My Code:
function scan(){
document.addEventListener("intel.xdk.device.barcode.scan",function(evt){
intel.xdk.notification.beep(1);
if (evt.success === true) {
//successful scan
//console.log(evt.codedata);
document.getElementById("data").innerHTML = String(evt.codedata);
}else {
//failed scan
document.getElementById("data").innerHTML = "Scan Operation Failed";
}
},false);
intel.xdk.device.scanBarcode();
}
I really hope you guys help me. If the XDK's QRCode scanner is just not capable of scanning multi-lines of plain text i will have to stop developing with XDK, which is a bummer.
Thanks in advance.

Just following up. This issue has now been fixed in our build system and the latest version of App Preview for Android, Windows Phone, and iOS. Please try your code again and let us know if you have any issues.

Related

Scanner (Ivanti) VELOCITY ver. 2.1.8, adding an error beep while scan an object, which is not counted in store/warehouse

community!
I use ZEBRA MC3300/android 8.1
I would really appreciate if you'll help me with one question.
The main reason I want to do it is to reduce amount of human error possibly can happen.
When VELOCITY app is on and a worker scans a barcode, there is usually plays a beep sound.
But the problem is that if a worker scans wrong barcode or an object, that is not counted in store, usually the same sound plays.
So I tried to edit this via console.
so, basically, the sound I've added works fine, but an error beep isn't playing when I try to scan any random(not our) object's barcode.
Is there a solution for my problem?
Sorry if my code looks too silly, I'm just trying to improve my workspace :(
Thanks in advance!
function replaceBeep(beepType,soundFile) {
function onBeep(event) {
if(event.type == beepType)
{
Device.beepPlayFile(soundFile);
event.eventHandled = true;
}
}
WLEvent.on("Beep", onBeep);
Device.errorBeep(1000, 300, 50, 0.5);
}
WLEvent.registerScope("session",replaceBeep,null,["2","error.wav"]);`
expecting to play separate beep sounds for wrong and right scan.

noble.state is set to "poweredOff" immediately after running the program. (Node.js Noble)

as the title suggests, I made a simple program made with Node.js and Noble to scan for devices with Bluetooth LE. My end goal here is to connect to my daydream view controller and receive information from it.
My problem is that whenever I run the file the state is set to "poweredOff" even though I set it to "poweredOn". When the state is set to "poweredOff" it stops scanning so I am never able to find devices.
Here is my code:
const noble = require('noble')
noble.on('stateChange', function(state) {
console.log("[STATE] State changed to: ", state)
if (state === 'poweredOn') {
console.log("[STATE] Powered on, now scanning")
noble.startScanning();
} else {
console.log("[STATE] Powered off, stopped scanning")
noble.stopScanning();
}
})
noble.state = "poweredOn"
// we found something
noble.on("discover", function(peripheral){
console.log(peripheral)
})
Here is the output I get after running that:
[STATE] State changed to: poweredOff
[STATE] Powered off, stopped scanning
What have I tried?
I have checked that I have all the prerequisites for Noble.
I have tried to run the examples provided by Noble. (same thing happens)
And I have tried moving noble.state = "poweredOn" above and below the noble.on('stateChange') event
I also figured out the problem is not in the daydream controller because I downloaded the LightBlue app on my phone and it detects and connects to the daydream controller just fine. I get no errors or anything at all. This is very strange to me and I hope that anyone could help me.
Thanks in advance.

Windows.UI.Popups.MessageDialog does not work for Windows 10 IoT

await new Windows.UI.Popups.MessageDialog("Test").ShowAsync();
Has anyone else noticed this? Is there an easy work around ?
I have the some problem and I did't found any trick. I made myself a MessageDialog with a and It's not so hard to build it. Try do take a look this http://bitaware.altervista.org/messagedialog-for-iot/
The unique problem is that it do not work across platforms. If you would this behavior you have to get a condition
string platform = AnalyticsInfo.VersionInfo.DeviceFamily;
if (platform == "Windows.IoT")
{
//Your code for IoT
}
else
{
//Your code for other devices
}
I know is not elegant but I think we have no other choice.
I hope it was helpful

SpeechRecognizer WinRT unwanted audio output

I am writing a WinRT app, testing it in VS 2015, x86 debug. I am getting
unwanted audio output that is not created by my application. Here is my code:
using Windows.Media.SpeechRecognition;
SpeechRecognitionResult result = await recEngine.RecognizeAsync();
//recEngine is of type SpeechRecognizer; using dictation grammar.
if (result.Confidence == SpeechRecognitionConfidence.Rejected)
return;
if (result.RawConfidence < .60)
return;
//proceed to process the speech-to-text in the result......
If I just return (have unrecognized speech), I do not get the audio output: fine. If I am successful in recognizing the speech, I process it in my app, but I also get the following audio output (in my desktop speakers):
"I do not recognize the command. Please try again".
Where is this coming from and how do I suppress it?
sorry, my mistake. I found the audio output (that I created myself).

IMFMediaPlayer hangs during SetSourceFromByteStream

Background: I'm coding a metro-styled app for Win8. I need to be able to play music-file. Because of quality and space requirements we're using encoded audio (mp3/ogg).
I'm using XAudio2 to play sound effects (.wav files), but since I couldn't figure out a way to play encoded audio with it, I decided to play the music files with Media Foundation (IMFMediaPlayer interface).
I downloaded metro apps sample, and found out that the Media Engine Native C++ video playback sample was closest to what I needed.
Now that my app has MediaPlayer playing musics, I ran into a problem. If the device running the app is slow enough, MediaPlayer hangs. When I'm running the release-version of the app on my device, it's fine and I can hear the music just fine. But when I attach the debugger or run it on a slower device, it hangs when I'm setting bytestream for the MediaPlayer to play.
Here's some code, you'll find it pretty similiar to the sample:
StorageFolder^ installedLocation = Windows::ApplicationModel::Package::Current->InstalledLocation;
m_pickFileTask = Concurrency::task<StorageFile^>(installedLocation->GetFileAsync(filename)), m_tcs.get_token());
auto player = this;
m_pickFileTask.then([player](StorageFile^ fileHandle)
{
player->SetURL(fileHandle->Path);
Concurrency::task<IRandomAccessStream^> fOpenStreamTask = Concurrency::task<IRandomAccessStream^> (fileHandle->OpenAsync(Windows::Storage::FileAccessMode::Read));
fOpenStreamTask.then([player](IRandomAccessStream^ streamHandle)
{
MEDIA::ThrowIfFailed(
player->m_spMediaEngine->Pause()
);
MEDIA::GetMediaError(player->m_spMediaEngine);
player->SetBytestream(streamHandle);
if (player->m_spMediaEngine)
{
MEDIA::ThrowIfFailed(
player->m_spEngineEx->Play()
);
MEDIA::GetMediaError(player->m_spMediaEngine);
}
}
);
}
);
And here's the SetBytestream method:
SetBytestream(IRandomAccessStream^ streamHandle)
{
if(m_spMFByteStream != nullptr)
{
m_spMFByteStream->Close();
m_spMFByteStream = nullptr;
}
MEDIA::ThrowIfFailed(
MFCreateMFByteStreamOnStreamEx((IUnknown*)streamHandle, &m_spMFByteStream)
);
MEDIA::ThrowIfFailed(
m_spEngineEx->SetSourceFromByteStream(m_spMFByteStream.Get(), m_bstrURL)
);
MEDIA::GetMediaError(m_spEngineEx);
return;
}
The line where it hangs is:
m_spEngineEx->SetSourceFromByteStream(m_spMFByteStream.Get(), m_bstrURL)
When I'm debugging the app, I can press pause and see the stack. Well, not much of it, but atleast I can see it that it's indefinitely at
ntdll.dll!77b7f4dc()
Any ideas why my app would hang in such a way?
(OPTIONAL: If you know a better way to play mp3/ogg in a c++ metro-styled app, let me know)
Could not figure out why this is happening, but I managed to code a work-a-round:
IMFSourceReader can be used to decode MP3s and feed bytes into XAudio2SourceVoice.
XAudio2 audio stream effect sample contains good example how to do this.

Resources