AndroidManifest.xml file


AndroidManifest.xml file


  • Introduction to AndroidManifest.xml file in Hindi
  • Elements of AndroidManifest.xml file in Hindi

    Introduction to AndroidManifest.xml file


    AndroidManifest.xml  file  में आपके package की information होती है. आप अपनी application में जितने भी components यूज़ करते है उन सब की information AndroidManifest.xml file में होती है. जैसे सेर्वलेट्स में deployment descriptors होते है. उसी प्रकार AndroidManifest.xml file भी आपकी application के लिए deployment descriptors की तरह होती है. ये आपकी application को कंट्रोल करती है. AndroidManifest.xml  file को देखकर आप बता सकते है की application में कितने और कौन कौन से components यूज़ हुए है.


    Related Reading : Android in Hindi : Android Components


    जैसा की आप जानते है की हर android application में कम से कम एक Activity, Service, Broadcast receiver या Content Provider अवश्य होता है. ये सभी components tasks परफॉर्म करने के लिए Intent create करते है या intent filters के द्वारा खुद को intents के लिए register करते है. Intent और intent filters  2 अलग अलग element है जिन्हे AndroidManifest.xml file जोड़ती है.


    किसी भी application के components को आपकी application के protected part को access करने से पहले permission required होती है. ये permission AndroidManifest.xml file में declare होती है. Permission डिक्लेअर करने के लिए <uses-permission> tag यूज़ किया जाता है.

    Application क्रिएट करते समय आप कोनसा android API यूज़ करते है ये आप AndroidManifest.xml file में डिक्लेअर करते है.


    Elements of AndroidManifest.xml file

    AndroidManifest.xml file कुछ elements से मिलकर बनी होती है.


    <manifest> 

    <manifest> एलिमेंट AndroidManifest.xml file का root element होता है.  इसमें package attribute होता है जो activity क्लास के package name को describe करता है.

    <application>   

    <application> एलिमेंट <manifest> एलिमेंट का sub-element होता है. इस एलिमेंट के कई sub elements होते है. इस attribute में commonly icon, label और theme attributes यूज़ किये जाते है. आइये इनके बारे में कुछ जान लेते है.

    android:icon  - ये आपकी एप्लीकेशन के icon को represent करता है.
    android:label  - ये आपकी application के label को represent करता है.
    android:theme  - ये आपकी एप्लीकेशन की theme को represent करता है.


    <activity> 

    <activity> एलिमेंट <application> element का sub-element होता है. ये एक activity को दर्शाता है. इस एलिमेंट के 2 प्रमुख attributes होते है. 

    android:name - ये activity class के नाम को represent करता है. 
    android:label  - ये एक label होता है जो स्क्रीन पर डिस्प्ले होता है.


    <intent-filter>

    <intent-filter> एलिमेंट <activity> एलिमेंट का sub-element होता है. इसके तीन प्रमुख sub-elements होते है. 

    <action> - intent-filter किस प्रकार के action के intent को respond करेगा ये इसमें डिफाइन किया जाता है.

    <data> - target component का URI इस एलिमेंट में डिफाइन किया जाता है.

    <category> - ये activity की category को डिफाइन करता है.

    Comments

    Add2

    Popular posts from this blog

    Android menus

    Android broadcast receivers