Using OAuth2 with Microsoft OneDrive and Xamarin.Auth

Last week I had an interesting question about Xamarin.Auth, a library that allows Xamarin apps to authenticate users via standard authentication mechanisms (OAuth2), and store user credentials.

You can see how I wrote the word “standard” in bold because as long as some OAuth2 service follows the standards, Xamarin.Auth should support it. So my answer to whether Xamarin.Auth will work with OneDrive’s OAuth mechanisms was clearly “of course, it does”.

I was wrong.

Continue reading

Adding async/await to CocosSharp actions

UPDATE: The CocosSharp team has decided to integrate my ideas directly into their source! 🙂

Are you a C# programmer? Using Xamarin? Are you interested in making great games that run…

  • cross platform,
  • from one code base
  • and are powered by Cocos2D and XNA?

If yes, then you should check out CocosSharp!

I used Cocos2D in the past (the “good” old days of ObjectiveC…) and liked it a lot. Seeing all this translated to C# just freaks me out! 🙂

However there has been one thing that bugged me: chaining actions and running actions simultaneously.

Say, you want your character to scale, then increase some score counter, afterwards make the character jump and then reset the animation phase to the default frame. You would use something like:

var scale = new CCScaleBy (1f, 1.5f);
var jump = new CCJumpBy (1f, new CCPoint (100, 100), 50, 2);

this.RunActions (scale, new CCCallFunc (() => this.UpdateScore ()), jump, new CCCallFunc(() => this.SpriteFrame = this.defaultFrame));

Works, but with the power of C# we can do better!

Continue reading

My iOS8 adventure as a Xamarin developer

With this post I sum up my experiences with iOS8 as a developer. If possible I will provide solutions and workarounds.

The release of iOS8 is really unfortunate for me. A lot of my demos have stopped working and it seems like there are some really annoying bugs in iOS8.

Update: Added working example for reachability

Update: Apple confirms bug in iOS8 Simulator regarding backgrounding.

Update: explanation for the NSUrlSession issue found!

Continue reading

iOS8 is draining your iPhone’s battery? Maybe here’s why.

If you like me are an early adoptor of iOS8 – be it because you’re just or curious about the new feature, or did it for work – you might have noticed that your device’s battery life might have decreased a lot. Yesterday I talked to some developer-friends and they told me: “You know what’s cool, iOS8 keeps on running threads even if applications have been backgrounded!” I was baffled.

UPDATE: This post has been moved and is now part of https://krumelur.me/2014/09/23/my-ios8-advent…arin-developer/ ‎

Android – handling screen rotation and different layouts using Fragments with Xamarin

When I was asked if I could demo how to handle different screen sizes and rotation in Android, I created a small project which I’d like to share here. You can find the complete repo at Github.

The demo uses Xamarin.Android and was built using the Compatibility Lib v4 to support Android’s navigation drawer layout. Fragments are used directly and not via the compatibility packages.

Navigation Drawer on a Nexus 7

Navigation Drawer on a Nexus 7

Continue reading

Change language in Google’s Developer console

If you are (like me) located in Germany but prefer to use the Google Developer Console in English, I encourage you to navigate to https://play.google.com/apps/publish/ now and then try to change your language settings. I’m waiting here…

You’re back? What do you mean, it’s not possible? Turns out you’re almost right. I talked to Google support and indeed there is nothing in the UI that would allow you to switch the language. However there’s a workaround. Just append “&hl=en” to the URL and you’re set!

 https://play.google.com/apps/publish?hl=en