How to make GET and POST requests on android, with a fast and updated tool?

Question:

I am currently using volley for web requests. But I'm finding this tool too slow.

I googled looking for alternatives, but all the results I find are old, from 2017, 2016 and below.

About org.apache.http They are said to be obsolete, among others that are also obsolete.

I found little information about Gson and from what I understand, I don't think it even makes web requests.

There are people who talk about Retrofit and Retrofit 2 , which I haven't tested yet.

But after all, now in the year 2018, what is the best way to do this? Is there a way to use android studio's native tools without installing any library and that is not obsolete?

Sorry for not posting any code, as I said I didn't like the volley as it was too slow. So I would really like some help on a more up-to-date tool. If possible some documentation or tutorial to use.

If I didn't ask the question correctly please excuse me, I don't know another way to ask about it here. And for me, here it's been the only place with professionals who really understand what they're talking about and who could help me.

I'm using android studio 3.1.2 with minSdkVersion 15 and targetSdkVersion 27

Answer:

in build.gradle add

dependencies {
    compile 'com.koushikdutta.ion:ion:2.+'
}
depois chame em sua Activity Ion.with(Context).load(url);

example

public class Login extends AppCompatActivity {

private String TAG = "Login";

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_identidade_digital);
    EditText   mUsuarioView  = (EditText) findViewById(R.id.mUsuarioView);
    EditText   mPasswordView  = (EditText) findViewById(R.id.mPasswordView);
    Login(mUsuarioView.getText().toString(),mPasswordView.getText().toString());
}
public void Login(String user, String senha){

    Ion.with(this).load("https://wwww.meuwebservice.com.br")
            .setBodyParameter("user", user)
            .setBodyParameter("senha", senha)
            .asJsonObject().setCallback(new FutureCallback<JsonObject>() {
        @Override
        public void onCompleted(Exception e, JsonObject result) {
            if(e != null){
               // algo deu errado
                Log.d(TAG, e.toString());
            } else if (result.get("retorno").getAsString().equals("YES")) {
               //   tudo ceto trabalhe no seu retorno pegando o resultado
                //seu metodo aqui

            }

        }
    });

}

Android Asynchronous Network and Image Loading

Scroll to Top