0

I know there is Jython and there is android SDK. and I know how to use PIL in a PC.

I would like to create an Android app that runs this code from here:

def roll(image, delta):
    "Roll an image sideways"

    xsize, ysize = image.size

    delta = delta % xsize
    if delta == 0: return image

    part1 = image.crop((0, 0, delta, ysize))
    part2 = image.crop((delta, 0, xsize, ysize))
    image.paste(part2, (0, 0, xsize-delta, ysize))
    image.paste(part1, (xsize-delta, 0, xsize, ysize))

    return image
  1. How do I run python code in the Android Java application source code?
  2. How do I run PIL python code in the Android Java application source code? which means how to add the PIL lib to the project?
  3. Can I make a whole python application to android to upload on the Market?
0x90
  • 39,472
  • 36
  • 165
  • 245
  • What you're asking can't be done easily, I'm afraid. You're just going to have to bite the bullet and port that code to use Android's Java. – Chinmay Kanchi Oct 12 '12 at 17:34

2 Answers2

0

You can't use Jython on Android.

0x90
  • 39,472
  • 36
  • 165
  • 245
Daniel Roseman
  • 588,541
  • 66
  • 880
  • 895
0

I am not sure Jython is the right choice, one should consider running python in his java Android application: Is there a way to run Python on Android?

Community
  • 1
  • 1
0x90
  • 39,472
  • 36
  • 165
  • 245