×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    May 2008
    Posts
    53

    printing latitude on canvas

    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"]))

  2. #2
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,800

    Re: printing latitude on canvas

    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.
    Pankaj Nathani
    www.croozeus.com

  3. #3
    Regular Contributor
    Join Date
    May 2008
    Posts
    53

    Re: printing latitude on canvas

    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

Similar Threads

  1. How to create a partly transparent Canvas to lay on top of another Canvas?
    By mkleijer in forum Mobile Java Media (Graphics & Sounds)
    Replies: 4
    Last Post: 2007-05-22, 07:00
  2. Order of called methods (Constructor,paint(), run()) when using canvas and runnable?
    By edmund66 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2004-09-22, 09:40
  3. Major problem with delegation to Canvas
    By bartekn in forum Mobile Java Media (Graphics & Sounds)
    Replies: 8
    Last Post: 2003-10-08, 17:46
  4. 7650 and 3650 Canvas and FullCanvas memory
    By marcilgen in forum Mobile Java General
    Replies: 5
    Last Post: 2003-07-08, 12:24
  5. Larger canvas?
    By bjajo780 in forum Mobile Java General
    Replies: 1
    Last Post: 2002-06-18, 14:17

Posting Permissions

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