Skip to main content

Android Views

Android Views


  • Introduction to android views in Hindi.
  • Common android views in Hindi. 
  • Common methods used with android views in Hindi.

Introduction to Android Views

Android views एक्टिविटी के अंदर होते है। Android views वो elements होते है जो हमे स्क्रीन पर शो होते है, जैसे की button, text-box आदि। सभी views activity के अंदर होते है।

Android view classes, views को represent करती है। हर android view एक view class के द्वारा represent किया जाता है। जैसे की button को represent करने के लिए Button class provide की गयी है। इन classes की मदद से हम events के द्वारा user से interact करते है।

Android views tree की form में represent होते है। किसी activity में views hierarchical tree की form में represent किये जाते है। अलग अलग views की अलग अलग size होती है। ज्यादातर use होने वाले views को android platform में include किया गया है।

आप खुद के android views भी create कर सकते है। Android platform में included views के अलावा आप खुद के views भी create कर सकते है। आप views को directly या तो code में डाल सकते है या XML file भी आप use कर सकते है।

Common Android Views

जब आप किसी single एलिमेंट को देखते है तो वह view कहलाता है। जब बहुत से views को एक साथ किसी layout की मदद से show किया जाता है तो वह view-group कहलाता है।

View's

View class को Analog-Clock, Progress-Bar, Image-View, Surface-View, View-Group, Text-View और View-Stub classes extend करती है।        


Text-View - Text-View क्लास view क्लास को extend करती है। Text-View क्लास को Edit-Text, Digital-Clock, Chronometer, Checked-Text-View और Button classes extend करती है।

Button class को Compound-Button class extend करती है। Compound-Button class को Radio-Button और Check-Box Classes extend करती है। 

Image-View - Image-View class को Image-Button class extend करती है। ये class image buttons क्रिएट करने के लिए यूज़ की जाती है।

Surface-View - Video-View क्लास Surface-View class को extend करती है। ये क्लास screen पर video शो करने के लिए यूज़ की जाती है।
Analog-Clock - ये class screen पर analog clock क्रिएट करने के लिए use की जाती है।

Progress-Bar - ये क्लास किसी process के लिए progress bar क्रिएट करने के लिए use की जाती है।

View-Stub - ये क्लास दूसरे views के लिए layout क्रिएट करने के लिए use की जाती है। 



View-Group's  

View-Group क्लास View क्लास को एक्सटेंड करती है। View-Group क्लास को Map-View, Adapter-View, Relative-Layout, Linear-Layout, Frame-Layout और Absolute-Layout क्लासेज extend करती है।


Map-View - इस क्लास के द्वारा हम screen पर map को show कर सकते है।

Adapter-View - Spinner, Grid-View, Gallery और List-View classes Adapter-View क्लास को extend करती है।

Relative-Layout - इस क्लास को Dial-er-Filter और Two-Line-List-Item क्लासेज एक्सटेंड करती है। ये classes views के लिए relative layout provide करती है।

Linear-Layout - Table-Layout, Table-Row, Radio-Group, Tab-Widget, Zoom-Controls क्लासेज Linear-Layout क्लास को extend करती है। ये क्लासेज views के लिए Linear layout प्रोवाइड करती है।

Frame-Layout - Scroll-View, Time-Picker, Date-Picker, Ticker, Scale-Layout, View-Animator क्लासेज Frame-Layout क्लास को extend करती है। ये क्लासेज views के लिए frame layout प्रोवाइड करती है।

Absolute-Layout - इस क्लास को Web-View क्लास extend करती है। ये क्लास views के लिए Absolute-Layout provide करती है।                  

Common Methods Used with Android Views

set-Background-Color(int Color) - ये मेथड background color set करने के लिए use किया जाता है। 

set-Background-Draw-able(Draw-able d ) - ये मेथड एक draw-able background सेट करने के लिए यूज़ किया जाता है। जैसे की कोई image आप background में सेट कर सकते है।

set-Clickable(Boolean c) - आप चाहे तो जिस element पर आप ये मेथड कॉल करेंगे उसे clickable बना सकते है।

set-Focus-able(Boolean f ) - आप चाहे तो एलिमेंट को focus-able बना सकते है। 

set-Layout-Pa-rams(View-Group.Layout-Pa-rams l ) - इस मेथड के द्वारा आप लेआउट की position और size सेट कर सकते है। 

set-Minimum-Height(int min-Height) - इस मेथड से आप एलिमेंट की minimum height सेट कर सकते है। 

set-Minimum-Width(int min-Width) - इस मेथड से आप element के minimum width सेट कर सकते है। 

set-On-Click-Listener(on-Click-Listener l) - इस मेथड से आप एक listener सेट कर सकते है जो की events generate होने पर respond कर सकता है। 

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