title: How to separate java file from the activities, and call them in each activity?
body: <p>I'm trying to separate some specific functions from the activities and put them under the source directory so that I can call them in each activity. For now, in activity1,2,3, I write down "helloTable(int index) in each activity, meaning when I change a bit in helloTable in activity1, I also have to change the remaining helloTable(s) in activity2 and 3 to make them same as. If I were to make global helloTable for all possible activities, then I wouldn't have had to repeat all procedures again and again. Here, index is just integer variable, INDEX is integer parameter and output type of helloTable is also an integer.</p>
  
  <p>For now, abstract program goes like this for each activity.</p>
  
  <pre><code>&lt;Activity1.java&gt;
  ... 
  int Level = helloTable( index );
  ...
  private int helloTable ( int INDEX)
  {
      int output;
      if(INDEX&lt;5)
      { output=0;}
      else
      { output=1;}
      return output;
  }
  ...//activity1 ends.
  
  &lt;Activity2.java&gt;
  ... 
  int Level = helloTable( index );
  ...
  private int helloTable ( int INDEX)
  {
      int output;
      if(INDEX&lt;5)
      { output=0;}
      else
      { output=1;}
      return output;
  }
  ...//activity2 ends.
  
  &lt;Activity3.java&gt;
  ... 
  int Level = helloTable( index );
  ...
  private int helloTable ( int INDEX)
  {
      int output;
      if(INDEX&lt;5)
      { output=0;}
      else
      { output=1;}
      return output;
  }
  ...//activity3 ends.
  </code></pre>
  
  <p>Please help me and I want to listen to the many expert's opinion :)</p>