Hola chic@s estoy teniendo problemas con esta linea , me parece que makehttprequest esta obsoleta he estado buscando mucha info por internet y no encuentro nada, agradeceria algo de ayuda gracias
public class MainActivity extends AppCompatActivity {
private ProgressDialog dialog;
ListView lv;
JSONParser jParser = new JSONParser();
ArrayList<HashMap<String, String>> productsList;
private static String url = "http://192.168.2.19/android/control/jquery.php";
private static final String imagen = "imagen";
private static final String posicion = "posicion";
private static final String hora = "hora";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
productsList=new ArrayList<HashMap<String, String>>();
JSONArray products = null;
new LoadAllProducts().execute();
lv = findViewById(R.id.list);
lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
Toast toas=Toast.makeText(getApplicationContext(),lv.getChildCount(),Toast.LENGTH_SHORT);
toas.show();
}
});
}
class LoadAllProducts extends AsyncTask<String,String,String>{
@Override
protected void onPreExecute() {
super.onPreExecute();
dialog = new ProgressDialog(getApplicationContext());
dialog.setMessage("Loading products. Please wait...");
dialog.setIndeterminate(false);
dialog.setCancelable(false);
dialog.show();
}
@Override
protected String doInBackground(String... strings) {
List<NameValuePair> nameValuePair = new ArrayList<NameValuePair>();
JSONObject json = jParser.makeHttpRequest(url, "POST", nameValuePair);
return null;
}
@Override
protected void onPostExecute(String s) {
super.onPostExecute(s);
}
}
}
JSONObject json = jParser.makeHttpRequest(url, "POST", nameValuePair);