Removing Code From MainActivity
<p>I am still new to Android development, and I still don't know a decent way to write code. Currently I throw everything into my <code>MainActivity</code>. But I don't think that is a good way to write it. I have been searching Google, but I don't really know what to search for. Does anyone have any tips?</p>

<p>I was going to try and take some code that I have and throw it into a view, but when I do I get errors.</p>

<p>For example when I place this in a view, I get <code>cannot find symbol LOCATION_SERVICE</code></p>

<pre><code>public class MainView extends View{
    public double[] getLoc(){
        // Get the location manager
        LocationManager locationManager = (LocationManager)getSystemService(LOCATION_SERVICE);
    }
}
</code></pre>

<p>That is basically a snippet from a function that gets a users latitude and longitude. It doesn't work in a view I assume. The code does work in my MainActivity though.</p>
