How to write an application for. Android Go app development: key aspects. Launch on device

Learning a new language and development environment is the minimum that is required of you if you want to write your first mobile application. It will take at least a couple of weeks to sketch out a basic todo list for Android or iOS without copying the example from the book. But you can not master Objective-C or Java and still quickly develop applications for smartphones if you use technologies such as PhoneGap.

If you have carefully studied the innovations that await us in Windows 8, you may have noticed that it will be possible to develop applications in HTML5 under it. The idea, in fact, is not new - technologies that implement the same approach for mobile platforms are developing by leaps and bounds. One of these frameworks, which allows you to develop applications for smartphones using a bunch of familiar HTML, JavaScript and CSS!, is PhoneGap. An application written with its help is suitable for all popular platforms: iOS, Android, Windows Phone, Blackberry, WebOS, Symbian and Bada. You will not need to learn the specifics of programming for each platform (for example, Objective-C in the case of iOS), or deal with various APIs and development environments. All you need to create a cross-platform mobile application is knowledge of HTML5 and a special PhoneGap API. In this case, the output will not be a stupid HTML page “framed” in the application interface, no! The framework's API allows you to use almost all phone capabilities that are used when developing using native tools: access to the accelerometer, compass, camera (video recording and photography), contact list, file system, notification system (standard notifications on the phone), storage, etc. . Finally, such an application can seamlessly access any cross-domain address. You can recreate native controls using frameworks like jQuery Mobile or Sencha, and the final program will look like it was written in a native language (or almost so) on a mobile phone. It is best to illustrate the above in practice, that is, write an application, so I suggest you start practicing right away. Keep track of the time - it will take hardly more than half an hour to do everything.

What will we create

Let’s take iOS as the target platform - yes, yes, the money is in the AppStore, and for now it’s best to monetize your developments there :). But let me make it clear right away: the same thing, without changes, can be done, say, for Android. I thought for a long time about which example to consider, since I didn’t want to write another tool to keep track of the to-do list. So I decided to create an application called “Geographic Reminder,” a navigation program whose purpose can be described in one phrase: “Let me know when I’m here again.” The AppStore has many utilities that allow you to “remember” the place where the user parked the car. It's almost the same thing, just a little simpler. You can point to a point on a city map, set a certain radius for it, and program a message. The next time you fall within the circle with the specified radius, the application will notify you and the point will be deleted. We will proceed according to this plan: first we will create a simple web application, test it in the browser, and then transfer it to the iOS platform using PhoneGap. It is very important to prototype and test the bulk of the code in a browser on a computer, since debugging an application on a phone is much more difficult. We will use the jQuery JS framework with jQuery Mobile (jquerymobile.com) as the framework, and Google Maps v3 as the map engine. The application will consist of two pages: a map and a list of points.

  • A marker of your current position is placed on the map. By clicking on the map, a point is created to which a message is attached (like “car nearby”). A point can be deleted by clicking on it. To move a person's marker on the map, a geonavigation API is used.
  • On the page with a list of points there should be an additional “Delete all points” button, and next to each point there should be a “Delete this point” button. If you click on an element in the list, the corresponding point will be displayed on the map. We will save the user settings and the list of points in localStorage.

UI frameworks

jQuery Mobile is, of course, not the only framework for creating a mobile interface. The PhoneGap website has a huge list of libraries and frameworks that you can use (phonegap.com/tools): Sencha Touch, Impact, Dojo Mobile, Zepto.js, etc.

Application framework

I’ll immediately explain why we will use jQuery Mobile. This JS library provides us with ready-made mobile application interface elements (as close as possible to native ones) for a variety of platforms. We need the output to be a mobile application, and not a page from a browser! So download the latest version of JQuery Mobile (jquerymobile.com/download) and transfer the first application files that we need to the working folder:

  • images/ (move here all the images from the jq-mobile archive folder of the same name);
  • index.css;
  • index.html;
  • index.js;
  • jquery.js;
  • jquery.mobile.min.css;
  • jquery.mobile.min.js.

It is necessary to make resources mostly local so that the user does not waste mobile Internet in the future. Now we create the page framework in the index.html file. The code below describes the top of the page with a map, the inscription “Geographic Reminder” and the “Points” button.

Map page

Georemembrance

Points

The page attribute data-dom-cache="true" is necessary to ensure that it is not unloaded from memory. The Points button uses data-transition="pop" so that the Points List page opens with a Pop-in effect. You can read more about how jQuery Mobile pages are structured in a good manual (bit.ly/vtXX3M). By analogy, we create a page with a list of points:

Point list page

delete everything

Points

Map

For the “Map” button, we will also write data-transition="pop", but we will add the data-direction="reverse" attribute so that the “Map” page opens with the “Fade” effect. We will write the same attributes in the point template. That's it, our frame is ready.

Creating an application

Now we need to display the map, for which we will use the standard Google Maps API, which is used by millions of different sites:

Var latLng = new gm.LatLng(this.options.lat, this.options.lng); this.map = new gm.Map(element, ( zoom: this.options.zoom, // Select the initial zoom center: latLng, // Set the initial center mapTypeId: gm.MapTypeId.ROADMAP, // Normal map disableDoubleClickZoom: true, // Disable autozoom by tap/double-click disableDefaultUI: true // Disable all interface elements ));

Here Gm is a variable referencing the Google Maps object. I commented out the initialization parameters well in the code. The next step is to draw a man marker on the map:

This.person = new gm.Marker(( map: this.map, icon: new gm.MarkerImage(PERSON_SPRITE_URL, new gm.Size(48, 48)) ));

The address of the person sprite from Google panoramas is used as PERSON_SPRITE_URL. Its static address is maps.gstatic.com/mapfiles/cb/mod_cb_scout/cb_scout_sprite_api_003.png . The user will add points by clicking on the map, so to draw them we will listen to the click event:

Gm.event.addListener(this.map, "click", function (event) ( self.requestMessage(function (err, message) ( // Method that returns the text entered by the user if (err) return; // Method adds a dot to the list of active ones and // draws it on the map self.addPoint(event.latLng, self.options.radius, message); self.updatePointsList(); // Redraw the list of points )), false);

I provide most of the code - look for the rest on the disk. Next we need to teach the application to move the user icon on the map. In the prototype, we use the Geolocation API (the one that is also used in desktop browsers):

If (navigator.geolocation) ( // Check if the browser supports geolocation function gpsSuccess(pos) ( var lat, lng; if (pos.coords) ( lat = pos.coords.latitude; lng = pos.coords.longitude; ) else ( lat = pos.latitude; lng = pos.longitude; ) self.movePerson(new gm.LatLng(lat, lng)); // Move the user icon ) // Every three seconds we request the current // position of the user window.setInterval (function () ( // Request the current position navigator.geolocation.getCurrentPosition(gpsSuccess, $.noop, ( enableHighAccuracy: true, maximumAge: 300000 )); , 3000);

The movePerson method uses a simple getPointsInBounds() procedure to check if the user is at any active point. Last question - where to store the list of points? HTML5 introduced the ability to use localStorage, so let's not neglect it (I'll leave you to figure out these parts of the code yourself, which I've commented out well). So, the application running in the browser is ready!

Launching a web application

As I said before, debugging mostly needs to be done on the computer. The most suitable browser for testing web applications on a computer is Safari or Chrome. After debugging in these browsers, you can be sure that your application will not work in a mobile phone browser. Both of these browsers are compatible with most mobile web browsers because they are built on the WebKit engine just like them. After eliminating all the bugs, you can proceed to launching the mobile web application directly on your phone. To do this, configure your web server (even Denwer or XAMPP) so that it serves the created page, and open it in your mobile phone browser. The application should look something like the one shown in the figure. It is important to understand here that the future mobile application compiled for the mobile platform using PhoneGap will look almost identical, except that the browser navigation bar will not be displayed on the screen. If all is well, you can start creating a full-fledged iOS application from the page. Please note that we haven’t even touched PhoneGap and the IDE for mobile development up to this point.

Preparation

In order to build an application for iOS, you need a computer with the Mac OS 10.6+ operating system (or a virtual machine on Mac OS 10.6), as well as the Xcode development environment with the iOS SDK installed. If you do not have the SDK installed, you will have to download a disk image from the Apple website that includes Xcode and the iOS SDK (developer.apple.com/devcenter/ios/index.action). Keep in mind that the image weighs about 4 GB. In addition, you will need to register on the Apple website as a developer (if you are not going to publish your application in the AppStore, then this requirement can be bypassed). Using this set, you can develop applications in the native iOS language Objective-C. But we decided to take a workaround and use PhoneGap, so we still need to install the PhoneGap iOS package. Just download the archive from the offsite (https://github.com/callback/phonegap/zipball/1.2.0), unpack it and run the installer in the iOS folder. When the installation is complete, the PhoneGap icon should appear in the Xcode projects menu. After launch, you will have to fill out several forms, but very soon you will see the IDE workspace with your first application. To check if everything is working, click the Run button - the iPhone/iPad emulator with the PhoneGap template application should start. The assembled program will generate an error saying that index.html was not found - this is normal. Open the folder in which you saved the primary project files and find the www subfolder in it. Drag it into the editor, click on the application icon in the list on the left and in the window that appears, select “Create folder references for any added folders”. If you run the program again, everything should work. Now we can copy all the files of our prototype to the www folder. It's time to tweak our prototype to work on a smartphone using PhoneGap processing.

Prototype transfer

First of all, you need to include phonegap-1.2.0.js in your index file. PhoneGap allows you to limit the list of hosts available for visiting. I suggest setting up such a “white list” right away. In the project menu, open Supporting Files/PhoneGap.plist, find the ExternalHosts item and add to it the following hosts that our application will access (these are Google Maps servers): *.gstatic.com, *.googleapis.com, maps.google. com. If you do not specify them, the program will display a warning in the console and the map will not be displayed. To initialize the web version of our application, we used the DOMReady event or the jQuery helper: $(document).ready(). PhoneGap generates a deviceready event, which indicates that the mobile device is ready. I suggest using this:

Document.addEventListener("deviceready", function () ( new Notificator($("#map-canvas")); // If the user does not have Internet, // notify him about it if (navigator.network.connection.type = == Connection.NONE) ( navigator.notification.alert("No Internet connection", $.noop, TITLE); ) ), false);
Let's prevent scrolling: document.addEventListener("touchmove", function (event) ( event.preventDefault(); ), false);

Then we will replace all alert and confirm calls with the native ones that PhoneGap provides us with:

Navigator.notification.confirm("Remove point?", function (button_id) ( if (button_id === 1) ( // OK button pressed self.removePoint(point); ) ), TITLE);

The last thing we need to change is the block of code that moves the user icon around the map. Our current code also works, but it works less optimally (it moves the icon even if the coordinates have not changed) and does not provide as rich data as the PhoneGap counterpart:

Navigator.geolocation.watchPosition(function (position) ( self.movePerson(new gm.LatLng(position.coords.latitude, position.coords.longitude)); ), function (error) ( navigator.notification.alert("code: " + error.code + "\nmessage: " + error.message, $.noop, TITLE); ), ( frequency: 3000 ));

This code is more elegant - it only generates an event when the coordinates have changed. Click the Run button and make sure that the application we just created works perfectly in the iOS device simulator! It's time to start launching on a real device.

Launch on device

Connect your iPhone, iPod or iPad to a computer running Xcode. The program will detect a new device and ask permission to use it for development. There is no point in refusing her :). Let me repeat once again: in order to run a written application on iOS, you must be an authorized iOS developer (in other words, be subscribed to the iOS Developer Program). This will only bother you if you are developing applications for Apple products; with other platforms (Android, Windows Phone) everything is much simpler. Those studying at a university have a chance to gain access to the program for free thanks to some benefits. Everyone else must pay $99 per year to participate in the program. Apple issues a certificate with which you can sign your code. The signed application is allowed to be launched on iOS and distributed in the App Store. If you are not a student, and you still feel sorry for $99 for innocent experiments, then there is another way - to deceive the system. You can create a self-signed certificate for code verification and run the mobile program on a jailbroken iOS device (I won’t dwell on this, because everything is described in as much detail as possible in this article: bit.ly/tD6xAf). One way or another, you will soon see a working application on the screen of your mobile phone. Stop the stopwatch. How long did it take you?

Other platforms

Besides PhoneGap, there are other platforms that allow you to create mobile applications without using native languages. Let's list the coolest players.

Appcelerator Titanium (www.appcelerator.com).

Titanium can build applications primarily for Android and iPhone, but it also claims to support BlackBerry. In addition to the framework itself, the project provides a set of native widgets and an IDE. You can develop applications on Titanium for free, but you will have to pay for support and additional modules (from $49 per month). The price of some third-party modules reaches $120 per year. The developers of Appcelerator Titanium claim that more than 25 thousand applications have been written based on their framework. The project's source code is distributed under the Apache 2 license.

Corona SDK (www.anscamobile.com/corona).

This technology supports the main platforms - iOS and Android. The framework is aimed mainly at game development. Of course, the developers claim high-quality optimization on OpenGL. The platform does not have a free version, and the price is quite steep: $199 per year for a license for one platform and $349 per year for iOS and Android. Corona offers its own IDE and device emulators. Corona applications are written in a language similar to JavaScript.

Conclusion

We created a simple mobile web application and ported it to the iOS platform using PhoneGap in a few simple steps. We didn't write a single line of Objective-C code, but we got a program of decent quality, spending a minimum of time porting and learning the PhoneGap API. If you prefer another platform, for example Android or Windows Mobile 7, then you can just as easily, without any changes for these platforms, build our application (for each of them there is a good introductory manual and video tutorial: phonegap.com/start) . To verify the platform’s viability, you can look at ready-made applications on PhoneGap, which the technology developers have collected in a special gallery (phonegap.com/apps). In fact, PhoneGap is an ideal platform for creating at least a prototype of a future application. Its main advantages are speed and minimal costs, which are actively used by startups that are limited in resources in all respects. If the application fails, and for some reason you are no longer satisfied with the HTML+JS internals, you can always port the application to a native language. I can’t help but say that PhoneGap was originally developed by Nitobi as an open source project (the repository is located on GitHub: github.com/phonegap). The source code will continue to remain open, although Adobe bought Nitobi last October. Need I say what prospects the project has with the support of such a giant?

How to develop a profitable Mobile application or how to hit the target!

If you have an idea for creating, there is no doubt that it will work and even generate income, provided that your mobile application will be incredibly useful to the user. This could be optimizing everyday tasks or solving user problems (paying traffic police fines or pre-registration for a car wash, etc.) or solving the problem of the user spending time on his smartphone.

It all starts with an idea

There's no point in creating an app if you don't have an idea. Therefore, at the very beginning it is recommended to think everything through carefully. An important point is to know who the utility will be intended for and what functions it will perform.

A large number of well-known mobile applications were not part of the creators' interests. These are games that are always in high ranking positions. Perhaps everyone already knows about Minecraft, Temple Run and others.

With the help of gaming applications, it is possible to get more profit, because... people are more willing to shell out their money for them. Especially if these are popular projects. You shouldn’t lose heart if the idea you want to implement already exists and is even posted on the App Store. But still, those who think outside the box win. You need to look at similar proposals and understand what is missing in them and make them better.

For example, if there are already several utilities that provide information about popular establishments in Moscow, they may compete with a program that shows places in the city that are not known to everyone.

There are several key points to consider when putting forward an idea:

  • Assessing the possibilities when creating an application yourself. In simple mobile app development, you will be able to make a simple mobile app by yourself.
  • If you have a mobile application with certain business processes or a technically complex mobile application, then you will need development from scratch. If your mobile application will serve as an online store, then we recommend using a ready-made solution for 1C Bitrix Mobile application. Deploy it and develop the necessary functionality over time. To do this, you need to find a mobile application development company.
  • If the mobile application is from the B2C segment, for example, like a cafe, pizzeria, taxi service, bank mobile application, mobile Internet bank client, travel agency mobile application, then you can use already developed ready-made mobile applications from development companies or find website constructors on which you can develop the application yourself (in this case, you can make it with simple, straightforward functionality).
  • It is important to highlight and evaluate the usefulness of the future application.
  • Decide whether the utility will require daily monitoring.
  • Select the platforms for which the future mobile phone is intended (IOS, Android, Windows Phone).

What applications are there?

There are a large number of types and categories. Below is a list of the most popular ones.

  • Toys (the simple colorful shooter game Angry Birds has won recognition among many users);
  • Resources for Travelers (Like TripAdvisor, a good example);
  • Social networks (VKontakte, Odnoklassniki);
  • News feeds (Well-known version - RIA Novosti);
  • Projects for music lovers (a striking example of Spotify);
  • Resources with video content (Vine);
  • Auxiliary utilities (For example, translator);
  • Photo networks (Instagram), etc.

How to make an application earn money

Before you start development, you need to determine the monetization of the mobile application. There are several options for monetizing projects:

  • Freely distributed. Similar programs are used by large corporations and allow them to promote a range of goods and services.
  • Free with advertising. This type is often found in popular projects that actively interact with users.
  • Paid system. The most profitable of all. Similar applications are used by Apple, which makes money on commissions (up to 30%) on sales.
  • Light (Lite) and professional (Pro) versions. The first of them is free, but contains limited functionality, which is fully available when purchasing the Pro version.
  • Internal purchases. The functionality of the application and new gaming capabilities of the character are gradually purchased by users for real money.

Development stage

When you already have an idea, that's half the success.

For those who do not want to bother themselves too much, but are ready to shell out a certain amount, there are offers from mobile application developers. We are developing custom mobile applications.

The easiest and cheapest way to find a specialist is to go to freelance exchanges. But, if you come across an unscrupulous employee, there is a risk that the project will not be delivered to you on time and, perhaps, the contractor will ask for an additional amount for the development (since initially, due to inexperience, he did not correctly determine the scope of work).

Below are questions to ask developers:

  • Cost of developer work for 1 hour?
  • Portfolio of completed projects?
  • Will the customer own the rights to the application?
  • Are there opportunities and experience that will allow you to bring the idea to life?
  • What platforms does it work with?

How much does app development cost?

Before you can earn a large amount of money, you must first spend it. This statement is not always true. But if we assume that the application is ordered from specialists, there are several nuances in the final cost.

The price can range from 50,000-5,000,000 rubles, depending on the type of application and its capabilities. This may seem very expensive (especially the last figure), but as the popularity of a high-quality application develops, the profit will recoup all costs several times over.

The most expensive games. They are often bestsellers.

When the project has already been developed at some stage or there is at least a mock-up, the price can be significantly reduced. Another option to reduce initial costs is to offer the developer a percentage of the program's profits. When the application is ready, it should be published on the App Store. This is also not a free step. The amount you will have to pay is approximately $100 per year. Posting on the Android Market will cost $25.

If you create an application for free

When you don’t have the desire or ability to invest money, you can go the other way and use mobile application designers. These extensions work in an online system and allow you to create a simple utility or “toy” for free without programming skills. But, if you need something individual and more complex, there is a paid tariff for this.

Here are some constructors:

  • My-apps.com. 10 ready-made templates are provided for developing business systems (taxi, pizza delivery, online store, etc.).
  • Net2Share.com. The designer is completely free and created for Android applications. There is an internal promotion system. As part of the program, training seminars on the features of creating mobile applications are regularly held.
  • ibuildapp.com. Constructor for developing applications running on iOS and Android platforms. According to the Russian version of the site, the tariff fee will be about 500 rubles.
  • MobiumApps.com. Designed for Android, Apple iOS and Windows Phone. The system is paid. One application can cost 10,000 rubles per month (with an unlimited tariff), or 7 rubles for each installation.
  • AppsGeyser.com. Cheap designer. The system is free, but full of advertising. Designed for bloggers and online publications that deliver content to subscribers.
  • BuildAnApp.com. Designer created for BlackBerry, Windows, iOS and Android. The subscription fee will be about $20. Generation is carried out in only 6 stages.
  • ViziApps.com. System for development on Android, Apple iOS and HTML5. The monthly rate is around $100 per month. Publishing costs will cost approximately $400. The service copes well with ideas for business processes.

How much can you earn from the application?

All money received through the application directly depends on its popularity. Therefore, it is difficult to immediately say a definite figure. The GigaOM PRO company conducted research that showed that about half of the developers earn approximately $500 every month and only 4% of mobile applications bring in millions of rubles in profit. This amount is very small to live only on the income from the application. Earning money is perfect for those who just want to earn a little extra money.

Geniuses who can recreate a project that is as profitable as Angry Birds have the opportunity to receive up to $100,000 every month. To make good money on the application, you need to consider the following:

  • The idea and the application as a whole should be of interest to a large audience;
  • Before starting creation, it is recommended to research all existing hits;
  • The easiest way to make money is on iOS applications;
  • RuTaxi

    Development of a mobile version of the website, landing page and mobile application for a taxi service

    rutaxi.ru

    Do you want the same project or even cooler?

    Write to us about it!

Google's Android operating system is ideal for developers who want to create applications for mobile phones without having to go through Apple's complex approval processes each time.

This guide aims to guide you through the necessary software and tools that will help you get started developing your own app with ease.

It doesn't matter how good you are at programming, because if you can master the Android software development kit (SDK), your apps will turn out great. So, check out the resources below to get yourself into the swing of things.

Java Development Kit

The first thing you will need to start developing java applications (the basis of Android applications) is the Java Development Kit (JDK) from Oracle, which can be downloaded from the following link.

You've probably already downloaded and installed the Java Runtime Environment (JRE) in some form, which is needed to run applets on your computer. You need to uninstall the JRE version that is currently installed on your computer in case it conflicts with the JDK version that you are downloading. Luckily, the version above includes the latest and greatest version of the JRE, which is sure to be compatible with the JDK, eliminating the need to reinstall it.

Download and run the installer, make sure that 'Development Tools', 'Source Code' and 'Public JRE' are included in the installation in the manual installation window (can be seen below). Click 'Next', read the terms of the license agreement if you have enough free time, and proceed with the installation.

Although most integrated development environment (IDE) applications—we'll talk more about this in the next step—come with their own compiler, I recommend that you embed the newly installed Java compiler into the command line so that you can use it on demand.

If you are using Windows, go to System Settings from Control Panel and select Advanced System Settings. Here select ‘Environment Variables’ and find the ‘Path’ variable. Add a let to file as a 'bin' directory before your Java installation, as shown in the example below.

To check if everything was successful, use the commands 'java -version' and 'javac -version'. You should see something like the following:



Installing the IDE

Integrated development environments are often used by seasonal developers and newbies who want to develop applications. For those who don't know, an IDE is an application that helps programmers write code by providing a condensed set of tools like debuggers, compilers, and more.

Although there are many IDEs available on the internet, here we will use the free Eclipse software as Google provides a plugin to integrate it with the Android SDK. You can download the required version of Eclipse.

This may vary from case to case, but when I downloaded the resource, the software was provided as a zip archive that contained an 'eclipse.exe' file that you could get started with without any installation. If your version requires installation, then do it yourself, since there are no special requirements or settings. When you first launch it, the software will ask you to specify the ‘Workbench’ where your codes and related files are located. Please indicate a location that is convenient for you.

Once completed, you will be presented with the following:

If you want to get a little familiar with Eclipse before you start, open the Help window and look through the Workbench User Guide. You can also see the Development User Guide here, which will help you learn basic Java skills if you are not yet familiar with the language.

Download Android SDK

Follow this link and click ‘Get the SDK’. On the next page you will be given a link to install the Android SDK on your computer.

Once the download of the executable file is complete, start the installation. When you reach the window below, specify the path to the directory where you want to install, or remember the one that is already specified.

When the installation is complete, open Android SDK Manager, and then you will see the following window:

Click the button to install any required packages and resources that were not included in the original installation.

Install the Android Development Tools plugin

As noted above, Google offers a special Android SDK plugin for Eclipse that can be added directly from the IDE.

In Eclipse, go to 'Help' and select 'Install New Software'. Click the ‘Add’ button and you will then be taken to a window that will allow you to add an online software repository containing the ADT plugin. Give a descriptive title, and enter the following URL in the ‘Location’ block:

  • http://dl-ssl.google.com/android/eclipse

Click 'OK'. Select the newly added repository and check the ‘Developer Tools’ checkbox.

Click ‘Next’ and go through the steps to install the plugin files. Once completed, the following 2 icons should appear in your Eclipse Control Panel:

Now go to 'Window' and 'Preferences', select the 'Android' section and make sure that the SDK Location matches the SDK directory you specified earlier. As a result, you should get the following:

You are now the owner of the Android Development Tools plugin.

Setting up an Android emulator

While this helps, you don't actually need to have every model of Android device on hand to create apps for them, as Google provides us with a great emulator of its own mobile OS along with an SDK. Before starting development, it is advisable for us to configure the Android Virtual Device (AVD) so that the testing platform is ready in advance.

Now we need to create a new virtual device. This example assumes the creation of a general device, but there are also resources for specific settings for Android devices. Select ‘New’ and you will be presented with an empty window like the one below:

  • Name: If you want to test the application on multiple device settings, then you will need to enter something descriptive. On the other hand, a more general name can also be used.
  • Target: This is the version of Android that the emulator will target. In most cases, your option will be the latest version of Android, which comes with the SDK you install. However, if you want to test on earlier versions (which would be quite wise, given there are so many different versions and models), then use the SDK manager to install additional versions.
  • SD card: Indicator of additional storage space to be used in the device. By default, the virtual device has 194 megabytes of “internal” memory and an SD card, so you will need to manually specify the required amount of disk space.
  • Skin: You can use this option to set the appearance and configurations of a specific device (HTC One X, for example). But in our case we use the standard value.
  • Hardware: Since there are significant differences in hardware among physical Android devices, you can use this option to add any hardware that will be used by your application.

When finished, the AVD Manager window should include your newly created device. You can click ‘Start’ to start this device, just be aware that the first startup may take some time.



Your first Android project

Now that you have equipped your computer with all the necessary applications and plugins, you can start developing code. But first we need to prepare the project files.

To get started, go to 'File', 'New', 'Project' and open the Android tab. Select ‘Android Application Project’ there, and the following window will open in front of you:

You can use the drop-down menus next to each field to select the appropriate value. The main thing to consider is the ‘Application Name’, which is responsible for the name of our application during installation, as well as the ‘Minimum Required SDK’, with which you indicate the earliest version of Android that supports your application.

Click 'Next' to continue and set an executable icon to be the face of your application. The next menu will ask you to create an ‘Activity’ for your application.

This is the action or view that the user will interact with, so the most logical thing to do is to divide your application into activities in terms of which windows the user will see and what functionality will be available in each of them. So, if you are, for example, creating a simple "Hello World" program, then you only need one active window that represents the text, and all the interface settings are pulled from the resource files that the SDK creates.

When you have decided on these windows, click ‘Finish’. Eclipse will gather all the files needed for the application together into which you will write code and/or change settings to specify the parameters of your program.

And that is all! Everything is ready to assemble the finished application. You can find comprehensive tutorials on Google on how to develop Android apps (for those with programming experience). Anyone looking to get into Java programming should also first read tutorials like the one provided by Oracle.

How does the Android development process work? Let's highlight a few basics:

  • In Java files, you describe program logic—what you want your application to do.
  • In XML files you develop layouts - the appearance.
  • Once the app is written, you need to use a build tool to compile all the files and package them together into an .apk file that can be run on Android devices and/or published on 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 will open to edit your code files and compile and run them.
  • Previously, the standard IDE for Android development was Eclipse, but it has now been replaced by the more functional Android Studio, a Google product.

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 there will be links to useful resources that every Android developer should be familiar with. The first one is the official documentation from Google.

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

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

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 start working with the Android platform, you need to set up a development environment.

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

It's important not to let any pitfalls get in the way of your ultimate goal of learning Android programming. It is known that even professionals sometimes experience certain problems with setting up their working environment. In such cases, command line knowledge is important. If you'd like to become more familiar with this tool, there's a link to a good introductory one below.

Along with training in syntax, it is important to train yourself to have the mindset of a successful programmer, which will not accept the error message file X not found as a final verdict. This kind of thinking is easily trained by you in cases where you do not give up and look for a solution to the problem that has arisen.

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

Click on the download button and you will be asked to read the terms and conditions of use of the software product. After carefully reading (as you always do) and accepting, the download begins. This will probably take a few minutes. After this, you can install Android Studio just like any other program. The initial download page contains installation instructions for Mac and Windows.

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

You should see a beautiful loading screen in Material Design style.

Once the download is complete, you will be taken to a welcome screen.

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

In this case, always select Update and Restart. Great! 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 with something simple. Programmers usually call the first program “Hello World”. Let's follow this tradition and then make a few small changes so that the app uses your name as a 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 that will help you create 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 does.

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

For more 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 the version, the starting template selection screen opens. You can create an application that already interacts with the google maps api and displays 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 you click Finish, pay attention to a few things. This is the first time you come across references to 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 element is very flexible. When Android Studio creates the MainActivity class, it inherits it from the Activity class in the Android SDK. Those familiar with object-oriented programming will understand this concept, but for beginners, this basically means that your MainActivity will be a customized version of the Activity.

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

Click Finish. It will take some time to create and download the project. After some time, Android 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 we move on to Android programming, let's talk about how we can run this application. It's time to say "Hello world!"

Running an application on an emulator

Now it's time to say a few words about the emulator. Android Studio comes with software that can emulate an Android device to run apps, browse websites, debug, and everything else on it.

This feature is provided by Android Virtual Device (AVD) Manager. If you wish, 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 multiple devices to test programs.

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

You'll have to wait a while for the emulator to load and once it's ready, you'll see something like this:

Congratulations! You've made your first Android app!

And so... Why and how did it work?

To start making changes and adding interesting features, you need to gain a working knowledge of what's 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 on the edge (see below) if the project explorer is not currently visible.

Browse your folder structure for a few minutes and double-click on files to see their contents in the main window. If this all seems mysterious, don't worry!

Android project structure: Team

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

Java: Professional

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

Resources: Artist

It's not enough to just make an Android application, it must also be stylish. Your app will never stand out if it doesn't have clear icons and images, well-designed layouts, and maybe even smooth animations.

When initialized, the folder contains the following folders:

  • drawable, which stores icons. Now there is only the standard application icon.
  • layout with XML files that represent screen designs.
  • menu with XML files of lists of elements that will be displayed in the action panel.
  • 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 Activities in the application. Do you need the work done by your application? Talk to your boss first.

Alteration

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

These resources are used in different places, but it is very convenient to have all the text used in your application in one file. If you need to translate it, or if your fellow marketer asks you to remove all the unnecessary links, it's easy to make all the changes here.

Change the hello_world string that the application displays on the screen. Change the content to something more personal, such as using your own name. You'll 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 completed your first project and learned how to edit the source code. The first step in Android programming has been taken. We wish you good luck on this difficult but incredibly interesting path! If you need professional Android application development, contact Infoshell specialists.

Do you have an idea to create a mobile application, but you doubt whether you have enough knowledge and skills to create it? Even if you don't know anything about creating mobile apps, you can still create one and even make money from it.

Idea

Work on creating an application begins with an idea. First, think about who you want to make the application for. For example, if you live in a big city where there are a lot of tourists, then you can think about creating an application for them. There are a lot of options.

Also, think about your hobbies and interests. Let's say you travel frequently and want to visit the most famous clubs around the world. You've made a list of your favorite places. Why not turn this database into a travel app?

Many well-known apps are not centered around specific interests, but the ones that always rank in the top three are games. You've probably already downloaded Temple Run, Minecraft to your smartphone. Gaming apps tend to make more money because users are more willing to pay for them, especially if they are very popular among your friends.

Don't be discouraged if you find something similar to your idea when searching through the App Store. Learn to think outside the box. For example, there are several apps that provide information and maps about all the most popular tourist spots in Moscow. But there is an application that provides information about unusual places in the city that not everyone knows about.

Try to come up with an idea that has few competitors. But if you are determined to turn your idea into an app despite the competition, take a look at your competitors and try to figure out what you can do to make your app better than theirs.

Here are some important points to consider as you think about your application:

Monetization options

Before you start developing an application, you need to decide how you will make money from it. There are several main ways to monetize applications:

  • Free application. Typically used by large companies, the app helps sell their products or services.
  • Free application with advertising. Used in popular applications that actively interact with the user
  • Paid application. The most popular and profitable type of monetization. Apple takes a 30% commission on every sale of your app.
  • Lite and Pro. The Lite app is free, but with a limited set of features. By purchasing Pro you will unlock all functionality
  • In-app purchases - you can sell new functionality or new game levels directly from the app

Development

Now you have an idea. Great, that's already half the battle! But what now? We assume that you, like most people, have no programming experience. And that's great! There are tons of options.

If you want to take the easy but more expensive route, then check out mobile app developer sites. The AppBooker website allows you to enter your platform, country, and budget, and it will then return a list of developers that meet your needs. Once you select a developer, you can see a list of their clients and the types of applications they specialize in.

A good list of domestic developers can be found here – ratingruneta.

Another option to find a developer is to contact flinaser exchanges. It may even be cheaper, but more risky, since you may come across an unscrupulous employee.

Here are some questions to ask your future developer:

What is the cost of their work?

Who have they worked for in the past?

Are their applications successful?

Will I have all rights to the application?

Do they have the experience and knowledge to bring your idea to life?

What platforms (IOS, Android, etc.) can they create applications for?

Development cost

As they say, to make money you must first spend it. This is not entirely true when it comes to mobile applications, but we will return to this below. For now, let's assume that you decide to order an application from the developer.

Depending on the type of application you want to make, the price can range from $500 to $100,000. This price may seem very high, but it is worth keeping in mind that the profit from a successful application covers the costs several times. In addition, gaming applications are the most expensive to develop and are also bestsellers.

If you already have some work in place (like layout and graphics), you can reduce the price significantly. Another way to reduce costs is to offer the developer a share of the profit from the application.

To find out approximately how much it will cost to develop an application, you can use the howmuchtomakeanapp calculator. It was created by the Canadian company ooomf.com. The resulting price can be safely divided by 2, and you will find out the price of development from us. You can also look at examples of applications they have already created with prices - crew.co.

Placing a ready-made application on the App store will cost you $99.9 per year. Placing an application on the Android Market costs $25.

This certainly isn't enough to live off of the app's earnings alone, but it's great if you just want to make a little extra money.

Of course, you can make another hit like Angry Birds that will earn you $100,000 a month!

In order to make good money on your application, read a few tips:

  • your application should be interesting to a wide audience
  • Explore the most popular apps on the market
  • Nowadays, it is easier to make money from iOS apps
  • make your application available for iPad