I'm not entirely new to py60 (or to python in general) but since trying to use carbide.c++ lead me to huge frustrations, I went back to try writing a simple app using python.
Back when I had my N73, things were - IMHO - a bit more simple, but today coding simple apps to my N85 can be very confusing at times.
I'm trying, for the time being, to write a code that would enable me to stop or start the auto-rotation of the screen.
I tried using the .accelerometer, the .orientation and the .rotation functions, but neither of them worked (so I temporary put ALL of them in - please ignore that for the time being):
Running the menu and choosing to stop_listening does not prevent the screen to auto-rotate when I tilt the phone...
from sensor import *
self.rotation = RotationData()
self.orientation = OrientationData()
self.accelerometer = AccelerometerXYZAxisData()
flag = 1
Selection = appuifw.popup_menu([u'Turn OFF', u'Turn ON', u'Quit...'])
if (Selection == 0):
Selection = appuifw.note(u"OFF!", 'info')
elif (Selection == 1):
Selection = appuifw.note(u"ON!", 'info')
elif (Selection == 2):
flag = 0
if __name__ == '__main__':
app = SENSE()
print "Exiting SENSE"
BTW, I installed the 1.9.2 runtime and scriptshell on the phone, and yes, I know the code is not elegant and I'm sorry - but first I want this piece of code to work properly, and only then I'll refine the code to be more elegant