Send and Receive Messages between Android App and Winform application - c#

Looked for a long time and didn't find anything that showed this, so I apologize in advance I missed something.
I have an android app running on KitKat (Android 4.4.2) and a Winforms application running Windows 7. I need to send messages between the two of them.
Clearly GCM works to get the message to the Android device. I have code that sends from Winforms to the Android Device using GCM. I cannot find a way to have the Android App send anything BACK though. Is it possible to have a Winforms app RECEIVE a GCM Message? Do I have to use Azure? (All examples there seem to focus on the Windows App store and Windows 8.1 neither one of which can be a solution in this case due to client restraints.)

I'm putting this here in case anyone stumbles across it and has a similar question. This is not really an answer. Still hoping someone comes on here and shows that I am wrong. But after 26 days, no one has even offered a suggestion, so I'm guessing not.
There is no way that I have seen that allows for this the way I had hoped. Windows 7 doesn't have this built in to it (AFAIK). Windows 10 should have it built in, but Windows 7 pre-dates the huge shift to the cloud, and didn't have it in the design. If I were working with something like Xamarin -- which is a cross-platform tool, this might be possible. But there is no concept in Windows 7 for receiving messages from the Cloud.
In order to accomplish this, there would have to be some sort of server added to the mix that could take messages and pass them along via a REST API. This is beyond the scope of what I wanted to code.
The solution I found, and that works for me, is to use Microsofts API that wraps a REST service. This allows for communication to OneDrive, for example. That is what I am using as my intermediary REST server.
Microsoft LIVE SDK
This has a pretty good sample list of Android examples, and can be used for what I need. The good thing is the Upstream is just a simple call, and I don't need to have the Android device poll anything (which kills the battery). The laptop will need to poll OneDrive, but its plugged in so there is no battery life concern.
One thing to be aware of, though, is that Microsoft sort of hints that they don't want a bunch of traffic headed to OneDrive. This is from the overview doc:
Throttling
OneDrive has limits in place to make sure that individuals and apps do
not adversely affect the experience of other users. When an activity
exceeds OneDrive's limits, API requests will be rejected for a period
of time. OneDrive may also return a Retry-After header with the number
of seconds your app should wait before sending more requests.
Although, I have never seen what those limits actually are, so YMMV.

Related

Azure IoT Hubs: offline storage of messages

Is there any functionality within the Azure IoT device SDKs to ensure that a message is sent to the hub from a device in the event of a loss of connectivity and subsequent termination and restart (after connectivity is restored) of the application sending the message?
I am struggling to find anything about this in the documentation; I have found this question, however it has not been updated in nearly 2 years and I suspect (hope) things have moved on since then.
The application will be WPF, running on Windows 10 Professional if that makes any difference.
This blog has a section on the reliability features in the SDKs. We will have more documentation on this soon. You may also want to implement some heat beat mechanism so devices can auto-reboot.
One way to implement that functionality is check the callback function result and the parent (SendConfirmationCallback - IoTHubClient_LL_SendEventAsync in SDK-C). With this You can check the quantity of messages without confirmation OK and restart your process of azure or Internet connection.

Push Notification for web site

I have been tasked to add push notification for a web site being developed. Never done one before. I spent a long time googling this and I am not much closer than when I started searching, mostly because most articles describe specific details.
The web application is an intranet app and they are asking for things like when a new report is made available, let the users know about it; or basically any kind of organization/department announcements.
Can someone tell me what are the components involved in developing/deploying this type push notifications? If I know what the pieces are that make this process possible, I can take it from there. I must mention that this web application is being designed to be available on devices (desktop, tablets and phones; if this makes any difference in design/development).
You can try OneSignal Push Notification
in this you can send notifications to websites,android app and ios app
You can also check the documentation for sending notifications to website here
Hope this helps:)

Trapping probe request in universal windows app C#

I was wondering if it is possible, in a universal windows app, to monitor all the probe requests around my device. I read and tried several samples codes provided from Microsoft to locate AP, but what I would like to do is the opposite, looking for every devices that send the probe request.
I read that it is usual to use Wireshark, but it possibly does not support the monitor mode under windows, and furthermore I want to use it in an application (even if I could use TShark...).
Well, is there an API that could do the trick ? (I looked at Windows.Devices.Wifi, WifiDirect and Co)
Thanks !

Send/receive notifications

I have an Outlook add-in and a separate winform app. These two apps need to "talk" together sending/receiving notifications.
Sometimes they are on the same computer and sometimes they are on different computers. Sometimes several instances runs on the same computer by different users (RDS server). Maybe later they will need to talk to mobile apps too.
If I do no want to play around with TCPIP, what is the best and easiset way? I don't mind buying some server software that will make it easier. It must be plug-and-play.
I thought about Microsoft Notification HUB, but it doesn't seam like it works with winform.
Then there is Amazon SNS, but I have no experience if this works in winform.
Do you have any suggestions?
Well you can use SignalR to develop real time notification system it easy and you can use it cross platform because it uses websockets like node js

How does Windows Phone send image to server? (Not HTTP)

I have developed a Windows Phone application that uses camera to take pictures every second. Now I want to send these images to my Windows desktop application.
Besides images, I'm planing to send GPS data and other sensors' data to my Windows desktop application in the future.
I believe I can use System.Net.Sockets.Socket, but what I get from Socket is byte[], I don't know which part of the array is an image and which part is the next image. I need special coding.
Are there object-oriented ways to send data? Does .net remoting and WCF work on WP? What's your suggestion?
The target Windows Phone OS version can be 8 or 8.1.
Don't reinvent the wheel. Opening a socket in this case is just about the same as starting a self-hosted http server, except with the http server all your problems are solved.
While with sockets, you have a lot of protocol and headaches to solve, with the HttpServer you got a ton of proven and tested code at your back, helping you solve your problem faster, plus everyone knows Http, so it's also easier to understand and maintain.
One way could be to roll up a Self-hosted Web API

Categories

Resources