Untitled

 avatar
unknown
kotlin
3 years ago
873 B
7
Indexable
//1.
//Please write funtion return sum of number in the list
//["1","99","AA","@@","22"] return 122
fun sumOfNumbers(inputList:List<String>) : Int {
    return 0
}

//2.
//rewrite previous code using functional programing

//3.
// please improve this code using proper Android background process
class MainActivity : AppCompatActivity() {

    private lateinit var appBarConfiguration: AppBarConfiguration
    private lateinit var binding: ActivityMainBinding
    private val run = {
        while (true) {
            sendUserLocation()
            Thread.sleep(180000)
        }
    }
    private val thread = Thread(run)


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        thread.start()
    }

    override fun onDestroy() {
        super.onDestroy()
        thread.stop()
    }
    
}

fun sendUserLocation(){}
Editor is loading...