Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

alternatives to replace synchronous retrofit2

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

According from : https://stackoverflow.com/questions/44665571/how-to-make-a-synchronous-call-using-retrofit-on-android

if I use retrofit2 synchronously would make app crash, but I really need something that could return the value directly.

I've ever used asycntask like this :



this could be return value directly when I call :


Note : I've ever used volley also, but volley incompatible with laravel, the result always GET never POST.

Q : Is there other solutions to get value data directly besides using asynctask?
I don't want to using asynctask because it caused my app slow.

Please someone help me

Thanks

 
Saloon Keeper
Posts: 12436
269
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
AsyncTask should not make your app slow. You're looking for a solution to a problem that doesn't exist.

Why do you think that using AsyncTask makes your application slow? The cause is likely something else. You need to fix that instead.
 
reply
    Bookmark Topic Watch Topic
  • New Topic