| Reply | « Previous Thread | Next Thread » |
|
hello, im trying to make a little script that prints the latitude on a canvas using a internal gps from a n95 phone , but im getting an unexpected behaivor, my app closes when it tries to print the latitude, any idea of what is going wrong here?
thanks o. here is the code: from graphics import * import appuifw import e32 import positioning appuifw.app.screen='normal' appuifw.app.title=unicode('My Test App') canvas=appuifw.Canvas() appuifw.app.body=canvas positioning.select_module(positioning.default_module()) positioning.set_requestors([{"type":"service", "format":"application", "data":"test_app"}]) d = positioning.position() e = d["position"] canvas.clear() canvas.text( (2,12), str(e["latitude"])) |
|
Hi Oyuky and welcome to the Python Forum
!Did you try print the latitude on the Console? You could even use this to print any unicode texts when you are running your application, Code:
t=appuifw.Text() appuifw.app.body=t t.add(unicode(variable_name)) Croozeus PS: Use the CODE tabs (#) to post your CODE as I have done. This helps to maintain the indents in the code. |
|
hello, thanks for the reply, yes, i forgot to convert to unicode. i was getting boxes in my canvas instead of numbers.
i added this and now it works fine canvas.text( (2,12), unicode(str(e["latitude"]))) e32.ao_yield() e32.ao_sleep(15) bye |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| How to create a partly transparent Canvas to lay on top of another Canvas? | mkleijer | Mobile Java Media (Graphics & Sounds) | 4 | 2007-05-22 08:00 |
| Order of called methods (Constructor,paint(), run()) when using canvas and runnable? | edmund66 | Mobile Java Media (Graphics & Sounds) | 3 | 2004-09-22 10:40 |
| Major problem with delegation to Canvas | bartekn | Mobile Java Media (Graphics & Sounds) | 8 | 2003-10-08 18:46 |
| 7650 and 3650 Canvas and FullCanvas memory | marcilgen | Mobile Java General | 5 | 2003-07-08 13:24 |
| Larger canvas? | bjajo780 | Mobile Java General | 1 | 2002-06-18 15:17 |