Giter Club home page Giter Club logo

androidphotoframe's Introduction

Android Photo Frame

This is an atempt to reuse an old Android tablet instead of putting it to trash.

Requirements

Setup

I have used ADB to copy, modify and test. But use what ever method works for you. This guide will not over how to install ADB, see link in requirements.

Copy some scripts

adb push *.sh /sdcard/

Install some apps

Either download them from Play Store or from some other place and run adb install *.apk

Setup some apps

Syncthing

Remeber to setup folder to use Send & Receive, else it wont work.
Syncthing Send & Receive

Photo Slides

Create a shortcut on your desktop/launcher.
Go through settings for timers, animations etc.
Select your camera folder (mine was: /sdcard/DCIM/Camera)
You can also run to add via sqlite.
First adb shell, then:

dbpath="/data/data/softick.android.photoframe/databases/PhotoFrameDB"
picdir="/sdcard/DCIM/Camera"
sqlite3 $dbpath "insert into folders(foldID,folder_path,folder_check) values(1,'$picdir',1)"

Have included my Photo Slides config which are located at:
/data/data/softick.android.photoframe/shared_prefs/softick.android.photoframe_preferences.xml
Install config via adb:

adb push softick.android.photoframe_preferences.xml /data/data/softick.android.photoframe/shared_prefs/

SH Script Runner

Add local scripts Hide Bar, Hide bar when connecting charger and Show Bar.
SH Script Runner Add Local Scripts

Hide Bar setup:
SH Script Runner Hide bar at boot

Hide Bar when connecting charger setup:
SH Script Runner Hide bar when connecting charger

Show Bar setup:
SH Script Runner Show Bar

Final setup with all scripts looks like this:
SH Script Runner Setup

Add shortcuts to your desktop for easy access:
SH Script Runner Shortcut

AutoStart

Here is my setup:
AutoStart Setup

Nova Launcher

Set as default, hide some elements. Chose this mainly due to swipe up action for app drawer access. But not a real requirement for the setup. Here is my launcher with bar and without.
With system bar Without system bar

Get touch coordinates

Run adb shell getevent -l and press CTRL+C after touching the display
Look foor POSITION_X and POSITION_Y:

...
/dev/input/event4: EV_ABS       ABS_Z                000000d7            
/dev/input/event4: EV_SYN       SYN_REPORT           00000000            
/dev/input/event5: EV_ABS       ABS_MT_POSITION_X    00000142            
/dev/input/event5: EV_ABS       ABS_MT_POSITION_Y    000000b9            
/dev/input/event5: EV_ABS       ABS_MT_TOUCH_MAJOR   000000c8      
...

Take that value and convert from HEX to DEC. Example 142 in HEX = 322 DEC.
Change these values in framenewpictures.sh for lines where input tap:

input tap XXX YYY # landscape
input tap XXX YYY # portrait

Crontab

Update crontab.sh according to your preference. Default for update is every 10 minutes and delete log 1th of every month.
Then run:

adb shell /sdcard/crontab.sh

Test

Add some pictures, restart and hope for the best.

Add new pictures

Upload pictures via Syncthing and add/edit textfile refresh.txt to contain the word yes. The script framenewpictures.sh should then notice that refresh.txt is yes, reload your pictures in to the database and restart Photo Slides app. Once done also change content of refresh.txt to no.

Improvments

Some stuff that could be improved or added:

  • Check screen orientation instead of sending two taps
dumpsys | grep 'SurfaceOrientation' | awk '{ print $2 }'
  • Fancier update check Instead of using refresh.txt you could fetch a value from web or other. But works and is simple.

  • OpenVPN Install openvpn client for why not? Add remove support?

  • Updater Have a script run from syncthing folder to run remote updates.

Other

hide/show system bar

Thank you masashi-k for your info.
Created two simple shell scripts to hide system bar (navigation and notifications) as the app did not do that.
Add them to SH Script Runner with automations

Format storage

Had to fix internal storage after a restore.

fdisk /dev/block/avnftli
d 1
o
w
n
p
1
w
mkfs.exfat /dev/block/avnftli1

androidphotoframe's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.