<?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 Re: simple Android example for APIv2 required in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/simple-Android-example-for-APIv2-required/m-p/252401#M14549</link>
    <description>We don't have another Android example app, aside from the one you linked to. &lt;BR /&gt;&lt;BR /&gt;What issues are you running in to?</description>
    <pubDate>Mon, 13 Nov 2017 17:25:10 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2017-11-13T17:25:10Z</dc:date>
    <item>
      <title>simple Android example for APIv2 required</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/simple-Android-example-for-APIv2-required/m-p/252329#M14543</link>
      <description>&lt;P&gt;I have implemented an Android code for Downloading / Uploading files to Dropbox App folder based on the old, simple DBRoulette example, which works perfectly well under Dropbox APIv1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have spent many hours trying to modify the "official" APIv2 example code from:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/dropbox/dropbox-sdk-java/tree/master/examples/android" target="_self"&gt;https://github.com/dropbox/dropbox-sdk-java/tree/master/examples/android&lt;/A&gt;&lt;/P&gt;&lt;P&gt;without much success.&lt;/P&gt;&lt;P&gt;Is there a simple example source code for APIv2, similar to DBRoulette example, that can be used to replace the old&amp;nbsp;APIv1 implementation ?&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:17:24 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/simple-Android-example-for-APIv2-required/m-p/252329#M14543</guid>
      <dc:creator>MarioEM</dc:creator>
      <dc:date>2019-05-29T09:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: simple Android example for APIv2 required</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/simple-Android-example-for-APIv2-required/m-p/252401#M14549</link>
      <description>We don't have another Android example app, aside from the one you linked to. &lt;BR /&gt;&lt;BR /&gt;What issues are you running in to?</description>
      <pubDate>Mon, 13 Nov 2017 17:25:10 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/simple-Android-example-for-APIv2-required/m-p/252401#M14549</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-11-13T17:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: simple Android example for APIv2 required</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/simple-Android-example-for-APIv2-required/m-p/252488#M14559</link>
      <description>&lt;P&gt;Hello Greg,&lt;/P&gt;&lt;P&gt;I am having problems uploading the single selected file from a fixed Android folder called "em" to a Dropbox apps folder. I have implemented the code exactly as per example app: UploadFileTask.java&lt;/P&gt;&lt;P&gt;Here is the problem section of the code after some modifications:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    @Override
    protected FileMetadata doInBackground(String... params) {
        String remoteFileName = params[0];

        if (remoteFileName != null) {
            File outPath = Environment.getExternalStorageDirectory();
            String remoteFolderPath = outPath.getAbsolutePath() + "/" + "em";
            File localFile = new File(remoteFolderPath, remoteFileName);

            try (InputStream inputStream = new FileInputStream(localFile)) {
                return mDbxClient.files().uploadBuilder(remoteFolderPath + "/" + remoteFileName)
                        .withMode(WriteMode.OVERWRITE)
                        .uploadAndFinish(inputStream);
            } catch (DbxException | IOException e) {
                mException = e;
            }
        }

        return null;
    }&lt;/PRE&gt;&lt;P&gt;The remoteFolderPath string is "/storage/emulated/0/em"&amp;nbsp; and the remoteFileName string is "EM.db"&lt;/P&gt;&lt;P&gt;The localFile is&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;/storage/emulated/0/em/EM.db&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The EM.db file does exist in that particular folder and the storage path is identical to the one generated in the APIv1 code, which worked perfectly well.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am getting an error message: ..."/storage/emulated/0/em/EM.db: open failed: EACCES Permission denied"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I tried it with several different files and different folders without success. The same error al the time.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can you see any problems with this code ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Another issue: the above example code requires a minimum Android SdkVersion = 19. My app currently uses minimum SdkVersion = 14 which works well with the old APIv1 code:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;fis &lt;/SPAN&gt;= &lt;SPAN&gt;new &lt;/SPAN&gt;FileInputStream(file);&lt;BR /&gt;mApi.putFileOverwrite(file, fis, file.length(),&lt;BR /&gt;etc. as per DBRoulete app. example.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Can you plese suggest how to resolve these issues and&amp;nbsp;how to overcome&amp;nbsp;&lt;SPAN&gt;Android SdkVersion restrictions.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 09:37:01 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/simple-Android-example-for-APIv2-required/m-p/252488#M14559</guid>
      <dc:creator>MarioEM</dc:creator>
      <dc:date>2017-11-14T09:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: simple Android example for APIv2 required</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/simple-Android-example-for-APIv2-required/m-p/252569#M14564</link>
      <description>The "EACCES Permission denied" error appears to be an Android error about a lack of permission to read/write the local data. That's not about Dropbox itself exactly, but it looks like you need to make sure you have write permissions, e.g., as covered here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://stackoverflow.com/questions/8854359/exception-open-failed-eacces-permission-denied-on-android" target="_blank"&gt;https://stackoverflow.com/questions/8854359/exception-open-failed-eacces-permission-denied-on-android&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Also, the Android sample app only supports 19+, so you may need to change some of the for 14+. What exactly isn't working for you? That's again more about Android itself so I may not be able to offer much insight there unfortunately.</description>
      <pubDate>Tue, 14 Nov 2017 17:11:18 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/simple-Android-example-for-APIv2-required/m-p/252569#M14564</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-11-14T17:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: simple Android example for APIv2 required</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/simple-Android-example-for-APIv2-required/m-p/252725#M14585</link>
      <description>&lt;P&gt;Hello Greg,&lt;/P&gt;
&lt;P&gt;That was a good&amp;nbsp;suggestion with the link that included the appropriate tip!&lt;/P&gt;
&lt;P&gt;I already had the correct Write and Read permissions in the AndroidManifest, but I forgot about the new Android rule introduced since version 23 that requires app users to manually accept the external write storage permission.&lt;/P&gt;
&lt;P&gt;It is all working well now, both file Upload and Download.&lt;/P&gt;
&lt;P&gt;Thanks for your help.&lt;/P&gt;
&lt;P&gt;I had to modify the example Download code to obtain the required metadata for the specific Dropbox file:&lt;/P&gt;
&lt;PRE&gt;    protected FileMetadata doInBackground(String... params) {
        String fileName = params[0];

        try {
            FileMetadata metadata = (FileMetadata) mDbxClient.files().getMetadata("/" + fileName);
&lt;/PRE&gt;
&lt;P&gt;Please comment if the above code is the correct way to do it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2017 10:23:35 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/simple-Android-example-for-APIv2-required/m-p/252725#M14585</guid>
      <dc:creator>MarioEM</dc:creator>
      <dc:date>2017-11-15T10:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: simple Android example for APIv2 required</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/simple-Android-example-for-APIv2-required/m-p/252773#M14594</link>
      <description>Thanks, I'm glad to hear you were able to get that working. Yes, that code looks fine.</description>
      <pubDate>Wed, 15 Nov 2017 15:41:26 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/simple-Android-example-for-APIv2-required/m-p/252773#M14594</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-11-15T15:41:26Z</dc:date>
    </item>
  </channel>
</rss>

