#other#awesome_list#brasil#ciencia_da_computacao#computer_science#curriculo#cursos#hacktoberfest
The MIT License is a simple and permissive software license that lets you freely use, copy, modify, merge, publish, distribute, sublicense, and sell software, as long as you include the original copyright notice and license text in all copies. It does not require you to share your changes or make your code open source. The software is provided "as is," without any warranty, so the authors are not responsible for any problems. This license gives you great freedom and flexibility to use software for any purpose, including commercial, with minimal legal restrictions[1][3][5]. This benefits you by allowing easy and safe use and sharing of software without complex legal barriers.
https://github.com/Universidade-Livre/ciencia-da-computacao
🚀 Вышел стабильный 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