Android Service Example
August 10, 2011
The steps to create a self-contained service associated with a single component are
1. Create a class to extend Service. (In Eclipse, this can be done by right-clicking
the project, choosing New → Class and specifying android.app.Service as the
super class.)
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class SimpleActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button startButton = (Button) findViewById(R.id.Button01);
startButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View view){
startService(new Intent(SimpleActivity.this,
SimpleService.class));
}
});
Button stopButton = (Button)findViewById(R.id.Button02);
stopButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v){
stopService(new Intent(SimpleActivity.this,
SimpleService.class));
}
});
}
}
What is a server
August 10, 2011
a server is a physical computer dedicated to running one or more such services, to serve the needs of programs running on other computers on the same network.
a server is a software/hardware system (i.e. a software service running on a dedicated computer) such as a database server, file server, mail server, or print server.
![]()
Read the rest of this entry »
What is twitter
August 10, 2011
Twitter is a Social networking and microblogging service utilising instant messaging, SMS or a web interface.
Twitter is also an online social networking and microblogging service that enables its users to send and read text-based posts of up to 140 characters, informally known as “tweets.”
Read the rest of this entry »







