Getting string in Protected Function Android
<p>Basically I have a stand alone class, which does not use Activity OR Service.
A function in the class starts a new Authenticator.</p>

<p>I have a string in the strings.xml file, which I want to access
Looking for the best method</p>

<p>Example code</p>

<pre><code>class MyConnection(){

 String username;
 String pwd;
 String strurl;
  public MyConnection(String usernameIN, String pwdIN, String urlIN){
      this.username = usernameIN;
      this.pwd = pwdIN;
      this.strurl = urlIN
  }
 public void
 URL url = null;

 try {
    url = new URL(this.strURL);
    URLConnection urlConn = null;
    Authenticator.setDefault(new Authenticator()){

         protected PasswordAuthentication getPasswordAuthentication()(
                // I want my vars from strings.xml here
                return new PasswordAuthentication(strUsername, strPwd.toCharArray());
         }
    });
  urlCOnn = url.openConnection();
  //Rest of the code, including CATCH
}
</code></pre>

<p>I passed the vars through into the class BUT how do I access them When I set the PasswordAuthentication.  OR Can I access them direct from strings.xml ???</p>
