cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you an educator? Well we want to hear from you, so check out some tools we think might help you out here!

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get a list of files from dropbox to android application

Get a list of files from dropbox to android application

AppDev
Explorer | Level 3

Hi everybody, I'm new to dropbox developing and I need help with it please. I wrote an android application that needs to get a list of files listing in dropbox. I used the tutorial and part of the code I wrote is:

 

private DropboxAPI<AndroidAuthSession> mDBApi;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main); InitializeSession(); } void InitializeSession() { AppKeyPair appKeys = new AppKeyPair(APP_KEY, APP_SECRET); AndroidAuthSession session = new AndroidAuthSession(appKeys);
mDBApi = new DropboxAPI<AndroidAuthSession>(session);
mDBApi.getSession().startOAuth2Authentication(MainActivity.this); } @Override protected void onResume() { super.onResume(); if (mDBApi.getSession().authenticationSuccessful()) { try {
mDBApi.getSession().finishAuthentication(); String accessToken = mDBApi.getSession().getOAuth2AccessToken(); PopulateList(); } catch (IllegalStateException e) { System.out.println("Error : " + e.getMessage()); } } } private void PopulateList() { List<String> filename = new ArrayList<>(); String mPath = "/"; DropboxAPI.Entry dirent = null; try {
dirent = mDBApi.metadata(mPath, 1000, null, true, null); } catch (DropboxException e) { System.out.println("Error : " + e.getMessage()); } for (DropboxAPI.Entry ent : dirent.contents) { if (ent.isDir) {
filename.add(ent.fileName()); } ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(getBaseContext(), android.R.layout.simple_list_item_1, filename); } }

 I am not getting the list of files from dropbox...

 In the PopulateList() method, after executing the line 

dirent = mDBApi.metadata(mPath, 1000, null, true, null);

The code stop executing and I get nothing to the dirent.

What am I doing wrong here? and what am I missing?

Do I somehow need to resume the authentication again?

One more thing I'm not sure about, with this code do I get files from sub folders too? if not, how can I get them? because the start path I use is "/".

 

I'm stuck on that for 2 weeks and can't find the solution or what did I do wrong...

Thanks for the helpers! 🙂

16 Replies 16

Re: Get a list of files from dropbox to android application

Greg-DB
Dropboxer

[Cross-linking for reference: https://stackoverflow.com/questions/52017573/get-a-list-of-dropbox-files-to-android-application ]

 

You appear to be using the old SDK/code for Dropbox API v1, which is retired. 

 

You should use the latest version of the official Java SDK, which uses Dropbox API v2:

 

https://github.com/dropbox/dropbox-sdk-java

 

To list files with that, you should use listFolder and listFolderContinue as shown here:

 

https://github.com/dropbox/dropbox-sdk-java#try-some-api-requests

Re: Get a list of files from dropbox to android application

AppDev
Explorer | Level 3

Thank you so much for your reply! You are right, I was using API v1, I was sure I used v2...

I corrected it and followed the tutorials and the linked you gave me, but it still not working... 😞

I need to make authentication every time, so my code now looks like this:

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

Auth.startOAuth2Authentication(MainActivity.this, getString(R.string.APP_KEY));
}

@Override
protected void onResume()
{
super.onResume();

String accessToken = Auth.getOAuth2Token();
if ((accessToken != null) && (accessToken != ""))
{
// Create Dropbox client
DbxRequestConfig config = DbxRequestConfig.newBuilder("dropbox/MyAppName").build();
DbxClientV2 client = new DbxClientV2(config, accessToken);

// Get files and folder metadata from Dropbox root directory
ListFolderResult result = null;
try
{
result = client.files().listFolder("");

while (true)
{
for (Metadata metadata : result.getEntries())
{
System.out.println(metadata.getPathLower());
}

if (!result.getHasMore())
{
break;
}

result = client.files().listFolderContinue(result.getCursor());
}
}
catch (DbxException e)
{
e.printStackTrace();
}
}
}

 The authentication is working, but in the onResume() method, after executing the:

DbxClientV2 client = new DbxClientV2(config, accessToken);

The application died. I even tried to use the accessToken as hard coded, without the authentication, and the application still died after I tried to create the dropbox client...

What am I doing wrong now? 😞

Thank you in advance.

Re: Get a list of files from dropbox to android application

Greg-DB
Dropboxer

What exception/output are you getting with the crash?

Re: Get a list of files from dropbox to android application

AppDev
Explorer | Level 3

I'm not sure how to get my exception since I'm very new to all this and not getting to any catch code, but when I call 

DbxClientV2 client = new DbxClientV2(config, accessToken);

The method

public DbxClientV2(DbxRequestConfig requestConfig, String accessToken) {
this(requestConfig, accessToken, DbxHost.DEFAULT, (String)null);
}

 In DbxClientv2.class is executing, and after that method loop() in looper.java executing the 

finally {
if (traceTag != 0) {
Trace.traceEnd(traceTag);
}
}

 The msg I get is:

{ when=-6s733ms what=100 obj=ActivityRecord{df633d6 token=android.os.BinderProxy@147a79f {com.example.downloadfilestry/com.example.downloadfilestry.MainActivity}} target=android.app.ActivityThread$H }

 

And traceTag is 0.

After that the app stop running and on debug I get:

cause = com.android.internal.os.ZygoteInit$MethodAndArgsCaller

The code is not getting to catch, so I don't really know what to paste here...

Is it enough to understand the error?

If not, can you please direct me what to do?

In case my integration is wrong, I'll paste here what I did:

On libs folder I pasted the dropbox-core-sdk-3.0.8.jar file.  on build.gradle file I added

dependencies {
............
implementation files ('libs/dropbox-core-sdk-3.0.8.jar')
}

packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
}

On the manifest file I added

.........

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

.......

<application
........
<activity android:name=".MainActivity">
.........
</activity>
<activity
android:name="com.dropbox.core.android.AuthActivity"
android:configChanges="orientation|keyboard"
android:launchMode="singleTask">
<intent-filter>
<data android:scheme="db-MY APP KEY" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

</application>

I added the app key also to the strings in values

Maybe I was wrong here?

Thank you for all your help.

Re: Get a list of files from dropbox to android application

Greg-DB
Dropboxer

First, for reference, unless there is a particular reason you need to process the authorization every time, you can store and re-use access tokens, e.g., as done in the example here.

Anyway, are you using Android Studio? If so, there's a "Logcat" tab where you can selected the relevant device and thread (though they should be automatically selected for you by default) and see the output/stack trace for an exception.

Also, you don't need to add the jar manually. We recommend having your package manager download and install it automatically, as shown here

Re: Get a list of files from dropbox to android application

AppDev
Explorer | Level 3

Hi Greg,

I don't know if I understood you correctly... I'm using Android Studio.

On SDK Manager --> SDK Update Sites I added DropBox SDK and the path https://github.com/dropbox/dropbox-sdk-java (not sure about that, first time I'm trying to use it... )

Then on build.gradle I added 

dependencies {
    // ...
    compile 'com.dropbox.core:dropbox-core-sdk:3.0.8'
}

When I execute the app, the authentication is working, also 

DbxClientV2 client = new DbxClientV2(config, accessToken);

 Is working, but the app stop running after 

ListFolderResult result = client.files().listFolder("");

or even befor that, if I try to use 

FullAccount account = client.users().getCurrentAccount();

 If I use the emulator, the output on Logcat is:

09-03 21:11:39.413 18255-18255/? E/Zygote: v2
09-03 21:11:39.413 18255-18255/? I/libpersona: KNOX_SDCARD checking this for 10169
KNOX_SDCARD not a persona
09-03 21:11:39.414 18255-18255/? E/Zygote: accessInfo : 0
09-03 21:11:39.414 18255-18255/? W/SELinux: SELinux selinux_android_compute_policy_index : Policy Index[2], Con:u:r:zygote:s0 RAM:SEPF_SECMOBILE_7.0_0010, [-1 -1 -1 -1 0 1]
09-03 21:11:39.416 18255-18255/? I/SELinux: SELinux: seapp_context_lookup: seinfo=untrusted, level=s0:c512,c768, pkgname=com.example.downloadfilestry
09-03 21:11:39.425 18255-18255/? I/art: Late-enabling -Xcheck:jni
09-03 21:11:39.465 18255-18255/? D/TimaKeyStoreProvider: TimaKeyStore is not enabled: cannot add TimaSignature Service and generateKeyPair Service
09-03 21:11:39.948 18255-18255/com.example.downloadfilestry I/InstantRun: starting instant run server: is main process
09-03 21:11:40.052 18255-18255/com.example.downloadfilestry W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
09-03 21:11:40.201 18255-18255/com.example.downloadfilestry D/TextView: setTypeface with style : 0
09-03 21:11:40.202 18255-18255/com.example.downloadfilestry D/TextView: setTypeface with style : 0
09-03 21:11:40.212 18255-18255/com.example.downloadfilestry D/TextView: setTypeface with style : 0
09-03 21:11:40.215 18255-18255/com.example.downloadfilestry D/TextView: setTypeface with style : 0
09-03 21:11:40.432 18255-18255/com.example.downloadfilestry D/NetworkSecurityConfig: No Network Security Config specified, using platform default
09-03 21:11:40.459 18255-18255/com.example.downloadfilestry I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
09-03 21:11:40.460 18255-18255/com.example.downloadfilestry I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
09-03 21:11:40.461 18255-18255/com.example.downloadfilestry D/AndroidRuntime: Shutting down VM
09-03 21:11:40.463 18255-18255/com.example.downloadfilestry E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.downloadfilestry, PID: 18255
java.lang.RuntimeException: Unable to resume activity {com.example.downloadfilestry/com.example.downloadfilestry.MainActivity}: android.os.NetworkOnMainThreadException
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3844)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3885)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3051)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1642)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6776)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386)
Caused by: android.os.NetworkOnMainThreadException
at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1303)
at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:86)
at java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:74)
at java.net.InetAddress.getAllByName(InetAddress.java:752)
at com.android.okhttp.internal.Network$1.resolveInetAddresses(Network.java:29)
at com.android.okhttp.internal.http.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:209)
at com.android.okhttp.internal.http.RouteSelector.nextProxy(RouteSelector.java:163)
at com.android.okhttp.internal.http.RouteSelector.next(RouteSelector.java:105)
at com.android.okhttp.internal.http.HttpEngine.createNextConnection(HttpEngine.java:489)
at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:465)
at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:371)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:503)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:130)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:261)
at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:218)
at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java)
at com.dropbox.core.http.StandardHttpRequestor.getOutputStream(StandardHttpRequestor.java:123)
at com.dropbox.core.http.StandardHttpRequestor.access$000(StandardHttpRequestor.java:28)
at com.dropbox.core.http.StandardHttpRequestor$Uploader.<init>(StandardHttpRequestor.java:133)
at com.dropbox.core.http.StandardHttpRequestor.startPost(StandardHttpRequestor.java:72)
at com.dropbox.core.http.StandardHttpRequestor.startPost(StandardHttpRequestor.java:28)
at com.dropbox.core.DbxRequestUtil.startPostRaw(DbxRequestUtil.java:256)
at com.dropbox.core.v2.DbxRawClientV2$1.execute(DbxRawClientV2.java:121)
at com.dropbox.core.v2.DbxRawClientV2.executeRetriable(DbxRawClientV2.java:300)
at com.dropbox.core.v2.DbxRawClientV2.rpcStyle(DbxRawClientV2.java:116)
at com.dropbox.core.v2.files.DbxUserFilesRequests.listFolder(DbxUserFilesRequests.java:1612)
at com.dropbox.core.v2.files.DbxUserFilesRequests.listFolder(DbxUserFilesRequests.java:1662)
at com.example.downloadfilestry.MainActivity.onResume(MainActivity.java:67)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1277)
at android.app.Activity.performResume(Activity.java:7121)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3821)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3885) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3051) 
at android.app.ActivityThread.-wrap14(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1642) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6776) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386) 

 

If I use my phone, the output on Logcat is:

09-03 21:29:23.491 31016-31016/? E/Zygote: v2
09-03 21:29:23.492 31016-31016/? I/libpersona: KNOX_SDCARD checking this for 10169
KNOX_SDCARD not a persona
09-03 21:29:23.493 31016-31016/? E/Zygote: accessInfo : 0
09-03 21:29:23.493 31016-31016/? W/SELinux: SELinux selinux_android_compute_policy_index : Policy Index[2], Con:u:r:zygote:s0 RAM:SEPF_SECMOBILE_7.0_0010, [-1 -1 -1 -1 0 1]
09-03 21:29:23.494 31016-31016/? I/SELinux: SELinux: seapp_context_lookup: seinfo=untrusted, level=s0:c512,c768, pkgname=com.example.downloadfilestry
09-03 21:29:23.498 31016-31016/? I/art: Late-enabling -Xcheck:jni
09-03 21:29:23.518 31016-31016/? D/TimaKeyStoreProvider: TimaKeyStore is not enabled: cannot add TimaSignature Service and generateKeyPair Service
09-03 21:29:23.554 31016-31016/com.example.downloadfilestry W/ActivityThread: Application com.example.downloadfilestry is waiting for the debugger on port 8100...
09-03 21:29:23.574 31016-31016/com.example.downloadfilestry I/System.out: Sending WAIT chunk
09-03 21:29:24.580 31016-31023/com.example.downloadfilestry I/art: Debugger is active
09-03 21:29:24.776 31016-31016/com.example.downloadfilestry I/System.out: Debugger has connected
waiting for debugger to settle...
09-03 21:29:24.977 31016-31016/com.example.downloadfilestry I/System.out: waiting for debugger to settle...
09-03 21:29:25.177 31016-31016/com.example.downloadfilestry I/System.out: waiting for debugger to settle...
09-03 21:29:25.378 31016-31016/com.example.downloadfilestry I/System.out: waiting for debugger to settle...
09-03 21:29:25.578 31016-31016/com.example.downloadfilestry I/System.out: waiting for debugger to settle...
09-03 21:29:25.778 31016-31016/com.example.downloadfilestry I/System.out: waiting for debugger to settle...
09-03 21:29:25.979 31016-31016/com.example.downloadfilestry I/System.out: waiting for debugger to settle...
09-03 21:29:26.179 31016-31016/com.example.downloadfilestry I/System.out: debugger has settled (1500)
09-03 21:29:26.659 31016-31016/com.example.downloadfilestry I/InstantRun: starting instant run server: is main process
09-03 21:29:26.695 31016-31023/com.example.downloadfilestry I/art: Starting a blocking GC Instrumentation
09-03 21:29:26.808 31016-31016/com.example.downloadfilestry W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
09-03 21:29:27.020 31016-31016/com.example.downloadfilestry D/TextView: setTypeface with style : 0
09-03 21:29:27.024 31016-31016/com.example.downloadfilestry D/TextView: setTypeface with style : 0
09-03 21:29:27.070 31016-31016/com.example.downloadfilestry D/TextView: setTypeface with style : 0
09-03 21:29:27.083 31016-31016/com.example.downloadfilestry D/TextView: setTypeface with style : 0
09-03 21:29:37.114 31016-31021/com.example.downloadfilestry I/art: Do partial code cache collection, code=31KB, data=27KB
After code cache collection, code=30KB, data=27KB
Increasing code cache capacity to 128KB
09-03 21:29:39.360 31016-31016/com.example.downloadfilestry D/NetworkSecurityConfig: No Network Security Config specified, using platform default
09-03 21:29:41.825 31016-31016/com.example.downloadfilestry I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
09-03 21:29:41.832 31016-31016/com.example.downloadfilestry I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
09-03 21:29:42.114 31016-31021/com.example.downloadfilestry I/art: Do partial code cache collection, code=62KB, data=61KB
After code cache collection, code=60KB, data=60KB
09-03 21:29:42.115 31016-31021/com.example.downloadfilestry I/art: Increasing code cache capacity to 256KB
09-03 21:29:45.442 31016-31016/com.example.downloadfilestry D/AndroidRuntime: Shutting down VM
09-03 21:29:45.474 31016-31016/com.example.downloadfilestry E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.downloadfilestry, PID: 31016
java.lang.RuntimeException: Unable to resume activity {com.example.downloadfilestry/com.example.downloadfilestry.MainActivity}: android.os.NetworkOnMainThreadException
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3844)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3885)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3051)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1642)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6776)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386)
Caused by: android.os.NetworkOnMainThreadException
at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1303)
at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:86)
at java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:74)
at java.net.InetAddress.getAllByName(InetAddress.java:752)
at com.android.okhttp.internal.Network$1.resolveInetAddresses(Network.java:29)
at com.android.okhttp.internal.http.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:209)
at com.android.okhttp.internal.http.RouteSelector.nextProxy(RouteSelector.java:163)
at com.android.okhttp.internal.http.RouteSelector.next(RouteSelector.java:105)
at com.android.okhttp.internal.http.HttpEngine.createNextConnection(HttpEngine.java:489)
at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:465)
at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:371)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:503)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:130)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:261)
at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:218)
at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java)
at com.dropbox.core.http.StandardHttpRequestor.getOutputStream(StandardHttpRequestor.java:123)
at com.dropbox.core.http.StandardHttpRequestor.access$000(StandardHttpRequestor.java:28)
at com.dropbox.core.http.StandardHttpRequestor$Uploader.<init>(StandardHttpRequestor.java:133)
at com.dropbox.core.http.StandardHttpRequestor.startPost(StandardHttpRequestor.java:72)
at com.dropbox.core.http.StandardHttpRequestor.startPost(StandardHttpRequestor.java:28)
at com.dropbox.core.DbxRequestUtil.startPostRaw(DbxRequestUtil.java:256)
at com.dropbox.core.v2.DbxRawClientV2$1.execute(DbxRawClientV2.java:121)
at com.dropbox.core.v2.DbxRawClientV2.executeRetriable(DbxRawClientV2.java:300)
at com.dropbox.core.v2.DbxRawClientV2.rpcStyle(DbxRawClientV2.java:116)
at com.dropbox.core.v2.files.DbxUserFilesRequests.listFolder(DbxUserFilesRequests.java:1612)
at com.dropbox.core.v2.files.DbxUserFilesRequests.listFolder(DbxUserFilesRequests.java:1662)
at com.example.downloadfilestry.MainActivity.onResume(MainActivity.java:67)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1277)
at android.app.Activity.performResume(Activity.java:7121)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3821)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3885) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3051) 
at android.app.ActivityThread.-wrap14(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1642) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6776) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386) 

 

what seems to be the problem now? maybe I didn't install the SDK correctly?

Is this the way you ment to install the SDK or I missedunderstood you?

Re: Get a list of files from dropbox to android application

Greg-DB
Dropboxer

From the error output you shared, I see that you're getting a NetworkOnMainThreadException. You can find an answer about this here:

https://www.dropboxforum.com/t5/API-Support-Feedback/NetworkOnMainThreadException-connecting-to-Drop...

Re: Get a list of files from dropbox to android application

AppDev
Explorer | Level 3

I'm getting access denied, can you share the link again please?

Re: Get a list of files from dropbox to android application

Greg-DB
Dropboxer
Poll
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?
Who's talking

Top contributors to this post

  • User avatar
    AppDev Explorer | Level 3
  • User avatar
    Greg-DB Dropboxer
What do Dropbox user levels mean?
Need more support?