×

Discussion Board

Page 1 of 4 1234 LastLast
Results 1 to 15 of 50
  1. #1
    Regular Contributor
    Join Date
    Aug 2008
    Location
    Ahmedabad,Gujarat,India
    Posts
    65

    Unhappy Can I Use python instead of symbian C++?



    Hi,

    I have application developed in j2me which can authenticate user.

    I got to know that i can not call this application at the time of screen saver or at stand by mode of phone in j2me?

    For example instead of screen saver or standby my application starts.

    But i can do this using symbian c++.

    I am knowing nothing about symbian c++. totaly confused....

    So it will be tooooooooooo tough for me to develop this on symbian.

    Can i use python to develop this? is possible to develop this application using python? Will it be easy to use python instead of symbian c++ ?
    Python is also new for me..
    I want to develop this for nokia n series.

    If possible,Please give me some quick start for python.

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

    Smile Re: Can I Use python instead of symbian C++?

    Hi Niraj,

    Welcome to PyS60 !

    This is feasible : In your application you can ask the standby time and Lauch your application after that time using timers.


    Quote Originally Posted by nirajpendal View Post


    If possible,Please give me some quick start for python.
    Well, I guess you might have already noticed the PyS60 FAQ Sticky, incase not here is the link.

    Moreover you can find good code examples in the FN Wiki and croozeus.com

    Best Regards,
    Croozeus
    Pankaj Nathani
    www.croozeus.com

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

    Re: Can I Use python instead of symbian C++?

    Quote Originally Posted by nirajpendal View Post
    Python is also new for me..
    And here is a must read article for knowing merits and demerits of PyS60:

    Which technology should I use? Round 3: Python
    By Daniel Rocha - FN Expert



    Best Regards,
    Croozeus
    Pankaj Nathani
    www.croozeus.com

  4. #4
    Registered User
    Join Date
    Sep 2006
    Location
    Sarajevo, Bosnia and Herzegovina
    Posts
    166

    Re: Can I Use python instead of symbian C++?

    Or he can use appswitch?

    Code:
    phn=[u'Standby mode']
    
    def runing:
      if appswitch.application_list(0) in phn:
        appswitch.switch_to_fg(u'application name')
      e32.ao_wait(1)
      return(runing())
    i use this way
    Last edited by w00k; 2008-08-26 at 16:25.

  5. #5
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: Can I Use python instead of symbian C++?

    Hi Niraj
    yes python is very easy and most rapid programming platform for building mobile applications.
    You can develop some good applications with no time.
    You can start with the wiki and learn more here.

    Enjoy Pythoning
    Gaba88

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

    Smile Re: Can I Use python instead of symbian C++?

    Quote Originally Posted by w00k View Post
    Or he can use appswitch?
    Good Idea

    Should work ! But in either ways, he has to ask the standby time.

    Here is a link to Appswtich

    and a more polished code (with indentations)

    Code:
    phn=[u'Standby mode']
    
    def runing:
      if appswitch.application_list(0) in phn:
        appswitch.switch_to_fg(u'application name')
      e32.ao_wait(1)
      return(runing())
    Best Regards,
    Croozeus
    Pankaj Nathani
    www.croozeus.com

  7. #7
    Regular Contributor
    Join Date
    Aug 2008
    Location
    Ahmedabad,Gujarat,India
    Posts
    65

    Re: Can I Use python instead of symbian C++?

    Thanks Guys for your quick reply,It really help me alot.

    And special thanks to croozeus for his articles.

    I am going for python to develop my authentication application.

    Is it possible in python so that i can call my J2ME application?

    I have already created authentication(part of application) in J2me.Only remaining thing is ,I am not able to start(launch/activate) it on screen saver.as it is limitation of j2me.

    To launch application I am going to use this python.

    So it is any way out so that i can use my code developed in J2ME,don't have to rework in python.

  8. #8
    Regular Contributor
    Join Date
    Jul 2007
    Location
    Eindhoven, the Netherlands
    Posts
    187

    Re: Can I Use python instead of symbian C++?

    Quote Originally Posted by croozeus View Post
    and a more polished code (with indentations)

    Code:
    phn=[u'Standby mode']
    
    def runing:
      if appswitch.application_list(0) in phn:
        appswitch.switch_to_fg(u'application name')
      e32.ao_wait(1)
      return(runing())
    I think this still is not right...
    The return(running()) should definately not be called in this recursive way, it will cause the application to hang...

    Wook,
    can you please reformat your code with [code] tags so that it appears properly?

  9. #9
    Registered User
    Join Date
    Sep 2006
    Location
    Sarajevo, Bosnia and Herzegovina
    Posts
    166

    Re: Can I Use python instead of symbian C++?

    quote me and copy it

    i know abt this

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

    Smile Re: Can I Use python instead of symbian C++?

    Quote Originally Posted by hurenkam View Post
    I think this still is not right...
    The return(running()) should definately not be called in this recursive way, it will cause the application to hang...
    Yes, Mark. It will go into infinite loop.

    So I had written the following in my previous post

    Quote Originally Posted by croozeus View Post
    But in either ways, he has to ask the standby time.

    A better version here
    Code:
    phn=[u'Standby mode']
    
    def running:
      if appswitch.application_list(0) in phn:
        appswitch.switch_to_fg(u'application name')
      e32.ao_wait(1)
    
    a= appuifw.query(u"Enter time (in seconds) ","number")
    while(a>0):
        a=a-1
        running()
    Best Regards,
    Croozeus
    Pankaj Nathani
    www.croozeus.com

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

    Re: Can I Use python instead of symbian C++?

    Now as I think of the problem statement again, I recall one more function that can be used in this case.

    inactivity_time() function from the misty extension can be used if one doen't want to use appswitch.

    Code snippet is a homework activity

    Best Regards,
    Croozeus
    Pankaj Nathani
    www.croozeus.com

  12. #12
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: Can I Use python instead of symbian C++?

    Quote Originally Posted by croozeus View Post
    Now as I think of the problem statement again, I recall one more function that can be used in this case.

    inactivity_time() function from the misty extension can be used if one doen't want to use appswitch.

    Code snippet is a homework activity

    Best Regards,
    Croozeus
    If you want to get the inactivity time there's also a function in the built-in e32 module which returns the inactivity time in seconds: inactivity().

  13. #13
    Regular Contributor
    Join Date
    Jul 2007
    Location
    Eindhoven, the Netherlands
    Posts
    187

    Re: Can I Use python instead of symbian C++?

    Quote Originally Posted by croozeus View Post
    Yes, Mark. It will go into infinite loop.
    Ok so it wasn't a mistake...
    However it is very bad coding practice.
    I'm not sure about python internals, but most programming languages use a call stack
    to call a function. When you use recursion instead of a loop, then the process will eventually
    run out of stackspace and hang/crash or worse.

    Quote Originally Posted by croozeus View Post
    A better version here
    That one looks a lot better, and even I can understand how this works ;-)
    Thanks.

    Mark.

  14. #14
    Super Contributor
    Join Date
    Mar 2003
    Location
    Espoo, Finland
    Posts
    976

    Re: Can I Use python instead of symbian C++?

    Quote Originally Posted by hurenkam View Post
    I'm not sure about python internals, but most programming languages use a call stack
    to call a function. When you use recursion instead of a loop, then the process will eventually
    run out of stackspace and hang/crash or worse.
    Yes, I've seen that:

    Python: System error (-50)
    RuntimeError: maximum recursion depth exceeded
    Cheers,

    --jouni

  15. #15
    Regular Contributor
    Join Date
    Aug 2008
    Location
    Ahmedabad,Gujarat,India
    Posts
    65

    Wink Re: Can I Use python instead of symbian C++?

    Thanks you guys,
    thank you very much

    I have started working into python and feeling very interesting.

    I have used code for switching the application to the foreground and it works fine.

    I have one authentication application is ready developed in J2ME.

    The problem is how I can start this java application when phone is in idle(stand by) mode.

    I want to start application not just switch into foreground it.

    Or we can do one thing,

    if user hasn't pressed any key for e.g 60 seconds(phone is not accesses since 60 seconds) my Java application starts.
    Can we do this in python?

    Plz provide me some do so.

Similar Threads

  1. Symbian MMF with RTP
    By swatiSymbi in forum Symbian Media (Closed)
    Replies: 11
    Last Post: 2008-02-18, 12:25
  2. Replies: 11
    Last Post: 2007-10-03, 19:46
  3. Oracle Database Lite 10g Available for Symbian OS Phones
    By chirag_cel in forum News and Announcements
    Replies: 2
    Last Post: 2006-12-11, 07:00
  4. Symbian Signed Freeware & Python
    By mikebukhin in forum Symbian
    Replies: 18
    Last Post: 2006-10-02, 18:07
  5. Replies: 0
    Last Post: 2003-06-13, 01:09

Posting Permissions

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