title: Android: Making elements randomly move around screen?
body: <p>I currently have a very simple Android Activity and corresponding XML. (shown below)</p>
  
  <p>I would like to add the ability that each TextView moves randomly around the screen slowly, so that it is more fun for the user to look at. </p>
  
  <p>How can I do so? </p>
  
  <p><strong>Activity:</strong></p>
  
  <pre><code>public class thirdActivity extends ActionBarActivity {
  
      TextView count;
      TextView avgMed;
      TextView avgAtt;
  
      DatabaseHelper db;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.third_tab);
  
          initialiseVars();
  
          displayAllResults();
  
      }
  
      public void initialiseVars() {
  
          db = new DatabaseHelper(this);
          count = (TextView) findViewById(R.id.tvSummary1);
          avgMed = (TextView) findViewById(R.id.tvSummary2);
          avgAtt = (TextView) findViewById(R.id.tvSummary3);
  
      }
  
      // Facade method that then calls all the rest
      public void displayAllResults() {
  
          displayNumberofGamesPlayed();
  
          displayAverageOfAllMedValues();
  
          displayAverageOfAllAttValues();
      }
  
      public void displayNumberofGamesPlayed() {
  
          // show how many games have been played
          int totalGamesPlayed = db.getTotalGamesPlayed();
          count.setText("Games" + "\n" + "Played: " + "\n" + totalGamesPlayed);
  
      }
  
      public void displayAverageOfAllMedValues() {
  
          // Setting cursor to return value of the method?
          int total = db.getTotalOfAllAvgMedLevels();
  
          int gamesPlayed = db.getTotalGamesPlayed();
  
          int average1 = total / gamesPlayed;
  
          avgMed.setText("Average" + "\n" + "Mediation" + "\n" + "Level:" + "\n"
                  + average1);
  
      }
  
      public void displayAverageOfAllAttValues() {
  
          // Setting cursor to return value of the method?
          int total = db.getTotalOfAllAvgAttLevels();
  
          int gamesPlayed = db.getTotalGamesPlayed();
  
          int average2 = total / gamesPlayed;
  
          avgAtt.setText("Average" + "\n" + "Attention" + "\n" + "Level:" + "\n"
                  + average2);
  
      }
  
  }
  </code></pre>
  
  <p><strong>Corresponding XML:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical" &gt;
  
      &lt;TextView
          android:id="@+id/tvSummary1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:background="@drawable/circle"
          android:gravity="center"
          android:text=" " 
          android:textSize="25sp"/&gt;
  
      &lt;TextView
          android:id="@+id/tvSummary2"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:background="@drawable/circle"
          android:gravity="center"
          android:text=" "
          android:textSize="25sp" /&gt;
  
      &lt;TextView
          android:id="@+id/tvSummary3"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:background="@drawable/circle"
          android:gravity="center"
          android:text=" " 
          android:textSize="25sp"/&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>