Android SDK v2 Changelog

2.2.1 and 2.2.1 Lite

  • In order to prevent issues while saving data for a new bundle (version, languages, translations), from this version, all changes will be processed in one database transaction.

2.2.0

  • Increased the minimum Android version supported from 16 to 21.
  • Fixed the cast type for the translations bundle. (The defect was introduced in version 2.1.2).
  • Updated the GSON library versions to fix a vulnerability.
    • Updatedio.realm:realm-gradle-pluginfrom 10.10.1 to 10.13.1
    • Updatedorg.jetbrains.kotlin.androidfrom 1.5.20 to 1.8.0
    • Updatedcom.android.tools.build:gradlefrom 7.0.4 to 7.4.2
  • UpgradedtargetSdkandcompileSdkversions to support Android 13.
  • Increased the OTA bundle fetch request timeout.

2.2.0 Lite

  • All changes on version 2.2.0.
  • Fixed the callback behaviour when the app version in the local database was always 1.

2.1.3 Lite

  • Updatedcom.google.code.gson:gsonfrom 2.3.0 to 2.9.0 version to fix aknown vulnerability.
  • Added handling for a possible exception that may occur after the migration from Lokalise OTAv2 to OTAv3, when parsing the bundle’s JSON.

2.1.2

  • Updatedcom.google.code.gson:gsonfrom 2.3.0 to 2.9.0 version to fix aknown vulnerability.
  • Added handling for a possible exception that may occur after the migration from Lokalise OTAv2 to OTAv3, when parsing the bundle’s JSON.

2.1.2 Lite

  • Prevents crashes by disabling WAL, which isenabled by defaultstarting from Android 9.
  • Checks the physical space on the device before saving a bundle.
    • If the available space is greater than the bundle size plus 10MB, the bundle will be saved to the local database. The solution works both for internal and external storages, depending on the app location.
    • If the available space is less than the bundle plus 10MB, the app may receive a new callback:LokaliseCallback.onUpdateFailedNotEnoughSpace()with typeLokaliseCallbackType.TYPE_NO_ENOUGH_SPACE
  • Wrapped the database initialization intry {} catch(SQLiteCantOpenDatabaseException). If the exception is caught, the SDK doesn't use the database but the bundle translations.

2.1.1

  • Fixed issues with returning configuration. From now on, the Lokalise SDK returns the system configuration changes with the app configuration set.
  • Added support forPreferenceFragmentCompat.

2.1.0

Breaking changes

  • Implemented translation strategy. CallLokalise.init()withLokaliseFallbackStrategy.SKIP_BUNDLE_DEFAULTto skip default bundle translation if a primary translation wasn’t found. By default,LokaliseFallbackStrategy.DEFAULTis applied.
  • CallLokalise.setLocale()with activity’ context to receiveActivity.onConfigurationChanged()callback when new configuration was applied.
  • Lokalise.setLocale()is extended to receive variant according to theLocaleclass. Other parameters were renamed to be the same as in theLocaleclass -languageISO -> language,regionISO -> country. The change affects languages with different scripts, for example, Chinese Traditional and Chinese Simplified scripts.
  • Added the ability to receive Lokalise UUID identifier for test reasons ->Lokalise.getUserUUID().

v2.0.0-Beta-10

Breaking changes

We are finalizing the specifications of the SDK 2, and this is probably the last beta build for this SDK before the full release. Please note, that since beta-10LokaliseMenuInflaterhas been removed, and instead, you should use thetranslateToolbarItemsmethod fromLokaliseResourcesif you want your menu items to be translated automatically.

public class MainActivity extends AppCompatActivity { ... private Toolbar toolbar; @Override protected void onCreate(Bundle savedInstanceState) { toolbar = findViewById(R.id.toolbar); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main, menu); ((LokaliseResources) getResources()).translateToolbarItems(toolbar); return true; } ... }

Also, Realm.io library has been updated to version 10, so if your project is using an old version of Realm.io, you may need to update it.

File size

Please note that the size of the new APK file may increase. To mitigate this, we recommend uploading a bundle generated by Android Studio to Google Play instead of a simple APK file. This will allow Google Play to serve only needed resources to end-user devices drastically decreasing the download size.