After coding several versions of elastic search client, I end up picking the simplest and most straight forward approach. This approach leaves all controllers completely untouched, so no need for any major code surgery.
Most of the changes happen inside the login activity. The login activity will need to load the data from elastic search server on startup and show a spinner while loading.
Here is a preview of what needs to be done inside login activity. I will help you making the change in lab.
new LoadingOnlineRecordTask().execute(); //put this inside oncreate
turnOnSpinner(); //fake pseudo code
//AsyncTask For loading records from Elastic Server
private class LoadingOnlineRecordTask extends AsyncTask<Void, Void, Void> {
@Override
protected Void doInBackground(Void... optionalInputs) {
new ESClient().loadRecordFromServer();
return null;
}
@Override
protected void onPostExecute(Void result) {
turnOffSpinner(); //fake pseudo code
ClaimListController claimListController = new ClaimListController();
Toast.makeText(LoginActivity.this,"Loaded: "+claimListController.size()+" claims "+UserList.users.size()+" users", Toast.LENGTH_SHORT).show();
}
}
After coding several versions of elastic search client, I end up picking the simplest and most straight forward approach. This approach leaves all controllers completely untouched, so no need for any major code surgery.
Most of the changes happen inside the login activity. The login activity will need to load the data from elastic search server on startup and show a spinner while loading.
Here is a preview of what needs to be done inside login activity. I will help you making the change in lab.