I wrote the first version of DeuterIDE over the course of a couple days during a school break last year for the sake of building something cool and useful (more on that later) and tested it on my first Android phone, an HTC G2 (a.k.a Desire Z) and on my BlackBerry PlayBook tablet which I received from their developer program. I've gained valuable experience as a programmer since then. Android has progressed a lot as a platform, combating its fragmentation problems and growing pains; I want to ensure that DeuterIDE grows as well.
New in DeuterIDE 2.0
- Integration of Deuterium Editor, a native syntax highlighter utility developed specifically for DeuterIDE
- Initial highlighting upon release of 13 of the most popular programming languages according to langpop
- Updated UI for Android Holo Light Theme and adherence to Android's Design Language
- Specific support for Honeycomb and above (API Level 11+), including Action Bar utilization
- Customizable Theming
- Smart bracket/parenthesis matching
- LaTeX Support
- Additional Syntax Highlighting Definitions
- Session Awareness
- Theming Customization Refinement
- Additional Editor Preprocessing and Optimization
- Migration from SharedPreferences to SQLite
- Github Gists
*I skipped a few version numbers and hoped you wouldn't notice. The 2.0 designation conveys how radically different the newest version is from the previous, as well as ensures consistency with the numbering of Deuterium Editor.Read on for the long and arduous tale of DeuterIDE and its development, and why these changes are happening now.
A Trip Down Memory Lane
When I first created DeuterIDE, the majority of users were running Android Froyo and Gingerbread (2.2.x and 2.3.x). I had maybe a handful of installs running Ice Cream Sandwich (4.0.x) and even less on Honeycomb. DeuterIDE runs on any screen dimensions, but it follows from how important screen real estate is when editing text that it's more suited for tablets. So why the disparity? The market was very different back then; only a handful of phones had received either stock ICS or stable ICS ROMs. My phone didn't have stable ICS either, so I was testing on Gingerbread. Everything worked relatively well back then. Barring the fragmentation problems that were the word of the day a year ago (and now, albeit to a lesser extent), DeuterIDE was received with overall positive reviews. However, there were subtle hints of incoming problems. A few ICS users reported loss of keyboard focus when using the virtual keys, a problem not present in Gingerbread. The cursor was unwieldy on smaller screens, meaning that loss of focus was actually quite detrimental to productivity.
WebView and Fragmentation
Fragmentation soon proved to be a serious problem. Some background on my editor implementation: because I support cloud compilation through the ideone API, the editor had to handle somewhere around 40 different syntaxes and provide highlighting, smart indent/prettyprinting for the majority of them. I wrapped the CodeMirror editor in a standard WebView and it worked perfectly (on my device). No wheel-reinventing needed. However, I ran into problems with certain devices, which I suspected mapped their keyboard inputs differently from what the KeyEvent class would handle and pass to CodeMirror. Suddenly, I had reports of backspace and enter not working, while I could not reproduce the error at all on my phone. I later updated the application to artificially fire those key events when a virtual key was pressed, to no avail. At first I thought it was Motorola devices, but it proved to be much more widespread than that. I'm still not sure if it was a key mapping issue or if it was just the gradual propagation of ICS to a broader spectrum of devices. Nonetheless, this was a serious problem. I updated the editor for CodeMirror 2 to 3 in the hopes that it would play nicer with the WebView, but no dice. WebView itself is unfortunately sucky and largely neglected by Android.
So what seemed like an expedient implementation choice at the time ultimately backfired. Especially now, almost exactly a whole year later, that my pie chart has changed from all 2.x to almost all 4.x, it was obvious to me and probably even more obvious to the casual observer that it was time for me to bite the bullet and re-implement my editor with native Android code, à la Facebook. The fact that the mobile OS space is such a changing landscape, and that Android went through a dramatic re-invention of self upon the proliferation of ICS is indicative of the rapid disruption the market went through in the past year. DeuterIDE's average rating had fallen from consistent 5 stars to an overall average of 3 stars as a result of decreased usability. The WebView problems brought in their fair share of 1 star ratings, and of that I am not proud. I'd also gotten some support emails to which I frankly didn't know how to respond, seeing as I couldn't reproduce the editor keymapping problems on my phone. Hopefully this update addresses these issues; I feel like with the integration of the native code editor, DeuterIDE is once again something I can be proud of and that I would have a pleasure using, and ultimately user experience is the most important metric of the app's success.
In making the jump to native, I had to completely re-implement a functional syntax highlighter. I wrote a class extending the built-in EditText and a Tokenizer class to parse the contents of that editable view. Then, I created an abstract Language class, extensible to the syntaxes of different languages, to hold the specifications for the parsing and styling of each language using the Tokenizer. In effect, I implemented a genericized syntax highlighter applicable to a variety of languages. To support highlighting for a language, one simply extends the Language class and fills in the details on keywords, comment delimiters, and the like. This highlighting tool became Deuterium Editor (free on Google Play), and was integrated into DeuterIDE. Because the input and everything is extended from a native Android class, it should be guaranteed support across pretty much all devices running Android.
The design for DeuterIDE's old user interface was very rounded and very pink. The name DeuterIDE is a play on IDE, or integrated development environment, and the 1- anion of heavy hydrogen (deuterium) called deuteride. According to wikipedia, ionized deuterium gives off a "characteristic pinkish-red glow." Geekily enough, I made it the unifying color of all of DeuterIDE's assets. However, I got a lot of complaints about the pink, which, sure. I've stubbornly held out long enough (something about not compromising my creative vision or whatever) but the new release will definitely allow for more customization of the color palette. In addition, the switch to API level 11 and the Holo Light theme meant that the old graphical buttons were grossly out of place in the new interface. I wished to ensure consistency with the new Android design language by Matias Duarte as of Honeycomb and standardized as of ICS, so I sat down and read the entire design reference and made note of the both the large scale appearance changes and the subtle unifying touches needed for the redesign. I was inspired by Pulse Reader in revising my application's iconography. The new icon, which blends with Holo Light, relies less on the name of the application to convey the deuterium idea and plays a clever trick with the electron also representing the negative in the deuteride symbol. (I'm really proud of that in a nerdy way. Even if the reference is lost on people, it makes me happy personally.) Andy Sturzu made the graphical assets for the UI redesign and the new website.
With all of these changes, DeuterIDE has become a different and better tool for users. Now that it utilizes the ActionBar introduced in Honeycomb and prominent in ICS and Jelly Bean, the current dominant Android versions, I am cutting support for pre-3.0 devices rather than retrofitting an ActionBar for Gingerbread and below, which are obsolete. What this means going forward is that I will release one final version supporting pre-3.0 devices integrating the new UI and Deuterium Editor, and then proceed to branch into a separate .apk with minSdkVersion set to 11 for all future releases. This also means that I will be withdrawing the application from BlackBerry App World, since the runtime is based on Gingerbread. I am also withdrawing from Amazon App Store, for a number of reasons. While I could ditch Kindle Fire (Gingerbread) in order to support the HD (ICS), the experience of publishing on Amazon App Store is bad in general. I have some horror stories from interacting with their support, and they've been dilly-dallying removing DeuterIDE from the store (there is no unpublish button - you have to submit a ticket and be interrogated on why you are withdrawing). I also included Google Play Licensing with the newest version and have no desire to maintain forked apks past what I already must do.
My intention going forward for the platform is that it will continually improve and sustain a high level of functionality and utility. It's my hope that DeuterIDE is taking the first steps toward taking off the kiddy gloves with this update (I finally moved to a git repository instead of using Dropbox for versioning). Mobile is the way of the future, and I made DeuterIDE because there is a need from people like me who daydream in code to be able to take their code with them and get ideas out of their head at a moment's notice. Lists like this one prove that I entered an important market at an important time. It remains to be seen what the future holds, but it is exciting indeed.