Skip to content

An Android homescreen widget for displaying various information about the author Brandon Sanderson.

Notifications You must be signed in to change notification settings

ITJammish/sanderson-widget

Repository files navigation

Keeping up with Sanderson

Sanderson Widget 1.0 screen screenshot

Brandon Sanderson, sci-fi and fantasy author, is known in the industry for writing incredibly fast. During the pandemic Brandon was able to write 5 extra novels in the time freed up by cancelled book touring. The man is a machine, and this is good news for his readers! He has so many projects and book series that it's hard to know when the next book is coming out. Thankfully Brandon's team let us know by publishing his writing progress on his website, but wouldn't it be great if you could be more seamlessly kept up to date? Yes, there's a mailing list... but now there's an Android home screen widget too!

The Sanderson progress widget is an indie project that I wanted to build for myself, but made sense to publish for the wider Sanderfans.

"What is a Widget?"

A home screen widget is an extension of an application that you can see outside of that app. It's like a window to a small part of an app's functionality that persists in an area of your home screen. Many apps have widgets that can be super helpful, but they're not widely promoted.

Some widgets are stand alone and don't have a core app that can be run, they just kind of exist as widgets and that's all they do. The Sanderson progress widget is one such widget.

"How does it work?"

When you place the widget a web call is made to https://www.brandonsanderson.com/ just like if you were visiting the page yourself in a browser, but rather than render the page we scan through the raw html and pull out (scrape) the information that we're interested in and pass that information to the widget to display it on your home screen. As long as the widget is on your home screen we'll poll for changes every so often in case the writing progress on the website has been updated.

"No, I mean; how does it work? How can I add a widget to my home screen?"

The first step is to get the widget app (it's an app as far as your device is concerned) onto your device. It is not currently available on the Google PlayStore, but should be soon. Until then, any developer can pull this project, compile and install it freely.

Once installed you have to find the Widget menu (Widgets aren't allowed to play with all the other apps, they get their own menu). Different phones have different ways of getting to this menu. Even Google doesn't make it obvious, but thankfully they've got some information here that can help.

Getting started

The easiest way is to install the widget from the Google Play Store. In order to run this project manually simply pull the code, build, install and have fun. Since we're not using an API there is no user ID keys required, but please be respectful and don't DOS Brandon's website. Or if that's really your bag, please don't use this project to do so.

If you'd like to learn more about coding widgets this is a good introduction. Android Studio also offers a Widget template that is a very useful place to start. I also found this video tutorial series by Coding in Flow very helpful.

Known Issues:

  • Theming specifically on Android 11 devices is not fully working: the flat progress bars are showing a default colour value.
  • Background images are not resizing automatically when the device is rotated.

If you find any unlisted issues please raise an issue here, or message me on 17th shard.

Thank you!

About

An Android homescreen widget for displaying various information about the author Brandon Sanderson.

Resources

Stars

Watchers

Forks

Packages

No packages published