Skip to main content

Android Resources

Android Resources 

  • Introduction to android resources in Hindi
  • Alternative resources in Hindi 
  • Supplying android resources in Hindi
  • Retrieving android resources in Hindi 

Introduction to Android Resources

जैसा की मैने आपको पहले बताया resources वो files होती है जो आपकी एप्लीकेशन code में include करती है। Resources को application के code से separately maintain किया जाता है। Resources को एप्लीकेशन से separate करने से आप resources को independently maintain कर सकते है। 

Resources को आपकी एप्लीकेशन directory के /res folder में maintain किया जाता है। Android studio में /res folder की position नीचे दी गयी window में दिखायी गयी है।

    

/res फोल्डर की sub directories और उनमे maintain किये जाने वाले resource types  की लिस्ट नीचे दी जा रही है। 





Alternative Resources 

अलग अलग devices की configuration भी अलग अलग होती है। जैसे किसी tablet device की screen size mobile device से बड़ी होती है। इसलिए हर application को अलग अलग device configuration को support करने के लिए alternative resources प्रोवाइड करने चाहिए। 

जब आपकी एप्लीकेशन run होती है तो android device configuration को detect कर लेता है और उस device के according resources load कर देता है। 

Alternative resources डिफाइन करने के लिए आपको /res फोल्डर में <resources-name>-<config_qualifier> directory क्रिएट करनी होगी।  

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...