Using Sharpbox to connect to dropbox from within an (Xamarin) Android app

Apr 13, 2013 at 1:39 PM
Hi,

I use Sharpbox with Xamarin for iOS and Android. The iOS version works fine, but the same code doesn't work at all in the Android version :-(

This is the code I use to get the Url the user can use to login to dropbox:
DropBoxConfiguration config = CloudStorage.GetCloudConfigurationEasy(nSupportedCloudConfigurations.DropBox) as DropBoxConfiguration;
config.AuthorizationCallBack = new Uri(callBackUrl);
requestToken = DropBoxStorageProviderTools.GetDropBoxRequestToken(config, consumerKey, consumerSecret);
DropBoxStorageProviderTools.GetDropBoxAuthorizationUrl(config, (DropBoxRequestToken)requestToken);
My app hangs when executing the third line: DropBoxStorageProviderTools.GetDropBoxRequestToken

I have a call stack like this one:
System.Security.Cryptography.X509Certificates.X509Store.Open (flags=) in
System.Security.Cryptography.X509Certificates.X509Chain.get_LMRootStore (Parameters=) in
System.Security.Cryptography.X509Certificates.X509Chain.get_Roots (Parameters=) in
System.Security.Cryptography.X509Certificates.X509Chain.get_CertificateCollection (Parameters=) in
System.Security.Cryptography.X509Certificates.X509Chain.FindParent (Parameters=) in
System.Security.Cryptography.X509Certificates.X509Chain.BuildChainFrom (Parameters=) in
System.Security.Cryptography.X509Certificates.X509Chain.Build (Parameters=) in
System.Net.ServicePointManager.ChainValidationHelper.ValidateChain (Parameters=) in
Mono.Security.Protocol.Tls.SslClientStream.OnRemoteCertificateValidation2 (Parameters=) in
Mono.Security.Protocol.Tls.SslStreamBase.RaiseRemoteCertificateValidation2 (Parameters=) in
Mono.Security.Protocol.Tls.SslClientStream.RaiseServerCertificateValidation2 (Parameters=) in
Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.validateCertificates (Parameters=) in
Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.ProcessAsTls1 (Parameters=) in
Mono.Security.Protocol.Tls.Handshake.HandshakeMessage.Process (Parameters=) in
Mono.Security.Protocol.Tls.ClientRecordProtocol.ProcessHandshakeMessage (Parameters=) in
Mono.Security.Protocol.Tls.RecordProtocol.InternalReceiveRecordCallback (Parameters=) in
My app has Internet permissions, but it seems it cannot get an answer from dropbox. Where is my mistake???

I would be very thankful for any ideas…

Thanks,
Jan
Apr 14, 2013 at 12:47 PM
Hi,

solved my problem. What I had overlooked was that exception handling in Xamarin studio was enabled for all exceptions and the debugger just stopped when some internal exceptions were thrown. After changing that my app runs fine.
Embarrassing...
Sorry for this needless post
Jan
May 2, 2013 at 1:23 PM
Hi JanJunius,

I am unable to connect to dropbox from xamarin.Android app.

Can you please detail on each step on how to do the same.

Regards
Vikram