Introduction
The description of this article may sound kind of strange. One may think, "What can be easier than turning a tablet into a photo frame?". Because essentially it means just restricting features of a universal device. But despite of the facts that Android is open source and supposed to be quite flexible, it turns out that making an android-based photo frame is not so easy as it may sound. There are few obstacles that one may encounter. That's why I decided to share my own experience in this matter.
Hardware
The display is obviously the most important hardware part of a photo frame. One of the best tablet LCD is LP097QX1-SPA1 (which, for example, can be found in Apple IPads 3/4/Air). It has brilliant technical specification (source):
- resolution: 2048x1536;
- DPI: 264;
- color gamut: 99% sRGB;
- contrast radio: 877:1;
- color depth: 24 bits;
- maximum brightness: ~421 cd/m^2.
The only parameter which may be significantly improved (at least in theory) is the contrast radio. For example, OLED displays offer much higher contrast radio. But OLED displays available on the market now suffer from dramatic biasing of color reproduction from natural colors. Besides that, their lifetime (which is crucial for a photo frame) is quite low. Therefore the proposed display is likely to be the best choice for quite a long period.
There is a bunch of Chinese tablets based on Rockchip RK3066 which are equipped with this LCD: CUBE U9GT5, Window N90 FHD, VISTURE V4, Chuwi V99. The hardware of the tablets is almost identical and in my opinion the system performance is not enough for comfortable usage as a tablet due to high screen resolution, but it suits perfectly for the tasks of a photo frame. These devices are available on internet stores for ~$200USD. The examples from the section Software imply that the hardware is one of those, but the other information mentioned there is true for any Android 4.1-based tablet device.
Software
This section implies that the tablet which is going to became a photo frame runs Android 4.1, user has root access and the following apps are installed: BusyBox, Terminal Emulator.
The main part of the software setup is the app displaying photo slideshow. There is the free app called Wallpaper Slideshow, which solves this task pretty well. Once the app is installed, the user needs to upload images to the tablet and select the respective directory in the wallpaper slideshow settings.
The only feature I was missing is the ability to disable image cropping. Here is the patch implementing this option and here is the apk with this patch applied.
The next thing you may want to do is to get rid of the StatusBar.
Unfortunately, there is no configuration option controlling visibility of the
StatusBar. Moreover, Android API version 4.1 does not even allow to hide it if
the device was detected a tablet. The easiest way to do it is to remove
SystemUI.apk from the /system/apps
directory.
In order to be able to make any changes in the /system
directory, you need to
switch to root and remount the partiton in read-write mode (rw):
su
mount -o rw,remount /system
Then just remove the apk-file:
rm /system/app/SystemUI.apk
Doing this you will also eliminate USB connection manager, which is located in the same package. If you need it, then you'll have to properly cut StatusBar out from the SystemUI packet and rebuild it. Another way to do it is to hack the framework polity package and change condition under which the StatusBar can be hidden via API.
When StatusBar is hidden, one will probably miss the Home button. In this case
some other hardware button can be remapped to the Home button. This can be
done via editing the /system/usr/keylayout/rk29-keypad.kl
config file. For
example, this diff shows how to rebind Power button to the Home button:
--- rk29-keypad.kl 2013-10-28 23:16:07.339244212 +0400
+++ rk29-keypad-remapped.kl 2013-10-28 23:15:25.899468711 +0400
@@ -1,8 +1,8 @@
key 59 MENU
-key 102 HOME
+key 102 POWER
key 114 VOLUME_DOWN
key 115 VOLUME_UP
-key 116 POWER WAKE
+key 116 HOME WAKE
key 143 NOTIFICATION WAKE
key 158 BACK
key 212 CAMERA
The Power button functionality can be replaced with a widget or just
reboot [-p]
called in the terminal emulator.
Once StatusBar is hidden, you'll probably face with another issue: the Launcher application displays garbage at the bottom of the screen where the StatusBar was located. This issue can be solved by replacing the default Launcher app with Trebuchet (launcher from the Cianogen mod). I made a patch implementing two small modifications for the Trebuchet launcher:
- It hides the SearchBar with Google logo and the menu button (located at the top of the home screen).
- Longpress on the homescreen invokes the menu instead of the settings.
The apk with this patch applied is available here.
The last minor this to do is to disable screen sleeping. There is an option in android settings, which allows to always keep screen on while charging: Settings->Developer options->Stay awake. But even when this options is enabled, android will dim screen after a while of idle activity. Unfortunatelly there is no UI option to permanently disable turning screen off and dimming it. But this can be done manually via CLI with ease.
Obtain root permissions:
su
Open the settings database:
$sqlite3 /data/data/com.android.providers.settings/databases/settings.db
Set screen_off_timeout
to -1
in order to disable screen sleeping:
UPDATE "system" SET value='-1' WHERE name='screen_off_timeout';
To list all availavle options:
.dump system
Here is a brief description of the settings.
Close the database and quit:
.quit
The new setting will take effect after reboot:
reboot
That's it. Now you can add new features, put clock or a weather widget on your homescreen, anything you want. The free photo frame is ready!