Wednesday, April 29, 2020

How to change json to string in Android App + Java

GetData is a retrofit configuration

UpdateUserProfile is model
getUser is getter of another model
Personame is an edit box
 
GetData service = RetrofitClient.getClient().create(GetData.class);
Call<UpdateUserProfile> callProfile= service.fetchUserData();
callProfile.enqueue(new Callback<UpdateUserProfile>() 
{    @Override    public void onResponse(Call<UpdateUserProfile> call,  
Response<UpdateUserProfile> response) {       
 String updateUserProfile= response.body().getUser().get(0).getId();     
         personName.setText(response.body().getUser().get(0).getName());         
     personDOB.setText(response.body().getUser().get(0).getDob());           
   personEmail.setText(response.body().getUser().get(0).getEmail());        
      personMobile.setText(response.body().getUser().get(0).getMobile_no());       
Picasso.with(ProfileActivity.this)
.load(response.body().getUser().get(0).getImage()).into();
    }


Front-End Custom Development

  Front-End Custom Development Our front-end functional components are tailor-made, crafted from the ground up to provide not only exception...

Clock