Hi, I have just start to develop android, and I just cannot start my Hello World application.
<br /> I have followed instructions about android installation, I have changed several IDE's, but still, when I press f11 to compile, it 'does' some job int he background, activate my virtual device, but wont to behave just as it should!
<br /> Only " Android . . . " is displayed on the screen, which mean that my class isn't 'loaded', somehow.
<br /> This is sample class :
<br />
<br /> <textarea name="code" class="java" cols="60" rows="10">
package test.and;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class TestAppActiv extends Activity {
Button button1;
EditText txtbox1,txtbox2;
TextView tv;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
txtbox1= (EditText) findViewById(R.id.txtbox1);
button1 = (Button) findViewById(R.id.button1);
tv = (TextView) findViewById(R.id.lbl1);
txtbox2= (EditText) findViewById(R.id.txtbox2);
button1.setOnClickListener(new Clicker());
}
class Clicker implements Button.OnClickListener
{
public void onClick(View v)
{
String a,b;
Integer vis;
a = txtbox1.getText().toString();
b = txtbox2.getText().toString();
vis = Integer.parseInt(a)+Integer.parseInt(b);
tv.setText(vis.toString());
}
}
}
</textarea>
<br /> And, also main.xml file, which reflect contains xml representation of display window :
<br /> main.xml :
<br /> <textarea name="code" class="java" cols="60" rows="10">
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout
android:id="@+id/widget35"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<EditText
android:id="@+id/txtbox1"
android:layout_width="145px"
android:layout_height="40px"
android:text="EditText"
android:textSize="18sp"
android:layout_x="75px"
android:layout_y="54px"
>
</EditText>
<EditText
android:id="@+id/txtbox2"
android:layout_width="144px"
android:layout_height="40px"
android:text="EditText"
android:textSize="18sp"
android:layout_x="75px"
android:layout_y="109px"
>
</EditText>
<Button
android:id="@+id/button1"
android:layout_width="106px"
android:layout_height="36px"
android:text="Button"
android:layout_x="88px"
android:layout_y="224px"
>
</Button>
<TextView
android:id="@+id/lbl1"
android:layout_width="141px"
android:layout_height="wrap_content"
android:text="TextView"
android:layout_x="76px"
android:layout_y="166px"
>
</TextView>
</AbsoluteLayout>
</textarea>
<br />
<br /> then, strings.xml :
<br /> <textarea name="code" class="java" cols="60" rows="10">
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello">Hello World, TestAppActiv!</string>
<string name="app_name">TestApp</string>
</resources>
</textarea>
<br />
<br /> AndroidManifest.xml :
<br />
<br /> <textarea name="code" class="java" cols="60" rows="10">
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="test.and"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".TestAppActiv"
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>
</textarea>
<br />
<br /> and default.properties file :
<br /> <textarea name="code" class="java" cols="60" rows="10">
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "build.properties", and override values to adapt the script to your
# project structure.
# Project target.
target=android-3
</textarea>
<br />
<br /> Just as I said, I did install everything I needed (SDK, ADT plugin, etc...), but it still wont work
<br /> I appreciate any help!
<br /> Thanks
<br /> I have followed instructions about android installation, I have changed several IDE's, but still, when I press f11 to compile, it 'does' some job int he background, activate my virtual device, but wont to behave just as it should!
<br /> Only " Android . . . " is displayed on the screen, which mean that my class isn't 'loaded', somehow.
<br /> This is sample class :
<br />
<br /> <textarea name="code" class="java" cols="60" rows="10">
package test.and;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class TestAppActiv extends Activity {
Button button1;
EditText txtbox1,txtbox2;
TextView tv;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
txtbox1= (EditText) findViewById(R.id.txtbox1);
button1 = (Button) findViewById(R.id.button1);
tv = (TextView) findViewById(R.id.lbl1);
txtbox2= (EditText) findViewById(R.id.txtbox2);
button1.setOnClickListener(new Clicker());
}
class Clicker implements Button.OnClickListener
{
public void onClick(View v)
{
String a,b;
Integer vis;
a = txtbox1.getText().toString();
b = txtbox2.getText().toString();
vis = Integer.parseInt(a)+Integer.parseInt(b);
tv.setText(vis.toString());
}
}
}
</textarea>
<br /> And, also main.xml file, which reflect contains xml representation of display window :
<br /> main.xml :
<br /> <textarea name="code" class="java" cols="60" rows="10">
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout
android:id="@+id/widget35"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<EditText
android:id="@+id/txtbox1"
android:layout_width="145px"
android:layout_height="40px"
android:text="EditText"
android:textSize="18sp"
android:layout_x="75px"
android:layout_y="54px"
>
</EditText>
<EditText
android:id="@+id/txtbox2"
android:layout_width="144px"
android:layout_height="40px"
android:text="EditText"
android:textSize="18sp"
android:layout_x="75px"
android:layout_y="109px"
>
</EditText>
<Button
android:id="@+id/button1"
android:layout_width="106px"
android:layout_height="36px"
android:text="Button"
android:layout_x="88px"
android:layout_y="224px"
>
</Button>
<TextView
android:id="@+id/lbl1"
android:layout_width="141px"
android:layout_height="wrap_content"
android:text="TextView"
android:layout_x="76px"
android:layout_y="166px"
>
</TextView>
</AbsoluteLayout>
</textarea>
<br />
<br /> then, strings.xml :
<br /> <textarea name="code" class="java" cols="60" rows="10">
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello">Hello World, TestAppActiv!</string>
<string name="app_name">TestApp</string>
</resources>
</textarea>
<br />
<br /> AndroidManifest.xml :
<br />
<br /> <textarea name="code" class="java" cols="60" rows="10">
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="test.and"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".TestAppActiv"
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>
</textarea>
<br />
<br /> and default.properties file :
<br /> <textarea name="code" class="java" cols="60" rows="10">
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "build.properties", and override values to adapt the script to your
# project structure.
# Project target.
target=android-3
</textarea>
<br />
<br /> Just as I said, I did install everything I needed (SDK, ADT plugin, etc...), but it still wont work
<br /> I appreciate any help!
<br /> Thanks