Send My gps location to Webservices

3

Good afternoon

I am developing an app that is almost finished, there is a part of my app where I get my GPS location, latitude and longitude, and I keep them in 2 Texview , but I need to send those data that are in my Textview through webservices, I have the class Assynctask where I send to call the necessary methods to send to record certain information in which the coordinates must go.

The question is how can I access my data that I have in my Textview so I can send them through the webservices.

This is where I send my method call within Assynctask ... and that's where I should send my gps location:

Resultado = webService.LLenarEncabezadoCXCP(Recurso,
                                           "I",    //Accion I
                                            0,      //Id = 0
                                            O_Cliente.getEmpresa(), //Id de Empresa
                                            Folio,
                                            new Date(),
                                            O_Cliente.getCliente(),
                                            O_Cliente.getProveedor(),
                                            O_Cliente.getMoneda(),
                                            1.0,      //Tipo de Cambio por default 1
                                            0,      //Cuenta Bancaria
                                            "hugo", //Usuario Captura
                                            6,          //Pago Forma
                                            Total,          //Saldo
                                            Importe,    //Importe
                                            0,          //Financiamiento
                                            Descuento,
                                            SubTotal,
                                            Retencion1,
                                            Retencion2,
                                            IEPS,
                                            IVA,
                                            0,          //ISH,
                                            Total,      //Total
                                            Total,      //totalaplicado,
                                            "A",        //status,
                                            "",         //usucariocancela,
                                            0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,   //Numero1...Numero10
                    String.valueOf(lblLatitud), String.valueOf(lblLongitud),"","","","","","","","",                      //Texto1...Texto10
                                            new Date(),new Date(),new Date(),new Date(),new Date(),new Date(),  //Fecha1...Texto6
                                            "",         //Observacion
                                            0,0,0,0,0,0,         //Catalogo1...Catalogo6
                                            "",         //ordencompra
                                            0,          //concepto
                                            "",         //observacioncancelacion
                                            0,          //origenventacompra,
                                            0           //origeninventario
                                            );
            if (Resultado.equals("OK"))
            {
            for(int i=0;i<DetalleArrayList.size();i++) {



                if (((DetalleCxP)DetalleArrayList.get(i)).TotalAplicado>0)
                {
                    DFactor = ((DetalleCxP)DetalleArrayList.get(i)).TotalAplicado / ((DetalleCxP)DetalleArrayList.get(i)).Total;


                    Resultado = webService.LLenarDetalleCXCP(Recurso,
                            "I", //Accion
                            0, //id
                            ((DetalleCxP)DetalleArrayList.get(i)).getId(),  //Origen
                            ((DetalleCxP)DetalleArrayList.get(i)).getDocumento(),  //OrigenDocumento
                            (Double)(((DetalleCxP)DetalleArrayList.get(i)).Importe*DFactor),   //Importe
                            (Double)0.0,  //Financiamiento
                            (Double)(((DetalleCxP)DetalleArrayList.get(i)).Descuento*DFactor), //Descuento
                            (Double)(((DetalleCxP)DetalleArrayList.get(i)).SubTotal*DFactor),   //Subtotal
                            (Double)(((DetalleCxP)DetalleArrayList.get(i)).Retencion1*DFactor), //Retencion1
                            (Double)(((DetalleCxP)DetalleArrayList.get(i)).Retencion2*DFactor),  //Retencion2
                            (Double)(((DetalleCxP)DetalleArrayList.get(i)).IEPS*DFactor),   //IEPS
                            (Double)(((DetalleCxP)DetalleArrayList.get(i)).IVA*DFactor), //IVA
                            (Double)0.0, //ISH
                            (Double)(((DetalleCxP)DetalleArrayList.get(i)).Total*DFactor),  //Total
                            ((DetalleCxP)DetalleArrayList.get(i)).getSaldo(),   //Saldo
                            "Android App"      //Referencia
                    );

                }

            }

        }
    
asked by Hugo Rodriguez 20.05.2016 в 01:24
source

1 answer

1

If your geolocation values are in a TextView you can get them this way:

String miLatitud = tvLatitud.getText().toString();

String miLongitud = tvLongitud.getText().toString();

you can store the values in variables:

webService.LLenarEncabezadoCXCP(
...
...
miLatitud, miLongitud ,
...
...
);

or directly get the value and use it in your method.

...
...
tvLatitud.getText().toString(), tvLongitud.getText().toString(),
...
...
);
    
answered by 20.05.2016 / 04:30
source