Android SDK v2 Changelog
2.3.1 and 2.3.1 Lite
- Improved the translation fetching strategy
- Added the
com.lokalise.sdk.LokaliseTranslations
interface that allows fetching translations directly from the bundle - Changed the internal SDK translation fetching strategy to
LokaliseFallbackStrategy.IGNORE_BUNDLE_DEFAULT_LANGUAGE
- Added the
- Removed
LokaliseUpdateError.NO_INTERNET_CONNECTION
in favor ofLokaliseOtaUpdateErrorType.UNKNOWN_HOST
andLokaliseOtaUpdateErrorType.TIMEOUT
to provide more information about connectivity issues. - Updated naming of some methods to improve clarity:
LokaliseResources.translateToolbarItems(toolbar: Toolbar)
->LokaliseResources.translateToolbarMenuItems(toolbar: Toolbar)
LokaliseFallbackStrategy.DEFAULT
–>LokaliseFallbackStrategy.WITH_BUNDLE_DEFAULT_LANGUAGE
LokaliseFallbackStrategy.SKIP_BUNDLE_DEFAULT
–>LokaliseFallbackStrategy.IGNORE_BUNDLE_DEFAULT_LANGUAGE
com.lokalise.sdk.LokaliseCallback
–>com.lokalise.sdk.ota.LokaliseOtaUpdateCallback
com.lokalise.sdk.LokaliseUpdateError
–>com.lokalise.sdk.ota.LokaliseOtaUpdateErrorType
- Added the
LokaliseAdditionalOptions
interface for additional options provided by SDK.
2.3.0 and 2.3.0 Lite
- Updated internal Lokalise domain (from .co to .com) for future compatibility.
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.
- Updated
io.realm:realm-gradle-plugin
from 10.10.1 to 10.13.1 - Updated
org.jetbrains.kotlin.android
from 1.5.20 to 1.8.0 - Updated
com.android.tools.build:gradle
from 7.0.4 to 7.4.2
- Updated
- Upgraded
targetSdk
andcompileSdk
versions 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
- Updated
com.google.code.gson:gson
from 2.3.0 to 2.9.0 version to fix a known 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
- Updated
com.google.code.gson:gson
from 2.3.0 to 2.9.0 version to fix a known 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 is enabled by default starting 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 in
try {} 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 for PreferenceFragmentCompat.
2.1.0
Breaking changes
- Implemented translation strategy. Call
Lokalise.init()
withLokaliseFallbackStrategy.SKIP_BUNDLE_DEFAULT
to skip default bundle translation if a primary translation wasn’t found. By default,LokaliseFallbackStrategy.DEFAULT
is applied. - Call
Lokalise.setLocale()
with activity’ context to receiveActivity.onConfigurationChanged()
callback when new configuration was applied. Lokalise.setLocale()
is extended to receive variant according to theLocale
class. Other parameters were renamed to be the same as in theLocale
class -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-10 LokaliseMenuInflater
has been removed, and instead, you should use the translateToolbarItems
method from LokaliseResources
if 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.
Updated about 1 year ago