Help with String[] queryParams

3996
1
Jump to solution
01-13-2015 11:12 AM
José_I_León
New Contributor

How do I select in the numeric field "magnitud" values between 3 and 4? I've tried in the following way but does not work:

String[] queryParams = {targetServerURL, "magnitud > 3 && magnitud < 4" };

or

String[] queryParams = {targetServerURL, "magnitud > '3' && magnitud < '4' " };

Thanks!!!

Code:

private void addListenerOnButton() {

  // Obtenemos el botón de valores de magnitud entre 3 y 4

  mag34Button = (Button) findViewById(R.id.button1);

  //Establecemos un listener para capturar cuando el usuario haga clic

  mag34Button.setOnClickListener(new View.OnClickListener() {

  public void onClick(View v) {

  // Limpiamos ls elementos de la capa gráfica

  gl.removeAll();

  //Establecemos como parámetros la url y la claúsula where.

  //Para ello creamos un array de string

  String[] queryParams = {targetServerURL, "magnitud > '3'" };

  //creamos una tarea asíncrona y la lanzamos con los parámetros

  AsyncQueryTask ayncQuery = new AsyncQueryTask();

  ayncQuery.execute(queryParams);

  }

  });

0 Kudos
1 Solution

Accepted Solutions
José_I_León
New Contributor

Eureka! This works correctly:

String[] queryParams = {targetServerURL, "magnitud BETWEEN '3' AND '4'" };

View solution in original post

0 Kudos
1 Reply
José_I_León
New Contributor

Eureka! This works correctly:

String[] queryParams = {targetServerURL, "magnitud BETWEEN '3' AND '4'" };

0 Kudos