what is android button in hindi-बटन क्या होता है ?

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

बटन

बटन एक पुश-बटन है जिसे user द्वारा कार्रवाई करने के लिए दबाया या क्लिक किया जा सकता है।

अथवा

यह एक UI होता है जो की यूजर के द्वारा click करते ही कोई action करने के लिए उपयोग किया जाता है हम इसे दो तरीके से बना सकते है

1.XML file – इसके लिए हम इसे layout tag में निम्नलिखित declare करते है

<Linear Layout 
xmls:android = “http://schemas.android.com/apk/res/android”>
<Button
//attributes 
/>
</LinearLayout>

2. activity फाइल – इसमे हम इसे निचे की तरह प्रोग्रामेटिकरूप में  declare करते है

setContentView(R.layout.activity_main);
LinearLayout linearlayout_name =(LinearLayout)findViewById(R.id.LinearLayout);
Button btn_name = new Button(this);
btn_name.setText(“hello I am javahindi owner Button”);
linearLayout.addView(btn_name);
android button in hindi

बटन Attributes

बटन नियंत्रण से संबंधित महत्वपूर्ण attributes निम्नलिखित हैं :

Android.widget. TextView Class से inheritance में मिला

अनुक्रमांकविशेषता और विवरण
1.Android:autoText: यदि सेट किया गया है तो यह निर्दिष्ट करता है कि इस TextView में एक पाठ इनपुट मेथड है और स्वचालित रूप से कुछ सामान्य वर्तनी त्रुटियों को ठीक करता है।
2.Android:drawableBottom: यह पाठ के नीचे खींचे जाने योग्य है।
3.Android:drawableRight : यह पाठ के दाईं ओर खींचे जाने योग्य है।
4.Android:editable: यदि सेट किया गया है, तो निर्दिष्ट करता है कि इस TextView में एक इनपुट मेथड है।
5.Android:text: यह प्रदर्शित करने के लिए पाठ है।

इसे भी जाने —

Android.view.View Class से inherita हम में मिला :

अनुक्रमांकविवरण
1.Android:background : यह बैक ग्राउंड के रूप में उपयोग करने के लिए एक योग्य है।
2.Android:contentDescription : यह पाठ को परिभाषित करता है जो संक्षेप में दृश्य की कंटेंट का वर्णन करता है।
3.Android:id : यह इस दृश्य के लिए एक identifier नाम की आपूर्ति करता है।
4.Android:onClick : जब दृश्य क्लिक किया जाता है, तो यह दृश्य के संदर्भ में मेथड का नाम है।
5.Android:visibility : यह दृश्य की प्रारंभिक दृश्यता को नियंत्रित करता है।

यह उदाहरण आपको सरल चरणों के माध्यम से दिखाएगा कि रैखिक लेआउट और बटन का उपयोग करके अपना खुदका Android एप्लीकेशन कैसे बनाएँ।

स्टेपविवरण
1.आप Android एप्लीकेशन बनाने के लिए Android स्टूडियो आईडीई का उपयोग करेंगे और इसे पैकेज com.example.saira_000.myapplication के तहत myapplication नाम देंगे।
2.एक क्लिक ईवेंट जोड़ने के लिए src / MainActivity.java फ़ाइल को संशोधित करें।
3.Android UI नियंत्रण शामिल करने के लिए Res / Layout / activity_main.xml फ़ाइल की डिफ़ॉल्ट कंटेंट को संशोधित करें।
4.String.xml पर डिफ़ॉल्ट स्ट्रिंग स्थिरांक घोषित करने की आवश्यकता नहीं है, Android स्टूडियो डिफ़ॉल्ट स्ट्रिंग स्थिरांक का ख्याल रखता है।
5.Android एमुलेटर लॉन्च करने के लिए एप्लीकेशन चलाएँ और एप्लीकेशन में किए गए परिवर्तनों के परिणाम की पुष्टि करें।

निम्नलिखित संशोधित main ACTIVITY फाइल src / MainActivity.java की कंटेट है।

package com.example.saira_000.myapplication;
import android.content. Intent; 
import android.net.Uri; 
import android.support.v7.app.ActionBarActivity: 
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem; 
import android.view.View;
import android.widget.Button; 
import android.widget. Toast;
public class MainActivity extends ActionBarActivity { 
Button b1,b2, b3;
@Override 
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
 setContentView(R.layout.activity_main);
b1 = (Button) findViewById(R.id.button);
 b1.setOnClickListener(new View.OnClickListener() {
@Override 
public void onClick(View v) {
Toast.makeText (MainActivity. this, "YOUR MESSAGE", Toast.LENGTH_LONG).show();
}
});
}
}

निम्नलिखित res/layout/activity_main.xml फ़ाइल की कंटेंट होगी

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" 
android: paddingLeft="@dimen/activity horizontal margin android:paddingRight="@dimen/activity horizontal margin" 
android: paddingTop="@dimen/activity_vertical_margin" 
android: paddingBottom="@dimen/activity vertical_margin" 
tools: context=".MainActivity">
<TextView
android:id="@+id/textView1" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:text="Button Control" 
android:layout_alignParent Top="true" 
android:layout_centerHorizontal="true" 
android:textSize="30dp" />
<TextView
android:id="@+id/textView2" 
android:layout_width="wrap_content" boom android:layout_height="wrap_content" 
android:text="Asian publishers"
android:textColor="#ff87ff09" 
android:textSize="30dp" 
android:layout_below="@+id/textView1". 
android:layout_centerHorizontal="true" />
<ImageButton
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:id="@+id/imageButton"
 android:src="@drawable/abc" 
android:layout_below="@+id/textView2" 
android:layout_centerHorizontal="true" />

<Edit Text
android:layout_width="wrap_content" 
android:layout_height="wrap_content"
android:id="@+id/editText" 
android:layout_below="@+id/imageButton" android:layout_alignRight="@+id/imageButton 
android:layout_align End="@+id/imageButton" />
<Button
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:text="Button" 
android:id="@+id/button" 
android:layout_alignTop="@+id/editText" android:layout_alignleft="@+id/textView1" android:layout_alignStart="@+id/textView1" android:layout_alignRight="@+id/editText" android:layout_alignEnd="@+id/editText" />
</RelativeLayout>

इन नए स्थिरांक को परिभाषित करने के लिए Res/value/str.xml की कंटेंटनिम्नलिखित होगी

<?xml version="1.0" encoding="utf-8"?> 
<resources>
<string name="app_name">myapplication</string>
 </resources>
AndroidManifest.xml की डिफ़ॉल्ट content निम्नलिखित है -
<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.saira_000.myapplication" >
<application
android: allowBackup="true" 
android:icon="@drawable/ic_launcher" 
android:label="@string/app_name" 
android:theme="@style/AppTheme" >
<activity
android:name="com.example.guidemo4.MainActivity" android:label="@string/app_name" >
<intent-filter>
<action android:name="android. intent.action.Main”/> 
<category android:name = “android.intent.category.LAUNCHER”/> 
</intent-filter>
</activity>
</application> 
</manifest> 
 android button in hindi

reference- allsitein.com

निवेदन :-अगर आपको यह आर्टिकल( android button in hindi) उपयोगी लगा हो तो इस आप अपने क्लासमेट ,दोस्तों  के साथ अवश्य share कीजिये और आपके जो भी इस पोस्ट्स से related() questions( android button in hindi) है तो आप उन्हें निचे कमेंट कर सकते है हम उसके  answer अवश्य करेंगे Thank

3 thoughts on “what is android button in hindi-बटन क्या होता है ?”

Leave a Comment