Posts

Open the Layout Editor

Image
Open the Layout Editor Note:  This lesson expects you are using Android Studio 2.3 or higher and you've followed the previous lesson to create your Android project. To get started, set up your workspace as follows: In Android Studio's Project window, open  app > res > layout > activity_main.xml . To make more room for the Layout Editor, hide the  Project  window by selecting  View > Tool Windows > Project   If your editor shows the XML source, click the  Design  tab at the bottom of the window. Click  Show Blueprint   so only the blueprint layout is visible. Make sure Show Constraints is on. The tooltip in the toolbar should read  Hide Constraints   (because they're now showing). Make sure Autoconnect is off. The tooltip in the toolbar should read  Turn On Autoconnect   (because it's now off). Click  Default Margins   in the toolbar and select  16 ...

Build a Simple User Interface

Image
Build a Simple User Interface In this lesson, you'll use the Android Studio Layout Editor to create a layout that includes a text box and a button. In the next lesson, you'll make the app respond to the button tap by sending the content of the text box to another activity. Figure 1.  Screenshot of the final layout The user interface for an Android app is built using a hierarchy of  layouts  ( ViewGroup  objects) and  widgets  ( View  objects). Layouts are invisible containers that control how its child views are positioned on the screen. Widgets are UI components such as buttons and text boxes. Figure 2.  Illustration of how  ViewGroup  objects form branches in the layout and contain  View  objects Android provides an XML vocabulary for  ViewGroup  and  View  classes, so most of your UI is defined in XML files. However, instead of teaching you to write some XML, this lesson shows you how to ...

Run Application

Run Your App In the privous lession, you created an Android project that displays "Hello World." You can now run the app on a real device or an emulator. Run on a real device Set up your device as follows: Connect your device to your development machine with a USB cable. If you're developing on Windows, you might need to install the appropriate USB driver for your device. For help installing drivers, see the OEM USB Drivers document. Enable  USB debugging  on your device by going to  Settings > Developer options . Note:  On Android 4.2 and newer,  Developer options  is hidden by default. To make it available, go to  Settings > About phone  and tap  Build number  seven times. Return to the previous screen to find  Developer options . Run the app from Android Studio as follows: In Android Studio, click the  app  module in the  Project  window and then select  Run > R...

Create an Android Project

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 project . If you have a project opened, select  File > New Project . In the  New Project  screen, enter the following values: Application Name : "My First App" Company Domain : "example.com" You might want to change the project location, but leave the other options as they are. Click  Next . In the  Target Android Devices  screen, keep the default values and click  Next . In the  Add an Activity to Mobile  screen, select  Empty Activity  and click  Next . In the  Customize the Activity  screen, keep the default values and click  Finish . After some processi...

Introduction

Image
                    Building Your First App Welcome to Android application development! This class teaches you how to build your first Android app. You’ll learn how to create an Android project with Android Studio and run a debuggable version of the app. You'll also learn some fundamentals of Android app design, including how to build a simple user interface and handle user input. Before you start this class, download and install Android Studio.