The history of creating a mobile application for children that allows you to earn money with your mind. Continuation

Continuation of the development history of the mobile application iOS / Android to motivate children to do mathematics


This is the second part of the story (mixed with a story about my mistakes and their solutions) about how I (about two years in my spare time) developed a mobile application (for iOS / Android) that would motivate my daughter to solve math examples. In the end, it turned out the application that allows the child to make money with his mind.


Read the first part here .


Second part plan



Little things in programming that make my life easier



Use // todo to create a task list



use of regions in code



The example below shows a traffic light corute, which infinitely (every ten seconds) lights up yellow, red, green light in turn:


IEnumerator TrafficLights() { while (true) { yield return new WaitForSeconds(10f); yield StartCoroutine(this.GetComponent<Lamp>().BlinkYellow()); yield StartCoroutine(this.GetComponent<Lamp>().BlinkRed()); yield StartCoroutine(this.GetComponent<Lamp>().BlinkGreen()); } } 

If it is in human language, the yield instruction tells Unity to transfer the execution of the function to the next frame (as many times as necessary) until it is executed, and then proceed to the next yield instruction. So Korutina TrafficLights will run like this:


  1. first waiting 10 seconds (first yield)
  2. then BlinkYellow's corutin starts (second yield) and until it completes, BlinkRed's corutin does not start,
  3. on completion of BlinkYellow BlinkRed is launched,
  4. on completion of BlinkRed BlinkGreen is launched,
  5. then the cycle repeats from the beginning (see point 1).

Version control, well, just really necessary!


The video that helped me start using GitHub in conjunction with Unity - How to use GitHub with Unity .


Despite the fact that I myself (alone, without a command) write code, I realized that I simply need to control the versioning of the code:



That's just when working with version control, you need to train yourself to commit (post updates) in very small portions. So that I didn’t have my first, I changed 20 files, added a ton of new functionality and zakomitil it all at once under the name “Fuh, now it finally works”.


It is good that I once figured out that it is better not to add cache files (Library folder), temporary files (tmp folder, obj folder) to the repository, and all that Unity generates on the fly. In fact, only the Assets and ProjectSettings folders had to be added to the repository.


It is not necessary to use GitHub, because its disadvantage is that in a free account it is impossible to make the code private (visible only for yourself). But there is a GitLab or Bitbucket , where possible.


How I tprprrruhal into the microphone


I perceive my application as educational and try, if possible, not to use distractions. Therefore, sometimes users complain, for example, about the lack of music or a very simple interface (although a simple interface is not because I wanted it, but more because I don’t know how to do it better). With music, I’m a bit at a crossroads now: and I want to add and prick (it’s unlikely teachers would approve homework in math to music).


Music, music, but without voice acting is impossible. At first, I searched for the sounds I wanted among free-of-charge, but then I realized that it took longer to search than if I did them myself. Therefore, I simply created most of the sounds with my mouth into a telephone microphone, and then processed it with Audacity (a free multiplatform software for recording and editing audio, which I used to convert audio from one format to another).


Most often, the sound effect creation logic in Audacity was as follows:


  1. Cut off all unnecessary.
  2. Used effect Noise Reduction (to remove noise from the recording).
  3. Added wahwah effect to cartoony sound.
  4. The effects of Bass and Treble played with frequencies, so that the sound sounded more delicious on the speakers of smartphones.
  5. If I said something, then by the effects of Change Pitch, Speed ​​and Tempo changed the sound of your voice to Chipmunk.

At first, my sound was far behind the event (not in the editor, but on the smartphone). The DSP Buffer Size option set to Best latency mode (Edit -> Project Settings -> Audio) and these tips helped (both in the question and in the answer).


How Daughter Generated Icon Ideas


While I was developing the application, I tried to create the icons myself several times, but none of them got accustomed (and in truth, some sort of dimness came out). Therefore, when it came to open publication, I commissioned the development of an icon for my daughter. I explained to her that the icon should be attractive and explain the meaning of the application. She came up with great enthusiasm and instantly drew a completely unsuitable picture. I rejected it and explained what exactly needs to be improved or not to use at all. Then everything went as expected - she was offended and stopped drawing icons.


After half a month, the insult passed and she approached the task more thoroughly: she cut squares from a notebook into a cell (in size as an icon on the screen of her iPod) and started drawing options one by one:


Variants of icons drawn by the daughter


Brought me. I chose the ideas I liked. He said in which direction to move on. She went to draw the following options. Two days and three dozen options, we stopped at the lower right (photo above).


Next, I asked my daughter to draw an enlarged version of the icon (the first on the left in the figure below), which I digitized (the second on the left) and ... called a familiar artist to help me with the color selection. As a result, the central version was obtained. Then I gradually began to grind the icon (second from right) throughout the life of the application in stores. And now it looks like the extreme right:


The progress of creating icons


Build under Android


With the creation of my first apk-file, this Unity Android Build-How to video helped me figure it out, which tells you how to set everything up without installing a heavy Android Studio.


I repeat that I do not have devices with Android (I just ask my friends to test after the new build) and therefore there were no errors with the devices shown in the video.


But without a hitch it still wasn’t. I had to tinker with the update of the Android SDK for a long time, since Unity did not want to work with the latest updates. As a result, it turned out that it was necessary to allow Unity to choose and install the necessary version of the update. Those. I just clicked the Update Android SDK button in Unity itself, and did not try to update everything myself, as shown in the video.


Problem when updating the Android SDK manually

Until I figured out that I needed to be updated from under Unity, I suffered for a long time, manually updating using the sdkmanager.bat script (you need to use this script with the --update parameter, and not the android.bat that is specified in the video). During the update, he complained that he could not overwrite the tools folder (from which he himself started). I tried a bunch of tips and I do not even remember what helped, it seems like some kind of solution with symboli links.


I also got strange errors related to java. It turned out that the problem with the version of Java Development Kit - it also did not need to install the latest version. I tried a few old ones and on one of them the errors disappeared and it all worked.


With the signature of apk-ashk for publication on Google Play, I was helped by the video How to sign a Unity app for the android market . I saved and saved these two passwords well, because they need to be entered each time you create a new build. And if you lose them, you will not be able to update the application (just release a new one with new keys).


The icon, unlike the iOS version, needs to be initially made with rounded corners, otherwise on some devices, it will remain perfectly square.


Android build size


Now my apk-file size is 22MB.


I have well reduced the size of the assembly using a lossy texture / sprite compression format — RGBA Crunched ETC2 (for alpha sprites) and RGB Crunched ETC (for textures without an alpha channel). The main thing was to set Compressor Quality = 100 (this parameter does not affect the speed of the textures on the end device, but only on the quality of the texture and the speed of compression in the editor).


Any other dances with tambourines did not allow me to achieve any significant reduction in the size of the apk-file (except for some of the nuances described below).


Now I use the following ..


.. settings from Player Settings ..


.. for the minimum size on the one hand and the maximum coverage of devices on the other:



Build under iOS


I collect the application on my wife's MacBook (I remember, they took the cheapest MacBook Air of 2015).


To compile under iOS 7 even in XCode version 9.3, it was enough to manually drive in the value 7.0 in the Deployment Target field (on the General tab).


To add languages ​​(to which I transferred the application using Lean Localization) to the application description in the AppStore, you had to add the following lines to the info.plist file (at any place, for example, immediately after <dict>):


 <key>CFBundleLocalizations</key> <array> <string>English</string> <string>Russian</string> </array> 

Now I use Unity 2017.4 for building on iOS (as I wrote above, I need iOS 7 support, otherwise I would use 2018.1).


IOS build size


Now the size of the downloaded file under my iPhone is 44 MB.


Unfortunately, under iOS, I cannot use Crunched sprites, as they are not supported on devices older than iPhone 5s ( without the support of Metal and OpenGL ES 3.0 ).


When I tried to reduce the size of the build at any cost, the smallest size (34 MB) was obtained if:



But I still haven’t figured out at all how to work with app thinning - this is such a thing that allows appstore to automatically build my application for a specific end-user’s iPhone / iPad / iPod (which reduces the size of the downloaded file). I just managed to bookmark my articles to jot down:



My Player Settings I want to share:



How I chose the name and what I used to promote


How many used Booking and TripAdvisor, but never noticed that their name in the AppStore is not just Booking, but “Booking.com Travel Deals” and “TripAdvisor Hotels Restaurants” (the name is diluted by keywords so that these keywords found in search of an apstor). So I decided not to use the old name Math4Ami, but for a long time I played with different wording to include the keywords I needed. As a result, I first came to Pocket Money: Math, and later to Learn Math & Earn Pocket Money. In Russian, these options sounded like "Pocket money for mathematics" and "Pocket money and mathematics: learn and earn."


I promoted my application by sending / publishing links to it to friends and acquaintances, I wrote two articles on my blog and hung up the banner there.


By the way, if you put this line in the <head> web page:


 <meta name="apple-itunes-app" content="app-id=1372434662" /> 

.. then, opening this page on the iPhone, everyone will see at the top of the banner of your application.


Download statistics


First I released the iOS version.


IOS app download statistics


Many people talked about dislike for apple devices and convinced that Android is much cooler. I decided to check and, after 20 days of proceedings with the assembly of the apk-file, made a release on Google Play.


Statistics of installations of the application on Android


Objective conclusions can not be made here (or none at all), but purely subjective - I expected more from the Google platform, but at the moment it turned out to be half as bad as Apple.


I regret that:



I realized that:



Links


List of links from the article in the order of their mention:


+ How to keep a single code style C # Style Guide with Unity in mind .
+ GitHub and a video on how to tie git to Unity .
+ Free private repository is on GitLab or Bitbucket .
+ Free Audacity to record and edit audio.
+ How to remove the delay sound .
+ Unity video tutorial Android Build - How to .
+ Video How to sign a Unity app for the android market .
+ Apple devices supporting Metal / OpenGL ES 3 .
+ App thinning (Apple documentation).
+ App thinning (Unity help).
+ AssetBundle Workflow (Unity documentation).
+ Team ID .
+ .
+ / UE4 .


, !

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


All Articles