I can see that you have tried very hard to learn Android, that is commendable. For that, I am more than happy to spend extra time looking into your problem.
Among other things, there are many typo errors and wrong cases, remember Java is case-sensitive
1. OnClickListner should be OnClickListener
2. Textview should be TextView
3. RedioButton should be RadioButton
4. isCheked should be isChecked
5. Why two similar methods: convertDollorToEuro()
6. ...
I have created a working android project based on my understanding of your attempt, take a look and learn for yourself.
MainActivity.java
package com.example.test1;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.TextView;
public class MainActivity extends Activity implements OnClickListener {
TextView dollar;
TextView euro;
RadioButton dte;
RadioButton etd;
Button calculate;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
dollar = (TextView) this.findViewById(R.id.dollar);
euro = (TextView) this.findViewById(R.id.euro);
dte = (RadioButton) this.findViewById(R.id.dte);
etd = (RadioButton) this.findViewById(R.id.etd);
calculate = (Button) this.findViewById(R.id.calculate);
calculate.setOnClickListener(this);
}
@Override
public void onClick(View v) {
if(dte.isChecked())
{
convertDollarToEuro();
}
else if(etd.isChecked())
{
convertEuroToDollar();
}
}
protected void convertDollarToEuro() {
double val = Double.parseDouble(dollar.getText().toString());
euro.setText(Double.toString(val * 0.7378));
}
protected void convertEuroToDollar() {
double val = Double.parseDouble(euro.getText().toString());
dollar.setText(Double.toString(val * 1.3554));
}
}
activity_main.xml
="1.0"="utf-8"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Dollar"
android:paddingLeft="10dip"
android:paddingRight="10dip"
android:paddingTop="10dip"
android:textSize="17dip"/>
<EditText android:id="@+id/dollar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="5dip"
android:layout_marginBottom="15dip"
android:singleLine="true"
android:inputType="numberDecimal"/>
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Euro"
android:paddingLeft="10dip"
android:paddingRight="10dip"
android:paddingTop="10dip"
android:textSize="17dip"/>
<EditText android:id="@+id/euro"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="5dip"
android:layout_marginBottom="15dip"
android:singleLine="true"
android:inputType="numberDecimal"/>
<RadioGroup
android:id="@+id/radioGroup1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="horizontal" >
<RadioButton
android:id="@+id/dte"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/dte" />
<RadioButton
android:id="@+id/etd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/etd" />
</RadioGroup>
<Button
android:id="@+id/calculate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="calculate" />
</LinearLayout>
This program will throw error when both text boxes are blank while clicking the button, I shall leave that to you as exercise.