I'm developing a Bluetooth app using UWP framework under Visual Studio 2017. Everything is going well thanks to Microsoft Example (C# SDK Example BluetoothLE well written).
During my fourth day of development, the API BluetoothLEDevice.FromIdAsync in the line:
bluetoothLeDevice = await
BluetoothLEDevice.FromIdAsync(bleDeviceToConnect.Id);
Is no longer working, neither in my app, neither in the original sample from Microsoft I'm using as example (I don't touch anything on it).
I don't understand as I changed nothing (in my project properties, neither any Windows update on my computer). When I call the function, it just never return.
I tried my Bluetooth object used with some smartphone app, and my hardware is working well.
The call is made in a try but no exception is catch, the function just never return (and I wait some time, I don't even have a timeout).
Have you seen this? Any input on how to solve it?
I'm totaly stuck and can't go ahead as I can't connect at all any object now...
If your code and the example code are having the same problem, the only reasons can be that your device is not available.
It is out of reach or even switched off or already connected.
It can also be that if you are using the deviceManager or deviceWatcher, your OS is providing stale information.
For BluetoothLE the windows deviceManager and watcher are nothing but trouble.
Windows sometimes keeps the pairing information and connection status, even if the device is out of reach or switched off.
Many times you have to remove and and re-add your device in settings to make it available again or a restart is needed.
To save you from all these troubles, I advise you to use the advertisementWatcher.
If your device is found by the advertisementWatcher you know it is in reach and connectable, and there is no need to add your BLE-device in settings.
If needed I can provide a simple example.
This may happen because of COM security (as you may know UWPAPI based on WinRTYY which works above COM). This should help.
Hello All and thank you for your help on this.
I got a shot on an other computer and it works just fine.
I double check this morning and found out that even Widnows can't connect to anything over Bluetooth (I tried with the Bluetooth Speaker I'm usually using).
It was a Driver issue, I don't know how it happens, but my computer Driver just stop working, and I add to reinstall it.
Related
I cannot find any definitive information anywhere but the System.Windows.Forms.SendKeys class appears to have been blocked / disabled / depreciated in Windows 10.
I wrote a demo program that monitors the users keystrokes and if a user enters a known code it will pop up a form and then go off to a document database and return various strings (company names / addresses / contact lists etc) and replace the typed code with the retrieved string. SendWait is used to send the retrieved strings to whatever program typed the code.
I built the program on the companies Windows 7 desktops but when I ran it on my personal Windows 10 system it didn't work. A lot of reading later and I feel like a complete idiot but I cant let them take this project any further knowing that they wont be on Win7 forever.
So my question is has this sort of functionality definitely been disabled in Windows 10 or is there another way or method I would be able to use to achieve this behavior of inserting text into running programs.
Any help appreciated.
I found this Forum-Thread:
https://www.tenforums.com/software-apps/49635-sendkeys-not-working-windows-10-a.html
SendKeys is Blocked in W10. In W8.1 it still works.
There are other anoying things, like not allowing App to Read or Wright to Drive C. The "file" is there but W10 "hides" it or simply not allowing to access it.
There are Netwok problems also, not allowing App to work on LAN environement.
Well, my opinion is that W10 behaves like Malware to user PC. Useless.
They had no solution.
It looks as if Sendkeys works with some apps and not others. I can automate an older app by sending it keystrokes but newer apps like Chrome don't respond. The inconsistent behavior has seriously messed up scripts that worked fine under Win 7.
I have not found any official documentation that says that Sendkeys has been deprecated so the inconsistency looks to be a Windows 10 bug.
So using the following diagram:
You can see that the only time when anything breaks is when I use ClickOnce in Windows 10, however the notifications work perfectly fine if I run it directly from the exe. When I run it using ClickOnce using the console I can see the same methods get hit in the console but the notifications don't show up. I have tried to get this fixed for a very long time now with no avail.
The click once is deployed to a network share. The ClickOnce notifications work fine on Windows 8. I have absolutely no idea what could be causing this.
So got into discussion with someone I know at Microsoft and it looks like in the latest version (that he said should be released somewhere in November 2015) should contain the fix for this issue.
Waiting it out and hopefully the fix comes, if not I will contact him again and see how things are going as I would say this is a really bad problem.
I am working on a Windows Phone 8.1 application. I am about a month into the project and have seen little to no issues with what I have written so far.
I decided to do some testing on the application without running it through the VS 2013 debugger. Now, for some reason, the app crashes before it gets to the first screen. I get no exceptions or messages whatsoever(I am using Raygun for error logging).
I am using async methods throughout(some async void, others async Task), but all of this works when debugging.
The main thing that would help, is to get some sort of error message. I've been reduced to commenting out sections of code, but ultimately this is getting me nowhere because it seems when I think I've found the issue, I get another crash further down into the code.
At one point, I found an issue with calling: ListView.UpdateLayout(). I commented this out and the app would run properly no crashes. I then un-commented some code further down and now it's crashing again.
If anyone knows of a way to get exceptions from the phone or if someone has experienced this issue before, any help would be greatly appreciated. I can provide any further information that is needed.
UPDATE:
I think I have narrowed the issue down to Sqlite.NET. I am using Sqlite.Net for WinRT along with an extension called SqliteNetExtensions. The particular statement is
DataContext.Context.Connection.Table<Message>().Where(m => m.ChannelID == channelID && m.ChannelID.Contains("C")).ToList();
If I comment this out, the app runs with no problems. This LINQ statement at most returns 100 records. I would not think that a 100 record SELECT statement could cause the app to crash, but it seems like the culprit. Any ideas on how to optimize Sqlite.NET?
UPDATE 2:
Finally figured it out! It was not SQLite at all. It was not my code at all. It was my phone. I am running a Nokia Lumia Icon. I had installed Rudy Huyn's Lockscreen Beta a few weeks back. It caused some issues when I uninstalled it but it wasn't related to my application. Today, I had my business partner install my app on his phone, he has the same model phone. The app was about 50x faster and did not crash. I restored my phone from factory and, lo and behold, it ran perfectly. So, pro tip: DO NOT INSTALL LOCKSCREEN BETA BY RUDY HUYN!!!
As an aside, I would take the time to ensure you always avoid using async void. It is well documented that async void is often a recipe for trouble.
There is a good article on the disadvantages shown here
I have been tasked with doing this application:
So far: I have a J2SE application which builds a bluetooth service and waits for an incoming connection.
A J2ME application which searches for the service and when a match is found, it streams images clicking continuously with the phone's camera. The J2SE app accepts the images and displays them on the desktop machine.
But according to my project specification, I need the desktop application to be developed in C#.
What I tried?
I tried to read the J2SE code line by line and reproduce the same in C#. After googling around I found that 32Feet library was a good choice. So I went ahead and read the documentation which has code samples in VB, and tried to implement it in C#. It started well with me discovering the local device successfully but eventually i got stuck in the part related to the creation of Bluetooth service.
While most of the terminology is same with ServiceRecord, UUID/GUID etc...but I have failed miserably. Moreover I tested some code which works in VB but fails in C#. Even I tried OBEX...(a small file transfer test) which worked yesterday but fails today with an exception.
Now I am contemplating of starting from scratch all over again. Can someone help me please in suggesting ways to proceed further. I mean in what tools/library/environment should i opt for. What is the best and reliable way to develop the desktop app in C# with the J2ME app already developed.
Help required please. All suggestions even small ones are welcome. I am relatively new to both Bluetooth and C#. I have some experience in Java and J2ME.
Its sad to see that you wish to leave back those libraries you did used and spend alot worty time tinkering with it.
Rather than leaving that effort, try to resolve it. Let us know what exceptions/errors your facing with those libs.
Many experts here shall surely help you with it. Or talk to the developer of those libs for any help needed.
Hope this kind of helps Bluetooth in C#, Which stack, Which SDK?
Is there a way to make Windows Mobile not use the main phone app? I have my own phone app that I want to handle phone transactions for a business device.
My app works fine (detects the call and can hang up), but the main phone app still wants to allow the user to answer a call normally. I can try to hide the incoming call window or programmatically press the ignore key, but that is a bit clunky.
Basically, I need a way to make the built in phone app not know about incoming calls.
Any advice would be appreciated!
In case it matters I am using a Symbol MC70 running Windows Mobile 5.
Thanks!
EDIT: Thanks to djhowell's answer to this question I now know that the offending app is cprog.exe. But apparently it is hard to kill because services.exe keeps bringing it back.
First of all, you should not do it. Replacing system dialer will create you more troubles than you can expect.
If you still want to do it, there is no nice way to do it, even if you opt to use RIL directly. So, there is a trick in which you create a dummy cprog.exe (which does absolutely nothing), and put in the root folder . After the phone boots, that program will be started instead of the native one that is located in the \Windows folder. Then no program will be listening for incoming calls.
I would recommend asking Symbol (actually Motorola), they may have insight into your problem. I work with MC3090's and they were helpful before.