Home For Fiction – Blog

for thinking people


December 23, 2018

What If – Random Quote Generator Widget

Programming

Android, app, computer, programming, what if, widget

Please note that none of my Android apps is any longer maintained – and they’re not even available on Google Play anymore – for reasons you can read about here. If you still have any of the Home for Fiction Android apps installed on your phone, you’re advised to uninstall them. The post below should be seen purely as a snapshot of history.

Besides GhostWriter and Narrative Nods, I’ve also published a third Android app about which I haven’t talked in this blog. The app is called What If – Random Quote Generator Widget.

As the name probably reveals, it’s a simple widget that lives on your screen and shows random what if quotes. It’s an entirely random quote generator, which means it can produce some inadvertently hilarious phrases.

Tapping the widget takes you to a settings screen, where you can customize the font and background colors to fit individual wallpapers. It’s also possible to make them transparent.

Changing the colors also updates the widget text. Automatic updates occur once per hour.

There is also a page on the main HomeForFiction website dedicated to this widget.

Finally, here’s a little online preview of what kinds of phrases the widget can produce. The snippet below runs in an iframe hosted on raw.githack. It’s written in JavaScript – obviously, the Android app is written in Java – but the results are exactly the same.

Click to run the program

Note for Developers:  The code for this what if random quote generator is remarkably simple.  

//You need the RiTa library from https://rednoise.org/rita/

var adjective, nounsing, verbbase, phrase1;
adjective = RiTa.randomWord("jj");
nounsing = RiTa.randomWord("nn");
verbbase = RiTa.randomWord("vb");
phrase1 = ("What if the " + adjective + " " + nounsing + " " + "could " + verbbase +"?");
document.write(phrase1);

Looking for another quote generator, of the more… demotivational kind? Take a look at this post!