Sunday, October 25, 2015

Progress Report - week of 10/25

  • PROGRESS: this past week our group dove right into the project. We realized what Mr. LIn had been telling us that without practicing we would never learn how to use Android Studio, and we started developing our mini app. We also got the example code, both from Senseg and from Mr. Lin, but we ran into a problem with that (explained later). We decided to use Derek Banas’ tutorials on Youtube because his pace is faster and we realized we would accomplish more following him. This is his tutorial: https://www.youtube.com/watch?v=nBD4xhH5vIE&list=PLGLfVvz_LVvSPjWpLPFEfOCbezi6vATIh.
These are some other websites we found useful:
This is part of Mr. Lin’s code, which we expect to base our app on:

  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      toggle = (ToggleButton) findViewById(R.id.toggleButton);
      relative = (RelativeLayout) findViewById(R.id.layout);
      text = (TextView) findViewById(R.id.textMessage);
      toggle.setOnCheckedChangeListener(this);
  }

  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.menu_main, menu);
      return true;
  }

  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
      // Handle action bar item clicks here. The action bar will
      // automatically handle clicks on the Home/Up button, so long
      // as you specify a parent activity in AndroidManifest.xml.
      int id = item.getItemId();

      //noinspection SimplifiableIfStatement
      if (id == R.id.action_settings) {
          return true;
      }

      return super.onOptionsItemSelected(item);
  }

  @Override
  public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {

      if(isChecked) {
          relative.setBackgroundColor(Color.DKGRAY);
          text.setText(R.string.feel);
          //this.vibe = true;
          setVibe(true);
          System.out.println("*** TURN ON *** VIBE =" + this.vibe);
      } else {
          relative.setBackgroundColor(Color.BLACK);
          text.setText(R.string.touch);
          //this.vibe = false;
          setVibe(false);
          System.out.println("*** TURN OFF *** VIBE =" + this.vibe);
      }
  }

  public boolean getVibe() {
      return this.vibe;
  }

  public void setVibe(boolean vibe) {
      this.vibe = vibe;
  }

}
  • PROBLEM: we ran into one big problem: we are not able to open Mr. Lin’s code on our computers. There is some kind of environment error which won’t let us read the code on our Android Studio platform. The other minor problem was the coincidence of a major step in our project with the deadline for Early application for some colleges. From next week on we expect to dedicate more time to building our app.

  • PLAN: what we decided to do is to learn everything we can from Mr. Lin’s code in class: this means we can open the code on Mr. Lin’s computer and understand what he did, how he incorporated haptic feedback, etc. This week we will work full speed on the “test app”.

No comments:

Post a Comment