GSoC 2012 Application Rishav Binayak Das: Mobile Application for SymPy - sympy/sympy GitHub Wiki

About Me

Name: Rishav Binayak Das

University: Indian Institute of Technology, New Delhi

Short Bio: I'm a student pursuing a B.Tech. Degree in Computer Science and Engineering. Currently, I'm in my second year. I've coded in multiple platforms as part of academic projects and have prior knowledge of working with the android platform.

How to Contact Me : GMAIL: [email protected] GITHUB Username: rishavbdas

My Coding Skills I've worked with several programming languages such as Python, Java, C and C++ in addition to web development languages. I consider myself to have a certain level of proficiency in coding for Python since it was a basis for a large number of academic projects I undertook in my first year. I have a great deal of experience in coding for the Android platform and have worked with the MIT Assisstive Technology group ( See  http://assistivetech.mit.edu/ for more details) in creating Android Applications for the specially-abled.

I've undertaken and completed a great deal of high-level academic projects in the past. These include creating games on C and C++ including a 3-D Online Multiplayer Carrom with Artificial Intelligence, Tic Tac Toe, Sudoku and Hangman. I've created a simulation of a Computer Architecture Pipeline in Java and a fully functioning graphical multi-threaded online booking system in C.

I'm comfortable using both Git and SVN and have experience in working with both in order to develop the aforementioned academic projects.

My Android Coding Skills

I've created several applications for the Android platform in the past. In developing these I've worked with both the native Eclipse-based Android SDK provided by Google as well as the non-native Adobe Flash Builder SDK. In addition, I've also been able to run Python and its libraries (including SymPy) on the Android platform via the Scripting Layer for Android (SL4A). I've used the following technologies and features of the Android platform:

  1. Graphical User Interface

  2. GPS and other location based services including the Google Maps API

  3. Database Management Systems in Android

  4. An Android image translation app using the Google translate API and Java Asprise OCR SDK.

  5. Home widgets and displaying custom information in the Notifications panel

  6. App wrappers around websites such as Facebook and Twitter using external Javascript and other Android GUI Elements.

  7. Custom Keyboards for my Applications

 As mentioned above, I've also worked with the MIT Assisstive Technology to create apps for the specially-abled. I'm also comfortable using the Scripting Layer for Android (SL4A) or more specifically, the Python for Android APIs and have used the same to run SymPy on the Android platform.

My Experience with the SymPy Community

I've spent the last month getting to know the SymPy community and coming in touch with my mentor. I've found the community to be an active, eager, enthusiastic and hard-working one. I've also acquainted myself with the source code and am still working with it.

In order to meet the patch submission requirement, I've submitted the following pull requests on GitHub:

[1] https://github.com/sympy/sympy/pull/1154

[2] https://github.com/sympy/sympy/pull/1207

These requests are mostly trivial and intended to make only minor improvements. The purpose of this was merely to fulfill the patch submission requirements and not to demonstrate my knowledge of the Android platform, which my project would be based on! 

Therefore, I consider myself more than qualified to work with the community in developing an Android application for SymPy and am looking forward to doing so over the summer.

**My Project **

My project is to create a running application with a beautiful, intuitive User Interface on the Android Platform for SymPy. The reason I chose this idea is because of my prior experience with coding for the platform and because of the evident number of functionalities a SymPy app would provide to a mobile user. I consider myself qualified for this because I've worked on the Android platform before and developed short specific apps dealing with User Interfaces, GPS, Text-To-Speech, Database Management and Optical Character Recognition. Since I'll have ample time during the summer, I'm willing to put in the required 40 hours/week during the GSoC period.

At the moment, SymPy has been demonstrated to work on the Android Platform via the SL4A (Scripting Layer for Android) application. However, I plan to create a full-fledged downloadable and easily installable Android app with a beautiful, intuitive user interface and a soft keyboard conducive to Math Input (similar to what WolframAlpha has for their mobile apps). The app will be basically a mobile-optimized interface to SymPy live with additional features.

In other words, I will be providing a native front-end to the already existing SymPy live feature. This will be created with the help of Android GUI and database elements. Connection to the SymPy live server will be handled through HttpClients provided by the Android SDK (based on Java). Therefore, throughout the project, my focus will be on User Interface and User Experience. Additional features provided in the app would be a math-input conducive keyboard, ability to open/save/run Python files (handled again by Text File Managers provided by Java), autocomplete and autocorrect, user history, etc. As a post-GSoC task, once the interface and server-based functionality is ready, I can work on running the code natively so that no data usage is incurred in running the app.

Implementation Details

My first job will be to create a user input-output front-end. This will be created with the Android GUI elements supported natively such as TextEdits, WebViews, Buttons and appropriate EventListeners. The area of focus here will be to create a front-end for SymPy live but one that has been optimized for Mobile Display and for usage by a mobile user. Therefore, unnecessary blank spaces and options will be removed from the display to make it simple and intuitive. This can be done in two ways : a) In places where the elements provided on the website seem good enough, I'll use the WebView feature of Android, load the appropriate URL and then apply external JavaScript. b) In other places, I can start from scratch and create a Graphical User Interface with Android UI elements and then use HttpConnect and associated 'POST' and 'GET' methods to interact with the SymPy live server in the background, i.e. to fetch and send data.

The next important task, once the above is set up and functioning, is to work on the Keyboard. As discussed on the ideas wiki page, we could encourage contributors to submit ideas for the same. The design inspiration will be Wolfram Alpha's mobile apps as well as apps available on the market such as Calculators. The Keyboard will be designed on the SDK through standard Android buttons and Action Listeners. With the help of simple animations, I'll implement submenus and sub-sections that would be visible on long press. A good keyboard would help users save a lot of time that would otherwise be wasted on finding letters and checking for spelling errors. Once the keyboard is designed, it'll be integrated with the app. This step is pretty trivial as it merely involves the use of certain Action Listeners to replace the native keyboard with our own custom soft keyboard.

In addition to all of this, I wish to provide some more features to the user. These are: a) The ability to save a python file for future reference in the SD card or internal memory b) The ability to load a python (or text) file from the SD Card or internal memory c) The ability to view User History on the app (which would be stored in the app's cache) or delete it as the user deems appropriate d) A set of instructions for those new to SymPy and/or Python in general Implementing these additional features would primarily consist of file read/write operations and Database management. Thankfully, these are all inbuilt in the Android SDK and would merely require a series of function calls.

As mentioned below, I would also make an effort to incorporate any ideas and suggestions provided by the community at any stage and resolve any reported bugs/complaints.

My Plan

April 6- April 23 (Pre-coding Phase)

Research. Create the a very basic app wrapper around SymPy live via the WebView UI element. This will be the very first version of SymPy for Android!! At this stage, the app will be a highly simplified input-output type of User Interface with HttpConnect clients running in the background connecting to SymPy live and carrying out computations on the server. The main purpose for now will be to demonstrate how SymPy live may be used to carry out computations on an Android app - highly simplified frontend but fully functioning app.

April 23- May 21 (Community Bonding Period)

Get in touch with my mentor. Discuss the idea further with the community, Make appropriate changes to my plan of action and develop a concrete strategy to finish the app. In addition, create the first designs of the keyboard that would be provided on the app. As mentioned on the wiki, we could let contributors design their own keyboards, with each key showing some unicode text, and running Python code on the input. Then, create some site on the App Engine where we can let people submit their keyboards and review them, and download other people's keyboards. However, this is subject to the number of contributions that are received. Otherwise, I shall work on the design on my own taking inspiration from the Wolfram Alpha android app keyboard and similar applications available in the market, including calculators.

Features provided at this period: Simple app wrapper around sympy live. For now, no external keyboard and no additional features (to be worked on during the next phase). Initial keyboard designs available but not yet integrated into the app. Main focus on keyboard designs and community bonding for now!

May 21- July 8 (Coding Period begins)

Work on the User Interface Design (adjusting screen, removing unnecessary elements from the SymPy live display. optimizing display for mobile, making the UI more informative and simultaneously, more intuitive). Focus on developing front-end. Adding more to the simple input-output panels created earlier. Adding the SymPy live logo, improving design, etc.

Finalize Keyboard Design. Integrate keyboard with the app. The Keyboard will be created in the Native Android SDK using Buttons and Event Listeners which would pop-up when the user taps on a text field. The design would be finalized based on inputs taken from the previous stage of app development and discussion in the SymPy community.

Testing, Debugging. Release and Polish initial working version of the app. (Packaging solution and releasing first .apk version.)

Main focus of this period : improving UI, finalizing and integrating keyboard and adding additional features described below.

Additional features provided at this time: caching of data for future reference, opening and saving Python files to run on SymPy live (this will include the option of opening/saving from both the SD card as well as the cell's in-built memory), 'help' feature for users new to SymPy, 'history' (based on cached information) to display the user's previous activity (and the option of clearing it too), copy/paste ability as already provided natively, 'autocomplete' feature based on user history.

July 9 (Mid-Term evaluation)

July 9 -August 12 (Final Polishing)

Optimizing and testing data usage pattern, smoothening the UI through Async Calls (a form of Android-based multithreading that would make data connectivity smooth making sure that the user does not experience any lag even if data connection is slow) and more animations, creating more animations for the app keyboard (pop-ups,sounds, sub-keyboards that would emerge on long pressing, transitions between sub-menus - for example, we would have separate sections for Physics-based and Calculus-based input - of course, this would depend on the Keyboard design finalized) and handling all kinds of bugs, requests and other complaints found after the release of the app.

Writing documentation for the app.

During this phase, all suggestions by the SymPy community and my mentor will be taken into serious consideration and any extra suggested features will be added to the existing app!

Package app again and release next version.

August 13 - August 20 (Pencils Down period)

Final phase to scrub code, improve documentation, testing, debugging and releasing the final version of the app

August 20 - (Post GSoC period)

Looking into and working on the following as add-ons to this project:Running the libraries natively on the Android platform to nullify data usage (may be released as the next major version of the app), making the UI smoother (something that can always be improved :) ), working with reported bugs, complaints and suggestions!