Following are helper model classes for Facebook, Twitter and Google Auth i.e. User and Response classes respectively.
//User Model class
import android.net.Uri; import org.json.JSONObject; public class User { public class Facebook{ public String name; public String email; public String facebookID; public String gender; public String about; public String bio; public String dob; public String cellno; public String coverPicUrl; public String profilePic; public String mProfileImage; public JSONObject response; } public class GoogleAuth { public String name; public String email; public String idToken; public String id; public String dob; public String cellno; public String familyName; public Uri photoUrl; public String mProfileImage; } public class Twitter{ public String name; public String email; public String description; public String pictureUrl; public String bannerUrl; public String language; public long id; public String cellno; public String dob;
public Twitter(){ }
}
}
//Response Model class
import android.support.annotation.NonNull; public class Response { public interface Facebook { void onFbSignInFail(); void onFbSignInSuccess(); void onFbProfileReceived(User.Facebook facebookUser); void onFBSignOut(); } public interface GoogleAuth{ void onGoogleAuthSignIn(User.GoogleAuth user); void onGoogleAuthSignInFailed(); void onGoogleAuthSignOut(boolean isSuccess); } public interface Twitter { void onTwitterError(); void onTwitterSignIn(@NonNull String userId, @NonNull String userName); void onTwitterProfileReceived(User.Twitter user); } }