Read/send data in android and c# Bluetooth Communication : c# <-> Android - c#

I have developed a web application in C# and an android app. Web app(c#) is acting as a server and attached to SQL server 2008 R2 while android is acting as client and it communicates with web app(C#) via bluetooth( bluetooth coding is done in c# winforms).
Now one thing I know is that android cannot directly communicate with SQL database for it I have to utilize web service. I wanted to authenticate my android app login/register from web app(C#)
My winform(C#) in which bluetooth(using feet32 library) functionality is implement should act as an agent between client(android) and server(C#).
Now I wanted to know that:
How my winform application will act as an agent to communicate with client and server both and read/send data to and fro.
If I need web service to implement then in which application I should write in webapp or winform?
I wanted to authenticate my android app login/register from web app(C#). I f I have to write for it webservice then whether I will write it in web app or winform?
I am just a beginner and its my final project. Please help me to understand the complete scenario and my knowledge is too little and also if there is any good tutorial for any of these functionality please do mention the link ..
Thanks
Edited: After little Research I come to know about SOAP http web service, What you guys think where to implement this web service according to above questions.

To establish communication between two devices by using Web services you don't have to use winform application.
You can establish a connection via web services, just create a new ASP.NET project using visual studio then add a Web service and folloe the template it gives you.
Right click on the service, click on view in browser, verify there is no any error. The address of this browser is the address of your service just connect to this service from the second device.
Please check out this guideline: CodeProject Web Service

Try ICE, It got excellent cross platform support and is open source. I have been using it for last four years to communicate between c++ and C# applications.
ICE for .Net
ICE for Android

Related

WCF Service hosted in internet

I have a desktop app with WinForms.
Now I need to create an app that could collect data from my desktop app via internet. I mean that it is shuld be hosted somewhere in inetrnet
For example data is: is app online/ofline, and some information about computer where desktop client is launched.
And also I will need to develop a site where I can look throught this data.(think it will be ASP.NET)
I'm going to use WCF.
Is it good idea?
Maybe there are some other technologes?
WCF is good idea. but if your application will use only http protocol then you should gave preference to web api.

Best Approach to communicate between a Windows forms application written in C# and Native Android App

so our company wrote an accounting app,in windows,using c# for a certain company that ordered an accounting application.
after a while,they requested an android app that can communicate with the server and request or send data from or to the database that the windows form application uses,which uses SQLExpress 2014.
note that : the application that runs on the android platform may need run on more than one client at any given time.
AND
the android app will be native.
my main question is this : whats the best technology to use?
do i HAVE to use web services ?
well to do that i have to install IIS on the windows client which is
all im trying to avoid,because i have a setup and the program has been
mass produced within the city so i cant just take back every
customer's product and add iis setup procedures to the setup...if u
know what i mean
Not true. Since WCF days, there's an in-process option called XXX self-host which is a tiny web server written in C# and started along with your process using code.
Currently your best web should be developing your Web services using OWIN/Katana self-host and implement your RESTful service running on a Windows service (did you know about TopShelf?).
Check this interesting MSDN article to learn more about self-hosting a Web API into a Windows Service using Topshelf.
TL;DR
Your best bet here would be creating a Windows service which might be installed along with the Windows application or in some customer's server machine and host this way your RESTful Web service using ASP.NET Web API.
This is easy to deploy and distribute, and your customer won't require an IIS installed to host web services.

server side framework for ios apps

I am new to the IOS app development. I go through the apple developer portal they use Objective -C as their server side framework.
The main problem is I need to develop the app in one month and I know C# web service or java server side framework.
Does these frameworks are supported by the iOS apps API. Please suggest me.
And if possible give me some reference for these existing frameworks.
Thanks in advance
Usually an App communicates via an HTTP service (usually a REST service) with a server. The server can be written in any language which can be used to provide a REST service. For example ASP.NET Web API if you are familiar with .NET and C#

Consuming a WCF RestFul API from android not from wifi connection

I have just completed my first WCF REST api that makes use of JSon for posting data back to a client app. As part of the dev process I made a quick sample c# forms app for testing. I serialize the incoming Json response and bind to gridview. An example would be of retrieving Balances for the associated ID's of accounts. I have yet to host this, but the idea is to host it on a client server, and for them to be able to develop 3rd party apps.
I really really want to develop a simple sample Windows Phone or Android app, for showcasing as well as learning how to access this hosted service. I have found plenty of articles on accessing via being connected to wifi. But, say I want to develop an app and distribute this on an app store. For users connecting via mobile connection, say 4G, how would this be achieved? If I host via IIS on a server, would I be able to use the URL in a client Android/Windows phone etc. app, authenticate via an API key and retrieve the data?
Please can someone advise on how to go about or where to start please?
Thanks in advance.
You would buy windows web hosting and deploy the WCF REST app there, it would be available on a global domain like http://myapp.com/wcf-app.
Android & iPhone apps would connect to the global address and view the information from the JSON requests, as could any one with a browser.

Good way of communicating between web and desktop app

I want my web app (running in a browser) to, at some point, communicate (bidirectionally) with a desktop app (in Windows), the client has installed in its computer.
What's an elegant and modular and simple way of doing this (with Java and C#)?
Not much information will be passed between the web app and the desktop app. Just something like "I was here", "Pick this from this point", etc.
I solved that problem by using a database on the network.
All communications where made trough the database.
Website -> DB -> User logged in <- DB <- Desktop
However, if no trusted information needs to be shared, you could consider just posting and reading some http headers to a common website, or a simple log file.
Greetings
I suggest you to use the backend part of your webapp, assuming that your app is based on some backend services.
You have two options:
Your desktop apps use the same services of your web app. You must use a class that mimic a web-browser to give the data (curl, ie). If your web app is based on AJAX push ( APE Server i.e ) use library that is able to run some javascript
Use a REST protocol, with a JSON format in your backend services. It's easy to manage and is supported by many client-side languages (java/c#/python....)
Use a specialized endpoint only for your desktop app,for C#, you can use WCF, that allow you, in one of his forms bidirectional communications. For JAVA, there are WSDL, DWR
My preferred solution is to decouple the web app in a front-end side and a backend side, that expose the services as REST that are used by the web app via AJAX.
If I need true bidirectional communication with other desktop app, I'll create a separate service / endpoint for it. (APE , WCF, ..)
I see several options to achieve part of what you are asking:
Besically you expose the relevant parts of your apps (web and desktop) via some sort of API and use that for the communication - for example DB and/or WCF (SOAP/REST/whatever).
BEWARE:
If you are after some sort of direct/interactive communication between both apps on the same computer then this won't be possible - at least not without some security related issues.
The browser executes your web app in a sandbox which doesn't allow for direct communication between the web app and the desktop... there are technologies which can help circumvent that (ActiveX, signed Java applets, some Flash technology called AIR etc.)... or you could host some webbrowser/control in your desktop app which in turn runs the web app... BUT basically I would recommend against using any such measures...
IF you really want to go this route then please describe your environment and goal with much more detail.

Categories

Resources