Forum Discussion

Anoop_Brijmohun's avatar
Anoop_Brijmohun
Helpful | Level 6
7 years ago

Xamarin Login issues

Hi guys,

im pretty new to xamarin and api's.

was working with the example seen here https://www.dropbox.com/developers/documentation/dotnet#tutorial

 

so i have managed to get the UWP working.

on my Android project the app just hangs and crashes

 

try
{
DropboxClient dbx = new DropboxClient("TOKEN HERE");

using (dbx)
{
var list = await dbx.Files.ListFolderAsync(string.Empty); // crashes here

// show folders then files
foreach (var item in list.Entries.Where(i => i.IsFolder))
{
Console.WriteLine("D {0}/", item.Name);
}

foreach (var item in list.Entries.Where(i => i.IsFile))
{
Console.WriteLine("F{0,8} {1}", item.AsFile.Size, item.Name);

}
}

 

anyone have a simple working example or can assist with the above

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    What error message and stack trace are you getting when it crashes on ListFolderAsync?

      • Greg-DB's avatar
        Greg-DB
        Icon for Dropbox Staff rankDropbox Staff

        I'm not sure I follow. You originally said it crashes on that method, but now you've said it actually returns null. Neither is supposed to happen, but please elaborate on exactly what you are seeing. You may want to add some extra logging, or step through with a debugger. (Is list actually null, or is list.Entries empty perhaps?)

        We don't officially support Xamarin, but we'll be happy to take a look to see if there's an API-level issue. 

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,950 PostsLatest Activity: 2 days ago
351 Following

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!