Hello bloggers , after 2hrs of Java Tutorial from my brother ( @ http://gadikotamohan.blogspot.com/ ) i have created my first Android App
here it goes , Its very easy to understand and to program guess that's why its so popular
There are lot of things to do before you can start writing Android App
Download eclipse IDE , android SDK , integrated android emulator and various setting
i am not going through all these things google about'em and find it yourself
Here are the problem's which i encountered
1) The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the arguments (new OnClickListener(){})
in your code include
import android.view.View.OnClickListener;
else DialogInterface.OnClickListener would be assumed as the method
and remove import statement for DialogInterfaces
2) andorid" for attribute "andorid:name" associated with an element type "activity" is not bound.
while typing in a new activity name in AndriodManifest.xml , this error's might bug you
dont worry , it a TYPO :)
andorid" for attribute "andorid:name" associated with an element type "activity" is not bound.
It should be android , that's all about the errors
now the Android App
screenshot of android emulator ( what's more emulator can access internet , aint a dumb simulator )
Home screen showing the App which i have created
launch button which invokes another activity
second activity called successfully , i have added few text boxes to check the layout xml file
its is easier that VB.NET !! take my word for it
That's it nothing HIGH FI about the App , happy coding
FYI one of my friend has asked to develop a App which can record call's , after googling found that the developer's haven't considered this as it may cause legal issues in some countries
codes :
package nataraja.helloworld;
import android.app.Activity;
import android.view.View.OnClickListener;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class HelloworldActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button btnSimple = (Button) findViewById(R.id.btnSimple);
btnSimple.setOnClickListener (new OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent (v.getContext(), activity2.class );
startActivityForResult(intent,0);
}
}) ;
}
}
activity2 class :
package nataraja.helloworld;
import android.app.Activity;
import android.os.Bundle;
public class activity2 extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate( Bundle savedInstanceState ) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity2);
}
}
second activity called successfully , i have added few text boxes to check the layout xml file
its is easier that VB.NET !! take my word for it
That's it nothing HIGH FI about the App , happy coding
FYI one of my friend has asked to develop a App which can record call's , after googling found that the developer's haven't considered this as it may cause legal issues in some countries
codes :
package nataraja.helloworld;
import android.app.Activity;
import android.view.View.OnClickListener;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class HelloworldActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button btnSimple = (Button) findViewById(R.id.btnSimple);
btnSimple.setOnClickListener (new OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent (v.getContext(), activity2.class );
startActivityForResult(intent,0);
}
}) ;
}
}
activity2 class :
package nataraja.helloworld;
import android.app.Activity;
import android.os.Bundle;
public class activity2 extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate( Bundle savedInstanceState ) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity2);
}
}
I have read this blog that provide the nice information for developing android project.I found some mistakes in your first Android app which is very more important for you so thanks for sharing this information.
ReplyDeleteAndroid App Development