How to communicate mobile (Xamarin) with a desktop Application (.NET) - xamarin

Is it possible to send some kind of message from mobile app (developed using Xamarin.forms with C#) to a desktop application (developed using VB.net or C#)? I would like to send messages from mobile to desktop app. I was thinking on using Bluetooth or maybe WIFI protocol
Other idea that I was thinkin is making desktop application to use a rest service, then also make mobile app to use same rest server. In this way It could be possible to create some kind of bridge between these techs.
Do you have any example or any experience on this?

You can create a web API https://learn.microsoft.com/en-us/aspnet/web-api/overview/older-versions/build-restful-apis-with-aspnet-web-api then host it on your desktop/laptop. That would be the channel between your mobile app and your desktop app.

Related

How do I enable loopback for a UWP Windows 10 app as TCP server?

I’m working on Windows 10 with a Universal Windows (UWP) app.
I’m using a StreamSocketListener in the UWP app to listen as a server.
I enabled “Internet (Client)” and “Private Networks (Client & Server) in the app manifest.
I used CheckNetIsolation.exe tool to enable loopback for my UWP app.
This works: sending TCP messages to the UWP app from remote machines.
This fails, but I NEED IT TO WORK: sending TCP messages to the StreamSocketListener in the UWP app from the local machine.
The CheckNetIsolation.exe tool seems to have no effect for UWP app as a server. I need to have the UWP app as a server in order to send messages to the app from a local service.
Some bad choices I could make as workaround:
I could have the app poll the service, but that's very poor and expensive architecture choice.
I could message the app from a remote machine, but that complicates things and (for complicated reasons) is very undesirable solution.
Can I fix the UWP as TCP server with a registry edit?
c:\>checknetisolation loopbackexempt -a -n=package family name
UWP Enable local network loopback

Why do whatsapp web application needs phone connection all the time?

WhatsApp just announced a new web application see here.
For some reason, the interface requires the phone to be connected all the time. Is it for performance reasons (not to create additional load on their current servers)? Is there any other constraint that cause that?
The official explanation:
Your session on WhatsApp Web is an extension of WhatsApp on your
phone. WhatsApp Web connects to your phone to sync messages, thus you
can see all messages on both devices. Thus, the first requirement to
being able to use WhatsApp Web is an active WhatsApp account on your
smartphone.
Source: https://www.whatsapp.com/faq/en/web/28080002
As you may know your Whatsapp history is only being stored in a database on the phone itself. To see that history in your web browser, it needs to get it from the phone. Whatsapp could have redesigned it, so that everything is stored in the cloud (as many competing messaging apps do). But that seems to be against their philosophy. They keep it tighly coupled to a (one) phone. As you may know you cannot install Whatsapp on multiple phones using the same account. The web interface is just a remote for Whatsapp running on your phone.
And even though I don't know for sure, I think it's more secure too. It wouldn't surprise me if the data that's sent between the web app and the phone is encrypted in a way that even Whatsapp themselves cannot decrypt. Maybe the QR code is generated client-side (in the browser) and by scanning it using the app there is no need to exchange the keys through Whatsapp's servers. That way they don't ever get the encryption keys and will not be able to inspect the data that gets routed through their servers.
Note: Of course Whatsapp could at any time change their implementation of both the app or the web app and enable eavesdropping.

Running an app on Azure and protecting signups

I'm about to finish an app that will run on Windows Phone and Android. It uses an azure web API and push notification service.
I was wondering if there is any standard or recommended way of protecting the 'signup' or 'register' functionality within an app like this? I note that some popular apps like snapchat will send you a text to verify the registration process. That would be ideal but obviously seems unfeasible for a modest app such as mine :-)
Can anyone enlighten me to some common ways to protect the 'register' functionality of a mobile app?
Thanks for any help!
Azure provides feature sets like Azure Mobile Services that provide authentication features that you can use in your Windows Phone apps. I doubt the authentication Azure Mobile Services uses is restricted to just Azure Mobile Services, but more information on getting started with this authentication can be found here:
http://azure.microsoft.com/en-us/develop/mobile/resources-wp8/#header-2

Is it possible to make use of mspn service without registering to app hub for testing my app?

i am about to develop a windows phone app that makes use of mspn service. I haven't registerd to app hub. Is it possible to make use of mspn service without registering to app hub for testing my app?
I believe so. (At least I remember testing this back in June 2010 - before registration was open.)
Have you tried?
There's nothing in the notification process which requires any reference to anything to do with your app hub registration, unless you need SSL or very large volume but you can easily test wihtout these.

Phone7 Communicating over the teather

Is it possible to have a phone7 application communicate with a desktop application via the USB tether?
Nope. This functionality is not possible unless the desktop app is running a web service or can recieve communication over HTTP.
There is currently no other way to do this.
It is possible if you decide to sniff the USB traffic and see the model by which the exchange occurs (e.g. phone -> Zune Client). This is what some applications do (e.g. the unofficial phone explorer).
Directly via the exposed API - not really.

Resources