Sunday, October 24, 2010

Tips for Transmission in Android


use Transmission Web UI


1. set environment variable TRANSMISSION_WEB_HOME to "/etc/transmission/web"

diff --git a/external/transmission/libtransmission/platform.c b/external/transmission/libtransmission/platform.c
index d3493ae..e7d6ab8 100644
--- a/external/transmission/libtransmission/platform.c
+++ b/external/transmission/libtransmission/platform.c
@@ -27,6 +27,10 @@
#include
#endif

+#ifndef TRANSMISSION_WEB_HOME
+ #define TRANSMISSION_WEB_HOME "/etc/transmission/web"
+#endif
+
#include
#include
#include
@@ -615,7 +619,10 @@ tr_getWebClientDir( const tr_session * session UNUSED )
s = NULL;
}
}
-
+#elif defined( TRANSMISSION_WEB_HOME )
+ {
+ s = tr_strdup( TRANSMISSION_WEB_HOME );
+ }
#else /* everyone else, follow the XDG spec */



2. copy its Web UI to rootdir

diff --git a/rootdir/Android.mk b/rootdir/Android.mk
index e91bad2..2f0ff12 100644
--- a/rootdir/Android.mk
+++ b/rootdir/Android.mk
@@ -5,6 +5,43 @@ include $(CLEAR_VARS)

copy_from := \
etc/dbus.conf \
+ etc/transmission/web/stylesheets/common.css \
+ etc/transmission/web/stylesheets/iphone.css \
+ etc/transmission/web/stylesheets/ie7.css \
+ etc/transmission/web/stylesheets/ie6.css \
+ etc/transmission/web/javascript/menu.js \
+ etc/transmission/web/javascript/common.js \
+ etc/transmission/web/javascript/torrent.js \
+ etc/transmission/web/javascript/transmission.remote.js \
+ etc/transmission/web/javascript/jquery \
+ etc/transmission/web/javascript/jquery/jquery.form.min.js \
+ etc/transmission/web/javascript/jquery/jquery.contextmenu.min.js \
+ etc/transmission/web/javascript/jquery/json.min.js \
+ etc/transmission/web/javascript/jquery/jquery.min.js \
+ etc/transmission/web/javascript/jquery/jquery.transmenu.min.js \
+ etc/transmission/web/javascript/dialog.js \
+ etc/transmission/web/javascript/transmission.js \
+ etc/transmission/web/index.html \
+ etc/transmission/web/images/favicon.ico \
+ etc/transmission/web/images/favicon.png \
+ etc/transmission/web/images/graphics/logo.png \
+ etc/transmission/web/images/graphics/filter_icon.png \
+ etc/transmission/web/images/graphics/chrome.png \
+ etc/transmission/web/images/graphics/iphone_chrome.png \
+ etc/transmission/web/images/graphics/transfer_arrows.png \
+ etc/transmission/web/images/graphics/filter_bar.png \
+ etc/transmission/web/images/progress/progress.png \
+ etc/transmission/web/images/buttons/cancel.png \
+ etc/transmission/web/images/buttons/info_activity.png \
+ etc/transmission/web/images/buttons/info_files.png \
+ etc/transmission/web/images/buttons/tab_backgrounds.png \
+ etc/transmission/web/images/buttons/torrent_buttons.png \
+ etc/transmission/web/images/buttons/toolbar_buttons.png \
+ etc/transmission/web/images/buttons/file_wanted_buttons.png \
+ etc/transmission/web/images/buttons/info_trackers.png \
+ etc/transmission/web/images/buttons/file_priority_buttons.png \
+ etc/transmission/web/images/buttons/info_general.png \
+ etc/transmission/web/images/webclip-icon.png \
etc/hosts


3. write transmission-daemon as a service in init.rc

diff --git a/rootdir/init.rc b/rootdir/init.rc
index 3011bf6..a3c45f8 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -361,6 +361,12 @@ service dbus /system/bin/dbus-daemon --system --nofork
user bluetooth
group bluetooth net_bt_admin

+service tr-daemon /system/bin/transmission-daemon -g /data/transmission -w /data/transmission/ -c /data/transmission/
+ user root
+ group net_admin system
+ disabled
+ oneshot
+
service bluetoothd /system/bin/bluetoothd -n
socket bluetooth stream 660 bluetooth bluetooth
socket dbus_bluetooth stream 660 bluetooth bluetooth


4. Some important arguments for transmission-daemon


-g --config-dir directory
Where to look for configuration files. When it stars to run, it would
write a settings.json file to this folder. It stores all config values.

-c directory
Directory to watch for new .torrent files to be added. If you push
torrent files to this directory, the daemon will load them into
Transmission automatically.

-w --download-dir
Where to store downloaded data.



5. add Transmission site "http://localhost:9091" to default Bookmark list in Browser

diff --git a/packages/apps/Browser/res/values/strings.xml b/packages/apps/Browser/res/values/strings.xml
index 18a2144..1824664 100644
--- a/packages/apps/Browser/res/values/strings.xml
+++ b/packages/apps/Browser/res/values/strings.xml
@@ -675,6 +675,8 @@
http://www.weather.com/
BBC
http://www.bbc.co.uk/
+ Transmission
+ http://localhost:9091/


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.