Android, Remote Only Client

Suggestions and discussion of future versions
infinityvoid

Android, Remote Only Client

Post by infinityvoid »

Howdy, I'm interested in porting the Deluge client to Android so I can monitor and admin my torrents when I'm on the go.

Given that Deluge is open source and released under the GPL what steps would I need to take before attempting to build a client?

Hope this doesn't seem like to simplistic of a question, this would be my first undertaking of this type.
ElmoTheElk
Member
Member
Posts: 25
Joined: Tue May 12, 2009 5:27 pm

Re: Android, Remote Only Client

Post by ElmoTheElk »

Hi infinityvoid,

Do you know Transdroid? I am developing this as a remote client for many torrent apps. It basically lets you control the daemon running on your server form your Andorid device. I am looking into supporting Deluge right a t this moment. See my post here: http://forum.deluge-torrent.org/viewtop ... =8&t=18645

As you can read over there, I'm having trouble getting enough information about Deluge's RPC API, but I am sure some developer will be able to answer my questions. Maybe you are interested in joining the development of Transdroid's support for Deluge? It is 100% open source an, I belief, well written and documented.

Eric
damoxc
Top Bloke
Top Bloke
Posts: 117
Joined: Sat Jul 19, 2008 7:26 pm
Location: Hampshire, UK
Contact:

Re: Android, Remote Only Client

Post by damoxc »

The best way to do this would be to have an android specific webui, there is practically zero point to a native client on android (at least in my point of view).
ElmoTheElk
Member
Member
Posts: 25
Joined: Tue May 12, 2009 5:27 pm

Re: Android, Remote Only Client

Post by ElmoTheElk »

Why do you think so, damoxc? Don't you prefer to use a native client over a webui?
damoxc
Top Bloke
Top Bloke
Posts: 117
Joined: Sat Jul 19, 2008 7:26 pm
Location: Hampshire, UK
Contact:

Re: Android, Remote Only Client

Post by damoxc »

Well, (at least in 1.2, the development version) Deluge is now using it's own RPC format, documented here: http://dev.deluge-torrent.org/wiki/Deve ... /DelugeRPC

You would have to create a java equivalent of this before any development could happen, unless python has been successfully ported along with the sdk (which I'm not aware of, but correct me if I'm wrong as that would be brill :)). And it's because of this that I'd personally just go for the web interface option.
ElmoTheElk
Member
Member
Posts: 25
Joined: Tue May 12, 2009 5:27 pm

Re: Android, Remote Only Client

Post by ElmoTheElk »

Okay. First of all: there will no longer be a JSON RPC API? That is a shame because many apps use this and I am not sure why you wouldn't.
Secondly: this protocol would still support remote web requests/responses right? So you don't actually have to do anything with Python; just send the web POST request...

Personally, I would go for the native client (and I have had several requests to support Deluge in my native Android app, so I'm sure I'm not alone).
damoxc
Top Bloke
Top Bloke
Posts: 117
Joined: Sat Jul 19, 2008 7:26 pm
Location: Hampshire, UK
Contact:

Re: Android, Remote Only Client

Post by damoxc »

Ahh right, so it'll go via the web json interface, that's still sticking around. Sorry, I've got brain freeze at the moment.

In 1.2, check the docstrings in deluge/ui/web/json_api.py and deluge/ui/web/auth.py and also the methods here:
http://dev.deluge-torrent.org/wiki/Deve ... #Remoteapi

There's a system.listMethods method as per the json-rpc spec which will return all the current method names.
ElmoTheElk
Member
Member
Posts: 25
Joined: Tue May 12, 2009 5:27 pm

Re: Android, Remote Only Client

Post by ElmoTheElk »

Yeah I think I can work it out. The only thing that I don't know and cannot find any documentation on is how to send the proper credentials. The regular web interface only has a single password, but what should I send with the JSON request?

I have tried to send a request to http://host:8112/json/rpc with the following JSON request stirng streamed as a POST:

Code: Select all

{"method":"login","params":{"password":"pass"}}
The result, however, was an unsatisfactory:

Code: Select all

Traceback (most recent call last):
  File "/var/lib/python-support/python2.6/deluge/ui/webui/lib/webpy022/wsgiserver/__init__.py", line 628, in communicate
    req.respond()
  File "/var/lib/python-support/python2.6/deluge/ui/webui/lib/webpy022/wsgiserver/__init__.py", line 361, in respond
    response = self.wsgi_app(self.environ, self.start_response)
  File "/var/lib/python-support/python2.6/deluge/ui/webui/lib/webpy022/webapi.py", line 314, in wsgifunc
    print >> debug, traceback.format_exc()
  File "/var/lib/python-support/python2.6/deluge/ui/webui/lib/webpy022/webapi.py", line 170, in _debugwrite
    out.write(x)
IOError: Errno 5 Input/output error
Actually, every request renders this response. The web interface is working fine, even when I enable the ajax template of the web interface (which looks great by the way).

Any hints please?
Eric
Last edited by ElmoTheElk on Fri May 15, 2009 9:51 am, edited 2 times in total.
damoxc
Top Bloke
Top Bloke
Posts: 117
Joined: Sat Jul 19, 2008 7:26 pm
Location: Hampshire, UK
Contact:

Re: Android, Remote Only Client

Post by damoxc »

If you going to be developing a new client I wouldn't bother working with 1.1, since there's such a drastic changes between it and 1.2.

Do an svn checkout of /trunk and develop using that.
ElmoTheElk
Member
Member
Posts: 25
Joined: Tue May 12, 2009 5:27 pm

Re: Android, Remote Only Client

Post by ElmoTheElk »

Sure. But is there any documentation on how the 1.2's JSON RPC API works? How do I send the proper login credentials?
Post Reply