<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to use access token in Dropbox authentication in Android app in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-use-access-token-in-Dropbox-authentication-in-Android-app/m-p/128887#M3739</link>
    <description>&lt;P&gt;Hello. I'm trying to make an Android application that uses Dropbox. I managed to upload some files to Dropbox so that is working. But I would like to store the access token so that the user doesn't need  to authenticate every time. Your tutorial says:&lt;/P&gt;

&lt;P&gt;"&lt;BR /&gt;
The &lt;CODE&gt;finishAuthentication()&lt;/CODE&gt; method will bind the user's access token to the session. You'll now be able to retrieve it via &lt;CODE&gt;mDBApi.getSession().getOAuth2AccessToken()&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;You'll need this token again after your app closes, so it's important to save it for future access (though it's not shown here). If you don't, the user will have to re-authenticate every time they use your app. A common way to implement storing keys is through Android's SharedPreferences API.&lt;BR /&gt;
"&lt;/P&gt;

&lt;P&gt;Now I have that accesstoken but how I can authenticate using it? I tried &lt;CODE&gt;mDBApi.getSession().setOAuth2AccessToken(accessToken)&lt;/CODE&gt;  but then putFile gives a &lt;CODE&gt;DropboxUnlinkedException&lt;/CODE&gt;.&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2019 09:42:16 GMT</pubDate>
    <dc:creator>tuomo s.</dc:creator>
    <dc:date>2019-05-29T09:42:16Z</dc:date>
    <item>
      <title>How to use access token in Dropbox authentication in Android app</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-use-access-token-in-Dropbox-authentication-in-Android-app/m-p/128887#M3739</link>
      <description>&lt;P&gt;Hello. I'm trying to make an Android application that uses Dropbox. I managed to upload some files to Dropbox so that is working. But I would like to store the access token so that the user doesn't need  to authenticate every time. Your tutorial says:&lt;/P&gt;

&lt;P&gt;"&lt;BR /&gt;
The &lt;CODE&gt;finishAuthentication()&lt;/CODE&gt; method will bind the user's access token to the session. You'll now be able to retrieve it via &lt;CODE&gt;mDBApi.getSession().getOAuth2AccessToken()&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;You'll need this token again after your app closes, so it's important to save it for future access (though it's not shown here). If you don't, the user will have to re-authenticate every time they use your app. A common way to implement storing keys is through Android's SharedPreferences API.&lt;BR /&gt;
"&lt;/P&gt;

&lt;P&gt;Now I have that accesstoken but how I can authenticate using it? I tried &lt;CODE&gt;mDBApi.getSession().setOAuth2AccessToken(accessToken)&lt;/CODE&gt;  but then putFile gives a &lt;CODE&gt;DropboxUnlinkedException&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:42:16 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-use-access-token-in-Dropbox-authentication-in-Android-app/m-p/128887#M3739</guid>
      <dc:creator>tuomo s.</dc:creator>
      <dc:date>2019-05-29T09:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to use access token in Dropbox authentication in Android app</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-use-access-token-in-Dropbox-authentication-in-Android-app/m-p/128888#M3740</link>
      <description>&lt;P&gt;It seems to be working now in the way that I wanted. All I did was I moved&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;session.setOAuth2AccessToken(accessToken);      
mDBApi = new DropboxAPI&amp;lt;AndroidAuthSession&amp;gt;(session);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 06 Jun 2015 02:36:10 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-use-access-token-in-Dropbox-authentication-in-Android-app/m-p/128888#M3740</guid>
      <dc:creator>tuomo s.</dc:creator>
      <dc:date>2015-06-06T02:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to use access token in Dropbox authentication in Android app</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-use-access-token-in-Dropbox-authentication-in-Android-app/m-p/128889#M3741</link>
      <description>&lt;P&gt;Glad to hear you got it working!&lt;/P&gt;</description>
      <pubDate>Sat, 06 Jun 2015 02:39:43 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-use-access-token-in-Dropbox-authentication-in-Android-app/m-p/128889#M3741</guid>
      <dc:creator>Leah C.1</dc:creator>
      <dc:date>2015-06-06T02:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to use access token in Dropbox authentication in Android app</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-use-access-token-in-Dropbox-authentication-in-Android-app/m-p/128890#M3742</link>
      <description>&lt;P&gt;I accidentally sent the answer before I had written it fully. &lt;BR /&gt;
So I did &lt;CODE&gt;setOAuth2AccessToken()&lt;/CODE&gt; to session instead of &lt;CODE&gt;mDBApi.getSession()&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;In other words I changed the order in which I used &lt;CODE&gt;setOAuth2AccessToken&lt;/CODE&gt; and &lt;CODE&gt;mDBApi= new DropboxAPI...&lt;/CODE&gt;&lt;BR /&gt;
I don't know what was the error and now I'm not even sure if there was error&lt;/P&gt;</description>
      <pubDate>Sat, 06 Jun 2015 02:40:53 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-use-access-token-in-Dropbox-authentication-in-Android-app/m-p/128890#M3742</guid>
      <dc:creator>tuomo s.</dc:creator>
      <dc:date>2015-06-06T02:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to use access token in Dropbox authentication in Android app</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-use-access-token-in-Dropbox-authentication-in-Android-app/m-p/128891#M3743</link>
      <description>&lt;P&gt;Actually I am also working on a similar kind of app and facing the same error as you did &lt;STRONG&gt;tuomo s.&lt;/STRONG&gt; So kindly help me.. solving it.As the solution you provided is not working in my case..&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2015 18:05:57 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-use-access-token-in-Dropbox-authentication-in-Android-app/m-p/128891#M3743</guid>
      <dc:creator>Demo B.</dc:creator>
      <dc:date>2015-11-20T18:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to use access token in Dropbox authentication in Android app</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-use-access-token-in-Dropbox-authentication-in-Android-app/m-p/128892#M3744</link>
      <description>&lt;P&gt;So after you have authenticated (written your username and password) you run for example something like this in onResume that saves your accessToken to your preferences.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;protected void onResume() {&lt;BR /&gt; super.onResume();&lt;/P&gt;
&lt;P&gt;String accessToken="DEFAULT";&lt;BR /&gt; if (mDBApi.getSession().authenticationSuccessful()&lt;BR /&gt; &amp;amp;&amp;amp; !mDBApi.getSession().isLinked()) {&lt;BR /&gt;&lt;BR /&gt;mDBApi.getSession().finishAuthentication();&lt;/P&gt;
&lt;P&gt;accessToken = mDBApi.getSession()&lt;BR /&gt; .getOAuth2AccessToken();&lt;/P&gt;
&lt;P&gt;SharedPreferences settings = getSharedPreferences("my_settings", 0);&lt;BR /&gt; SharedPreferences.Editor editor = settings.edit();&lt;BR /&gt; editor.putString("dropboxtoken", accessToken);&lt;BR /&gt; editor.commit();&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Next time you start your app you run something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SharedPreferences settings = getSharedPreferences("my_settings", 0);&lt;BR /&gt; accessToken = settings.getString("dropboxtoken", "DEFAULT");&lt;BR /&gt; if(!accessToken.equals("DEFAULT")){&lt;BR /&gt; MyService.mDBApi.getSession().setOAuth2AccessToken(accessToken);&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;else {&lt;/P&gt;
&lt;P&gt;// accesstoken was not stored so start authentication&amp;nbsp;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2015 20:35:52 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-use-access-token-in-Dropbox-authentication-in-Android-app/m-p/128892#M3744</guid>
      <dc:creator>tuomo s.</dc:creator>
      <dc:date>2015-11-20T20:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to use access token in Dropbox authentication in Android app</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-use-access-token-in-Dropbox-authentication-in-Android-app/m-p/128893#M3745</link>
      <description>&lt;P&gt;I Know it's a little old but do you know how to create a similar method for the java core API? Ive been trying to use different methods to store the accessToken with no success...Any help or recommendation on what you guys did for you App would be appreciated, thank you!&lt;/P&gt;</description>
      <pubDate>Sun, 10 Jan 2016 10:59:32 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-use-access-token-in-Dropbox-authentication-in-Android-app/m-p/128893#M3745</guid>
      <dc:creator>travis h.4</dc:creator>
      <dc:date>2016-01-10T10:59:32Z</dc:date>
    </item>
  </channel>
</rss>

