어플에서 twitter로 글을 올리는 어플을 제작중입니다.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final EditText input_id = (EditText)findViewById(R.id.user_id);
final EditText input_pw = (EditText)findViewById(R.id.password);
final EditText input_text = (EditText)findViewById(R.id.input_text);
Button signin = (Button)findViewById(R.id.sign_in_button);
signin.setOnClickListener(new View.OnClickListener() {
public void onClick(View v){
username = (String)input_id.getText().toString();
password = (String)input_pw.getText().toString();
update_text = (String)input_text.getText().toString();
if( username.equals("") || password.equals("") || update_text.equals(""))
{
Toast.makeText(getApplicationContext(), "wrong input", Toast.LENGTH_SHORT)
.show();
}
else
{
Twitter twitter = new Twitter(username, password);
Status status;
try {
status = twitter.updateStatus(update_text);
Toast.makeText(getApplicationContext(), "Successfully updated the status to [" + status.getText() + "].", Toast.LENGTH_LONG)
.show();
} catch (TwitterException e) {
// TODO Auto-generated catch block
Toast.makeText(getApplicationContext(), "Fail to update text [" + e + "].", Toast.LENGTH_LONG)
.show();
}
}
}
});
}
위의 소스를 보시면 twitter객체를 생성하여 updateStatus()를 이용하여 글을 올리려고 합니다.
소스를 돌려본 결과 LogCat에 다음과 같은 익셉션이 일어납니다.
12-28 17:59:15.684: INFO/11(8567): 401:Authentication credentials were missing or incorrect.
12-28 17:59:15.684: INFO/11(8567): TwitterException{exceptionCode=[15bb6564-00f9bf33], statusCode=401, retryAfter=0, rateLimitStatus=null, version=2.1.9-SNAPSHOT(build: 2dd26b04a45a3eb2de7e35de087e90aeeb2f01fb)}
고수님들 알려주세요 ㅜ



