linkedin-skill-assessments-quizzes

Android (हिंदी में)

प्रश्न 1. अपने Android app में features, components, और permissions जोड़ने के लिए किस file को edit करना होगा?

प्रश्न 2. Image View को accessible बनाने के लिए किस XML attribute का उपयोग करना चाहिए?

प्रश्न 3. आप अपना app launch करते हैं, और जब आप एक नई screen पर navigate करते हैं तो यह crash हो जाता है। कौन सी action आपको issue diagnose करने में मदद नहीं करेगी?

प्रश्न 4. Push notifications काम करना क्यों बंद हो सकती हैं?

प्रश्न 5. Items की एक list को vertically display करने वाले RecyclerView को implement करने के लिए component classes का सही set क्या है?

    RecycleView
    RecyclerView.Adapter<T extends BaseAdapter>
    RecyclerView.ViewHolder<T extends BaseViewHolder>
    LinearLayoutManager
    RecycleView
    RecyclerView.Adapter
    RecyclerView.ViewHolder<T extends BaseViewHolder>
    LinearLayoutManager
    RecycleView
    RecyclerView.Adapter
    RecyclerView.ViewHolder
    LinearLayoutManager
    RecycleView
    RecyclerView.Adapter<VH extends ViewHolder>
    RecyclerView.ViewHolder
    LinearLayoutManager

प्रश्न 6. Android system जब memory free करना चाहता है तो process को kill कर देता है। किसी दिए गए process को system द्वारा kill किए जाने की संभावना process की state और उस समय activity पर निर्भर करती है। Process और activity state के किस combination को kill होने की सबसे अधिक संभावना है?

प्रश्न 7. आपने एक NextActivity class बनाई है जो intent के अंदर pass होने वाले कुछ data युक्त string पर निर्भर करती है। कौन सा code snippet आपको अपनी activity launch करने की अनुमति देता है?

    Intent(this, NextActivity::class.java).also { intent ->
        startActivity(intent)
    }
    Intent(this, NextActivity::class.java).apply {
        put(EXTRA_NEXT, "some data")
    }.also { intent ->
        activityStart(intent)
    }
    Intent(this, NextActivity::class.java).apply {
        putExtra(EXTRA_NEXT, "some data")
    }.also { intent ->
        startActivity(intent)
    }
    Intent(this, NextActivity::class.java).apply {
        put(EXTRA_NEXT, "some data")
    }.also { intent ->
        activityStart(intent)
    }

प्रश्न 8. आप अपने project में about और settings modules शामिल करना चाहते हैं। कौन सी files उनके inclusion को सही तरीके से reflect करती हैं?

प्रश्न 9. @VisibleForTesting annotation का उपयोग करने का क्या लाभ है?

प्रश्न 10. आप अपनी build.gradle file में कैसे specify करेंगे कि आपके app को run करने के लिए कम से कम API level 21 की आवश्यकता है, लेकिन इसे API level 28 पर test किया जा सकता है?

      defaultConfig {
        ...
        minApiVersion 21
        targetApiVersion 28
      }
      defaultConfig {
        ...
        targetSdkVersion 21
        testSdkVersion 28
      }
      defaultConfig {
        ...
        minSdkVersion 21
        testApiVersion 28
      }
      defaultConfig {
        ...
      minSdkVersion 21
        targetSdkVersion 28
      }

प्रश्न 11. किसी activity का onActivityResult() कब call होगा?

संदर्भ

प्रश्न 12. आपको अपने API से उसके ID के आधार पर एक Event को remove करना है। Retrofit में उस request को कौन सा code snippet define करता है?

प्रश्न 13. आप अपने build setup में product flavor का उपयोग कब करेंगे?

प्रश्न 14. नीचे दिए गए fragment को देखते हुए, आप Fragment class की layout file में contained text_home की ID वाले TextView तक कैसे पहुंचेंगे?

    private lateinit var textView: TextView
    override fun onCreateView(...): View? {
        val root = inflator.inflator(R>layout.fragment_home, container, false)
        textView = ??
        return root
    }

प्रश्न 15. UI tests run करते समय आप AndroidJUnitRunner का उपयोग क्यों करते हैं?

नोट: AndroidJUnitRunner हमें Android Devices पर JUnit3/4-style tests run करने देता है

प्रश्न 16. जब कोई activity restart हो तो user की state को properly restore करने के लिए आप क्या उपयोग करेंगे?

संदर्भ

प्रश्न 17. यदि main thread बहुत लंबे समय तक blocked रहता है, तो system ___ dialog display करता है।

प्रश्न 18. आप SharedPreferences से user के email की value कैसे retrieve करेंगे जबकि यह सुनिश्चित करते हुए कि returned value null नहीं है?

व्याख्या: Method "getDefaultSharedPrefarances(this).getString()" में दूसरा parameter pass किया जाता है ताकि यदि key exist नहीं करती है तो उसे return किया जा सके। इसलिए हमें एक empty string pass करनी होगी जो key exist न होने की स्थिति में return हो।

प्रश्न 19. Android पर pixels का उपयोग करके sizes define करना समस्याग्रस्त क्यों है?

संदर्भ

प्रश्न 20. आपको उन devices की list प्राप्त करने की आवश्यकता है जो USB debugging enabled के साथ आपके computer से attached हैं। Android Debug Bridge का उपयोग करके कौन सा command execute होगा?

प्रश्न 21. कौन सी drawable definition आपको नीचे दी गई shape प्राप्त करने की अनुमति देती है?

img

    <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="oval">
        <stroke
            android:width="4dp"
	    android:color="@android:color/white" />
	<solid android:color="@android:color/black" />
    </shape>
    <oval xmlns:android="http://schemas.android.com/apk/res/android">
        <stroke android:width="4dp" android:color="@android:color/black"/>
        <solid android:color="@android:color/white"/>
    </oval>
    <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="oval">
        <stroke
            android:width="4dp"
            android:color="@android:color/black" />
        <solid android:color="@android:color/white" />
    </shape>
    <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="oval">
        <stroke
            android:width="4dp"
            android:color="@android:color/white" />
        <solid android:color="@android:color/white" />
    </shape>

प्रश्न 22. Key-value data के एक छोटे collection को persist करने के लिए आपको क्या उपयोग करना चाहिए?

प्रश्न 23. आपको API से photos की list retrieve करनी है। Retrofit में HTML GET request को कौन सा code snippet define करता है?

प्रश्न 24. नीचे दी गई test class को देखते हुए, कौन सा code snippet एक सही assertion होगा?

प्रश्न 25. Layout file में reusable view component जोड़ने के लिए आपको किस tag का उपयोग करना चाहिए?

प्रश्न 26. आप उन devices के लिए एक अलग drawable provide करना चाहते हैं जो landscape mode में हैं और जिनकी भाषा French पर set है। किस directory का नाम सही है?

प्रश्न 27. आपको अपने app में निम्नलिखित permission क्यों शामिल करने की आवश्यकता हो सकती है?

android.permission.ACCESS_NETWORK_STATE

प्रश्न 28. कौन सी image निम्नलिखित LinearLayout से सबसे अच्छी तरह correspond करती है?

    <LinearLayout
        android:layout_width="match_parent"
	android:layout_height="match_parent"
	android:orientation="horizontal"
	android:gravity="center">
	<Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Button" />
	<Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Button" />
        </LinearLayout>

प्रश्न 29. आप device पर default Dialer app open करना चाहते हैं। इस code में क्या गलत है?

val dialerIntent = Intent()
val et = findViewById(R.id.some_edit_text)
dialerIntent.action = Intent.ACTION_DIAL
dialerIntent.data = Uri.parse("tel:" + et.getText()?.toString())
startActivity(dialerIntent)

प्रश्न 30. आपको /assets directory में files कब store करनी चाहिए?

संदर्भ

प्रश्न 31. आप users को अपने app में pictures लेने की अनुमति देना चाहते हैं। सीधे camera permission request करने के बजाय एक appropriate intent बनाने का कौन सा लाभ नहीं है?

प्रश्न 32. आप ActivityCompat.shouldShowRequestPermissionRationale() function का उपयोग कब करेंगे?

प्रश्न 33. आप केवल release builds में analytics tracking enable करना चाहेंगे। उस value को store करने के लिए generated BuildConfig class में एक नया field कैसे बना सकते हैं?

buildTypes {
	debug {
		buildConfig 'boolean', 'ENABLE_ANALYTICS', 'false'
	}
	release {
		buildConfig 'boolean', 'ENABLE_ANALYTICS', 'true'
	}
}
buildTypes {
	debug {
		buildConfig 'String', 'ENABLE_ANALYTICS', 'false'
	}
	release {
		buildConfig 'String', 'ENABLE_ANALYTICS', 'true'
	}
}
buildTypes {
	debug {
		buildConfigField 'boolean', 'ENABLE_ANALYTICS', 'false'
	}
	release {
		buildConfigField 'boolean', 'ENABLE_ANALYTICS', 'true'
	}
}
buildTypes {
	debug {
		buildConfigField 'boolean', 'ENABLE_ANALYTICS', 'true'
	}
	release {
		buildConfigField 'boolean', 'ENABLE_ANALYTICS', 'false'
	}
}

प्रश्न 34. अपने APK size को optimize करने के लिए, आपको किस image codec का उपयोग करना चाहिए?

संदर्भ

प्रश्न 35. आपने network call करने के लिए code बनाया है और test किया है कि यह आपके development environment में काम करता है। हालांकि, जब आप इसे Play console पर publish करते हैं, तो networking call काम करने में विफल रहता है। क्या आपको इस issue को troubleshoot करने में मदद नहीं करेगा?

प्रश्न 36. नीचे displayed layout को कौन सा code snippet achieve करेगा?

img

    <androidx.constraintlayout.widget.ConstraintLayout
	...>

	<TextView
		android:id="@+id/text_dashboard"
		android:layout_width="match_parent"
		android:layout_height="wrap_content"
		android:layout_marginTop="16dp"
		android:padding="8dp"
		android:textAlignment="center"
		android:text="Dashboard"
		app:layout_constraintEnd_toEndOf="parent"
		app:layout_constraintStart_toStartOf="parent"
		app:layout_constraintTop_toTopOf="parent" />

    </androidx.constraintlayout.widget.ConstraintLayout>
    <androidx.constraintlayout.widget.ConstraintLayout
	...>

	<TextView
		android:id="@+id/text_dashboard"
		android:layout_width="match_parent"
		android:layout_height="wrap_content"
		android:layout_marginStart="8dp"
		android:layout_marginEnd="8dp"
		android:textAlignment="center"
		android:text="Dashboard"
		app:layout_constraintEnd_toEndOf="parent"
		app:layout_constraintStart_toStartOf="parent"
		app:layout_constraintTop_toTopOf="parent" />

    </androidx.constraintlayout.widget.ConstraintLayout>
    <androidx.constraintlayout.widget.ConstraintLayout
	...>

	<TextView
		android:id="@+id/text_dashboard"
		android:layout_width="match_parent"
		android:layout_height="wrap_content"
		android:layout_marginStart="8dp"
		android:layout_marginTop="16dp"
		android:layout_marginEnd="8dp"
		android:padding="8dp"
		android:textAlignment="center"
		android:text="Dashboard"
		app:layout_constraintEnd_toEndOf="parent"
		app:layout_constraintStart_toStartOf="parent"
		app:layout_constraintTop_toTopOf="parent" />

    </androidx.constraintlayout.widget.ConstraintLayout>
    <androidx.constraintlayout.widget.ConstraintLayout
	...>

	<TextView
		android:id="@+id/text_dashboard"
		android:layout_width="match_parent"
		android:layout_height="wrap_content"
		android:layout_marginStart="8dp"
		android:layout_marginTop="16dp"
		android:layout_marginEnd="8dp"
		android:padding="8dp"
		android:text="Dashboard"
		app:layout_constraintEnd_toEndOf="parent"
		app:layout_constraintStart_toStartOf="parent"
	/>

</androidx.constraintlayout.widget.ConstraintLayout>

प्रश्न 37. जब Android Studio एक नया project बनाता है तो default रूप से कौन सा source set आपके लिए उपलब्ध नहीं है?

प्रश्न 38. कौन सी definition अन्य apps को intent के माध्यम से आपकी Activity class तक पहुंचने से रोकेगी?

	<activity android:name=".ExampleActivity" />
	<activity android:name=".ExampleActivity">
		<intent-filter>
			<action android:name="android.intent.action.SEND" />
		</intent-filter>
	</activity>
	<activity android:name=".ExampleActivity">
		<intent-filter>
			<action android:name="android.intent.action.MAIN" />
			<category android:name="android.intent.category.LAUNCHER" />
		</intent-filter>
	</activity>
	<activity android:name=".ExampleActivity">
		<intent-filter>
			<action android:name="android.intent.action.VIEW" />
		</intent-filter>
	</activity>

व्याख्या: Intent filters का उपयोग intents का उपयोग करके activities को अन्य apps के लिए accessible बनाने के लिए किया जाता है। इसलिए हमें उस option को चुनना होगा जिसमें कोई intent filter नहीं है ताकि यह सुनिश्चित हो सके कि यह intent द्वारा accessible नहीं है

प्रश्न 39. On-device memory को preserve करने के लिए, आप कैसे निर्धारित कर सकते हैं कि user के device में limited storage capabilities हैं?

प्रश्न 40. Android code को reuse करने का कौन सा अच्छा तरीका नहीं है?

प्रश्न 41. बड़े, complex hierarchies के लिए कौन सा layout सबसे अच्छा है?

प्रश्न 42. आपको Android Gradle plugin के latest version में upgrade करने की आवश्यकता है। आपको किस file को modify करना चाहिए?

संदर्भ

प्रश्न 43. Developers अक्सर Application class में app initialization code क्यों रखते हैं?

संदर्भ

प्रश्न 44. आपको अपने app के launcher icons के लिए किस folder का उपयोग करना चाहिए?

प्रश्न 45. कौन सी drawable definition आपको नीचे दी गई shape प्राप्त करने की अनुमति देती है?

img

	<shape xmlns:android-"http://schemas.android.com/apk/res/android"
	    android:shape-"oval">
	    <gradient
               android:startColor-"@android:color/white"
               android:endColor-"@android:color/black"
               android:angle-"45"/>
	</shape>
	<rectangle xmlns:android-"http://schemas.android.com/apk/res/android">
	   <gradient
	      android:startColor-"@android:color/white"
	      android:endColor-"android:color/black"
	      android:angle-"135"/>
	</rectangle>
	<shape xmlns:android-"http://schemas.android.com/apk/res/android"
	   android:shape-"rectangle">
	   <gradient
	      android:startColor-"@android:color/white"
	      android:endColor-"@android:color/black"
	      android:angle-"135"/>
	</shape>
	<shape xmlns:android-"http://schemas.android.com/apk/res/android"
	   android:shape-"rectangle">
	   <gradient
	      android:startColor-"@android:color/white"
	      android:endColor-"@android:color/black"
	      android:angle-"98"/>
	</shape>

प्रश्न 46. नीचे दिए गए ConstraintLayout को देखते हुए, कौन सा statement सही है?

img

प्रश्न 47. build.gradle file से इस code snippet को देखते हुए, कौन सा choice संभावित build variant नहीं है?

android {
    ...
    defaultConfig{...}

    buildTypes{
    debug{...}
    releasae{...}
}

    flavorDimensions "environment"
    productFlavors {
        producation {...}
        staging {...}
    }
}

संदर्भ

प्रश्न 48. आपको अपने test classes को store करने के लिए androidTest directory का उपयोग कब करना चाहिए?

संदर्भ

प्रश्न 49. Build process से produced app-internal-debug.apk नामक एक APK को देखते हुए, कौन सा statement सही होने की संभावना है?

प्रश्न 50. अपने project को build करने का प्रयास करते समय, निम्नलिखित error क्या indicate कर सकती है?

Conversion to Dalvik format filed: Unable to execute dex: method ID not in [0, 0xffff]: 65536

प्रश्न 51. build.gradle file में कौन सा statement सही तरीके से denote करता है कि corresponding module एक Android library module है?

प्रश्न 52. निम्नलिखित dimens.xml file को देखते हुए, आप bottom पर medium spacing के साथ एक ImageView कैसे define करेंगे?

<?xml version=1.0 encoding="utf-8"?>
<resources>
    <dimen name="spacing_medium">8dp</dimen>
    <dimen name="spacing_large">12dp</dimen>
</resources>
<ImageView
   android:id=@+id/image_map_pin"
   android:layout_width="wrap_content"
   android:layout_heignt="wrap_content"
   android:src=@drawable/map_pin />
<ImageView
   android:id=@+id/image_map_pin"
   android:layout_width="wrap_content"
   android:layout_heignt="wrap_content"
   androi:layout_botttom="@dimen/spacing_medium"
   android:src=@drawable/map_pin />
<ImageView
   android:id=@+id/image_map_pin"
   android:layout_width="wrap_content"
   android:layout_heignt="wrap_content"
   android:layout_marginBottom="@resources/spacing_medium"
   android:src=@drawable/map_pin />
<ImageView
   android:id=@+id/image_map_pin"
   android:layout_width="wrap_content"
   android:layout_heignt="wrap_content"
   android:layout_marginBottom="@dimen/spacing_medium"
   android:src=@drawable/map_pin />

प्रश्न 53. Code से images और strings जैसे app resources को externalize करने का लाभ क्या नहीं है?

प्रश्न 54. इस code snippet में line five का मुख्य उद्देश्य क्या है?

override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_post_create)

	if (savedInstanceState != null) return

	val fragment = CreatePostFragment()
		supportFragmentManager
		.beginTransaction()
		.add(R.id. fragment_container, fragment)
		.commit()

}

प्रश्न 55. कौन सा component एक entry point नहीं है जिसके माध्यम से system या user आपके app में enter कर सकता है?

प्रश्न 56. Elements की एक बड़ी, scrolling list को display करने के लिए आपको क्या उपयोग करना चाहिए?

प्रश्न 57. आपने एक AboutActivity class बनाई है जो आपके app के बारे में details display करती है। कौन सा code snippet आपको अपनी activity launch करने की अनुमति देता है?

व्याख्या: Intent(Context packageContext, Class<?> cls) ध्यान दें: Class न कि KClass

प्रश्न 58. AndroidManifest.xml file का उपयोग क्या है?

प्रश्न 59. element की कौन सी attribute application को run करने के लिए आवश्यक minimum API Level specify करने के लिए उपयोग की जाती है?

प्रश्न 60. Release builds में अपने code को shrink करने के लिए, Android Studio कौन सा tool उपयोग करता है?

व्याख्या: जब आप Android Gradle plugin 3.4.0 या higher का उपयोग करके अपना project build करते हैं, तो plugin अब compile-time code optimization perform करने के लिए ProGuard का उपयोग नहीं करता है। इसके बजाय, plugin R8 compiler के साथ काम करता है

संदर्भ

प्रश्न 61. कौन सी layout hierarchy सबसे तेज़ी से draw होने की संभावना है?

संदर्भ

प्रश्न 63. आपको Google Play के माध्यम से on-demand या instant experiences के रूप में अपने users को अपने app की कुछ features provide करनी हैं। आपको किस प्रकार का module बनाना चाहिए?

  1. संदर्भ
  2. संदर्भ

संदर्भ

प्रश्न 65. यदि आपको अपने app code को current build के बारे में information inspect करने की आवश्यकता है, तो आपको किस class का उपयोग करना चाहिए?

प्रश्न 66. नीचे दिए गए ConstraintLayout में, button parent की width को fill करने के लिए expand क्यों नहीं होगा?

    <androidx.constraintlayout.widget.ConstrantLayout
        ...>
	    <Button
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:text="Button"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"/>

    </androidx.constraintlayout.widget.ConstrantLayout>

प्रश्न 67. आपके Espresso tests में idling resources के लिए कौन सा use case नहीं है?

प्रश्न 68. अपने app को strings provide करने के लिए resources का कौन सा type नहीं है?

प्रश्न 69. Activity lifecycle में क्या नहीं है?

प्रश्न 70. आप users को अपने app में picture लेने की अनुमति देना चाहते हैं। कौन सा code snippet सही approach है?

  fun showCamera(view: View) {
      Log.i(TAG, "Show camera button pressed.")
      if (ContextCompat.shouldShowRequestPermissionRationale(thisActivity,
      Manifest.permission.CAMERA) {
        showCameraPreview()
      }
       else {
         requestPermissionLauncher.launch(Manifest.permission.CAMERA)
       }
   }
  fun showCamera(view: View) {
      Log.i(TAG, "Show camera button pressed.")
      if (ContextCompat.checkSelfPermission(thisActivity,
      Manifest.permission.CAMERA)
      == PackageManager.PERMISSION_GRANTED) {
        showCameraPreview()
      }
      else {
         requestPermissionLauncher.launch(Manifest.permission.CAMERA)
      }
  }
  fun showCamera(view: View) {
      Log.i(TAG, "Show camera button pressed.")
      showCameraPreview()
  }
  fun showCamera(view: View) {
      Log.i(TAG, "Show camera button pressed.")
      if (ContextCompat.checkSelfPermission(thisActivity,
      Manifest.permission.CAMERA)
      != PackageManager.PERMISSION_GRANTED) {
         showCameraPreview()
       }
       else {
          requestPermissionLauncher.launch(Manifest.permission.CAMERA)
       }
  }

प्रश्न 71. नीचे दिए गए string resource को देखते हुए, कौन सा code snippet valid है?

<string name="upload_photo_notification">%1$d of %2$d photos uploaded</string>
val string: String = getString(
   R.string.upload_photo_notification,
   "2",
   "5"
)
val string: String = getString(
   R.id.upload_photo_notification,
   2,
   5
)
val string: String = getString(
   R.string.upload_photo_notification,
   2,
   5
)
val string: String = getString(
   R.id.upload_photo_notification,
   "2",
   "5"
)

संदर्भ

प्रश्न 72. विभिन्न भाषाओं में quantity के साथ grammatical agreement के लिए अलग-अलग rules हैं। अपने app में कई भाषाओं में निम्नलिखित दो strings को support करने के लिए, ideal resource definition क्या है?

"You have 1 day remaining"
"You have 2 days remaining"
<string name="trial_days_left_one"> You have %1$d day remaining</string>
<string name="trial_days_left_other">You have %1$d days remaining</string>
<plurals name="trial days left">
    <plural quantity="one">You have %1$d day remaining</plural>
    <plural quantity="other">You have %1$d days remaining</plural>
</plurals>
<plurals name="trial_days_left">
    <item quantity="one">You have %1$d day remaining</item>
    <item quantity="other">You have %1$d days remaining</item>
</plurals>
<string name="trial_days_left">
    <plural quantity="one">You have %1$d day remaining</plural>
    <plural quantity="other">You have &1$d days remaining</plural>
</string>

प्रश्न 73. Operating system onTrimMemory() method का उपयोग कब करेगा?

संदर्भ

प्रश्न 74. अपने app में, आपके पास items का एक RecyclerView है। आप portrait और landscape modes के लिए एक अलग configuration रखना चाहते हैं। नीचे दिए गए layout को best support करने के लिए कौन सा code snippet आपको अनुमति देगा?

img

recyclerView.setLayoutManager(GridLayoutManager(this, 3))
val coulumnCount = resources.getInteger(R.integer.column_count)
recyclerView.setLayoutManager(GridLayoutManager(this, columnCount))
recyclerView.setLayoutManager(LinearLayoutManager(this))
val coulumnCount = resources.getInteger(R.integer.column_count)
recyclerView.setLayoutManager(LinearLayoutManager(this, columnCount))

प्रश्न 75. आपको अपने API से उसके ID के आधार पर एक Event को remove करने की आवश्यकता है। Retrofit में उस request को कौन सा code snippet define करता है?

प्रश्न 76. आप users को अपने app में pictures लेने की अनुमति देना चाहते हैं। सीधे camera permission request करने के बजाय एक appropriate intent बनाने का कौन सा लाभ नहीं है?