title: Yamba - 301 Moved Permanently https://twitter.com/statuses/update.json
body: <p>I follow the guide in the "Learning Android" book to build a Twitter-like application. 
  Firstly, I used jtwitter.jar as a library. When sending a new status to a server, the app wrote "Failed", but the message appeared on the server page. Today I made some refactoring (bringing common functionality into an Application class and adding services) and after that I got <code>301 Moved Permanently https://twitter.com/statuses/update.json -&gt; https://twitter.com/statuses/update.json</code>. Following <a href="https://stackoverflow.com/questions/18848001/alternative-for-getpublictimeline-for-jtwitter">this</a> advice, I tried using jtwitter-yamba.jar. The text of error has changed a bit (below), but it seems to be still the same.</p>
  
  <pre><code>E/StatusActivity﹕ winterwell.jtwitter.TwitterException: 301 Moved Permanently https://twitter.com/statuses/update.json
  W/System.err﹕ winterwell.jtwitter.TwitterException: 301 Moved Permanently https://twitter.com/statuses/update.json
  W/System.err﹕ at winterwell.jtwitter.URLConnectionHttpClient.processError(URLConnectionHttpClient.java:155)
  W/System.err﹕ at winterwell.jtwitter.URLConnectionHttpClient.post(URLConnectionHttpClient.java:219)
  W/System.err﹕ at winterwell.jtwitter.Twitter.post(Twitter.java:1944)
  W/System.err﹕ at winterwell.jtwitter.Twitter.updateStatus(Twitter.java:2555)
  W/System.err﹕ at winterwell.jtwitter.Twitter.updateStatus(Twitter.java:2502)
  W/System.err﹕ at org.my.yamba.StatusActivity$PostToTwitter.doInBackground(StatusActivity.java:93)
  W/System.err﹕ at org.my.yamba.StatusActivity$PostToTwitter.doInBackground(StatusActivity.java:88)
  W/System.err﹕ at android.os.AsyncTask$2.call(AsyncTask.java:287)
  W/System.err﹕ at java.util.concurrent.FutureTask.run(FutureTask.java:234)
  W/System.err﹕ at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
  W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
  W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
  W/System.err﹕ at java.lang.Thread.run(Thread.java:841)
  </code></pre>
  
  <p>The code causing error:</p>
  
  <pre><code>Twitter.Status status = ((YambaApplication) getApplication())
                          .getTwitter().updateStatus(statuses[0]);
  </code></pre>
  
  <p>where YambaApplication is a new Application class:</p>
  
  <pre><code>import android.app.Application;
  import android.content.SharedPreferences;
  import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
  import android.preference.PreferenceManager;
  import android.text.TextUtils;
  import android.util.Log;
  import winterwell.jtwitter.Twitter;
  
  public class YambaApplication extends Application implements OnSharedPreferenceChangeListener{
  
      private static final String TAG = YambaApplication.class.getSimpleName();
      public Twitter twitter;
      private SharedPreferences prefs;
      @Override
      public void onCreate() {
          super.onCreate();
          this.prefs = PreferenceManager.getDefaultSharedPreferences(this);
          this.prefs.registerOnSharedPreferenceChangeListener(this);
          Log.i(TAG, "onCreated");
      }
      @Override
      public void onTerminate() {
          super.onTerminate();
          Log.i(TAG, "onTerminated");
      }
      public synchronized Twitter getTwitter() {
          if (this.twitter == null) {
              String username = this.prefs.getString("username", "");
              String password = this.prefs.getString("password", "");
              String apiRoot = prefs.getString("apiRoot",
                      "http://yamba.marakana.com/api");
              if (!TextUtils.isEmpty(username) &amp;&amp; !TextUtils.isEmpty(password)
                      &amp;&amp; !TextUtils.isEmpty(apiRoot)) {
                  this.twitter = new Twitter(username, password);
                  this.twitter.setAPIRootUrl(apiRoot);
              }
          }
          return this.twitter;
      }
      public synchronized void onSharedPreferenceChanged(
              SharedPreferences sharedPreferences, String key) {
          this.twitter = null;
      }
  }
  </code></pre>
  
  <p>What can be the problem? How to make it work?</p>