import android . os . Bundle ; import android . util . Log ; import com . loginradius . androidsdk . api . AuthenticationAPI ; import com . loginradius . androidsdk . handler . AsyncHandler ; import com . loginradius . androidsdk . helper . LoginRadiusSDK ; import com . loginradius . androidsdk . resource . QueryParams ; import com . loginradius . androidsdk . response . login . LoginData ; public class MainActivity extends AppCompatActivity { @Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; // Before using the SDK, you must initialize the SDK with the help of following code: LoginRadiusSDK . Initialize init = new LoginRadiusSDK . Initialize ( ) ; init . setApiKey ( "<your-api-key>" ) ; init . setSiteName ( "<your-site-name>" ) ; // The below following code can be used to implement traditional login: QueryParams params = new QueryParams ( ) ; params . setEmail ( "xyz@mailinator.com" ) ; params . setPassword ( "123456" ) ; AuthenticationAPI api = new AuthenticationAPI ( ) ; api . login ( getApplicationContext ( ) , params , new AsyncHandler < LoginData > ( ) { @Override public void onSuccess ( LoginData logindata ) { Log . e ( "FirstName" , logindata . getProfile ( ) . getFirstName ( ) . toString ( ) ) ; } @Override public void onFailure ( Throwable error , String errorcode ) { Log . e ( "error" , error . getMessage ( ) ) ; } } ) ; } }