#cplusplus#android_auto#android_automotive#headunit#wireless_android_auto
You can turn your car’s wired Android Auto into wireless using a Raspberry Pi and a special software called Wireless Android Auto Dongle. This DIY adapter connects your phone to the car wirelessly via Bluetooth and Wi-Fi, without needing extra apps on your phone. It works with several Raspberry Pi models and boots up quickly, connecting in under 30 seconds. After the first setup, it automatically connects every time you start your car, making your Android Auto experience seamless and cable-free. This saves you from plugging in your phone every time and keeps your car’s infotainment system working smoothly[1][2][3].
https://github.com/nisargjhaveri/WirelessAndroidAutoDongle
🚀 Вышел стабильный JavaScript движок от Google для Android
Новая стабильная библиотека Jetpack JavaScript Engine позволит разработчикам выполнять JS код в изолированной и ограниченной среде.
class MainActivity : ComponentActivity() {
// Теперь nullable, без lateinit
private var jsSandbox: JavaScriptSandbox? = null
private var jsIsolate: JavaScriptIsolate? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (!JavaScriptSandbox.isSupported()) {
Log.e("JS", "JavaScriptSandbox не поддерживается")
return
}
lifecycleScope.launch {
// Создаём и сохраняем в nullable-поле
jsSandbox = JavaScriptSandbox
.createConnectedInstanceAsync(applicationContext)
.await()
jsIsolate = jsSandbox?.createIsolate()
// При выполнении гарантируем, что jsIsolate != null
val result: String = jsIsolate
?.evaluateJavaScriptAsync(JS_SCRIPT_SCRING)
?.await()
?: "Ошибка: isolate не инициализирован"
Log.d("JS", "Результат выполнения: $result")
}
}
override fun onDestroy() {
super.onDestroy()
// Закрываем только если не null
jsIsolate?.close()
jsSandbox?.close()
}
}
#jetpack#js