×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Regular Contributor
    Join Date
    Sep 2009
    Posts
    285

    Appuifw query : Reads only 9 digits - Need more!

    Hi!

    In the application I am trying to build, I need to read the phone number from the user. For this, I am using the following code snippet -
    Code:
    import messaging, appuifw
    def sms_out:
    	num_out = appuifw.query(u"Enter phone number:",'number')
    	if (e32.in_emulator()):
    		print "Sending sms...", sms_out
    		print "To : ", num_out
    	else:
    		messaging.sms_send(num_out,sms_out)
    However, the maximum size of the number is 9 digits - which is a pain, since mobile phones have ten digit numbers (India).
    Is there any way to increase the size of the field in terms of digits accepted?

    Thanks
    Kedar

  2. #2
    Registered User
    Join Date
    Dec 2008
    Posts
    35

    Re: Appuifw query : Reads only 9 digits - Need more!

    Query for 'text', not 'number'. You will have to check if the text is actually a phone number, but it eliminates the length restriction.

  3. #3
    Registered User
    Join Date
    Nov 2009
    Posts
    2

    Re: Appuifw query : Reads only 9 digits - Need more!

    If you query for text, the device is put into 'text' input rather than 'number' input mode. This means that when you hit the '2' key, you get the letter 'A'.

    Not exactly the user experience we want.

    Any way to get a longer number in the input?

    --b

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

    Re: Appuifw query : Reads only 9 digits - Need more!

    Quote Originally Posted by brianacton View Post
    If you query for text, the device is put into 'text' input rather than 'number' input mode. This means that when you hit the '2' key, you get the letter 'A'.

    Not exactly the user experience we want.

    Any way to get a longer number in the input?

    --b
    hello brianacton

    ya you are true that its the not the correct user experience but AFAIK there is no relevant option in PyS60 apart from using text in the query.
    Last edited by gaba88; 2009-12-29 at 15:50.

  5. #5
    Regular Contributor
    Join Date
    Sep 2009
    Posts
    285

    Re: Appuifw query : Reads only 9 digits - Need more!

    Quote Originally Posted by gaba88 View Post
    ya you are ture that its the not the correct user experience but AFAIK there is no relevant option in PyS60 apart from using text in the query.
    That is true - it's not the best, but as of now, there is not much choice. Unless, we can have an input mode that reads it as a 'long' instead of 'int'. Can't think of any other method as of now...

  6. #6
    Registered User
    Join Date
    Mar 2009
    Posts
    4

    Re: Appuifw query : Reads only 9 digits - Need more!

    Quote Originally Posted by kedarm View Post
    Hi!

    In the application I am trying to build, I need to read the phone number from the user. For this, I am using the following code snippet -
    Code:
    import messaging, appuifw
    def sms_out:
    	num_out = appuifw.query(u"Enter phone number:",'number')
    	if (e32.in_emulator()):
    		print "Sending sms...", sms_out
    		print "To : ", num_out
    	else:
    		messaging.sms_send(num_out,sms_out)
    However, the maximum size of the number is 9 digits - which is a pain, since mobile phones have ten digit numbers (India).
    Is there any way to increase the size of the field in terms of digits accepted?

    Thanks
    Kedar
    hi,

    the workaround can be to use float instead of number such as

    num_out = int(appuifw.query(u"Enter phone number:",'float'))

  7. #7
    Registered User
    Join Date
    Mar 2009
    Posts
    4

    Re: Appuifw query : Reads only 9 digits - Need more!

    Quote Originally Posted by ayushaga View Post
    hi,

    the workaround can be to use float instead of number such as

    num_out = int(appuifw.query(u"Enter phone number:",'float'))
    further to my reply earlier, it works only with s60 3rd edition. for s60 2nd edition you have to stay with text.

  8. #8
    Registered User
    Join Date
    Nov 2009
    Posts
    2

    Re: Appuifw query : Reads only 9 digits - Need more!

    Using the following code snippet:

    Code:
    long(appuifw.query(u'Telephone Number', 'float', 4085551234))
    I see several problems:
    1) the phone number input is limited to 10 digits.
    2) if the phone number starts with zero, the leading zero will be lost.
    3) the prefill 4085551234 is converted to a 0 upon entry

    It does work, yes. And it's a viable alternative for US phone numbers (where 0 is not needed) but it really breaks down worldwide.

    Any other proposed alternatives?

Similar Threads

  1. Query dialog cancel problem
    By s4028469 in forum Symbian
    Replies: 2
    Last Post: 2007-09-25, 00:34
  2. I cannot send query string to the servlet
    By raghda in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2007-09-10, 07:23
  3. Query regarding pkg file syntax
    By vinayakak in forum Symbian
    Replies: 1
    Last Post: 2006-11-06, 12:14
  4. Multiline Query in 3rd edition sdk
    By parag_purkar in forum Symbian User Interface
    Replies: 1
    Last Post: 2006-09-26, 03:54
  5. php query problem in nokia
    By datareceived in forum Browsing and Mark-ups
    Replies: 0
    Last Post: 2002-12-10, 11:43

Posting Permissions

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