#5 Smartphone support

closed-accepted
None
5
2007-10-04
2007-03-24
No

The attached patch provides initial support for running PythonCE on windows mobile powered smartphone devices. The same CAB file will now install and operator on both Pocket PC and Smartphone devices.

The changes are as follows:

1) Altered the cab file inf file to remove potential warnings during installation about incompatible screen sizes.

2) Altered window creation code such that failure to query the size of the Software Input Panel (SIP) is not considered a fatal error. Smartphones do not have SIPs, so SIP related API calls will always return error codes.

3) Sent a couple of smartphone specific window messages to the main edit control. These messages override the behaviour of the '1' key on a cellphone's keypad when in mutli-tap mode such that the user has easy access to symbols such as ()[]@: etc as often needed when entering Python source code. On Pocket PC powered devices these additional messages will be ignored.

4) Fixed a race condition which appeared to be falling over more often than it does on the pocket pc platform. When the second thread within python.exe is started up the main thread suspends itself (via a call to SuspendThread) until it is woken up by the second thread after it has performed initialisation (via a call to ResumeThread).

The issue is if the newly created thread manages to execute it's call to ResumeThread before the main thread has gained control of the processor again after creating the new thread. This leads to the situation of the main thread entering it's call to SuspendThread and never being woken up (due to the second thread having called ResumeThread before we suspended).

The solution I have used is to utilise a named event instead. The main thread creates an event called "PythonStartup", the newly created thread simply sets this event to the signaled state when completed, and the main thread waits for it to be become signaled. This means the main thread can detect when the second thread has completed initalisation even if it completes before we wait for it to occur on the main thread.

Discussion

1 2 > >> (Page 1 of 2)
  •  
    Attachments
  • Logged In: YES
    user_id=1751877
    Originator: YES

    attached a screenshot of PythonCE running on a smartphone
    File Added: script.png

     
  • jasontck80
    jasontck80
    2007-09-28

    Logged In: YES
    user_id=1900665
    Originator: NO

    Hi Christopher! would you mind attach the working pythonce for smartphone5.0 cab file here. Thanks in advance! =)

     
  • Logged In: YES
    user_id=1751877
    Originator: YES

    My original CAB files (the ones which produced the screenshots) have been lost.

    After making the original patches I lost a little bit of interest in this project, since there didn't seem to be a heck of a lot of development effort going into the project this year and I hadn't received much feedback.

    Since I've had a number of requests recently for a smartphone CAB file, I took a look at what source code I had floating around on my harddrive and tonight produced the following CAB file (PythonCE.SP2005_ARM.CAB). It should work on any WM5.0+ Pocket PC or Smartphone device, but I havn't given it much testing other than getting it to execute a few statements such as "print 1 + 4" etc (use at your own risk....)

    Unfourtantly a lot of my code changes since this original patch have probably been lost (I think I must have accidentally deleted a folder or two at some stage). I had done a number of additional improvements since this original patch, including at one stage having a single CAB file which should have worked on all Pocket PC, Smartphone and "raw" Windows CE devices running WinCE v4.2 or greater.

    Is there much community interest in a smartphone build of Python? Is the lack of patches to this project, an indication of lack of interest, or an indication that most people are happy with the current builds?

     
  • Logged In: YES
    user_id=1751877
    Originator: YES

    Hmm... at the moment I can't seem to upload any file to this issue. I just get a "connection could not be established" error when I click the submit changes button if I have attempted to attach a file.

    I'll try again tomorrow. In the mean time if anyone is interested in this CAB file, email me personally and I'll try forwarding you a copy directly.

     
  • jasontck80
    jasontck80
    2007-09-28

    Logged In: YES
    user_id=1900665
    Originator: NO

    Thank you so much for your response! I'll wait for your upload file. If it is still not able to upload, you can email to me with this email address, jasontck80@yahoo.com

    Thanks a lot for your efforts!

     
  • Logged In: YES
    user_id=1751877
    Originator: YES

    Source forge only allows files less than 256000 bytes to be uploaded via the tracker.

    I don't have access to uploading files to the files download section of this project. I'll see what I can do over the next few days.

     
  • Logged In: NO

    Hi christopher,

    You can attach it & email to me jasontck80@yahoo.com.

    Thanks!

     
  • Logged In: YES
    user_id=1751877
    Originator: YES

    In the meantime (until I manage to find a way to upload the CAB to sourceforge) I have posted by CAB to my blog.

    You can find further details and a download at http://www.christec.co.nz/blog/archives/142

    I'm keen to hear feedback on this.

     
1 2 > >> (Page 1 of 2)