android text fields in hindi-एंड्राइड टेक्स्ट फ़ील्ड्स क्या है?

हेल्लो दोस्तों आज के इस पोस्ट में आपको android text fields in hindi के बारे में बताया गया है की क्या होता है कैसे काम करता है तो चलिए शुरू करते है

Introduction to Android Text Fields 

आप अपनी android application में text fields क्रिएट कर सकते है। Text fields को text boxes भी कहते है। एक text field के द्वारा आप यूज़र से input लेते है। जैसे की यूज़र का नाम और ईमेल एड्रेस। 

ज्यादातर text fields एक ही लाइन के होते है। लेकिन आप चाहे तो android में multiple lines के भी text फ़ील्ड्स क्रिएट कर सकते है। 

Text एंटर करने के लिए यूज़र text field पर क्लिक करते है। यूज़र के क्लिक करने पर typing cursor text field में शो हो जाता है। साथ ही टाइप करने के लिए keyboard भी शो हो जाता है। ये सब automatically होता है।  

आप text fields को अलग अलग तरह की input values के लिए भी configure कर सकते है। जैसे की किसी text box को आप सिर्फ email के लिए configure कर सकते है।  

Android text fields के लिए आप actions भी define कर सकते है। जो यूज़र input करने के बाद perform करता है। 

Creating Android Text Fields 

Text fields आप अपने layout में add कर सकते है। इसके लिए आप XML layout file में <EditText> element define करते है। <EditText> element के basic attributes वही है जो सब view elements define करते है –

android:id – ये attribute text field की id define करता है।  

android:layout_width – ये attribute text field की width define करता है।  

android:layout_height – इस एट्रिब्यूट के द्वारा आप text field की height define करते है।  

android:hint – इस attribute के द्वारा आप input type की hint दे सकते है।  

android:inputType – इस attribute के द्वारा आप input type डिफाइन करते है।  

android:imeOptions – इस attribute के द्वारा आप action define करते है।      

Example 

  <EditText  android:id="id for text field" android:layout_width="width of text field" android:layout_height="height of text field" android:hint="hint of  input type" android:inputType="input type" android:imeOptions="action" /> 

Input Types of Android Text Fields 

Text fields में अलग अलग तरह की values डाली जा सकती है। जैसे की text, number, date और email address. एक text field में आप किस तरह की वैल्यू enter कर सकते है ये आप android:inputType attribute के द्वारा डिफाइन करते है।

इस attribute के लिए common input types निचे दिए जा रहे है। ये सभी input types अलग अलग keyboard शो करते है।  

text – ये input type साधारण text enter करने के लिए declare किया जाता है। ये normal text कीबोर्ड शो करता है।   

textEmailAddress – ये input type email address इनपुट करने के लिए यूज़ किया जाता है। इससे normal keyboard शो होता है @ sign के साथ।    

textUri – इस इनपुट टाइप से आप text field में URL enter कर सकते है। ये input type साधारण text keyboard शो करता है / के साथ।    

number – ये input type numbers एंटर करने के लिए यूज़ किया जाता है। और numbers का keyboard शो करता है।   

phone – इस input type को phone style keyboard के लिए यूज़ किया जाता है।  
Example

  <EditText  android:id="id for text field" android:layout_width="width of text field" android:layout_height="height of text field" android:hint="hint of  input type" android:inputType="textEmailAddress" android:imeOptions="action" /> 

Keyboard Actions of Android Text Fields

User के information input करने के बाद action लिया जाता है। ये action क्या होता है ये आपकी एप्लीकेशन पर depend करता है। जैसे की यदि आपकी एप्लीकेशन searching की service provide करती है तो action search हो सकता है और यदि आपकी एप्लीकेशन messaging की service provide करती है तो ये action send हो सकता है।

किस तरह का action आप लेना चाहते है ये आपकी application पर निर्भर होता है। यदि आप कोई action डिफाइन नहीं करते है तो next का option निचे right hand side corner में शो होता है। नहीं तो जो action आप डिफाइन करते है वो शो होता है।

Keyboard action आप android:imeOptions attribute के द्वारा डिफाइन कर सकते है।

Example

  <EditText  android:id="id for text field" android:layout_width="width of text field" android:layout_height="height of text field" android:hint="hint of  input type" android:inputType="textEmailAddress" android:imeOptions="actionSend" /> 
 android text fields in hindi

reference-https://stuff.mit.edu/afs/sipb/project/android/docs/guide/topics/ui/controls/text.html

निवेदन:-आप सभी छात्र –छात्रों से निवेदन है की अगर आपको ये Topic(android text fields in hindi) या post अच्छा लगा हो तो कृपया आप इस वेबसाइट के बारे में अपने दोस्तों(android text fields in hindi) को जरुर बताये और -अगर कोई topic(android text fields in hindi) से संबधित प्रश्न हो तो कमेंट्स(comments) आपके लिए ही बना है और किसी Subject() के लेकर भी कोई प्रश्न हो तो कमेंट करे

Leave a Comment