Send and receive data from MySQL with Android

0

And, peace of mind? I have an activity that is listing a series of products from a MySQL database. I need to click on any of these products, transfer to another activity, take the product ID together, and for that collected ID, search the MySQL database. MySQL and return me the details of that product. I am able to pass the ID to second activity, I just can not get this ID, play in php, search MySQL and return JSON pro android results.

In the first activity I am able to pass the ID:

    @Override
 public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

    String pid = ((TextView) view.findViewById(R.id.pid)).getText().toString();

    Intent in = new Intent(getApplicationContext(), DetalhesLivro.class);

    in.putExtra("pid", pid);

    startActivity(in);
 }

On the second, I recover:

EditText txtID;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_detalhes_livro);


    Intent i = getIntent();

    pid = i.getStringExtra("pid");

    //Teste para ver se está pegando o ID
    //Jogando o ID num EditText
    txtID = (EditText) findViewById(R.id.inputID);
    txtID.setText(pid);
}

My problem is thereafter. I need to play this ID in php and return the results to me.

    
asked by anonymous 14.04.2015 / 19:07

0 answers