Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


python for android.. possible?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 bigbang89   Members   -  Reputation: 102

Like
0Likes
Like

Posted 23 December 2012 - 09:04 AM

I just made .py game using python 3.1... However, I would like it to run on android devices. however, I found a Pygame Subset for Android but I am indeed confused. the site says I must "Download and install PGS4A, Python 2.7, the Java Development Kit, and Android USB Drivers." if that's the case, should I just uninstall python 3.1 in my pc and retype all the codes for my game in python 2.7 OR is there a way to convert python 3.1 codes so that it may be compantible with python 2.7 I appreciate any helpful replies.

Sponsor:

#2 6677   Members   -  Reputation: 1058

Like
0Likes
Like

Posted 23 December 2012 - 09:41 AM

You would need to manually port the code to python 2.7. You cant put python games on the play store either, infact the end user would need to go through the process of installing python onto their device themselves and then manually loading their game into it.

If you want to write an app on android then just use java, C or C++. Python on android seems to be more useful for light programming on the go (it makes an excellent calculator for example).



#3 Blind Radish   Members   -  Reputation: 355

Like
0Likes
Like

Posted 23 December 2012 - 09:49 AM

Android runs on ARM right?  Pretty sure you might be able to use {this newish JIT compiler}.

No clue, but if I'm not mistaken, and I probably am, what you're looking for is the ability to compile or interpret the language and libraries on a specific CPU type which is likely ARM, which probably supports openGL ES, and odds are your game supports regular openGL.

Its potentially doable, as far as I can tell from my knowledge of how this stuff works.  Good luck.



#4 6677   Members   -  Reputation: 1058

Like
0Likes
Like

Posted 23 December 2012 - 02:09 PM

Android runs on ARM right?  Pretty sure you might be able to use {this newish JIT compiler}.

No clue, but if I'm not mistaken, and I probably am, what you're looking for is the ability to compile or interpret the language and libraries on a specific CPU type which is likely ARM, which probably supports openGL ES, and odds are your game supports regular openGL.

Its potentially doable, as far as I can tell from my knowledge of how this stuff works.  Good luck.

That is just another python interpreter. Your kinda on the wrong track there. As it is the default python interpreter runs on arm already. What he is after is running his .py file within the actual android environment (which is actually available on mips and x86 aswell as arm). Its doable with SL4A but that isn't practical for end users, the only way I know of the actually get a python app on the play store or in a neat .apk file would involve a lot of kludging around with java and NDK and by the time its working you would have been better off writing your app in java in the first place.



#5 Lightness1024   Members   -  Reputation: 737

Like
0Likes
Like

Posted 27 December 2012 - 08:27 AM

Java doesn't have the practicality of typeless python, but I wouldn't say Java is less productive, I would say python is nice for short programs that have limited code design complexity and limited size (< to 1000 lines I found to be manageable). But I'm going on a troll line here.

Anyway, if his python game is now working well and would be too long to adapt into python 2.7 (I doubt much has to be redone, there are not THAT many differences),

he still has the option to make an interpreter program for python 3 himself. There must be some python library for java somewhere. there is boost::python that can interpret python for C++. And I'm pretty sure many python interpreters are open source. But take the time to make all of that compile and run, if his game is not too big, a rewrite in 2.7 would be over long ago.



#6 smr   Members   -  Reputation: 1676

Like
0Likes
Like

Posted 27 December 2012 - 09:10 AM

** Edit: Didn't realize you were already using ps4a. Disregard.

 

You can already use python with pygame on Android, and also deploy these packages to the Play store. Check out pygame subset for Android, and kivy.


Edited by smr, 27 December 2012 - 09:12 AM.


#7 frob   Moderators   -  Reputation: 22283

Like
0Likes
Like

Posted 27 December 2012 - 11:38 PM

Its doable with SL4A but that isn't practical for end users, the only way I know of the actually get a python app on the play store or in a neat .apk file would involve a lot of kludging around with java and NDK and by the time its working you would have been better off writing your app in java in the first place.
This.

Just because you CAN do something does not make it a good idea.

I CAN make a tool that will emit my own executables, but then I would have spent my time writing a new compiler rather than writing a game.

It looks like you are on a similar path: You are creating a tool chain, you are not creating a game.

Currently the most direct route to creating a game is either to use Java or to use an existing engine. While you might find a way to do it with PyGame, it won't be the easiest or most direct route.

Check out my book, Game Development with Unity, aimed at beginners who want to build fun games fast.

Also check out my personal website at bryanwagstaff.com, where I write about assorted stuff.


#8 Servant of the Lord   Crossbones+   -  Reputation: 20377

Like
0Likes
Like

Posted 27 December 2012 - 11:50 PM

Ofcourse, if you're a brand new programmer entirely, then the best way to learn is to make things for the computer you are currently on, instead of making things for devices like Android and iPhone or game consoles. Python is an excellent choice, Java is another excellent one. There's no need to toss "Trying to get things working on Android"  into the mix if you are already burdened with "Trying to learn how to program in general". Sometimes trying to kill two birds with one stone makes you miss both birds.


It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal

[Fly with me on Twitter] [Google+] [My broken website]

[Need web hosting? I personally like A Small Orange]





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS