Intro to Android Development
  • Welcome
  • Syllabus
  • Hack Challenge
  • Resources
    • Lecture Videos
    • Ed Discussion
    • Git & GitHub Help/How-To
    • Setting up Android Studio
    • Starting an Android Studio Project & Making an Emulator
    • Importing, Exporting, & Submitting Your Projects to CMS
  • SP25 Course Material
    • Week 1 | Course Logistics, Kotlin, & Basic UI
      • Relevant Links
      • Demo/Lecture: Eatery Card
      • A0: Eatery Card (Follow-Along)
    • Week 2 | States, Components, LazyColumn
      • Relevant Links
      • Demo: Todo List
      • A2: Shopping List
    • Week 3 | Navigation & Animations
      • Relevant Links
      • Demo: Onboarding
      • A3: Stock Trading (RobbingGood)
    • Week 4 | MVVM and Flows
      • Relevant Links
      • Demo: Eatery Card 2
      • A4: Chat of a Lifetime
    • Week 5 | Dumb Components & UIEvents
      • Relevant Links
      • Demo: Music Player
      • A5: Rate My Vibe
    • Week 6 | Coroutines, Networking, JSON
      • Relevant Links
      • Demo: Retrofit
      • A6: You Should Even Lift, Bro.
  • Bonus Week | Android Job Search
    • Relevant Links
    • Android Technical Interview Question!
  • Textbook
    • 1. Introduction to the Editor and Views
      • 1.1 Introduction to the Editor
      • 1.2 SDK Management
      • 1.3 Kotlin Overview
      • 1.4 Views
      • 1.5 Android Studio Project Demo + Understanding The Editor
    • 2. Jetpack Compose
      • 2.1 Introduction
      • 2.2 Layouts
      • 2.3 Modifiers
      • 2.4 Animations
      • 2.5 Lazy Lists
      • 2.6 Reactive UI
    • 3. Intents and Manifest
      • 3.1 Activities
      • 3.2 Implicit Intents
      • 3.3 Explicit Intents
      • 3.4 Manifest
      • 3.5 Permissions
      • 3.6 Summary
    • 4. Navigation
      • 4.1 Types of Navigation
      • 4.2 Implementation of the Bottom Navigation Bar
    • 5. Data and Persistent Storage
      • 5.1 Singleton Classes
      • 5.2 Shared Preferences
      • 5.3 Rooms
      • 5.4 Entities
      • 5.5 Data Access Objects
      • 5.6 Databases
    • 5.5 Concurrency
      • 5.5.1 Coroutines
      • 5.5.2 Implementation of Coroutines
      • 5.5.3 Coroutines with Networking Calls
    • 6. Networking and 3rd Party libraries
      • 6.1 HTTP Overview
      • 6.2 3rd Party Libraries
      • 6.3 JSON and Moshi
      • 6.4 Retrofit
      • 6.5 Summary
    • 7. MVVM Design Pattern
      • 7.1 Key Idea
      • 7.2 Implementation Ideas
    • 8. Flows
    • 9. The Art and Ontology of Software
    • 10. 🔥 Firebase
      • 10.1 Setting up Firebase
      • 10.2 Authentication
      • 10.3 Analytics
      • 10.4 Messaging
      • 10.5 Firestore
  • Additional Topics
    • Git and GitHub
    • Exporting to APK
  • Archive
    • Archived Native Android Textbook Pages
      • 1. Layouts and More Views
        • 1.1 File Structure and File Types
        • 1.2 Resource Files
        • 1.3 Button and Input Control
        • 1.4 ViewGroups
        • 1.5 Summary + A Note On Chapter 2 Topics
      • 2. RecyclerViews
        • 2.1 RecyclerViews
        • 2.2 RecyclerView Performance
        • 2.3 Implementation of a Recycler View
        • 2.4 Implementation with Input Controls
        • 2.5 Filtering RecyclerViews
        • 2.6 Recyclerview Demo
      • 3. ListViews and Searching
        • 3.1 ListView vs. RecyclerView
        • 3.2 ListView Performance
        • 3.3 Implementation of a ListView
        • 3.4 Searching in a List View
      • 4. Fragments
        • 4.1 What are Fragments?
        • 4.2 Lifecycle of a Fragment
        • 4.3 Integrating a Fragment into an Activity
        • 4.4 Sharing Data Between Fragments
        • 4.5 Fragment Slide Shows
      • 5. OkHttp
      • 6. Activity Lifecycle
      • 7. Implementation of Tab Layout
    • Fall 2024 Course Material
      • Lecture 1 & Exercise 1: Introduction to Android
      • Lecture 1.5: Beauty of Kotlin
      • Lecture 2 & HW 2: Modifiers, Lazylists and Reactive UI
      • Lecture 3 & HW 3: Animations, Intents and Manifest
      • Lecture 4 & HW 4: Coroutines & Navigation
      • Lecture 5 & HW 5: Persistent Storage, Networking, and JSON Parsing
      • Lecture 6 & HW 6: MVVM, Flows
      • Bonus Lectures & Bonus HW
      • Bonus Lecture: Industry Practice
    • Spring 2024 Course Material
      • Lecture 1 & Exercise 1: Introduction to Android
      • Lecture 4 & HW 4: LazyLists
      • Lecture 6 & HW 6: Networking, Data, and Persistent Storage
    • Spring 2020 Course Material
      • Week 1: Intro to the Editor
      • Week 2: Views and Layouts
      • Week 3: Intent and Manifest
      • Week 4: ListView and RecyclerView
      • Week 5: Fragments
      • Week 6: Networking
    • Spring 2021 Lecture & HW 8: Networking & 3rd Party APIs
    • HackOurCampus Workshop
Powered by GitBook
On this page
  • Starting an Android Studio Project
  • Editor Layout
  • Toolbar
  • Project Pane
  • Editor
  • Bottom Menu Bar
  • Android Emulator
  • Logcat

Was this helpful?

  1. Textbook
  2. 1. Introduction to the Editor and Views

1.1 Introduction to the Editor

Previous1. Introduction to the Editor and ViewsNext1.2 SDK Management

Last updated 4 years ago

Was this helpful?

Starting an Android Studio Project

After you have successfully installed the Android Studio IDE, double-click the Android Studio application icon to start it. Click Start a new Android Studio project → then select “Empty Activity”. Name the project the same name that you want to use for the app.

Create a new project window

Note: The company domain field must be unique if you wish to publish to Google Play, as that's the identifying name that differentiates your app from anyone else’s.

Editor Layout

The standard layout of the Android Studio editor has several logical panes that in all have all the functions you'll need to develop for Android.

The main five components of the editor that we'll touch upon includes toolbar, project pane, editor, menu bar, and bottom menu bar.

Toolbar

This is the bar near the top containing shortcuts to different actions within Android Studio. The most important is the green triangle allowing you to run your program. If you press it, you should see a simulator pop up and run the code.

Project Pane

Just as in most IDEs, our project files are available in the left third of the screen. You can navigate to different files in your project by using the project pane. One neat trick is to go to the toolbar at the top of the project pane and toggle from Project to Android; this way, you can navigate directly to the java and XML files.

Editor

This is the component of the screen where the code is written. If you just created a new activity, you should see something like this:

class MainActivity : AppCompatActivity() {
  override fun onCreate(savedInstanceState: Bundle?) {
    ...
  }
}

The code above might be a bit difficult to understand. For now, think of onCreate() method of MainActivity as the first method that is executed when running our application, similar to how public static void main(String[] args) is first executed in Java.

Bottom Menu Bar

The bottom menu bar returns output from the compiler and displays useful information about gradle and compile time errors. The bar also houses the debugger, which is a great tool to use for understanding errors.

Android Emulator

Emulators are valuable tools for testing, but beware of the drawbacks. They will most likely be slower than their physical counterparts and will most definitely slow down your machine while you're running them. They often don't have as many capabilities as the real phone and certain functionality (like getting user location) is often absent. For applications that require user data, such as location or storage, it is recommended to test directly on a physical device.

Logcat

Android Studio doesn’t have a traditional version of the console that IDEs like Eclipse and PyCharm do. Instead, Android Studio uses what is referred to as Logcat. To open Logcat, navigate to View > Tool Windows > Logcat.

Our end users will never be interacting with Logcat, so this feature is only used by the developer for debugging purposes. Therefore, unlike Java’s standard System.out methods for printing to the console, Android Studio has it’s own conventions:

  • Log.d(tag, message) for logging debugging statements

  • Log.i(tag, message) for printing useful information to developers

  • Log.w(tag, message) for outputting a warning (generally for operations that should never occur)

  • Log.e(tag, message) for outputting an error message

Here's an example of how you might using the Logcat for debugging. In this example, we're printing out the string name to the console:

var name = "Android"
Log.d("tag_string", name)

Now, let’s look at the Logcat. If we re-run our project, we’ll see a huge stream of data that is completely independent of what we’ve told our program to print. You can filter out the stream by typing "tag_string" into the search bar and you should see the line:

<DATE> <TIME> <PID>-<TID>/com.example.myapplication I/tag_string:Android

Android emulators are what developers use to test their application. A selection of available emulators shows up in the Toolbar, directly to the left of the green play button. Your Android devices will also show up here, which can also be used to test your application. To create a new Android Emulator, you must use Tools > AVD Manager to create and edit Android Virtual Devices.

connected
Breakdown of Android Studio editor