You Are Here:

Community: Developer Discussion Boards

#1 Old printing latitude on canvas - 2008-05-19, 14:56

Join Date: May 2008
Posts: 53
oyuky
Offline
Regular Contributor
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"]))
Reply With Quote

#2 Old Re: printing latitude on canvas - 2008-05-19, 15:04

Join Date: May 2007
Posts: 2,738
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Offline
Forum Nokia Champion
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))
Best Regards,
Croozeus

PS: Use the CODE tabs (#) to post your CODE as I have done. This helps to maintain the indents in the code.
Reply With Quote

#3 Old Re: printing latitude on canvas - 2008-05-20, 05:36

Join Date: May 2008
Posts: 53
oyuky
Offline
Regular Contributor
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 With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
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

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia