📜 ⬆️ ⬇️

How I wrote a simple application for Android / iOS

I want to immediately note that this is not an article from a professional, but rather an amateur's glance at mobile development, let's say, from scratch. My main activity is website creation. At this time, I work with an Internet provider and support internal billing / site, and so on (PHP and some Perl), quite a boring task, I tell you. In general, I am an ordinary provincial "programmer".

At one point, the company's management had the idea to make a mobile application for the iPhone, which could show the balance to the user, his status, the ability to take the "promised payment", in fact, duplication of personal account, but to the application. Not knowing anything about mobile development, I took the idea with great enthusiasm, because it is always nice to do / learn something new, I think it’s all so.

Having come to work on one of the dull gray days, I decided and wrote “how to make a mobile application” in Google search. It was very naive. It seems that I even tried to ask a question on Toster, “where to start developing for mobile applications,” then I didn’t understand how stupid this question was taken by professionals.

Pretty quickly, I divided the development into two parts, it was Android and iOS, because they are completely different (search prompted.
')
Somehow I stumbled upon Phonegap, as far as I understood, we write Javascript + html + css, and then we get a ready-made application for Android / iOS, but for some reason I did not want to use such solutions, first: there were incomprehensible reviews, who praised, someone scolded, and secondly: I would like to try it from the inside, what is the "native" application to do.

Plan and preparation


Actually, the idea is quite simple:

For the functioning of the application, I wrote the simplest API in PHP, a script that, for a specific request, answered with a string in JSON format. Make it turned out to be elementary.

I decided to start with Android.

Android


I started with the installation of Android Studio, I was initially confused by the number of buttons / icons, but in a couple of days I was like a fish in water. To begin with, it was necessary to understand how applications are generally made, the initial “Hello world!”, Which is created by default, helps a lot. Everything looked quite simple and clear. Googling "How to start development in Android Studio", I realized that I need to download the SDK. Having opened the SDK-manager, I did not understand anything at all, well, more precisely, I did not understand what exactly to do, so I ticked all the checkboxes and waited until everything was downloaded. For what I need it, I didn’t understand at all, of course, the general idea was “for the support of such and such a version to work,” but why should you download everything and choose among hundreds of checkboxes - brrr.

The second rather difficult step was to run the application on the simulator. Googling, I had to tinker with AVD, of course, while poking around like a blind kitten, I made several virtual devices. One even started the application. Honestly, the Android Studio simulator is not User-friendly at all, I fought with it for a very long time, tried to launch it in different ways, I wanted the control buttons to be on the screen and work, but for some reason they did not work. Apparently, a lack of experience.

As it turned out, for Android they write in Java. All I knew about Java was that it was a programming language and it was not Javascript.
I decided to break the big task into smaller ones.

Now a situation arose when, in principle, everything was ready for me, but I didn’t know how the application was being made at all, therefore, by Google, I realized that I couldn’t find any normal information in Russian (or I was looking bad). The information is either outdated or not what I need. Saved me youtube and knowledge of English. Having made a few requests in youtube you can find a lot of information, and even with the process itself - it would help a lot if it were not for the training videos, I think, I would do the application for several months.

Choosing the minimum version of Android, I stopped at 4 something there :) (audience coverage is 90% + according to Google).

Again, breaking down my tasks into smaller ones, I was looking for tutorials on youtube, for example: “how to get json in android” or “menu in android studio”. Of course, I had to review 30 pieces of different videos and they were all in English (one in German and one in Chinese - when they show it’s not so difficult to get what they say :)).

Development for Android took about a week since the installation of Android Studio. After that, having taken the tablet from my son, I was able to test my application on a real device — simply by connecting it to a computer.

Publish to Google Play


At first, I thought it would be very difficult and even worried, but as it turned out, only $ 25 and virtually without any serious checks the application got into Google Play and after a few hours it was available in the search, the publication took about one day.

iOS


Having had a rest for a couple of days and having thought it over, I decided that it was time to implement the same application under iOS. But it turned out that the free xCode development environment can be run exclusively in the Mac environment. I had to download the MAC OS Yosemite virtual machine image and run it through VMWare. It was very simple to do this and in fact did not require any gestures from me except to “wait”.

After that, I downloaded xCode and started to figure it out, things went faster, because the development for mobile devices is for Android, which for iOS is roughly similar in its ideas.

Programming language chose Swift. IOS version minimum 7.1+

In principle, development under iOS was simpler, although the simulator's bugs were present, but the whole process turned out to be more convenient than under Android. Again, I opened youtube and watched videos / read manuals on how to do something. For example, googled a wonderful script that makes the slide menu, which I did not have in Android. In general, one more marathon was completed in the week with an improved application, added the ability to replenish an account using a prepaid card and combined payments / debits into one window.

I used the same API (the same script as for Android).

IOS Publishing


It all turned out not so rosy and easy as in Android. First, it turned out that I needed a real device for testing the application, and without it I couldn’t publish it. I had to search for the iPhone and link it to the testing profile.

Again, when creating an account, there was a choice between “company” and “individual developer”, but after reading scary stories about 4+ months of company verification, I decided to register as an individual developer. It was not difficult to do this, the main thing is to pay $ 99 for an iOS developer account from your credit card so that the name matches (suggested search). Payment took place 2 days.

After that, I had to look for the whole video “how to publish in app store” and follow the instructions, so everything is unclear. Some certificates, back and forth. In general, it is not very convenient, although you only need to do it once :).

The application went to check and waited for the queue for about one and a half weeks. After which it was taken. By the way, as the logs showed, the check was something like this: Login -> Balance -> Payments -> Balance. And yet, even though there was another page “To replenish the balance”, but it was not checked (and in vain, I messed up there and had to upload a new version of the program 1.1 which was also checked for more than a week).

findings


1. As it turned out, it is not difficult even for a person who has never used Java / Swift / Mac OS.

2. A lot of new information made my brain just overflow in the first days and hang. Only sleep helped, after it I understood more clearly what to do next. Do not be afraid of such stages. Sometimes it seemed to me that “I don’t understand anything at all,” there was a feeling that I was beating my head against a concrete wall. But the next day I solved the problem. For example, in Android, at the very beginning I had a situation “nothing works” when I connected to the server and had to receive information, it turned out that I had to do it in an asynchronous stream. Spent the whole day.

3. Very fast obsolescence of manuals / video lessons. Platforms are developing so fast that it is necessary to immediately check the relevance of the information. In Russian, it is very small, after several attempts, I even gave up looking and immediately began to study stackoverflow and the English-language Internet. Youtube with their video tutorials just saved me! I opened the video on one monitor and worked on the second. Without basic English - nowhere.

4. Question-answer services really help! Sometimes, falling into a stupor, I asked questions and almost immediately received answers - it is very convenient if you are at an impasse.

5. Apple is more sensitive to the publication of applications, but I did not notice any special problems except a long time. Android does everything very quickly (but they let everyone in a row, as I understood).

6. In total, I spent almost a month (on the development of about two weeks with interruptions). Was it worth it - I think so, it was very interesting. If you have a desire - try it, everything was not so difficult. I do not have an Android / iPhone smartphone, but even without them everything turned out to be simple. Simulators work reliably.

The application is called dagotel, but it was created for customers, so it will not allow further login. Is that look at the screenshots.

I have no idea why I wrote this article and what goals I pursued, but once I wrote, I decided to publish it.

Source: https://habr.com/ru/post/258515/


All Articles