Теперь Кью работает в режиме чтения

Мы сохранили весь контент, но добавить что-то новое уже нельзя

Как создать apk? Имеется все для создания.

У меня есть исходники компилятора в apk.
Сама компиляция выполняется с телефона.
Как можно пересобрать имея все файлы компилятор?

Компьютерная помощь+4
Анонимный вопрос
  ·   · 8,4 K
Лучший
Эксперемент  · 16 янв 2021

Установите Android Studio

Cледующие снимки экрана были сделаны c Android Studio версии 3.6.1. Экран может выглядеть несколько иначе в зависимости от используемой версии Android Studio. Но следует постараться найти свое решение установки. Помощь от сообщества здесь.

Одна из наиболее важных заповедей при установке Android Studio: Будьте терпеливы! Во время установки и настройки Android Studio загружает многие элементы, которые отнимают время.

Установите Android Studio и настройте при первом запуске.

Выберите “Не импортировать настройки”, так как вы не использовали их раньше.

Не импортируйте настройки

Решите, хотите ли вы совместно использовать данные с Google или нет.

Обмен данными с Google

На следующем экране нажмите кнопку “Далее”.

Экран приветствия

Выберите “Стандартная” установка и нажмите “Далее”.

Стандартная установка

Для интерфейса выберите тему, которая вам нравится. (В этом руководстве мы использовали “Светлую”.) Затем нажмите кнопку “Далее”. Это всего лишь цветовая схема. Можете выбрать любую (напр. Darcula для темного режима). Этот выбор не влияет на построение APK.

цветовая схема UI

Нажмите “Далее” в диалоге “Проверить настройки”.

Подтвердить настройки

Подождите, пока Android Studio скачивает дополнительные компоненты и будет терпеливы. После того, как все загрузится кнопка “Готово”, станет синей. Теперь нажмите на кнопку.

Загрузка компонентов

Задайте путь к git в параметрах

Убедитесь, что git установлен на вашем компьютере.

На экране приветствия Android Studio нажмите на маленький треугольник (1. на следующем снимке экрана) и выберите “Настройки” (2.).

Параметры Android Studio с экрана приветствия

Windows

Нажмите на маленький треугольник рядом с Контролем Версий (1.) чтобы открыть подменю.

Нажмите Git (2.).

Убедитесь, что выбран метод обновления “Слияние” (merge) (3.).

Check if Android Studio can locate path to git.exe automatically by clicking the button “Test” (4.)

Android Studio settings

If automatic setting is successful git version will be displayed.

Click “OK” in the dialog box (1.) and “OK” in the settings window (2.).

Automatic git installation succeeded

In case file git.exe cannot be found click “OK” in the dialog box (1.) and then the button with the three dots (2.).

Use search function in windows explorer to find “git.exe” if you are unsure where it can be found. Вы ищете файл git.exe, находящийся в папке \bin.

Select path to git.exe and make sure you selected the one in \bin\ folder (3.) and click “OK” (4.).

Close settings window by clicking “OK” button (5.).

Automatic git installation failed

Reboot your computer to update system environment.

Mac

Any git version should work. For example https://git-scm.com/download/mac.

Use homebrew to install git: $ brew install git.

For details on installing git see the official git documentation.

If you install git via homebrew there is no need to change any preferences. На всякий случай: Их можно найти здесь: Android Studio - Настройки.

Скачайте код AndroidAPS

If you haven’t already rebooted your computer after setting git path in preferences do it now. System environment must be updated.

There are two options to start a new project:

On the Android Studio welcome screen click “Get from version control”

Check out project from version control from welcome screen

If you already opened Android Studio and do not see the welcome screen anymore select File (1.) > New (2.) > Project from Version Control... (3.)

Check out project from version control within Android Studio

Fill in the URL to the main AndroidAPS repository (https://github.com/nightscout/AndroidAPS) (1.).

Choose the directory where you want to save the cloned code. (2.)

Click button “Clone” (3.).

Clone repository

Do not click “Background” while repository is cloned!

No background action

After repository is cloned successfully open your local copy by clicking “Yes”.

Open repository

In the lower right corner you will see the information that Android Studio is running background tasks.

Background tasks

Grant access if your firewall is asking for permission.

Firewall permission java

Once the background tasks are finished you will probably see the following error message:

SDK licence

Загрузите Android SDK

Click File > Settings.

Open settings

Click the small triangle next to Appearance & Behaviour (1.).

Click the small triangle next to System Settings (2.) and select Android SDK (3.)

Check the box left of “Android 9.0 (Pie)” (4.) (API Level 28).

SDK settings

Confirm changes by clicking OK.

Confirm SDK changes

Accept licence agreement (1.) and click “Next” (2.).

Accept SDK licence

Wait until installation is finished.

Wait during SDK installation

When SDK installation is completed the “Finish” button will turn blue. Click this button.

Finish SDK installation

Android Studio might recommend to update the gradle system. Never update gradle! This might lead to difficulties!

If you see an information on the lower right side of your Android Studio window that Android Gradle Plugin is ready to update click on the text “update” (1.) and in the dialog box on “Don’t remind me again for this project” (2.).

No cradle update

Создание подписанного APK

Signing means that you indicate your app to be your own creation but in a digital way as a kind of digital fingerprint within the app itself. That is necessary because Android has a rule that it only accepts signed code to run for security reasons. For more information on this topic, follow this link.

Нажмите “Build” в строке меню и выберите “Generate Signed Bundle / APK...”.

Построение apk

Выберите “APK” (1.) вместо “Android App Bundle” и нажмите кнопку “Далее” (2.).

Apk вместо пакета

Make sure that module is set to “app” (1.).

Click “Create new...” (2.) to start creating your key store.

A key store in this case is nothing more than a file in which the information for signing is stored. It is encrypted and the information is secured with passwords.

Create key store

Click the folder symbol (1.) to select your key store path.

Select the path where your key store shall be saved (2.). Do not save in same folder as project. You must use a different directory! One option might be your home folder.

Type a file name for your key store (3.).

Click “OK” (4.).

Passwords for key store and key do not have to be very sophisticated. Make sure to remember those or make a note in a safe place. In case you will not remember your passwords in the future you see troubleshooting for lost key store.

Enter (5.) and confirm (6.) the password for your key store.

Do the same for your key (7. + 8.).

Validity (9.) is 25 years by default. You do not have to change the default value.

First and last name must be entered (10.). All other information is optional.

Click “OK” (11.) when you are done.

Key store path

Make sure the box to remember passwords is checked (1.). So you don’t have to enter them again next time you build the apk (i.e. when updating to a new AndroidAPS version).

Click “Next” (2.).

Remember passwords

Выберите вариант компоновки “fullRelease” (1.).

Отметьте флажки V1 и V2 для подписи версий (2.).

Нажмите Finish. (3.)

Завершение сборки

После завершения сборки Android Studio покажет информацию “APK (s) сгенерировано успешно ...”.

В случае, если сборка не удалась, обратитесь к разделу поиск и устранение неисправностей.

Самый простой способ найти apk это нажать на кнопку “журнал событий”.

Построено успешно - журнал событий

В секции журнала событий нажмите «locate».

Журнал событий - обнаружить apk

app-full-release.apk это файл, который вы ищете.

Расположение файла apk

Перенос приложения на смартфон

Самый простой способ перенести приложение на ваш телефон - через кабель USB или Google Drive. Обратите внимание, что передача по почте может вызвать трудности и не является предпочтительным способом.

На вашем телефоне необходимо разрешить установку из неизвестных источников. Инструкции, как это сделать, можно найти в интернете (например здесь или здесь).

Идентифицируйте ресивер при использовании xDrip+
See xDrip+ page

Как создать APK - файл