Ready to Pass Your Certification Test

Ready to guarantee a pass on the certification that will elevate your career? Visit this page to explore our catalog and get the questions and answers you need to ace the test.

Google ASSOCIATE-ANDROID-DEVELOPER

Custom view settings

Exam contains 128 questions

Page 3 of 22
Question 13 🔥

For example, we have a BufferedReader reader, associated with the json file through InputStreamReader. To get a file data we can do this:

Question 14 🔥

For example, we have a file in our assets folder app/src/main/assets/sample_teas.json. To get an InputStream for reading it, from out Context context, we can try do this:

Question 15 🔥

An example. In our ViewModelFactory (that implements ViewModelProvider.Factory) we have an instance of our Repository, named mRepository. Our ViewModel has such constructor: class MyViewModel(private val mRepository: MyRepository) : ViewModel() ... Next, in our ViewModelFactory create ViewModel method (overriden) looks like this: override fun <T : ViewModel?> create(modelClass: Class<T>): T { return try { //MISSED RETURN VALUE HERE” } catch (e: InstantiationException) { throw RuntimeException("Cannot create an instance of $modelClass", e) } catch (e: IllegalAccessException) { throw RuntimeException("Cannot create an instance of $modelClass", e) } catch (e: NoSuchMethodException) { throw RuntimeException("Cannot create an instance of $modelClass", e) } catch (e: InvocationTargetException) { throw RuntimeException("Cannot create an instance of $modelClass", e) } } What should we write instead of “//MISSED RETURN VALUE HERE”?

Question 16 🔥

What is demonstrated by the code below? // RawDao.kt @Dao interface RawDao { @RawQuery fun getUserViaQuery(query: SupportSQLiteQuery?): User? } // Usage of RawDao ... val query = SimpleSQLiteQuery("SELECT * FROM User WHERE id = ? LIMIT 1", arrayOf<Any>(sortBy)) val user = rawDao.getUserViaQuery(query) ...

Question 17 🔥

What happens when you create a DAO method and annotate it with @Insert? Example: @Dao interface MyDao { @Insert(onConflict = OnConflictStrategy.REPLACE) fun insertUsers(vararg users: User) }

Question 18 🔥

What is a correct part of an Implicit Intent for sharing data implementation?

Lorem ipsum dolor sit amet consectetur. Eget sed turpis aenean sit aenean. Integer at nam ullamcorper a.

© 2024 Exam Prepare, Inc. All Rights Reserved.