GSoC 2012 Application Flavio Manoel S Hemerli: Sympy GUI for Android

Sean Vig edited this page Apr 11, 2012 · 1 revision
Clone this wiki locally

Personal Information

My name is Flavio Manoel Santos Hemerli and I'm studying Physics at Federal University of Espirito Santo (UFES), Brazil. I'm in the SymPy mailing list since February (e-mail address: bard.botouls@gmail.com) and my github name is Botouls.

Coding Background and Skills

I began to 'play' with computers 7 years ago, and my curiosity led me to learn how web pages were made, and always tried to create pages using HTML, easy to navigate with a good look. Later I became interested in how games work, and using RPG Maker XP I have modified the RGSS (Ruby Game Scripting System) script codes of the engine to create the best game interface for the genre (32-bit, 2D, turns based RPG) in my opinion, adding some useful character informations that weren't available by standard.

After that I took some time to begin coding again, I began studying C/C++ by myself and developed small softwares to test my skills for one year. I have studied Pascal for six months, and when I started the Physics course at Federal University of Espirito Santo I continued Pascal studying for more six months. For the past 7 months I have been studying and developing Python and SymPy to apply on scientific programming applications. I use to code in Linux/Ubuntu, mostly using gedit text editor and command line tools. I never used git or any similar tool before last week.

I work with Python and SymPy since August 2011, targeting mobile applications for Symbian OS using PyS60 and Android OS with Python SL4A [1]. The public results of this work are my three softwares developed in Python applied to Physics, that are Obliq for Symbian [2], Obliq for Android [3] and Cinematics [4] for Android :

  • Obliq is a numerical calculator for launching of projectiles that calculates flight time, maximum range and maximum height of a particle moving in an oblique trajectory. It has two versions, one for Symbian [2], written in Python for Series 60 (PyS60), and one for Android [3] written in Python SL4A using WebView (HTML+CSS+JavaScript) and UIFacade GUI.
  • Cinematics for Android [4] is a symbolic tool using SymPy to calculate particle movement behavior from a function of time given by user (position, speed or acceleration). It is written in Python SL4A using WebView (HTML+CSS+JavaScript) and UIFacade GUI.

The Project

I want to develop a nice and easy to install and use SymPy frontend (GUI - Graphical User Interface) on Android OS. SymPy runs directly on Android devices [5] because Python SL4A (Scripting Layer for Android) [6,7] is available since 2009, so the SymPy frontend will run SymPy nativelly on device without needing Internet connection (for SymPy Live or another web server). Python SL4A also provides graphical user interface by using WebView (HTML+CSS+JavaScript) [8] and Android UIFacade, which will be used by the SymPy frontend on Android.

I have chosen this idea (SymPy GUI for Android) because I think there is a lot of wasted potential on mobile devices for scientific computing and for generic Python programming. SymPy is a huge Python library that can do lots of useful things for scientific computing, and it's portable (pure Python). I choose Android for no reason but my experience programming for it using Python. I already developed Cinematics [4] (see above), a simple Python SL4A Android application that successfully loads and runs SymPy to do some physics calculations, also showing that WebView + UIFacade allows to create a nice GUI.

Project Implementation

What concerns the implementation of the SymPy frontend for Android, there are four fundamental issues :

  1. choose a Python/SymPy parser capable of interpreting the user input, including: single line and multi line; assignment to variables; function definitions; control flow structures (while, if, for, etc).

This issue will require discussion with the SymPy community that can provide help from its past experiences (SymPy Live, etc) in the subject.

  1. build the GUI allowing to use all the features of SymPy easily. The SymPy community will be asked about the desired features to be present in the frontend. There are many possibilities that should be discussed: menu style (cascade, tab, hidden, etc); menu items to most used SymPy functions, classifiedby categories (like wxMaxima [9]); input field allowing code completion, object information, etc; size, proportion and location of input and result fields; etc.

Everything will be made using HTML, CSS and JavaScript, a concept that Mozilla is applying to build all the GUI of its project Boot to Gecko mobile OS [10]. Python SL4A uses events to communicate between the HTML and Python code.

  1. the file format to read and save the combined inputs and outputs. XML is a candidate. The choice should be made carefully, to ensure the compatibility and expandability for new versions.

  2. package everything to be easily installed on Android devices. The SymPy module and the SymPy frontend should be packaged to be installed on devices by anyone without needing any hack or a complex step-by-step tutorial. The idea is to create a single .APK to install everything the application will need to run : SymPy module, SymPy frontend and Python SL4A runtime. The goal is to publish this SymPy frontend .APK package on the Android Market/Play Store as a free software.

Project Schedule

Before the Google Summer of Code starts I can spend less than 20 hours per week on the project, but when it begins I can code for 40 hours per week. The progress of the project will be updated weekly on my blog, and pull requests will be made on github every time I finish coding a part of the application suitable to be reviewed by the SymPy community.

  • April 6th to April 23rd (Pre-coding period): Study, research and test parsing and interface designing in some demonstration software.

  • April 24th to May 20th (Community bonding period): Study and discuss with the community the parsing methods, try to find the best solution to parse expressions. Study and discuss with the community the organization of the interface and the desired features to be implemented. Further develop the demonstration software to test and get feedback from SymPy community.

  • May 21st to June 10th (Coding period starts): Design the basics of the SymPy interface, define its initial concept and included features by consulting the SymPy community. Choose the parser to be used with the help from the SymPy community, implementing it in the first version of the SymPy frontend.

  • June 11th to June 24th: Detailed testing of the parser with complex cases for user input. Keep developing the SymPy GUI, see what need changes to increase the user experience. Choose the initial file format specification and implement it on the SymPy frontend.

  • June 25th to July 8th: First alpha version of SymPy frontend with complete parser and a simple GUI implemented. Testing implementation of the file format, see if it can read and save large files, test its speed, etc. Testing the .APK packaging with the demonstration software.

  • July 9th to July 13th (Midterm evaluation): Debugging and testing of the alpha version of SymPy frontend to submit it for evaluation.

  • July 16th to July 29th: Keep developing the interface with more features in the beta version of SymPy frontend. Implement the reference manual, help and object information in the SymPy frontend. Final testing and debugging of the file format. Testing the .APK packaging for the SymPy frontend and the SymPy module.

  • July 30th to August 13th: Implementing the final and most complex features of the GUI. Final .APK packaging of the beta SymPy frontend also installing the SymPy module and Python SL4A runtime.

  • August 20th to 24th (Final evaluation): Debugging and testing of the beta version of SymPy frontend, including all SymPy community feedback, to submit it for the final evaluation. Submit the beta SymPy frontend to Android Market / Play Store.

  • August 24th onwards (post GSoC): Further development of the SymPy frontend now as a SymPy community project with frequent releases to Android Market / Play Store.

Patch Requirement:

https://github.com/sympy/sympy/pull/1217

References