| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 
 | ---
layout: post
title:  "🚀 Release: Android Components 0.24"
date:   2018-09-21 20:15:00 +0200
categories: releases
author: jonathan
---
# 0.24 (2018-09-21)
* [Commits](https://github.com/mozilla-mobile/android-components/compare/v0.23...v0.24),
[Milestone](https://github.com/mozilla-mobile/android-components/milestone/24?closed=1),
[API reference](https://mozilla-mobile.github.io/android-components/api/0.24/index)
* Compiled against:
  * Android
    * SDK: 27
    * Support Libraries: 27.1.1
  * Kotlin
    * Standard library: 1.2.61
    * Coroutines: 0.23.4
  * GeckoView
    * Nightly: 64.0.20180905100117
    * Beta: 63.0b3 (0269319281578bff4e01d77a21350bf91ba08620)
    * Release: 62.0 (9cbae12a3fff404ed2c12070ad475424d0ae869f)
* **dataprotect**: 
  * Added a component using AndroidKeyStore to protect user data.
  ```kotlin
  // Create a Keystore and generate a key
  val keystore: Keystore = Keystore("samples-dataprotect")
  keystore.generateKey()
  
  // Encrypt data
  val plainText = "plain text data".toByteArray(StandardCharsets.UTF_8)
  val encrypted = keystore.encryptBytes(plain)
  
  // Decrypt data
  val samePlainText = keystore.decryptBytes(encrypted)
  ```
* **concept-engine**: Enhanced settings to cover most common WebView settings.
* **browser-engine-system**:
  * `SystemEngineSession` now provides a way to capture a screenshot of the actual content of the web page just by calling `captureThumbnail`
* **browser-session**:
  * `Session` exposes a new property called `thumbnail` and its internal observer also exposes a new listener `onThumbnailChanged`.
    
  ```Kotlin
  session.register(object : Session.Observer {
      fun onThumbnailChanged(session: Session, bitmap: Bitmap?) {
              // Do Something
      }
  })
  ```
  
  * `SessionManager` lets you notify it when the OS is under low memory condition by calling to its new function `onLowMemory`.
* **browser-tabstray**:
   * Now on `BrowserTabsTray` every tab gets is own thumbnail :) 
* **support-ktx**:
   * Now you can easily query if the OS is under low memory conditions, just by using `isOSOnLowMemory()` extension function on `Context`.
  ```Kotlin
  val shouldReduceMemoryUsage = context.isOSOnLowMemory()
  
  if (shouldReduceMemoryUsage) {
      //Deallocate some heavy objects
  }
  ```
  
  * `View.dp` is now`Resource.pxtoDp`.
  ```Kotlin
  // Before
  toolbar.dp(104)
  
  // Now
  toolbar.resources.pxToDp(104)
  ```
* **samples-browser**:
   * Updated to show the new features related to tab thumbnails. Be aware that this feature is only available for `systemEngine` and you have to switch to the build variant `systemEngine*`.
 |