Android Studio is the software built by Google themselves to be used for Android Development. As such, it's certain that support for it will never drop as long as Android apps are still being developed. Studio is also the tool that Google recommends using for Android development and it's the IDE that gets updates related to Android first.
How fast does your MacBook need to be to comfortably code iOS apps with Xcode? Is a MacBook Pro from 2-3 years ago good enough to learn Swift programming? Let’s find out!
- Use.NET and C# to create native apps for the billions of Android, iPhone, iPad, Mac, and Windows devices around the world. Add to that sharing code with any.NET app, empowering you to be more productive and build apps faster than ever across all platforms.
- I can manage my files on Android straight in my Finder and edit photographs on Mac without actually saving them on Mac. Lizzie Plummer 5 Needed to save my whole Android photo gallery on Mac, and the best solution I found was MacDroid.
- This is how you can install the Android Studio and can set up the Android Development Environment in your Mac OS. Next, You will need an Android device to run your React Native Android app. This can be either a physical Android device or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your.
- We used to think the best value Mac for developers was the 13in MacBook Pro that costs £1,249/$1,299, although we’d recommend adding 16GB RAM at point of sale for £1,399/$1,399 if you can.
Here’s what we’ll get into:
- The minimum/recommended system requirements for Xcode 11
- Why you need – or don’t need – a fancy $3.000 MacBook Pro
- Which second-hand Macs can run Xcode OK, and how you can find out
I’ve answered a lot of “Is my MacBook good enough for iOS development and/or Xcode?”-type questions on Quora. A few of the most popular models include:
- The 3rd- and 4th-gen MacBook Pro, with 2.4+ GHz Intel Core i5, i7, i9 CPUs
- The 2nd-gen MacBook Air, with the 1.4+ GHz Intel Core i5 CPUs
- The 4th-generation iMac, with the 2.7+ GHz Intel Core i5 and i7 CPUs
These models aren’t the latest, that’s for sure. Are they good enough to code iOS apps? And what about learning how to code? We’ll find out in this article.
My Almost-Unbreakable 2013 MacBook Air
Since 2009 I’ve coded more than 50 apps for iOS, Android and the mobile web. Most of those apps, including all apps I’ve created between 2013 and 2018, were built on a 13″ MacBook Air with 8 GB of RAM and a 1.3 GHz Intel i5 CPU.
My first MacBook was the gorgeous, then-new MacBook White unibody (2009), which I traded in for a faster but heavier MacBook Pro (2011), which I traded in for that nimble workhorse, the mighty MacBook Air (2013). In 2018 I upgraded to a tricked out 13″ MacBook Pro, with much better specs.
Frankly, that MacBook Air from 2013 felt more sturdy and capable than my current MacBook Pro. After 5 years of daily intenstive use, the MacBook Air’s battery is only through 50% of its max. cycle count. It’s still going strong after 7 hours on battery power.
In 2014, my trusty MacBook Air broke down on a beach in Thailand, 3 hours before a client deadline, with the next Apple Store 500 kilometer away. It turned out OK, of course. Guess what? My current MacBook Pro from 2018, its keyboard doesn’t even work OK, I’ve had sound recording glitches, and occasionally the T2 causes a kernel panic. Like many of us, I wish we had 2013-2015 MacBook Air’s and Pro’s with today’s specs. Oh, well…
Learn how to build iOS apps
Get started with iOS 14 and Swift 5
Sign up for my iOS development course, and learn how to build great iOS 14 apps with Swift 5 and Xcode 12.
That 100 Mhz i486 PC I Learned to Code With
When I was about 11 years old I taught myself to code in BASIC, on a 100 Mhz i486 PC that was given to me by friends. It had a luxurious 16 MB of RAM, initially only ran MS-DOS, and later ran Windows 3.1 and ’95.
A next upgrade came as a 400 Mhz AMD desktop, given again by friends, on which I ran a local EasyPHP webserver that I used to learn web development with PHP, MySQL and HTML/CSS. I coded a mod for Wolfenstein 3D on that machine, too.
We had no broadband internet at home back then, so I would download and print out coding tutorials at school. At the one library computer that had internet access, and I completed the tutorials at home. The source codes of turn-based web games, JavaScript tidbits and HTML page snippets were carried around on a 3.5″ floppy disk.
Later, when I started coding professionally around age 17, I finally bought my first laptop. My own! I still remember how happy I was. I got my first gig as a freelance coder: creating a PHP script that would aggregate RSS feeds, for which I earned about a hundred bucks. Those were the days!
Xcode, iOS, Swift and The MacBook Pro
The world is different today. Xcode simply doesn’t run on an i486 PC, and you can’t save your app’s source code on a 1.44 MB floppy disk anymore. Your Mac probably doesn’t have a CD drive, and you store your Swift code in a cloud-based Git repository somewhere.
Make no mistake: owning a MacBook is a luxury. Not because learning to code was harder 15 years ago, and not because computers were slower back then. It’s because kids these days learn Python programming on a $25 Raspberry Pi.
I recently had a conversation with a young aspiring coder, who complained he had no access to “decent” coding tutorials and mentoring, despite owning a MacBook Pro and having access to the internet. Among other things, I wrote the following:
You’re competing with a world of people that are smarter than you, and have better resources. You’re also competing against coders that have had it worse than you. They didn’t win despite adversity, but because of it. Do you give up? NO! You work harder. It’s the only thing you can do: work harder than the next person. When their conviction is wavering, you dig in your heels, you keep going, you persevere, and you’ll win.
Winning in this sense isn’t like winning a race, of course. You’re not competing with anyone else; you’re only really up against yourself. If you want to learn how to code, don’t dawdle over choosing a $3.000 or a $2.900 laptop. If anything, it’ll keep you from developing the grit you need to learn coding.
Great ideas can change the world, but only if they’re accompanied by deliberate action. Likewise, simply complaining about adversity isn’t going to create opportunities for growth – unless you take action. I leapfrogged my way from one hand-me-down computer to the next. I’m not saying you should too, but I do want to underscore how it helped me develop character.
If you want to learn how to code, welcome adversity. Be excellent because of it, or despite it, and never give up. Start coding today! Don’t wait until you’ve got all your ducks in a row.
Which MacBook is Fast Enough for Xcode 11?
The recommended system specs to run Xcode 11 are:
- A Mac with macOS Catalina (10.15.2) for Xcode 11.5 or macOS Mojave (10.14.4) for Xcode 11.0 (see alternatives for PC here)
- At least an Intel i5- or i7-equivalent CPU, so about 2.0 GHz should be enough
- At least 8 GB of RAM, but 16 GB lets you run more apps at the same time
- At least 256 GB disk storage, although 512 GB is more comfortable
- You’ll need about 8 GB of disk space, but Xcode’s intermediate files can take up to 10-30 GB of extra disk space
Looking for a second-hand Mac? The following models should be fast enough for Xcode, but YMMV!
- 4th-generation MacBook Pro (2016)
- 3rd-generation Mac Mini (2014)
- 2nd-generation MacBook Air (2017)
- 5th-generation iMac (2015)
When you’re looking for a Mac or MacBook to purchase, make sure it runs the latest version of macOS. Xcode versions you can run are tied to macOS versions your hardware runs, and iOS versions you can build for are tied to Xcode versions. See how that works? This is especially true for SwiftUI, which is iOS 13.0 and up only. Make sure you can run the latest!
Pro tip: You can often find the latest macOS version a device model supports on their Wikipedia page (see above links, scroll down to Supported macOS releases). You can then cross-reference that with Xcode’s minimum OS requirements (see here, scroll to min macOS to run), and see which iOS versions you’ll be able to run.
Further Reading
Awesome! We’ve discussed what you need to run Xcode on your Mac. You might not need as much as you think you do. Likewise, it’s smart to invest in a future-proof development machine.
Whatever you do, don’t ever think you need an expensive computer to learn how to code. Maybe the one thing you really want to invest in is frustration tolerance. You can make do, without the luxury of a MacBook Pro. A hand-me-down i486 is enough. Or… is it?
Want to learn more? Check out these resources:
Learn how to build iOS apps
Get started with iOS 14 and Swift 5
Sign up for my iOS development course, and learn how to build great iOS 14 apps with Swift 5 and Xcode 12.
In this tutorial, we will create a simple yet fully-functional Android application that counts how many times you tap a droid image. After that, we will run it on an Android virtual device.
This tutorial covers a simple scenario to help you get started with Android development in IntelliJ IDEA. For comprehensive how-to guides and reference documentation, visit the Android Studio user guide.
Create a new Android project
Create a project
Launch IntelliJ IDEA. On the Welcome screen, click Create New Project. If you already have a project open, from the main menu select File | New | Project.
In the New Project wizard, select Android on the left.
If you don't have the Android SDK configured, IntelliJ IDEA will detect this and prompt you to download it:
Select the components you want to install. If you haven't installed the Android SDK tools before, all the required components will be preselected.
Optionally, modify the location for the Android SDK, and click Next:
Review the installation settings and click Finish to start the download:
When all components have been downloaded and installed, click Finish:
Select Empty Activity as the project template:
On the last step, type
HelloDroid
as the project name and select Java as the language:
Configure project JDK
Now that we have created our first project, let's make sure it uses the correct JDK.
From the main menu, choose File | Project Structure and go to Platform Settings | SDKs. Select the Android SDK and make sure that the correct Java version is selected in the Java SDK field.
We recommend that you use Java SE 11 or Java SE 8 for Android development in IntelliJ IDEA. If you don't have the correct JDK installed, in the Project Structure dialog, click the Add New SDK button on the toolbar and select Download JDK:
In the Settings/Preferences dialog Ctrl+Alt+S, go to Build, Execution, Deployment | Build Tools | Gradle and select the correct Java version (8.x or 11.x).
Explore the project structure
For Android projects, there's a dedicated view in the IntelliJ IDEA Project tool window: click Project in the top-left corner and select Android.
This view doesn't reflect the actual hierarchy of files on your disk - it is organized by modules and file types to ease navigation between source files of your project. Note that it hides project files and directories that you don't commonly use (to see them, choose the Project view):
The app folder consists of the following subfolders:
manifests: contains the AndroidManifest.xml file, which holds general information about the application processed by the Android operating system. Among other things, it declares the package name that serves as a unique identifier for your application and the minimum version of the Android SDK required for the device where the application will run. It also declares the entry points of the application, along with permissions the application requires. For details, see App Manifest Overview.
java: contains the Java source code files grouped by packages, including JUnit tests.
res: contains all non-code resources, such as XML layout files, UI strings, images, and so on.
The Gradle Scripts folder contains all the project's build-related configuration files.
Edit the UI layout
At this stage, the user interface of our sample HelloDroid
application is based on a very simple layout defined in the activity_main.xml
file located in the res/layout
folder.
Let us modify the auto-generated user interface and see how the application layout is rendered without running it on any physical or virtual device.
Open the UI designer
In the Android project view, go to the
app/res/layout
and double-click theactivity_main.xml
file to open it. Note that since IntelliJ IDEA downloads the components required to render layout files, opening it may take a few seconds.If the UI designer fails to open, and you get the Design editor is unavailable until after a successful project sync error, press Ctrl+Shift+A, search for the
Sync Project with Gradle Files
action, and wait for the sync to finish.By default, IntelliJ IDEA provides a graphical view of the layout file, but you can also switch to the source code view, or view the text and the graphical representation side by side - use the icons in the top-right corner of the UI Designer pane:
This pane shows a rectangular canvas that is synchronized with the layout definition and with the Component Tree, so any changes to the canvas are reflected there accordingly.
Normally, layout files have a layout manager as their root element (for example,
LinearLayout
,FrameLayout
,ConstraintLayout
, and so on). In our example, the root element in activity_main.xml isConstraintLayout
that is responsible for positioning the elements of the application interface. For the purpose of this tutorial, we are not going to modify it, but you can learn more about designing interfaces from Build a Responsive UI with ConstraintLayout.To eliminate distraction and only see how your layout is represented, click the Select Design Surface icon in the top-left corner and choose Design:
Now let's delete the existing text element. To do this, right-click the text label and choose Delete from the context menu.
Now the UI layout looks like the following, and we are ready to start designing the layout of our application:
Add image to the UI layout
Now let's add a droid image to our layout.
In the Android project view, expand the
app/res
folder and drag the image you want to use into thedrawable
folder. For this tutorial, we've downloaded a Hello Droid image from the internet and saved it with the dimensions 50x50 px.Return to the
activity_main.xml
file opened in the Designer pane, from the Palette choose the ImageView element, and drag it to the canvas to the position where you want the image to appear.In the Pick a Resource dialog that opens, choose the resource file you've added and click OK:
Next, we need to modify the default id of the
imageView
element to be able to reference it later.Select it in the Component Tree and in the Attributes pane on the right, enter the new identifier in the id field:
droidImage
. Press Enter; in the dialog that opens, confirm that you want to update all references to the image element id:
Add text to the UI layout
Now let's add some text to our layout.
In the Palette pane, pick the TextView element and drag it to the canvas below the image.
The widget displays some default text:
TextView
. To change it and link it to a string, we need to create a new text resource.Select the textView element in the Component Tree on the left. In the Attributes pane on the right, click the Pick a Resource icon next to the text attribute:
In the dialog that opens, click the Add resource to the module icon in the top left corner and choose String Value.
In the New String Value dialog, enter the resource name (
welcome_text
) and the resource value (Hello! I'm a droid.
):Click OK to save the value and then click OK in the Pick a Resource dialog.
Now let's modify the
textView
element id the same way we did withimageView
.Select
textView
in the Component Tree on the left, and in the Attributes pane set the id to a new value:clickCounter
.
Add style to text
Now let's add some style to the text to make it look more appealing.
Pad the text a bit: locate the padding attribute, and set all values to
10dp
:Change the font color: locate the textColor attribute, and click the Pick a Resource icon next to it.
In the dialog that opens, click the Add resource to the module icon in the top left corner and choose Color Value.
Enter the resource name (
text_color
) and the value (#9C27B0
):Change the font size: locate the TextSize property and and click the Pick a Resource icon next to it.
In the dialog that opens, click the Add resource to the module icon in the top left corner and choose Dimension Value.
Enter the resource name (
text_size
) and the value (24sp
):
As a result, your user interface now looks like the following:
To check what your application UI looks like in landscape orientation, click the Orientation for Preview icon on the Designer toolbar and choose Landscape:
To preview what your layout looks like on different devices, select another device from the device list:
Make the application interactive
Although our sample application is fully functional at this point, it does not support any form of interaction yet. Let's modify it to support tap events.
Android Mac Address
In the Android project view, locate the MainActivity file under appjavacom.example.hellodroid and double-click to open it.
MainActivity is not a very meaningful class name, so let's rename it.
Right-click this file in the Android project view and choose Refactor | Rename from the context menu or press Shift+F6. In the dialog that opens, change the class name
HelloDroidActivity
and click Refactor:All references to this class will be updated automatically, and your application's source code will look as follows:
Replace the code in HelloDroid.java with the following:
package com.example.hellodroid; import android.os.Bundle; import android.view.View; import android.widget.ImageView; import android.widget.TextView; import androidx.appcompat.app.AppCompatActivity; public class HelloDroidActivity extends AppCompatActivity { private TextView message; private int counter = 0; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); message = findViewById(R.id.clickCounter); ImageView droid = findViewById(R.id.droidImage); //Define and attach click listener droid.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { tapDroid(); } }); } private void tapDroid() { counter++; String countAsText; /* * In real applications you should not write switch like the one below. * Use resource of type 'Quantity strings (plurals)' instead. * See https://developer.android.com/guide/topics/resources/string-resource#Plurals */ switch (counter) { case 1: countAsText = 'once'; break; case 2: countAsText = 'twice'; break; default: countAsText = String.format('%d times', counter); } message.setText(String.format('You touched the droid %s', countAsText)); } }Note that the identifiers we've used in the source code correspond to those we've set in our layout definition file, otherwise our code would not work.
Build and run the application
Android Development For Mobile
Now let's build our application and run it on a virtual device.
Configure Android virtual device
Android Development Mac Vs Windows
First of all, to be able to run our application, we need to configure a virtual device.
In the main IntelliJ IDEA toolbar, click the devices list and choose AVD Manager:
On the first step of the wizard, click Create Virtual Device:
On the next step, we need to select the hardware that our virtual device will emulate.
Let's select Phone on the left, and choose Pixel 2 as the target device:
Choose the system image you want to mimic on the virtual device, that is the OS version, the Android API level, the application binary interface (ABI), and the target SDK version:
Click the Download link next to the system image you want to mimic on the virtual device. For this tutorial, we've chosen to download the R system image.
In the License Agreement dialog that opens, read the license agreement and accept it, then click Next and wait for the download to finish. When the system image has been downloaded, select it and click Next in the System Image step of the wizard.
On the last step, you can modify your virtual device name and select the startup size and orientation of the screen. Choose the portrait layout and click Finish:
The newly configured device appears in the Android Virtual Device Manager.
Run the application
On the main IntelliJ IDEA toolbar, make sure the automatically created Run configuration and the virtual device we've just configured are selected and click :
The Android emulator will launch after the build has successfully finished, with our application started:
Click the droid image and see how the application processes the tap events, counts them and returns the corresponding message: