title: Trying to access string in another class crashes app
body: <p>I'm trying to make a class that will handle some router functionality such as retrieving the Mac address of the router you are connected to. I would like a method that retrives this to be able to be called in more than one class. This is the router class:</p>
  
  <pre><code>public class Router extends Service
  {
      static Router thisclass = new Router();
  
      WifiManager wifiMan = (WifiManager) getSystemService(Context.WIFI_SERVICE);
      WifiInfo wifiInf = wifiMan.getConnectionInfo();
  
      public String BSSID() {
          return wifiInf.getBSSID();
      }
  
      static String bssid() {     
          return thisclass.BSSID();
      }
  
      @Override
      public IBinder onBind(Intent arg0) {
          return null;
      }
  }
  </code></pre>
  
  <p>Then in the main class I'd like to use this string as such:</p>
  
  <pre><code>public class AppActivity extends Activity 
  {
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
  
          TextView macAddress;
  
          macAddress = (TextView) findViewById(R.id.textView1);
  
          //Router r = new Router();
          macAddress.setText("BSSID: " + Router.bssid());
      }
  }
  </code></pre>
  
  <p>The app crashes every time and I can't get why. I also have no idea how to catch errors, I tried try catch statements but could print to logcat. You may at this point know I'm not too hot at programming. One last thing is my ManiFest and thanks for reading</p>
  
  <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.infoturtle.ringbyrouter"
        android:versionCode="1"
        android:versionName="1.0"&gt;
      &lt;uses-sdk android:minSdkVersion="7" /&gt;
  
      &lt;uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/&gt;
      &lt;uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"&gt;&lt;/uses-permission&gt;
  
      &lt;application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true"&gt;
          &lt;activity android:name=".AppActivity"
                    android:label="@string/app_name"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;service android:name="Router"&gt;&lt;/service&gt;
      &lt;/application&gt;
  &lt;/manifest&gt;
  </code></pre>