Connecting to the d2l api via android application

79 views
Skip to first unread message

Kim

unread,
Apr 16, 2014, 5:27:55 PM4/16/14
to valenc...@googlegroups.com
I am looking for some help creating an android application to connect to the d2l api. I have created multiple C# web applications to do this but now I need to create an android app. I'm running into two problems. First is authentication I have gotten a webview to work to display and allow the user to log into d2l but since the app doesn't have a url I haven't been able to figure out how to get the query string returned.

Second problem is I tried using a hard coded user id and user key but I cannot get a basic whoami request to work. I have tried using the java client library compiling it and putting the .jar file into my libs folder with in the android project but the app crashes whenever I try to create an authenticated URI. I also looked at the d2l android sdk but it doesn't appear to have the create app context/ create usercontext creat authenticated uri methods in it. 

Am I missing a getting started sample or an example of connecting from android? Any help is greatly appreciated I have been working with this over a week with really no progress.

Thanks

Desire2Learn Staff: Viktor

unread,
Apr 17, 2014, 11:02:36 AM4/17/14
to valenc...@googlegroups.com
Hi Kim,

Thanks for moving your thread here. Sarah-Beth, our dev community management person, is consulting with the devs who could likely help out here, but it may take them a bit of time to get back to this thread.

Some historical background might clarify matters: the iOS and Android SDK bundles were actually created by a different group of devs (mobile dev specialists) from the main body of our SDK offerings. Thus, there might be differences in approach between the mobile SDKs and the others, and historically speaking, keeping them in any kind of synchronization has proved challenging. This should improve going forward.


Desire2Learn Staff: Mike Ruthven

unread,
Apr 17, 2014, 11:09:13 AM4/17/14
to valenc...@googlegroups.com
Hi Kim,

I don't know if this is the same problem, but we ran into something that sounds like what you're hitting when trying to use the Java library for Android ourselves. I was part of the move to unify the Java and Android using apache commons for Base64 encoding instead of a javax library (I'd have to look it up), and in theory it works, but there's a snag in that Android has its own Base64 implementation, that is just the apache commons implementation. Where we hit a snag is that the package names collide, and the Android Base64 implementation is missing the method signature that we use, and since the package names collide, we're hitting the framework version, and you get the problem you're seeing (I think).

I'll try and merge our changes with what's up on our GitHub account as soon as I can get it into a state that makes sense.

Desire2Learn Staff: Mike Ruthven

unread,
Apr 17, 2014, 4:09:13 PM4/17/14
to valenc...@googlegroups.com
Sorry Kim. A few of the changes that were community submitted weren't as backwards compatible as we would like, so we're having trouble validating my fix. Should be able to have it up for you on Monday.

Kim

unread,
Apr 17, 2014, 4:22:37 PM4/17/14
to valenc...@googlegroups.com
Thank you so much for trying! I look forward to Monday.

david....@desire2learn.com

unread,
Apr 21, 2014, 9:56:19 AM4/21/14
to valenc...@googlegroups.com
I've merged in Mike's change to fix the SDK for Android.  Mike was pretty confident in his changes at the end of day Friday.

Please let us know if that works for you now.  

Kim

unread,
Apr 21, 2014, 1:19:10 PM4/21/14
to valenc...@googlegroups.com
Where do I find this update? The GitHub link I have says updated six months ago so I am assuming I'm in the wrong spot (i'm going to: https://github.com/Desire2Learn-Valence/valence-sdk-android).
Thanks

Desire2Learn Staff: Sarah-Beth

unread,
Apr 21, 2014, 3:50:31 PM4/21/14
to valenc...@googlegroups.com
Hi Kim - David and Mike have updated our Java SDK to make it compatible with Android. That SDK can be found here: https://github.com/Desire2Learn-Valence/valence-sdk-java

Kim

unread,
Apr 21, 2014, 7:46:23 PM4/21/14
to valenc...@googlegroups.com
Thank you so much this works perfectly!
Reply all
Reply to author
Forward
0 new messages