Android: send data to website and receive reply

2019-09-01 17:33发布

问题:

I am working on an lotery app. The hit is to send the coupon number to the lotery server and receive the result (winner price or not). The web ( http://www.telekino.com.ar/ ) has a simple form with three values: emision,cupon,algo

This is the form:

After fill the form, the web reply the results

I am lost, what is the best way to duplicate this? . Send the form and receive the results.

Suggestion? tutorials?

Form

orm action="/cupones/controlar" id="control_frm" method="post" accept-charset="utf-8"><div style="display:none;"><input type="hidden" name="_method" value="POST" /></div>              <label for="sorteo">Sorteo</label>
            <select name="data[Cupon][emision]" id="sorteo" class="basic-tooltip"><label for="carton">Número de Cartón</label>
            <input name="data[Cupon][cupon]" type="text" id="carton" value="número" title="Ingrese el número SIN puntos." class="basic-tooltip" />              <label for="algoritmo">Algoritmo</label>
            <input name="data[Cupon][algo]" type="text" id="algoritmo" value="últimos 2 números" maxlength="2" />               <img id="algorithm-help" src="/img/algoritmo.png" alt="últimos 2 números" width="135" />
            <button type="submit" id="control_button">Controlá tu cartón</button>
            </form>

回答1:

I think you should use Asp.Net Web API for server-side if you prefer Asp.Net (C#, VB.Net)



回答2:

The easiest and probably best way used in android to communicate with web service is by using Volley Library and PHP, MySql web service See this tutorial