Code example for Instrumentation

Methods: sendKeyDownUpSync

0
        assertEquals(displayVal(), mActivity.getString(R.string.minus) + "600");
    } 
   
    // helper functions 
    private void press(int keycode) {
        mInst.sendKeyDownUpSync(keycode);
    } 
     
    private boolean tap(int id) {
        View view = mActivity.findViewById(id);
        if(view != null) {
            TouchUtils.clickView(this, view);
            return true; 
        } 
        return false; 
    } 
   
    private String displayVal() {
        CalculatorDisplay display = (CalculatorDisplay) mActivity.findViewById(R.id.display);
        assertNotNull(display);