How can I determine what does my mobile application require? - c#

I'm confused between native apps and web apps in the mobile context. I don't know if I go with native mobile development then do I need to know HTML, CSS, and JavaScript. If not then how can I make that app connect to database online for example?
If I want to build an application for chatting on mobiles. Something like WhatsApp! Will knowing a programming language (e.g. Java on Android and C# on Windows Phone) will be enough to build something like that? or what other components are necessary to add?

Native apps tend to be more recommended for android apps as they are faster as it is running what it was intended i.e. java code, html web apps tend to be slower.
For what you want to do, a chat app, then a native android app, (using java code) will probably work best then trying to do it as a web app.
You would need to learn about Http connections for your chat application. If you are accessing a database, such as MySQL, then you would need to have PHP code running on a web service where the Android app can access the database.
As an example, if your application, need to query the database, then you would tell the Android app to post to the web server running the PHP code. The PHP code would run the query on the MySQL database, and the result set should be json encoded and echo'd out, that way, Android will receive the json encoded content. Then you would need to decode the json to process what was returned in some way.
Hope this helps.

For android you will need to learn Java and XML, and if you want to make a chatting application for all or either platforms you must learn SQL, (including php).

Related

I want to send a string from an android device to a windows machine over wifi with c#. Is this possible?

I want to make a program that transmits strings from an Android device, to the web or directly to my PC.
Do note that the android and windows device are connected to the same wifi if this makes a difference. The problem here is that I do not know how to send strings from one device to another. I am thinking of doing it in a txt file and then reading it with the program on my PC (Which I have already tested), but I don't know how to transmit it.
Yes, you can share a data from cross platform devices. There are many methods to do it. I would personally recommend using Web APIs using asp.net core, the consume that Web API in your android application, it can be in Xamarin, and for Desktop you can used HttpClient package to consume either in WPF or Winform.

Webservices and Server-Client Connection with Windows Phone in C#

I have a local test server on my pc on which I already filled a MySQL database. Now I would like to receive this data with my Windows Phone app and represent the data.
Currently, I've made ​​it awkward. I have a PHP script on my server that represents the database. The app fetches the source code and parses it with the Html Agility Pack.
But this version is too complicated right? How can I do it better? I know something with webservices, but I do not know so much of them. Can someone explain to me in more detail? I heard from OData, but what should I do on my Apache Server and what should I do in my C# App? For the C# App there are examples. I feel so dumb because I really know nothing about web-services. And the most tutorials don't help me.
You can implement SOA (Service Oriented Architecture). You should have a look to WCF :
WCF Tutorial for beginners
The idea of web services is pretty simple. You store some services on a server (services = C# functions) and you consume them on your client (which is you windows phone app).

How can I implement a C# server that receives JSON data and how to POST it?

I have a phonegap iOS app which has a form that, when submitted, it should post some json data to a server and get a response. I have to use C# on the server side and listen somehow when the json is posted from the form in the phonegap app, do some stuff with the data and then respond to the phonegap app. How can I implement the c# server and how should I post the data from my html form? I am experienced in c# desktop applications, but I am really new to everything related to web stuff. The ios app is running in an iphone simulator on a mac in my local network. I have searched for resources but I haven't been able to do this and have been trying for a while. I think I don't need the whole code, just advice on how to do it and what to use.
Any help will be greatly appreciated.
Thanks.
ASP.NET Web Api is exactly what you need. It's a framework for creating web APIs that receive and respond to requests coming through the web, which of course includes JSON data.
ASP.Net MVC and/or ASP.Net WebAPI are perfect for this. Check out the resources at http://asp.net.
The MS Web API won't help with writing a server.
You don't need to write your own server, but you can if you so choose.
Setup and run IIS.
Make a simple ASP.NET Web Forms application
Handle the Page_Load event
Read the value of your json from the posted data using Request.Form["json"]; or whatever you called your posted fields.
System.Web.Script.Serialization.JavaScriptSerializer will help to deserialize your json. Just make a class for your types. You'll have add a reference to System.Web.Extensions.
Publish your application to IIS.
I can highly recommend ServiceStack. It's highly testable, easy to host, and in my experience magnitudes faster than any of the MS web service platforms. Plus, as you don't state what platform your server is, ServiceStack can be hosted on both Windows and Linux systems.
https://github.com/ServiceStack/ServiceStack/wiki/Mono
https://github.com/ServiceStack/ServiceStack/wiki/Self-hosting

Google App Engine ASP.net

I am new to Google App Engine. What i really need to go is host my web service which is written in ASP.net & C# on google app engine.
My web service gets a string and translate that string from already stored translated values in the database which is SQL server 2008 R2. This translated string is in the form of spans. i then return the string.
thanks
The Google App Engine currently supports applications written in Python, Java and Go and won't run ASP.net applications unless some heavy magic (such as compiling it to Java bytecode) is involved and I'm not aware of anything that can do that specific trick.
Maybe you should consider Microsoft's Azure. It's kind of an equivalent PaaS solution, but will play with Microsoft's stack.
Note: Google has since added PHP support.
Note: Now Google has the "custom runtime" that allows you to host pretty much anything you can run on a Linux machine.
It should now be possible to host ASP.NET applications on App Engine. Use the custom runtime feature on App Engine and Microsoft's ASP.NET Docker image with your application. Also, you need to create a route for /_ah/health and respond with HTTP status code 200 and a blank message body (see lifecycle events).
You can not host C# applications.
Google App Engine is focused in supporting three application environments only: Java, Python and Go.
Additionally App Engine applications can also be written in any JVM-compatible language (e.g. JRuby, Groovy, Scala, etc.) and run in a Java 6 runtime environment.

Connecting C# Back-end with PHP frontend

I have a code written in C# I would like to use as the back-end of a site I'm building.
I would prefer not to build the site front-end in ASP.NET (which integrates nicely with C#), and to use PHP or Python instead.
Is that reasonable? Should I re-consider using ASP.NET?
How can I achieve that?
Just use asp.net mvc framework for the frontend instead of plain asp.net. It's easy to learn. And if you know php it will be easy to you undestand asp.net mvc.
I don't see the reasons if you are using c# backend use php frontend. For sure you can create service layer on c# and communicate with php through it, but it does not make sence for me.
You can do whatever you like. Personally i wouldnt use php because i dont know very much php.
But you can do it, you could expose a soap web service and there are libraries that will let php talk to it.
No one here will be able to tell you what you haven't already told us. Asp.Net will probably be easier because of how everything integrates and you can share classes etc - but that does not mean you HAVE to use it.
Both of them are fairly passive server side technologies that present html to browsers though. why do you need 2 servers?
You have to ask why you are doing it .. if you are playing and want to learn then of course you can do it just to see how it all works. But if you are on a commercial project then id suggest that you dont need both a php and a c# server ... or if you do perhaps you want to go asp.net for your web server and if you need another layer of services behind then use WCF if you want to go a microsoft route. Howver it is usually possible to host all services in the same IIs instance.
You can do this i have done this for a web site my self use a database server or files,
http://dtpgroup.co.uk/
Your C# application can connection to your store save the info it needs to then php can read them if it file just use a formatted file E.G
if your using Database php can connect to MySQL or MSSQL so your C# application can use MySQL if you know what your doing in C# if not and your more comfortable in php then use MSSQL (also php have the superior documentation )
I work in both frequently
Ugh, in normal instances, reading data with C# writing it to files and loading up with PHP sound slow, inefficient and down wright crazy. I believe these terms are being used wrongly.
Client Server - user machine - database great for private networks where you connect to the DB without going over the internet
vs n-Tier
Client - Browser programming html, css, javascript connects to middleware over the internet
Middleware - inside your firewall, connects browser to database could be called part of backend - php and C# are middleware languages
Database final (generally 3rd) tier
With php and c# you are creating multiple middleware layers
why why why would you do this for a web app pick one
now if you have a web app with PHP and sneakerware in house client server apps that are controlled ie shipping, accounting that are not exposed - maybe but you have added complexity that you would not need (generally)
Gary

Categories