How to make Python ctypes on Android?

887 views
Skip to first unread message

Jordan Jambazov

unread,
Apr 4, 2013, 8:56:04 AM4/4/13
to kivy-...@googlegroups.com
I'm currently struggling to make the python ctypes module work on Android device. What I did was to remove the ctypes module from the python recipe patch disable_modules_list. When I start the application on the device it crashes and in the log I see the following error:

[WARNING           ] stderr: ImportError: No module named ctypes


Could you please just give me some directions about how to make the ctypes module work on mobile devices?

Gabriel Pettier

unread,
Apr 5, 2013, 2:19:27 PM4/5/13
to kivy-...@googlegroups.com
Not expert in these things, and not saying you shouldn't use ctypes, but
kivy comes with cython, maybe you can use that instead of ctypes?
> --
> You received this message because you are subscribed to the Google Groups "Kivy users support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Jordan Jambazov

unread,
Apr 5, 2013, 4:43:13 PM4/5/13
to kivy-...@googlegroups.com
I want to use the structures and unions features of the ctypes module. But that's not the big deal. Also I want it in order to load dynamic link C/C++ libraries, containing functionality that I wouldn't like write in Cython. It would be great to have the ctype module running on Android and iOS devices!


2013/4/5 Gabriel Pettier <gabriel...@gmail.com>
You received this message because you are subscribed to a topic in the Google Groups "Kivy users support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kivy-users/AOpkaWJuaGU/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to kivy-users+...@googlegroups.com.

Mathieu Virbel

unread,
Apr 6, 2013, 8:48:20 AM4/6/13
to kivy-...@googlegroups.com
Hi,

Somebody send while ago a patch to make ctypes working, but i don't
remember which mailing list (-dev / -users, or python-android).

Nobody tried on iOS (mostly because you can't dlopen(), but i think that
should'nt be a big issues if you introspect with dlsym in the current
context.)

Mathieu

Le 05/04/2013 22:43, Jordan Jambazov a �crit :
> I want to use the structures and unions features of the ctypes module.
> But that's not the big deal. Also I want it in order to load dynamic
> link C/C++ libraries, containing functionality that I wouldn't like
> write in Cython. It would be great to have the ctype module running on
> Android and iOS devices!
>
>
> 2013/4/5 Gabriel Pettier <gabriel...@gmail.com
> <mailto:gabriel...@gmail.com>>
>
> Not expert in these things, and not saying you shouldn't use ctypes, but
> kivy comes with cython, maybe you can use that instead of ctypes?
>
> On Thu, Apr 04, 2013 at 05:56:04AM -0700, Jordan Jambazov wrote:
> > I'm currently struggling to make the python ctypes module work on
> Android
> > device. What I did was to remove the ctypes module from the python
> recipe
> > patch disable_modules_list. When I start the application on the
> device it
> > crashes and in the log I see the following error:
> >
> > [WARNING ] stderr: ImportError: No module named ctypes
> >
> >
> > Could you please just give me some directions about how to make
> the ctypes
> > module work on mobile devices?
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "Kivy users support" group.
> > To unsubscribe from this group and stop receiving emails from it,
> send an email to kivy-users+...@googlegroups.com
> <mailto:kivy-users%2Bunsu...@googlegroups.com>.
> > For more options, visit https://groups.google.com/groups/opt_out.
> >
> >
>
> --
> You received this message because you are subscribed to a topic in
> the Google Groups "Kivy users support" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/kivy-users/AOpkaWJuaGU/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to
> kivy-users+...@googlegroups.com
> <mailto:kivy-users%2Bunsu...@googlegroups.com>.

qua-non

unread,
Mar 25, 2014, 5:06:53 AM3/25/14
to kivy-...@googlegroups.com
Just for future reference I found this https://bitbucket.org/Nodrev/kivy-python-for-android-with-ctypes.
We should look at merging the changes back into kivy/py4a
Reply all
Reply to author
Forward
0 new messages