Author Topic: Programming on the Android smartphone  (Read 14478 times)

0 Members and 2 Guests are viewing this topic.

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: Programming on the Android smartphone
« Reply #15 on: April 20, 2011, 12:25:13 am »
Only thing is the internals suck for what they charge.

Too much flipping stuff means it will wear out extremely quickly. I recommend a 2nd Lock style approach instead, and having dedicated arrow keys. They won't take too much space. Don't forget you'll get more buttons by having only the screen on the top, and the entire 83+ surface area on the bottom.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Programming on the Android smartphone
« Reply #16 on: April 20, 2011, 12:28:50 am »
The issue with a calculator with cellphones capabilities though is that it would quickly get banned from school. Some cellphones are, already, due to disturbing classes, and people could just text each others the answers.

Otherwise, if there are no cellphone capabilities there is always UberGraphX which Uberspire is currently working on.

Offline Netham45

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2103
  • Rating: +213/-4
  • *explodes*
    • View Profile
Re: Programming on the Android smartphone
« Reply #17 on: May 13, 2011, 09:22:38 pm »
Oh hey, I'd been thinking of trying to compile Python on it myself, this will save me a bunch of time. :P
Omnimaga Admin

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: Programming on the Android smartphone
« Reply #18 on: May 13, 2011, 10:44:48 pm »
You can actually compile Python on the Android?

EDIT: I don't own an android but I'm going to try writing an output function for it. Liek the one in TI-Basic on the 84
does anyone know how many chars on a line in a python app on the android? and how many lines there are on the screen?
« Last Edit: May 13, 2011, 11:36:40 pm by ruler501 »
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Programming on the Android smartphone
« Reply #19 on: May 14, 2011, 01:01:36 pm »
You can actually compile Python on the Android?

EDIT: I don't own an android but I'm going to try writing an output function for it. Liek the one in TI-Basic on the 84
does anyone know how many chars on a line in a python app on the android? and how many lines there are on the screen?

I don't know if you can compile (if you can, it would be complicated), but you can run scripts using an interpreter.

When held vertically, the default amount of chars per line (on the output console) is 80, unless the user resized it.

Note that at this moment, any Python you write for the android has to be compatible with Python 2.6.2
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: Programming on the Android smartphone
« Reply #20 on: May 14, 2011, 01:29:56 pm »
How many Lines on the console?
I writing in python 2.6 so my code should be compatible.
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Programming on the Android smartphone
« Reply #21 on: May 14, 2011, 01:36:04 pm »
With keyboard showing:
 80 chars x 34 lines

Without keyboard showing:
 80 chars x 58 lines
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: Programming on the Android smartphone
« Reply #22 on: May 14, 2011, 01:36:55 pm »
Are there any good emulators I can use for free to test this?

EDIT: also how would I load the python file to it. Do i nee to run some kind of a script on it efore loading
« Last Edit: May 14, 2011, 01:37:48 pm by ruler501 »
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Programming on the Android smartphone
« Reply #23 on: May 14, 2011, 01:40:04 pm »
Are there any good emulators I can use for free to test this?

EDIT: also how would I load the python file to it. Do i nee to run some kind of a script on it efore loading

Sorry, I don't know any emulators.  I do know that there are free ones floating around, its just that I've never gotten around to finding one and setting it up.

Loading the python file: either type it in or do some sort of transfer thing.  You don't need to do anything special to get most code to run (except graphics -- not sure how that's going to work out)
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: Programming on the Android smartphone
« Reply #24 on: May 14, 2011, 01:49:49 pm »
I'm running it TI-BASIC like with Output command.
How do you get input with python on the android?
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Programming on the Android smartphone
« Reply #25 on: May 15, 2011, 06:09:01 pm »
I suppose one way would be to use 'raw_input()' or something.

If you want to use the actual android input methods, try this:
Code: [Select]
# No shebang necessary.

# You need these only if you want to use the android API.
import android
droid = android.Android()

# both the title and message are optional parameters.
title = "Name"
message = "Enter your name here:"

# Creating the input
droid.dialogCreateInput(title, message)
droid.dialogSetPositiveButtonText("Submit")
droid.dialogShow()

# Getting the response
response = droid.dialogGetResponse().result["value"]

print response

This uses the default input box.

See http://code.google.com/p/android-scripting/wiki/ApiReference for more info.
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.

Offline Binder News

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 785
  • Rating: +46/-3
  • Zombie of Tomorrow
    • View Profile
Re: Programming on the Android smartphone
« Reply #26 on: May 15, 2011, 06:11:13 pm »
If you need an emulator, download and install the Android SDK. It includes an emulator.
Spoiler For userbars:







Hacker-in-training!   Z80 Assembly Programmer     Axe Programmer
C++ H4X0R             Java Coder                           I <3 Python!

Perdidisti ludum     Cerebrum non habes

"We are humans first, no matter what."
"Fame is a vapor, popularity an accident, and riches take wings. Only one thing endures, and that is character."
Spoiler For Test Results:





Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: Programming on the Android smartphone
« Reply #27 on: May 15, 2011, 06:38:18 pm »
I did that. How do you get key inputs?

I have a simple output and ClrHome functions working now(sound familiar_)

EDIT: I forgot the code to send a python program to the android emulator. does anyone know what it is?
« Last Edit: May 15, 2011, 06:52:37 pm by ruler501 »
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y