Choosing an environment for android programming. What are Android apps written in?

Fine. But where to start? What language to learn? What sources? And where to apply the acquired basic skills? Our article will help answer these questions.

Each language and framework has its own complexities and nuances, advantages and disadvantages. Consider the main languages ​​for Android application development.

Java

Official programming language supported by the development environment android studio. According to the annual Stackoverflow survey, in 2019, Java entered the top five most popular programming languages. Most of the programs created by Live Typing until 2019 are written in Java.

The first step to learning Java is to install Android Studio. This is a type of software called IDE - Integrated Development Environment, or built-in development environment. Comes with Android Studio Android SDK— a set of tools for Android development and everything you need to get started.

Java is referenced in most of the official Google documentation, and it is not difficult to find paid and free libraries and manuals - there are a great many of them.

Unfortunately, the complexity of Java prevents everyone from programming in it. As an object-oriented programming language, it has a lot of features in the form of class constructors, exceptions that cause applications to crash during operation, and other points that must always be taken into account when developing. However, Java code is easy to read and structure, especially if the accepted standards for its design are observed.

When developing in Java for Android, not only Java classes containing code are used, but also manifest files in XML that provide the system with basic information about the program, and Gradle, Maven or Ant automatic build systems, in which commands are written in Groovy, POM and XML, respectively; by default, projects use Gradle, and at the initial stages of learning to develop in Java, there is practically no need to edit files written in Groovy. For the layout of the UI part, the XML language is also usually used.

Android Studio, recognized by Google as the official Android development environment in December 2014, has been improving year by year to make life easier for Android developers. Its features, such as a visual UI editor and code completion, help make the development process more comfortable.

For those who are ready for a full immersion in Android application development, Java is recommended in the first place. However, if you feel difficult because of the specifics of the language, then start with something simpler and go back when you feel confident.

Kotlin


The language was officially introduced to the Android community in May 2017 at Google I/O. Already in 2019, Google recognized it as the preferred one for developing applications on Android, relegating Java to the background. This also means that the creation of new standard tools(libraries, Android Studio features) will primarily target Kotlin.

Since 2019, Live Typing Android developers have written exclusively in Kotlin. Projects such as Superbro are written in this language, and are gradually being translated into it.

Kotlin has included the best of modern programming languages ​​such as Java, Scala, TypeScript. Among the main advantages are automatic detection of data types, support for the functional paradigm, extension functions. At the same time, the language received protection from a number of large-scale problems, such as "errors per billion", or NullPointerException. All this explains its popularity - according to the 2019 StackOverflow survey, Kotlin entered the top five languages ​​\u200b\u200bmost loved by the community.

The basis for Kotlin is Java, so the transition is made easier for seasoned developers. If Java is unfamiliar to you, we advise you to work with it first. Major projects with big amount legacy code is most likely written in Java. That is, in the commercial development of applications for Android, there may be tasks where knowledge of Java will be required.

C/ C++


More low-level languages ​​that are also supported by Android Studio using the Java NDK. This allows you to write native applications, which can be useful for creating games or other resource-intensive programs. Android Studio offers C/C++ support through the Android NDK (Native Development Kit). This means that the code will not run through the Java Virtual Machine, but directly through the device, which will give you more control over system elements such as memory, sensors, gestures, etc., as well as the ability to squeeze the maximum resources out of Android devices . This also means that you will have to use libraries written in C or C++ .

In turn, it is difficult to set up and not very convenient, so it is recommended to use it to write only those program modules where you need to quickly perform complex operations: processing and rendering graphics, videos and complex 3D models.

Python


Just because Android doesn't support using Python to build native apps doesn't mean it's impossible. Fans of this language have developed many tools that allow you to compile Python code to the required state, and the presence of various libraries will allow you to build even native interfaces in compliance with Material Design guidelines. The most popular framework is Kivy, which allows you to create an application for Play market in pure Python.

BASIC


Due to its simplicity and friendliness, BASIC is the optimal entry point for beginner programmers.

The bad news is that it is not supported by Android Studio and is not suitable for Unity and Xamarin environments. The good news is that there is a special B4A development environment for BASIC, in which you can create Android applications. B4A embodies the concept of visual prototyping RAD, which implies the speed and convenience of programming. There are a lot of handy small design solutions here, and a responsive community will help with any problem.

The fact that resource-intensive games cannot be created on BASIC also brings its minus, and you should not count on support from Google due to the unofficial status of the software. This means that applications will not comply with Material Design, and you with knowledge of BASIC alone cannot be regarded as a professional developer. And among the entire list of languages ​​and environments in this article, this one is the only paid one.

Lua (using Corona SDK)


Balance between ease of learning mobile development under Android and a sense of control from the developer. The cross-platform graphics engine Corona is based on the Lua language. LUA is much simpler than Java, and the Corona SDK makes working with this language easy and enjoyable. It supports all native libraries, thus allowing you to write for many platforms.

To write code, you need Notepad++, and to run it without first compiling, you need an emulator. If the APK is built and the program is ready to be deployed, then you can run the application through the online tool. With basic programming skills, you can master Android development through Corona without much difficulty.

There were some restrictions, and such restrictions that make it impossible to develop serious things and establish yourself in the status of a professional. If you need functionality like in-app purchases in your app, you'll have to pay to be able to develop it, just like using the native Android API.


If you already know something about web programming in general and HTML, CSS and JavaScript in particular, then this knowledge will be useful for you to create elementary cross-platform applications using the PhoneGap framework. This is the last on our list, but by no means the least, a way to conquer Android development.

The main reasons to use PhoneGap for app development at Live Typing were:

  • reducing the time and cost of developing an application for several platforms at once (an application for obtaining a subscription to sports institutions in the city);
  • the ability to use an existing client site and its fragments (application for paying for services and online shopping).

Conclusion

In general, Android applications can be created in almost any popular language - there are frameworks and utilities for everything. However, if you want to become a professional Android developer, use all the features operating system and have access to the latest Android features, then Java or Kotlin will become your faithful companions. Even if these languages ​​are not familiar to you and seem complicated, they are worth learning in order to write diverse, beautiful and functional applications for the Android operating system.

And you need to start getting acquainted with the theoretical side of Android development from our article in which we have collected .

And if you decide to create a mobile application, but do not know which platform to start with, then start with Android. Android app downloads are 65% higher than iOS, and Android app design and development is cheaper. Looking for a reliable mobile development studio? and we will contact you.

The Android operating system every year becomes not only a suitable OS for ordinary users, but also a powerful platform for developers. What can you do: Google always meets developers halfway, providing ample opportunities and powerful tools, seasoned with informative documentation.
Moreover, one should not lose sight of the fact that green robot"is the leader in popularity among mobile operating systems. This suggests that by programming under Android, you will have a wide audience, which can subsequently bring profit. In general, Android is a kind of "oasis" for developers. Therefore, we have prepared for you a special selection of programming languages, as well as development environments for this OS.
Attention, a little instruction for beginners
: Programming on Android can seem complicated or too monotonous at first. Tip: Check out the links to helpful documentation before you get started, and Android programming won't be a problem for you.

Java is the main tool for the Android developer

Development environments: Android Studio (IntelliJ IDEA) , Eclipse + ADT plugin
Suitable for a wide range of tasks
Java is the main language for Android programmers, a must-have for beginners. The main Android source code is written in this language, so it's easy to see why most people choose this language. Applications written in Java run on Android with virtual machine ART (or Dalvik in Jelly Bean and more early versions Android) - an analogue of the Java virtual machine, because of which Google has serious litigation with Oracle.


Google on this moment officially supports a fairly powerful environment android development Studio, which is built on the basis of Intellij IDEA from JetBrains. Also, do not forget about the very detailed documentation from Google, which understands everything from match_parent and wrap_content to constructors, constants and basic methods of the JavaHttpConnection class - definitely worth a read.

Also, don't forget about Eclipse, a very popular environment for Java programmers. FROM official plugin ADT by Google, this toolkit will be a powerful and lightweight weapon in your hands. But the guys from Mountain View stopped supporting Eclipse since last summer, giving way to the fresh Android Studio. It is recommended to use on weak PCs.

Required documentation:

C++ is a powerful tool in the hands of a master

Main Development Environments: Android Studio (version 1.3 and up), Visual Studio 2015 , QtCreator
Suitable for game engines and resource-intensive applications.
C++ is a middle-aged but very powerful programming language that celebrated its 30th anniversary last year. It was invented in 1985 thanks to the efforts of comrade Bjorn Stroustrup and still occupies the top positions of the most popular programming languages. "Pros" gives you complete freedom actions, limiting you only to the limits of reason.




Throughout the existence of Android, many frameworks and development tools for C ++ have been created. I would especially like to highlight the well-known Qt and IDE QtCreator, which allow you to develop cross-platform applications for Windows, Windows phone, Windows RT, iOS, SailfishOS and Android (Symbian used to be on this list as well). In addition, you get a handy library of containers, algorithms and templates Tulip, which has absorbed all the best from Java and Android. And finally, you get a lot of different QT modules for high- and low-level work with the system. Your humble servant is coding in conjunction with C ++ and Qt.

Last year at the Windows: The Next Champter conference, wide attention was paid to the fairly popular Visual Studio 2015 development environment. One of the main innovations was support for developing applications for both Windows Phone and Android - Microsoft tried to somehow increase the number of applications for your OS.

It is also impossible not to mention that official android Studio began to support the NDK. With the help of the NDK, you can use OpenGL graphics when working with Android. If you need speed and efficiency - choose NDK! This development method is perfect for game engines that require high performance.

Android development in C or C++ may seem easier than in Java, but despite the fact that the language offers you complete freedom of action and does not limit you in your steps, it has some specific features that will take a lot of time to learn - not without reason C++ has been compared to nunchucks (an excellent weapon that, unfortunately, requires great skill). However, developing Android applications in C and C++ can be a lot of fun.

Required documentation:

Other languages

Now is the time to talk about other less popular, but also interesting languages ​​and frameworks for them. However, for many reasons you won't be as successful as with Java and C++.

Corona (LUA Script)


Suitable for creating games and simple applications
If for some reason you do not want to learn Java or understand how to build an interface through XML, then you can choose this IDE for yourself. Corona is a fairly lightweight development environment, in which you need to write code in a fairly lightweight LUA (Pascal lovers will appreciate it).

This toolkit will help you to write simple 2D games, for which there are libraries for 2D=objects, sounds, network and game engine. The created games work with OpenGL, which means high efficiency. Great for beginners, maybe you can use it to create your first Android mobile app!


Required documentation:

Adobe PhoneGap (HTML5, JavaScript, CSS)


Suitable for creating resource-intensive applications
If you are already familiar with HTML, CSS, and JavaScript, you can try PhoneGap as an alternative. This IDE will allow you to build full apps, developed in the aforementioned programming and markup languages.

In fact, ready-made applications from PhoneGap are the simplest WebViews animated with JavaScript. With the help of a variety of APIs, you can use the various functionality of the device just like on native applications. Interestingly, applications are compiled on the server and then available for use on iOS, Android, Windows Phone, Web OS and BlackBerry OS. With such wide cross-platform application development can be greatly accelerated.


Required documentation:

Fuse (JavaScript and UX)


Suitable for creating both simple and complex applications
When people talk about Android development tools, they often think of Fuse. This tool is one of the most convenient of its kind, and it can provide a wide range of features and benefits to the developer.

The main logic of Fuse applications is built on JavaScript - a simple and understandable language with a low entry threshold. The interface foundation is represented by UX markup - intuitive for everyone. Well, the “goodies” of the environment will allow you to apply changes right while the application is running on your device or emulator - just like in Android Studio 2.0 and higher. With Fuse, Android app development can be both easy and enjoyable.

Required documentation:

The words "behind the curtain"

Of course, we have not shown you all the currently existing development tools. With this article, we wanted to explain to you that becoming an Android developer is not so difficult, although it often requires effort and perseverance. The world of mobile development is open to you, but remember: the first step is always yours.

Some time ago official Android IDE was Eclipse (as the de facto standard for Java) with the ADT plugin. Some time later, the IDE from JetBrains began to gain popularity among Java programmers, then a plug-in for Android development appeared for it, and people began to slowly switch to it from Eclipse.

A little more later Google announces what Android Studio will do based on IDEA. And now the second version of Android Studio is on the way, and Eclipse is remembered only as a bad dream :)

android studio is the official development environment for Android. Basically, Android Studio is a famous Java IDE IntelliJ IDEA with plugins.

At the moment, there are the following options when choosing an IDE for Android:

  1. eclipse. The most popular IDE for Java some time ago, now use it for Android development highly not recommended.
  2. IntelliJ IDEA. Great IDE, good for android.
  3. android studio. Best IDE for Android. It differs from IDEA in little things, but these little things are very, very pleasant and make our work much easier :) That's where we will stop.

First of all, you need to make sure you have the JDK (Java Development Kit) installed. This is a required component for Java development, and since Android development is done in Java, it is also required for Android development.

Secondly, check the boxes "show line numbers" and "show method separators":

The first will display line numbers to the left of the text, the second will draw separators between methods in the code.

These two options are incredibly important, especially for beginners, and I don't understand why they are disabled by default.

Thirdly, set up autocompletion. To do this, select "None" in "Case sensitive completion":

Let me explain why this is so. The default option means that auto-completion is triggered only if the first letter is typed in the correct case. The None option will trigger auto-completion regardless of the case in which you started typing the code.

The standard value of this option, like the previous two, is puzzling to me.

Create your first project

Well, with the setting and Android installation Studio we figured out, it's time to create our first project.

In the main window of Android Studio, click on " Start a new Android Studio project«:

A new window will appear in which we need to perform several actions.

In the first, you need to specify the application name, the company domain (the package name will be created from these two parameters), and the location of the project on disk:

In Android, as in Java, the primary identifier for an application is the package name. If you have worked with Java before, you know what it is. For those who do not know, I recommend Google, or, for example, here.

Next, Android Studio will ask us which and which SDK versions we want to use. For now, the “Phone and Tablet” SDK is enough for us, put the API version 16 instead of the recommended 15th, since API 15 is no longer relevant and not at all common:

On the next screen, we will be asked what application components we want to create. Select "Empty Activity":

In the next step, just click "Finish" without changing anything.

At the end of this process, you will finally see your first project:

It is already quite functional, but in order to run it, we need an Android emulator.

Creating an Android emulator

To create an Android emulator, we need Android AVD Manager(AVD = Android Virtual Device). Don't worry, you don't need to install anything else. Just click on this button:

Then on this button:

And then just click “Next” a few times and finally “Finish”

Launch Hello World

It's time to start our first project created in android studio!

Click on this button (or Shift-F10):

After that, you will see a dialog in which you will be asked to select the device on which the IDE should run the built application:

Check the box highlighted by the arrow and click OK. The assembly of the project will begin, the launch of the emulator, the installation of the application on the emulator, and the launch of the application.

This will take some time (the more powerful your computer, the less time it will take), because the emulator is quite a slow thing, despite huge improvements in the last couple of years.

And now, after 1-10 minutes (after launching the emulator, projects will, of course, build and run faster), you will finally see your Hello World on the emulator screen!

That's all, and in the next lesson we will look at.

New lessons are added every day! In order not to miss anything, subscribe to our

What is the Android development process like? Let's highlight a few basics:

  • IN Java files you describe the logic of the program - what you want your application to do.
  • In XML files, you design layouts - appearance.
  • Once the application is written, the build tool must be used to compile all the files and package them together into an .apk file that can be run on Android devices and/or published to Google Play.
  • All utilities and files that are used to create an Android application are combined into an integrated development environment (IDE). An IDE is a program that you open to edit your code files and compile and run.
  • Previously, Eclipse was the standard IDE for Android development, but now it has been replaced by the more functional Android Studio, a product of Google.

You will of course find deeper processes going on behind the scenes of the above steps. For example, advanced users will want to know the role of the Dalvik virtual machine. At the end of the article, links to useful resources that every Android developer should be familiar with will be listed. The first one is the official documentation from Google.

  • Download and install Android Studio.
  • Learn about running and testing applications on Android devices and emulators.
  • Let's create a simple Android application that displays the inscription "Hello World" on the screen of a mobile device.

At the end of the article, you can find useful recommendations for novice developers from the company.

Installing the Android Studio development environment

It's really tempting to start reading documentation and writing code to find out what the platform is capable of. And we will do it soon! However, to get started with the Android platform, you need to set up a development environment.

For newcomers to Android programming, it is especially important to take your time and follow each step methodically. Even if you follow the steps correctly, you may need to fix a small issue with your environment setup depending on your system configuration or product version. To do this, use search services. The StackOverflow resource can be especially highlighted.

It is important to prevent any underwater rocks hindered your ultimate goal of learning Android programming. It is known that even professionals sometimes experience certain problems with setting up a working environment. In such cases, it is important to know command line. If you'd like to get more familiar with this tool, there's a link to a good introductory one at the bottom.

Along with syntax training, it's important to train yourself to think like a successful programmer that won't accept a file X error message. not found final verdict. Such thinking is easily trained by you in cases where you do not give up and look for a solution to a problem that has arisen.

Go to android page Studio developer.android.com/studio/index.html and find the download button latest version for your platform.

Click on the download button and you will be asked to read the terms and conditions for using the software product. After careful reading (as you always do) and acceptance, the download begins. It will probably take a few minutes. After that, you can install Android Studio just like any other program. On the home page The download contains installation instructions for Mac and Windows.

Now that you've installed Android Studio, let's get it up and running! Launch Android Studio. The program will ask if you want to import your settings. Since you are starting from scratch, just select the second option and continue.

You should see a nice Material Design loading screen.

Upon completion of the download, you will be taken to the welcome screen.

Even if you just downloaded Android Studio, you may not have the latest version. To avoid future version issues, click the "Check for updates now" button and, if necessary, follow all the instructions to get the latest version. Sometimes Studio will automatically inform you that there's an update with a screen like this:

In this case, always select Update and Restart. Fine! We have successfully completed the installation of the development environment.

Creating the first Android project

It's time to create the first project. Let's start simple. It is customary for programmers to call the first program "Hello World". Let's follow this tradition and then make a few small changes to make the app use your name for greeting. At the end, you can download it to your device and show it to your friends. Android Studio has a small step by step tool to help you build your project. Click "New Project" on the start screen:

Fill it out like this. Feel free to replace "example" in the package name with something else to remove the warning at the bottom of the screen. You can also set the project location by pointing to any folder on your hard drive

For drop-down SDK versions, note the Description section at the bottom of the dialog box. It explains what each setting is for.

Install the minimum required SDK as shown in the screenshot. This sets the minimum android version required to run the application. Choosing this value for your own projects is a matter of balancing the SDK features you want with the devices that will be supported.

For getting additional information about API versions and their use, there is a special Dashboards page on the website for Android developers https://developer.android.com/about/dashboards/index.html.

After selecting a version, the start template selection screen appears. You can create an app that already interacts with the google maps api and renders the map. In our test example, select the Empty Activity and click the "Next" button.

And now you are at the last step of the application creation process. Before clicking "Finish", there are a few things to note. Here, for the first time, you come across mentions of the main architectural components of any application.

  • - this is the first, but not the last mention of the word Activity. In the context of Android, an Activity is usually thought of as a "screen" in your application. This item is very flexible. When Android Studio creates the MainActivity class, it inherits it from the Android SDK's Activity class. Those who are familiar with object-oriented programming understand this concept, but for beginners, this basically means that your MainActivity will be a custom version of the Activity.

  • Layout Name- the layout of what will be shown to the user is defined in a special as Android xml. You will soon learn how to read and edit these files.

Click Finish. It will take some time to create and load the project. After some android time Studio will complete the build of your project. Of course, the project is still empty, but it has everything you need to run on an Android device or emulator.

After loading the project, you view the layout file in XML format. Before moving on to Android programming, let's talk about how we can run this application. It's time to say "Hello world!".

Running the application on the emulator

Now it's time to say a few words about the emulator. Android Studio comes with software capable of emulating an Android device for running apps, browsing the web, debugging, and more.

This feature is provided by the Android Virtual Device (AVD) Manager. Optionally, you can set up multiple emulators, set the screen size and platform version for each new emulator. This functionality is very useful because it saves developers from having to buy several devices for testing programs.

Click on the Run button in the form of a green arrow.

You will have to wait a while for the emulator to load and once it is ready you will see something like this:

Congratulations! You have made your first Android app!

And so… Why and how did it work?

To start making changes and adding interesting features, it is necessary to gain a working knowledge of what is going on behind the scenes. Take a look at the Android Studio project section with files and folders on the left side of the screen. You may need to click the small tab at the edge (see below) if the project explorer is not visible at the moment.

Look through the folder structure for a few minutes and double-click on files to see their contents in the main window. If this all looks cryptic, don't worry!

Android project structure: Team

Every good team is made up of people who fill their assigned roles. Do you want to get the job done right? You need the right team. There are several key elements in Android projects, and each of them has a role to play:

Java: Professional

This is the part of your code that is responsible for the application logic. Your code will be in the src\main\java directory in the main project folder. To learn Java, you can recommend Bruce Eckel's book "Java Philosophy";

Resources: Artist

It's not enough just to do android application, it should also be stylish. Your app will never stand out if it doesn't have crisp icons and images, well-designed layouts, and maybe even smooth animations.

When initialized, the folder contains the following folders:

  • drawable, which holds the icons. Now there is only standard icon applications.
  • layout with XML files, which are screen designs.
  • menu with XML files of lists of items that will be displayed in the action bar.
  • values ​​with XML files containing sizes, colors, string constants, and styles.

AndroidManifest.xml: Boss

This XML file informs your system of the application's hardware and software requirements and contains its version name and icon. The manifest also contains information about all the activities in the application. Do you need work done by your application? Talk to your boss first.

Alteration

Go to res/values/strings.xml and double click on the file. When you open the file, you will see two string resources in the XML.

These resources are used in different places, but it's very convenient to have all the text used in your application in one file. If you need to translate it, or if your marketing colleague asks you to remove any redundant links, it will be easy to make all the changes here.

Change the hello_world string that the application displays on the screen. Change its content to something more personal, such as using your own name. You will get something like:

Matt is learning Android!

Click Run. The application should restart and you will see a personalized message:

We congratulate you - you have made your first project and learned how to edit the source code. The first step in Android programming is done. We wish you good luck on this difficult, but insanely interesting path! If you need professional Android application development, please contact Infoshell specialists.

Create own programs for mobile devices operating on Android is difficult task, and it can only be dealt with using a special software, as well as having basic programming skills. Moreover, the choice of a suitable environment for creating mobile applications is no less important, because it can greatly simplify the development and testing process. Today we will consider the best representatives of the software segment designed for developing Android applications.

Android Studio is an integrated software environment created by Google Corporation. It compares favorably with its counterparts due to the fact that it is adapted and optimized for the development of applications on Android by the same people who develop this OS. The program provides an opportunity to conduct various kinds of tests and diagnostics. So, Android Studio contains tools for testing the compatibility of applications you write with different versions mobile operating system and different platforms. There are in the arsenal of the Studio and tools for designing mobile applications and almost instantaneous viewing of the changes made.

Support for version control systems and the presence of a developer console are impressive, as well as many standard templates basic design and standard elements to create Android applications. To a huge number of advantages, you can also add the fact that this product is distributed absolutely free of charge. Of the minuses, it is worth highlighting perhaps the English-language interface of the environment, but after all, you will program by no means in Russian.

RAD Studio

The new version of RAD Studio called Berlin is a complete tool for developing cross-platform applications, including mobile programs, in Object Pascal and C++. Its main advantage over other similar software environments is that it allows you to develop very quickly through the use of cloud services. New developments in this environment allow you to see in real time the result of the program execution and all the processes occurring in the application, which allows us to talk about the accuracy of development.

Here you can flexibly switch from one platform to another or to server storages. Minus RAD Studio Berlin is a paid license. But upon registration, you can get a free trial version of the product for 30 days. Interface - English.

Eclipse is one of the most popular software platforms with open source for writing applications, including mobile ones. Among the main advantages of Eclipse is a huge set of APIs for creating program modules and the use of an RCP approach that allows you to write almost any application.

This platform provides users with such elements of commercial IDEs as a convenient editor with syntax highlighting, a streaming debugger, a class navigator, file and project managers, version control systems, code refactoring. Particularly pleased with the opportunity additional installation needed to write the SDK program. But to use Eclipse, you also have to learn English.

Choosing a development platform is an important part starting work, since the time of writing the program and the amount of effort spent largely depend on it. After all, why write your own classes if they are already present in standard sets environment?