Networking on Android

156 views
Skip to first unread message

Philip

unread,
Jul 18, 2011, 5:36:12 AM7/18/11
to Kivy users support
Hi,
I found out about your library on reddit and am interested in using it
on my next application.
I read through your documentation and pgs4a's documentation and
couldn't find an answer to this...

I want to implement networking in my app between a client android
phone and a server PC.
Is it possible to import libraries like Pyro or Twisted to handle
networking? Would I have to use the socket interface? How do I get
these libraries to include when I build the apk?

http://irmen.home.xs4all.nl/pyro/
http://twistedmatrix.com/trac/wiki/TwistedCore

Thanks

Mathieu Virbel

unread,
Jul 18, 2011, 6:41:00 AM7/18/11
to kivy-...@googlegroups.com
HI Philip,

Yes, you can use Pyro or Twisted. We are shipping socket python module into the build, but not theses libraries.
If you want to use it, you need to embed it yourself. For example, you can create a "libs" directory, put twisted in it, and add in the top of your code:

# Add <curdir>/libs to the python module search paths
from os.path import dirname, join
from sys import path
path.append(join(dirname(__file__), 'libs'))

If you intend to make a server (ie bind a socket), you need to activate the INTERNET permission too:

# on the kivy-android package
./build.py <put standard options here> --permission INTERNET

That's all !

Mathieu

2011/7/18 Philip <philip...@gmail.com>

Philip

unread,
Jul 18, 2011, 6:50:55 AM7/18/11
to Kivy users support
Thanks for the quick, complete response!
I look forward to using your library.

On Jul 18, 10:41 am, Mathieu Virbel <m...@kivy.org> wrote:
> HI Philip,
>
> Yes, you can use Pyro or Twisted. We are shipping socket python module into
> the build, but not theses libraries.
> If you want to use it, you need to embed it yourself. For example, you can
> create a "libs" directory, put twisted in it, and add in the top of your
> code:
>
> # Add <curdir>/libs to the python module search paths
> from os.path import dirname, join
> from sys import path
> path.append(join(dirname(__file__), 'libs'))
>
> If you intend to make a server (ie bind a socket), you need to activate the
> INTERNET permission too:
>
> # on the kivy-android package
> ./build.py <put standard options here> --permission INTERNET
>
> That's all !
>
> Mathieu
>
> 2011/7/18 Philip <philipbjo...@gmail.com>
Reply all
Reply to author
Forward
0 new messages