The Skype Widget

Mikael Magnusson
I am a developer
Published in
2 min readNov 2, 2015

When my dad got himself an Android tablet I wanted to help him understand the whole digital world. He had almost never used a computer or tablet before (neither iOS nor Android) so I knew I had to simplify things as much as possible for him to get used to it.

And one thing I stumbled upon was that Skype had made it possible to open Skype and ask it to automatically open up a video call to a specific person using Android Intents and a Skype formatted Uri:

Intent skypeVideo = new Intent("android.intent.action.VIEW");
skypeVideo.setData(Uri.parse("skype:" + "username" + "?call&video=true"));
startActivity(skypeVideo);

I had been doing some test coding for Widgets the day before so I coded and published this entire app in about four hours (very proud of that!); you can get it here.

A few things to note when creating a widget.

Widget tutorials

There are few Google samples on how to create a code a complete widget with a configuration Activity and aService updater. But here are some resources I found useful:

  1. Vogella’s widget tutorial
  2. This StackOverflow question
  3. This and this old Google example classes
  4. The sample found in the SDK; you find it in Eclipse using File > New > Other > Android samples > … > AppWidget
  5. Check out my widget on github :)

Saving configuration for each widget

This took the most time to figure out as I really thought there would be a better mechanism to save each widget’s configuration. The default way of doing this is through storing Preferences, like this:

When your configuration Activity is done and you need to save the widget’s configuration you call the saveTitlePref. And in your AppWidgetProvider onUpdate you get the widget’s configuration back through the loadTitlePref.

That’s basically it. Coding widgets was damn easy :)

(Originally published 2013–12–23)

--

--