Skip to main content

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 यूज़ हुए है।


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

how-androidmanifest.xml-file-works-in-hindi

किसी भी 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

Popular posts from this blog

Android Services

Android Services Introduction to  android services in Hindi  Declaring  services in Hindi Creating a  android service in Hindi Introduction to Android Services इससे पहले की आप जाने की service क्या होती है आइये जानते है की service क्या नहीं होती है - एक service separate प्रोसेस नहीं होती है। ये आपकी एप्लीकेशन का ही पार्ट होती है।  एक service thread नहीं होती है।  आइये अब देखते है service क्या होती है - Service एक facility होती है जिससे आप android system को बता सकते है की आप कोई काम background में करते रहना चाहते है।  Service एक facility होती है जिससे एक एप्लीकेशन अपनी कुछ functionality दूसरी applications को expose कर सकती है।    हर service क्लास का <service> declaration AndroidManifest.xml file में होना चाहिए। Services को आप context.startService() और context.bindService() मेथड्स से स्टार्ट कर सकते है।            जब service component क्रिएट होता है तो android syst...

Android Activity

Android Activity Activity life cycle in Hindi Starting an  android activity in Hindi Creating a new activity in Hindi Destroying an  android activity in Hindi Introduction to Activity आप की application में एक से ज्यादा activity हो सकती है। जब आप इन activities के through navigate करते है, यानि एक activity से दूसरी activity में जाते है तो activity अपनी life cycle की different stages में जाती है। उदाहरण के लिए जब आपकी activity start होती है तो ये foreground में होती है और user का पूरा focus इस पर होता है। इस process के दौरान  android  system कुछ life cycle methods को call करता है। यदि user कोई दूसरी activity start करता है तो android system उस activity के life cycle methods को call करता है और आपकी पहले वाली activity background में चली जाती है। life cycle methods में आप decide कर सकते है की जब user जाता है या वापस आता है तो आपकी activity कैसे behave करेगी।  उदाहरण के लिए यदि आप एक वीडियो player बना रहे है तो जब user किसी दूसरी activity पर जाये तो...

Android Spinners

Android Spinners  Introduction to  android spinners in Hindi Defining  android spinners in Hindi Creating spinner items array in Hindi Responding to spinner selections in Hindi    Introduction to Android Spinners Android spinners आपकी एप्लीकेशन में एक drop down menu होती है। इस drop down menu में बहुत से items होते है जिन्हे user choices कहते है। जब user spinner पर क्लिक करता है तो ये items शो होते है। यूज़र अपने लिए appropriate choice choose करता है। By default spinner में सबसे top वाला element शो होता है। Spinners को XML layout file में क्रिएट किया जाता है। और items की लिस्ट string resource file में क्रिएट की जाती है। जिसमे आप एक string array क्रिएट करते है।  Spinner और items को जोड़ने के लिए एक array adapter क्रिएट किया जाता है। इसके बाद selection events को respond करने के लिए OnItemSelectedListener interface को  इम्प्लीमेंट किया जाता है।  Defining Android Spinners Android spinners को आप XML l...