I am not able to get the user account email after the authentication:
I have this code (in Kotlin) on my onResume
mDBApi!!.session.finishAuthentication() val accessToken = mDBApi!!.session.oAuth2AccessToken val client = DbxClientV2(DbxRequestConfig.newBuilder("dropbox/MyAppName").build(), accessToken) val email = client.users().currentAccount.email
but the getCurrentAccount() throws me 'android.os.NetworkOnMainThreadException'.
How can I solve this to get the user account email?
You're getting a NetworkOnMainThreadException, which means you're trying to make a network call on the main thread, which isn't allowed on Android. (The Dropbox API methods each make a network call to the Dropbox API servers.) You should make this call on a background thread instead. This isn't specific to Dropbox, so there are several answers about how to do this on StackOverflow, e.g.:
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?