【发布时间】:2016-02-07 11:21:15
【问题描述】:
我正在尝试开发一个简单地从 api 检索图片的 android 应用程序。我试图使用改造,但我很困惑如何使用它。我也不明白如何获取访问令牌?我需要用户登录吗?我不能简单地从 Instagram 获取与任何用户没有特别关系的图片吗?
我尝试了类似的东西
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mButton = (Button) findViewById(R.id.button);
mButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Uri uri = Uri.parse("https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=code"); // missing 'http://' will cause crashed
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
}
});
这将我带到一个登录页面,然后它提示我输入用户详细信息,然后给我某种身份验证错误。
我似乎无法理解 insta 文档
【问题讨论】:
标签: android instagram retrofit