boatmeme / microsoft-translator-java-api

Java wrapper for the Microsoft Translator API
http://code.google.com/p/microsoft-translator-java-api/
Apache License 2.0
86 stars 61 forks source link

Edit for compatibility with Android 2.2 and below #25

Closed rmtheis closed 13 years ago

rmtheis commented 13 years ago

Replace java.lang.String.isEmpty() to support Java 1.5 (and Android 2.2 and below).

Running on Android 2.2 using the JAR file causes a RunTimeException in MicrosoftTranslatorAPI.java because java.lang.String.isEmpty() is part of Java 1.6, and not available on Android prior to version 2.3. Using length() instead allows the API to run without errors on Android 2.2. Android 2.2 is still very commonly used, so the change is worthwhile.

boatmeme commented 13 years ago

Great catch. I didn't realize isEmpty() was 1.6 specific. Thanks, I will merge this into master.