The Galaxy SII Information lock screen

My Android lock screen was featured on Lifehacker! I submitted it to the desktop show and tell pool a few months ago and it seems to gave gathered some interest. Who would have thought.

Below are some words to explain how it was created. It does not require rooting, but two of the apps used cost money.

The key component of this custom lock screen is WidgetLocker, which you can get from the Android Market. It costs AU$ 1.89: https://market.android.com/details?id=com.teslacoilsw.widgetlocker
WidgetLocker lets you place any kind of widgets and shortcuts on the lock screen that you can usually only place on your home screen. Once WidgetLocker is installed it will replace your default lock screen that you may get with Sense or Touchwiz. If you have a PIN or pattern lock on the phone, you will still be prompted for it.

On the right hand side of my lock screen I use a 3×2 CalWidget to show any upcoming events in my various calendars. CalWidget is available for free from the Market: https://market.android.com/details?id=net.eggenstein.android.calwidget

The time, date, battery percentage and weather are displayed using Minimalistic Text, also available for free from the Market at https://market.android.com/details?id=de.devmil.minimaltext
Minimalistic Text is the part that took by far the most time to configure as it has a lot of options. Especially in combination with Tasker the possibilities are nearly endless, if you’re willing to spend the time configuring it.

Once the three apps are installed, start WidgetLocker and long press on the screen to add a widget, shortcut, application (icon) or custom slider.

WidgetLocker allows you to place iPhone and HTC Sense type sliders on your lock screen to unlock the phone. A vast number of custom sliders are available from the community at the XDA forums and the one I have used is ArrowSlider by toosurreal01: http://forum.xda-developers.com/showpost.php?p=11637091&postcount=12 (thread is NSFW!)

Once you’ve placed your slider in the desired spot, you can then add any other widgets that you like. Such as a 2×3 CalWidget. I’ve tweaked the colours so that the background is slightly tinted, whcih makes it easier to read the text, no matter what wallpaper I have.

There are lots of different dimensions to choose from for the Minimalistic Text widgets, and you may need to experiment a little to get this working properly. The clock, for instance, is a 1×2 widget with just one row of data: Hours first, then minutes, with custom font settings just for the element itself. You can also set up the Minimalistic Text widget to display the data top to bottom, which is what I have done with the date. Remember to select a 3×1 widget instead, if you do this, of course.

The Lifehacker article also mentioned that I am using Tasker (https://market.android.com/details?id=net.dinglisch.android.taskerm, AU$ 6.07) to get a new wallpaper.
Tasker is a powerful app that essentially lets you write little macros using a nice usable interface. The use of it is definitely more advanced than what I wrote above.

The central task I created to get a new wallpaper from APOD is called “Get apod Wallpaper”. I have set it to fire once at 3pm every day. It is based on some of the instructions found at XDA and in the Tasker wiki.

  1. copy the existing apod wallpaper (if there is one) from /apod.jpeg to /apod_old.jpeg. I have done this because I sometimes don’t like the wallpaper I get and so I can easily revert to yesterday’s.
  2. turn on WiFi (one doesn’t really need this)
  3. wait
  4. fetch the page that is at http://apod.nasa.gov/apod
  5. split the received page %HTTPD at <IMG SRC=” and then delete itbecause the result will be in %HTTPD1 and %HTTPD2
  6. split %HTTPD2 at ” and delete base, because the URL of the image will now be in %HTTPD21 and some garbage will be in %HTTPD22
  7. do another HTTP GET for apod.nasa.gov/apod/%HTTPD21, save the resilt as /apod.jpeg
  8. set wallpaper /apod.jpeg. Now you’ve got a new wallpaper for both the home and lock screen.
  9. Set a notification that the wallpaper has been updated. I do this so that when I don’t like the wallpaper I can tap the notification and tell it to revert to yesterday’s (see step 1). This notification is called “Apod updated” so that I can call another task when I tap it (see below).
This is the XML code for Tasker. It’s not quite human readable as the actions are out of order here. Sorry.
	<class cl="Task" sr="task12">
		<nme>Get apod Wallpaper</nme>
		<class cl="Action" sr="act1">
			<class cl="IntArg" sr="arg0">
				<val>1</val>
			</class>
			<code>425</code>
		</class>
		<class cl="Action" sr="act0">
			<code>404</code>
			<class cl="StringArg" sr="arg1" ve="2">
				<val>external_sd/apod/apod_old.jpeg</val>
			</class>
			<class cl="StringArg" sr="arg0" ve="2">
				<val>external_sd/apod/apod.jpeg</val>
			</class>
		</class>
		<class cl="AppIcon" sr="icn" ve="2">
			<icn>17301567</icn>
		</class>
		<id>12</id>
		<pri>10</pri>
		<class cl="Action" sr="act8">
			<class cl="IntArg" sr="arg4">
				<val>1</val>
			</class>
			<class cl="IntArg" sr="arg3">
			</class>
			<class cl="AppIcon" sr="arg2" ve="2">
				<icn>17301567</icn>
			</class>
			<class cl="StringArg" sr="arg1" ve="2">
				<val>Keep or revert?</val>
			</class>
			<class cl="StringArg" sr="arg0" ve="2">
				<val>Apod updated</val>
			</class>
			<code>523</code>
		</class>
		<class cl="Action" sr="act6">
			<class cl="StringArg" sr="arg5" ve="2">
				<val>external_sd/apod/apod.jpeg</val>
			</class>
			<class cl="StringArg" sr="arg4" ve="2">
				<val>image/jpeg</val>
			</class>
			<class cl="IntArg" sr="arg3">
				<val>10</val>
			</class>
			<class cl="StringArg" sr="arg2" ve="2">
				<val></val>
			</class>
			<class cl="StringArg" sr="arg1" ve="2">
				<val></val>
			</class>
			<class cl="StringArg" sr="arg0" ve="2">
				<val>apod.nasa.gov/apod/%HTTPD21</val>
			</class>
			<code>118</code>
		</class>
		<class cl="Action" sr="act7">
			<class cl="StringArg" sr="arg0" ve="2">
				<val>external_sd/apod/apod.jpeg</val>
			</class>
			<code>109</code>
		</class>
		<class cl="Action" sr="act4">
			<class cl="IntArg" sr="arg2">
				<val>1</val>
			</class>
			<code>590</code>
			<class cl="StringArg" sr="arg1" ve="2">
				<val>&lt;IMG SRC="</val>
			</class>
			<class cl="StringArg" sr="arg0" ve="2">
				<val>%HTTPD</val>
			</class>
		</class>
		<class cl="Action" sr="act5">
			<class cl="IntArg" sr="arg2">
				<val>1</val>
			</class>
			<code>590</code>
			<class cl="StringArg" sr="arg1" ve="2">
				<val>"</val>
			</class>
			<class cl="StringArg" sr="arg0" ve="2">
				<val>%HTTPD2</val>
			</class>
		</class>
		<class cl="Action" sr="act2">
			<class cl="IntArg" sr="arg4">
			</class>
			<class cl="IntArg" sr="arg3">
			</class>
			<class cl="IntArg" sr="arg2">
			</class>
			<class cl="IntArg" sr="arg1">
				<val>10</val>
			</class>
			<class cl="IntArg" sr="arg0">
			</class>
			<code>30</code>
		</class>
		<class cl="Action" sr="act3">
			<class cl="StringArg" sr="arg5" ve="2">
				<val></val>
			</class>
			<class cl="StringArg" sr="arg4" ve="2">
				<val>text/html</val>
			</class>
			<class cl="IntArg" sr="arg3">
				<val>10</val>
			</class>
			<class cl="StringArg" sr="arg2" ve="2">
				<val></val>
			</class>
			<class cl="StringArg" sr="arg1" ve="2">
				<val></val>
			</class>
			<class cl="StringArg" sr="arg0" ve="2">
				<val>apod.nasa.gov/apod</val>
			</class>
			<code>118</code>
		</class>
	</class>

The Task that fires when one clicks on the “Apod updated” task shows a dialog with a choice of two sub-tasks: “Keep New Apod Wallpaper” and “Revert To Old Apod” (both below)

	<class cl="Task" sr="task23">
		<nme>Apod dialog</nme>
		<id>23</id>
		<class cl="Action" sr="act1">
			<code>779</code>
			<class cl="IntArg" sr="arg1">
			</class>
			<class cl="StringArg" sr="arg0" ve="2">
				<val>Apod updated</val>
			</class>
		</class>
		<pri>10</pri>
		<class cl="Action" sr="act0">
			<class cl="StringArg" sr="arg5" ve="2">
				<val></val>
			</class>
			<class cl="IntArg" sr="arg4">
				<val>18</val>
			</class>
			<class cl="IntArg" sr="arg3">
			</class>
			<class cl="StringArg" sr="arg2" ve="2">
				<val>Keep New Apod Wallpaper</val>
			</class>
			<class cl="StringArg" sr="arg1" ve="2">
				<val>Revert To Old Apod</val>
			</class>
			<class cl="StringArg" sr="arg0" ve="2">
				<val>Happy With New Apod Wallpaper?</val>
			</class>
			<code>565</code>
		</class>
	</class>

“Keep New Apod Wallpaper” does absolutely nothing except remove the notification:

	<class cl="Task" sr="task24">
		<nme>Keep New Apod Wallpaper</nme>
		<id>24</id>
		<pri>10</pri>
		<class cl="Action" sr="act0">
			<class cl="IntArg" sr="arg0">
			</class>
			<code>25</code>
		</class>
	</class>

“Revert To Old Apod” removes the notification and copies the backup we took of the last apod back over the new one we didn’t like, and then sets the wallpaper again:

	<class cl="Task" sr="task22">
		<nme>Revert To Old Apod</nme>
		<id>22</id>
		<class cl="Action" sr="act1">
			<code>404</code>
			<class cl="StringArg" sr="arg1" ve="2">
				<val>external_sd/apod/apod.jpeg</val>
			</class>
			<class cl="StringArg" sr="arg0" ve="2">
				<val>external_sd/apod/apod_old.jpeg</val>
			</class>
		</class>
		<pri>10</pri>
		<class cl="Action" sr="act0">
			<code>406</code>
			<class cl="IntArg" sr="arg1">
			</class>
			<class cl="StringArg" sr="arg0" ve="2">
				<val>external_sd/apod/apod.jpeg</val>
			</class>
		</class>
		<class cl="Action" sr="act2">
			<class cl="StringArg" sr="arg0" ve="2">
				<val>external_sd/apod/apod.jpeg</val>
			</class>
			<code>109</code>
		</class>
	</class>

Comments are closed.