Mobile Development
Mobile development involves creating mobile applications that can be installed and run on mobile devices, using technologies such as Java for Android development and Swift for iOS development. Understanding mobile development is essential for developing software that can be accessed through mobile devices. Here's an example of a simple Android application in Java that displays a message when a button is pressed:
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button button = findViewById(R.id.button);
final TextView textView = findViewById(R.id.textview);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
textView.setText("Button pressed!");
}
});
}
}
No comments:
Post a Comment