Author

Anit Kumar

26

Lesson 10: Stopping and Restarting an Activity

Properly stopping and restarting your activity is an important process in the activity lifecycle that ensures your users perceive that your app is always alive and doesn't lose their progress. There are a few of key scenarios in which your activity is stopped and restarted: The user opens the Recent ...

Lesson 9: Pausing and Resuming an Activity

During normal app use, the app sometimes loses focus, causing the activity to pause. For example, when apps run in multi-window mode, only one of the apps has the focus at any time; the system pauses all other apps. Similarly, when a semi-transparent activity opens (such as one in the ...

Lesson 8: Starting an Activity

Unlike other programming paradigms in which apps are launched with a main() method, the Android system initiates code in an Activity instance by invoking specific callback methods that correspond to specific stages of its lifecycle. There is a sequence of callback methods that start up an activity and a sequence ...

Lesson 7: Supporting Different Platform Versions

While the latest versions of Android often provide great APIs for your app, you should continue to support older versions of Android until more devices get updated. This lesson shows you how to take advantage of the latest APIs while continuing to support older versions as well. The dashboard for ...

Lesson 6: Supporting Different Screens

Android categorizes device screens using two general properties: size and density. You should expect that your app will be installed on devices with screens that range in both size and density. As such, you should include some alternative resources that optimize your app’s appearance for different screen sizes and ...

Lesson 5: Supporting Different Languages

It’s always a good practice to extract UI strings from your app code and keep them in an external file. Android makes this easy with a resources directory in each Android project. If you created your project using the Android SDK Tools (read Creating an Android Project), the tools ...

Lesson 4: Starting Another Activity

After completing the previous lesson, you have an app that shows an activity (a single screen) with a text field and a button. In this lesson, you’ll add some code to MainActivity that starts a new activity when the user clicks the Send button. Respond to the Send Button ...

Lesson 3: Building a Simple User Interface

In this lesson, you create a layout in XML that includes a text field and a button. In the next lesson, your app responds when the button is pressed by sending the content of the text field to another activity. The graphical user interface for an Android app is built ...

Lesson 2:Running your App

In the previous lesson, you created an Android project that displays "Hello World." You can now run the app on a real device or on an emulator. If you don't have a real device available, skip to Run on an Emulator. Run on a Real Device Set up your device ...

Lesson 1: Create an Android Project

This lesson shows you how to create a new Android project with Android Studio and describes some of the files in the project. In Android Studio, create a new project: If you don't have a project opened, in the Welcome to Android Studio window, click Start a new Android Studio ...