If you are an iOS developer, having experience with Android can be a valuable addition to your portfolio of skills and experience.
This post walks through how to get started developing Android apps on your Mac. It will cover installation of the required tools, development of a first simple app, and running the app on the Android emulator.
Whereas native iOS developers must develop on a Mac, with Android, you have the choice of Windows, Mac, or Linux. To get started with Android on a Mac, download Android Studio for Mac. Android Studio is the official IDE for Android app development, and is based on IntelliJ IDEA. Just open Android Studio and click on 'Open an existing Android Studio project' and point to your project. For the setttings you may go to FileExport Settings (on your Android Studio for Windows) then on Android Studio for Mac FileImport Settings.
Whereas native iOS developers must develop on a Mac, with Android, you have the choice of Windows, Mac, or Linux.
To get started with Android on a Mac, download Android Studio for Mac. Android Studio is the official IDE for Android app development, and is based on IntelliJ IDEA.
Once you download the DMG file, you should land at an installation page with instructions to install and launch, but the steps are as follows:
- Launch the Android Studio DMG file.
- Drag and drop Android Studio into the Applications folder, then launch Android Studio.
- Select whether you want to import previous Android Studio settings, and then click OK.
- The Android Studio Setup Wizard guides you though the rest of the setup, which includes downloading Android SDK components that are required for development.
The wizard summarizes the components that will be installed, as the screenshot illustrates.
Once the setup is complete, you will see the welcome screen.
You are now ready to start developing Android apps on your Mac, so let's create a first app.
Click the Start a new Android Studio project., and then you can configure the new project.
Name it FirstAndroidMac, and you can leave all other settings the same, or customize the Project location and Company domain. Click Next.
You will see the Target Android Devices screen, so leave the defaults as they are.
Click Next, and if this is your first project, you should see the Installing Request Components screen, and you can click Next when it is finished.
You'll see the Add an Activity to Mobile screen, where you are offered various Activity templates. An Activity represents something that a user can do, and generally has one window associated with it. One Activity may represent a Settings screen, and another might implement a payment screen.
An app has a main Activity, which is the entry point of an Android app. If you are an iOS developer just starting to look at Android, this is like UIViewController for an iOS app.
Select Empty Activity and click Next., which will lead to the Customize the Activity screen.
Leave the default values, including the MainActivity, and click Next. This will open the IDE.
Click on View > Tool Windows > Project, and then ensure Android is the selected view from the top drop down. You'll see the files that have been created for the project.
The MainActivity will be the first screen you will see upon launching the app. There is an activity_main.xml file which defines the user interface components for the screen. If you click on the xml file, you'll see that our empty activity has included a TextView that contains the ever so common 'Hello World!'.
Let's create an Android Virtual Device definition so that we can run the app on an emulator.
Select Tools > Android > AVD Manager. There should be one virtual device that exists by default in recent versions of the the Android Studio Virtual Device Manager. If for some reason there isn't one there, click Create Virtual Device... to create one.
Select a virtual device, and then under Actions, click the green play button to launch the emulator.
With the emulator now running, you can close the Virtual Device Manager if you like. Head back to your project in the IDE and click the green play button. You'll see the virtual device in the Select Deployment Target window.
Click OK to install and start the app on the virtual device. After the build and install has completed, bring the emulator window to the forefront and you'll see the app is now running. This will take some number of seconds.
You now have your first Android app running on a Mac!
Enter your text here...
Get started
Make sure that your devices meet the requirements for using AirPlay. To use Siri to play and control video from your iPhone, iPad, or iPod touch, add your Apple TV or AirPlay 2-compatible smart TV to the Home app and assign it to a room.
Stream video from your iPhone, iPad, or iPod touch
- Connect your device to the same Wi-Fi network as your Apple TV or AirPlay 2-compatible smart TV.
- Find the video that you want to stream.
- Tap . In some third-party apps, you might need to tap a different icon first.* In the Photos app, tap , then tap .
- Choose your Apple TV or AirPlay 2-compatible smart TV. Need help?
To stop streaming, tap in the app that you're streaming from, then tap your iPhone, iPad, or iPod touch from the list.
*Some video apps might not support AirPlay. If you can’t use AirPlay with a video app, check the App Store for tvOS to see if that app is available on Apple TV.
If video automatically streams to an AirPlay device
Your device might automatically stream video to the Apple TV or AirPlay 2-compatible smart TV that you frequently use. If you open a video app and see in the upper-left corner, then an AirPlay device is already selected.
To use AirPlay with a different device, tap, then tap another device, or tap 'iPhone' to stop streaming with AirPlay.
Stream video from your Mac
- Connect your Mac to the same Wi-Fi network as your Apple TV or AirPlay 2-compatible smart TV.
- On your Mac, open the app or website that you want to stream video from.
- In the video playback controls, click .
- Select your Apple TV or smart TV. Need help?
To stop streaming video, click in the video playback controls, then choose Turn Off AirPlay.
Mirror your iPhone, iPad, or iPod touch
Use Screen Mirroring to see the entire screen of your iPhone, iPad, or iPod touch on your Apple TV or AirPlay 2-compatible smart TV.
- Connect your iPhone, iPad, or iPod touch to the same Wi-Fi network as your Apple TV or AirPlay 2-compatible smart TV.
- Open Control Center:
- On iPhone X or later or iPad with iPadOS 13 or later: Swipe down from the upper-right corner of the screen.
- On iPhone 8 or earlier or iOS 11 or earlier: Swipe up from the bottom edge of the screen.
- Tap Screen Mirroring.
- Select your Apple TV or AirPlay 2-compatible smart TV from the list. Need help?
- If an AirPlay passcode appears on your TV screen, enter the passcode on your iOS or iPadOS device.
Your TV uses your iOS or iPadOS device's screen orientation and aspect ratio. To fill your TV screen with the mirrored device screen, change your TV's aspect ratio or zoom settings.
To stop mirroring your iOS or iPadOS device, open Control Center, tap Screen Mirroring, then tap Stop Mirroring. Or press the Menu button on your Apple TV Remote.
Project My Android Screen
Mirror or extend your Mac display
With Apple TV or an AirPlay 2-compatible smart TV, you can mirror the entire display of your Mac to your TV or use your TV as a separate display.
- Connect your Mac to the same Wi-Fi network as your Apple TV or AirPlay 2-compatible smart TV.
- On your Mac, click in the menu bar at the top of your screen. If you don't see , go to Apple menu > System Preferences > Displays, then select 'Show mirroring options in the menu bar when available.'
- Choose your Apple TV or AirPlay 2-compatible smart TV. Need help?
- If an AirPlay passcode appears on your TV screen, enter the passcode on your Mac.
Change settings or stop mirroring
To change the size of your desktop mirrored on your TV, click in the menu bar. Then select Mirror Built-in Display to match the size of your desktop or Mirror Apple TV to match the size of your TV.
AirPlay also lets you use your TV as a separate display for your Mac. Just click in the menu bar, then select Use As Separate Display.
Android Home Screens
To stop mirroring or using your TV as a separate display, click in the menu bar, then choose Turn AirPlay Off. Or press the Menu button on your Apple TV Remote.
Learn more about mirroring or extending the display of your Mac.
Do more with AirPlay
Project Android Screen To Macbook
- Use Siri on your iPhone, iPad, or iPod touch to play movies and TV shows, and control playback on your Apple TV or AirPlay 2-compatible smart TV.
- Use AirPlay to stream music, podcasts, and more to your Apple TV, HomePod, or other AirPlay-compatible speakers.
- Add your AirPlay 2-compatible speakers and smart TVs to the Home app.
- Learn what to do if you can't stream content or mirror your device's screen with AirPlay.