Architecture of Mobile Applications
1. Definition and Importance
1.10. Example Code
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
Navigation: Users navigate between Activities using Intents. An Intent is a message that you send to the system, specifying which Activity you want to start.
Example: In a social media app, the "Home" screen, the "Profile" screen, and the "Post" screen would each be separate Activities
Use Cases
- Displaying the main UI of an app.
- Handling user interactions, such as button clicks.
- Navigating between different screens.