Blockcerts Android application by Learning Machine
Gradle allows us to define different product variants. Each has a separate app id and can be installed simultaneously. Currently they all use the Bitcoin main net and do not differ all that much. Production has an empty logging tree.
dev
com.learningmachine.android.app.dev
env
staging
com.learningmachine.android.app.staging
env
production
com.learningmachine.android.app
env
sh scripts/run_tests.sh
At the time of writing it seems Robolectric is not compatible with JDK > 13 (https://github.com/robolectric/robolectric/issues/5863)
sh scripts/GenerateReleaseBuild.command
Answer the prompts as they come.
Blockcerts team members: password is stored in regular password manager.
The following are guidelines for this Android project.
Activity
, Fragment
, Listener
, ListItemView
, Manager
m
.mPasswordEditText
, mLoginButton
mLocked
) and have getters using isState()
(ie: isLocked
)abstract
methods in super over implicit setup in subclass constructors.public class TemplateFragment {
private static final String ARG_CONSTANT = "TemplateFragment.Constant";
private List<Object> mObjects;
/* static methods */
public static TemplateFragment newInstance() {
return new TemplateFragment();
}
/* lifecycle overrides, onSavedInstanceState, options menu, onActivityResult */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mObjects = new ArrayList<Object>();
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {
// databinding & init
initView();
}
/* private methods */
private void initView() {}
private void setupData() {}
/* getters, setters, and other public methods */
public List<Object> getObjects() {
return mObjects;
}
public void setObjects(List<Objects> objects) {
mObjects = objects;
}
/* enums */
protected enum ObjectItemType {
ITEM_TYPE_A,
ITEM_TYPE_B,
}
/* inner classes */
private class TemplateListAdapter extends ArrayAdapter<ObjectItemType> {
public EnergyListAdapter(List<ObjectItemType> items) {
super(getActivity(), 0, items);
}
}
/* base class overrides */
@Override
protected boolean usesInjection() {
return true;
}
}
We suggest the following method orgainization:
activity_login
, fragment_login
, list_item_login
login_username_text_view
/>
over open and close tags that do not contain children.0dp
is an exception and should remain in the layout file.Preferences > Code Style > XML > Android > Insert Line break before first attribute
to help format your layout files properly.strings.xml
fragment_login_username_hint
_message
: "We would like to welcome you to this app because it is amazing" becomes fragment_login_welcome_message
_error_message
: "Failed to login" would be login_error_message
%1$s
s
, d
, f
, etc.Responsibilities
WebService
Prefix data operations with load
, this signifies an asynchronous call (i.e. webservice or database)
Prefix direct data accessors with get
. These methods will synchronously return data directly to the caller.
Pull down the cvjs repository:
https://github.com/blockchain-certificates/cert-verifier-js.git && cd cert-verifier-js
CVJS requires an npm token, so create one on npm
export NPM_TOKEN={insert token here}
Install
npm install
Generate build
npm run-script build
Copy content of /dist/verifier-iife.js
Paste in this android project at this location: wallet-android/LearningMachine/app/src/main/assets/www/verifier.js
www
directory of the appContact us at the Blockcerts community forum.