Как сделать интернет в mit app inventor

от admin

LABA 120 — самодельный Веб сервер на телефоне под Андроид

домашний веб сервер - http://aeha.narod.ru/appinv/webserver/

Вид В браузере на мониторе компа

Для примера выводить будем информацию о состоянии
батареи устройства и параметры сотовой сети
как то код оператора ID сотовой вышки и номер позиции сотовой ячейки

так как апп инвертор «MIt App Inventor 2» напрямую не поддерживает
эти операции в проекте используются расширения от сторонних разработчиков

App Inventor Thunkable Extensions

com.KIO4_SimpleWebServer.aix
com.puravidaapps.TaifunTM.aix
com.puravidaapps.TaifunBattery.aix

ни чего секретного, они бесплатны и легко скачиваются

web app server - http://aeha.narod.ru/appinv/webserver/

компонент веб сервера SimpleWebServer.aix прост как
ситцевые трусы, может транслировать в сеть сайт из файла расположенного
на флешке, или из текстовой переменной.

мне не удалось прикрутить картинку тегом
< img src=»http://aeha.narod.ru/ws.png» > ни так <img src=»http://aeha.narod.ru/sdcard/ws.png» >

и таблицу стилей

< link rel=’stylesheet’ type=»text/css» href=’/user.css’ >

хотя стили можно задать непосредственно в тегах сайта
а вот с картинками — печалька (на самом деле проблема давно решена **)

<a href=’/sdcard/ws.png’> Скачать ws.png </a>
<a href=’/sdcard/main.htm’> На главную </a>

так же не удалась попытка, перейти на другую страницу, и скачать по ссылке файл

ну да ладно, и без картинок тема достаточно грандиозная

Наверно для многих не секрет что на телефонах имеется
несколько сетевых устройств. Это сама сотовая сеть
и WiFi. Если сотовая сеть находится в мировой паутине
без посредников. То WiFi обращается туда через —

* точку доступа
* маршрутизатор
* роутер

Такое построение сети имеет некоторые ограничения
И если точка доступа не ваша, а типа общественная,
то ограничения эти труднопреодолимые, есть конечно методы
Можно поломать или договориться.

app inventor 2 - http://aeha.narod.ru/appinv/webserver/

В своем роутере понадобиться настроить проброску портов

Настройка портоа на ASUS

Trigger Port — это когда внешний запрос может пройти
на устройство в сети с указанным ип IP

эта тема избитая, наверно нет смысла переписывать из
других источников

У этой красоты есть еще один момент, В мировой паутине,
ИП «IP» много — красивых, и разных. Так который из них нужный?
Для точки доступа, можно заказать у провайдера статичный ип
который не будет меняться никогда. За это возьмут несколько денег

Для мобильного интернета такая услуга тоже предоставляется операторами.
Вот только что нашел

Настройка статического IP-адреса на МТС
Плата за активацию: 100 рублей;
Абонентская плата: 5 рублей в ежедневном формате;
Плата за отключение опции: отсутствует.

прогресс на лицо цены смехотворные

Для тех парней, которым важнее не цена а принципы
Есть вариант использование бесплатного (на момент написания)
сервиса Dynamic DNS на http://dnsip.ru/
Регистрация проста, сами разберетесь

В результате получите доменной имя типа такого — «ваше название».hldns.ru

Тогда ваш андроид сайт — http://»ваше название».hldns.ru:8080

порт 8080 это для обращения к устройству которое работает в сети через ГПРС «GPRS»

или «3G» — кому как нравится.

При работе через Wifi и точку доступа, для внешних обращений
порт будет — какой настроите, внутри домашней сети,
все тот же 8080, пока не известно как это изменить.

Теперь, по этому доменному имени можно обращаться с любого девайса из
любой точки мира!

После смены IP в сети, а это случается —

* после перезагрузки роутера
* при перемещении телефона от вышки к вышке
* Просто время от времени

Новый IP необходимо передать на сервис http://dnsip.ru/
Обновление доменного имени займет несколько минут.
Что вероятно для GPRS существенное препятствие,
ибо там IP меняется при перемещении аппарата весьма часто.

В зависимости от модели на телефона
поведение программы в фоновом режиме может быть разным
На Алкател (alkatel) 4034D, после погашения экрана
и ухода аппарата в спячку веб сайт не перестает работать
но скорость его работы снижается, не удобно но не смертельно

Уход в спячку можно предотвратить выставив в настройках телефона
— не выключать экран, при подключенной зарядке.

на других аппаратах смотрите сами, отчет о проведенных тестах
приветствуется

Описание блоков программы

mit app inventor 2 - http://aeha.narod.ru/appinv/webserver/

01

На верх
Здесь объявляются глобальные переменные
текстовая переменная Text — похоже это в данном проекте не используется
текстовая переменная Meta — здесь теги Мета и неизменяемая часть нашего сайта
======================================
< html> <head >
<meta http-equiv=»Content-Type» content=»text/html; charset=utf-8″>
<meta http-equiv=»Refresh» content=»5″>
<style type=»text/css»>
.d
.d1 < font-size: 105%; color: red ;>
.d2 < color: blue ;>
</style>
<title> LABA 120 — Новые горизонты < /title>
</head> <body> <br> <img src=»http://aeha.narod.ru/ws.png» alt=’КАРТИНКА’ title=’четонету’>
<br>
<h1> Новые горизонты №1 </h1> <br>
</b>

======================================
числовая переменная
refresh_ip — счетчик времени для обновления внешнего IP
ибо, чаще чем раз в 5 минут там делать нечего

текстовая переменная body — сюда блоком JOIN собирается весь сайт
который передается веб серверу для отправки

app inventor 2 +на русском - http://aeha.narod.ru/appinv/webserver/

**********************************************
02

Обработчик when Screen1.initialize
срабатывает при запуске приложения на Андроид девайсе
в нем:
KIO4_SimpleWebserver1.ServeText присваиваться переменная
в которой содержится весь сайт

метка l_ip.text методом KIO4_SimpleWebserver1.GetIp
получает значение внутреннего IP если выход в интернет происходит через WiFi и

При коннекте через GPRS или 3G, тут будет
IP внешней сети

В компонент Таймер устанавливаются параметры
Clock1.TimerAlwaysFires — True дословно
Таймер Всегда Срабатывает, вероятно всегда, но бля по разному

Clock1.TimerEnable = True, а что же еще?
Clock1.TimerInterval = 5000 , это пять секунд

app inventor 2 скачать - http://aeha.narod.ru/appinv/webserver/

в метку l_cnt.text блоком TinyDB1.GetValue
считывается из базы приложения, значение счетчика
которое записывается туда при нажатии кнопки STOP
для чего? да просто так
**********************************************
03

процедура OUT_IP
в label — l_staus.text заносится информация о том
что кнопка была нажата

свойству Url компонент Web1 — присваивается адрес
на Бесплатный сервис DDNS hldns.ru

метод Web1.Get — выполняет запрос

При запросе специальной ссылки обновления система автоматически обновит на нашем
http://hldns.ru/update/»ваш ключ»

сервере Ваш ip-адрес и максимум в течении 5 минут он станет доступен по имени.

Обработчик when Web1.GotText
срабатывает когда компонент Web1
получает ответ и заносит в метки

l_out_ip.Text — ваш внешний IP
l_sattus.Text — код ответа сервера

app inventor 2 уроки - http://aeha.narod.ru/appinv/webserver/

****************************
04

Обработчик when TaifunBattery1 BatteryChanged
проверяет изменения в состоянии батареи устройства

и заносит в шесть штук label
соответствующие значения

status, plugged, level, health, temperature, voltage
состояние, подключение, уровень, здоровье, температура, напряжение

особенно про здоровье клево сказано

ну и наконец вызывается процедура SAVE

thunkable - http://aeha.narod.ru/appinv/webserver/

************************
05

Обработчик when Clock1.Timer
срабатывает каждые 5 секунд, помните настройки таймера?
и вызывает процедуру NET в которой с помощью подключаемого компонента
(App Inventor Thunkable Extensions ) TaifunTM1 снимается информация о
состоянии сотовой сети у самого компонента TaifunTM1 функций много, в данном проекте
используется только три из них

в метку
ll1.text = заносится TaifunTM1.CellID, — ID сотовой вышки
ll2.text = заносится TaifunTM1.Lac — Значение сотовой позиции
ll3.text = заносится TaifunTM1.NetworkOperator — Информация о сотовом операторе

По этим трем параметрам, применив некоторые действия,
можно узнать местоположение сотового телефона.
Точность определения положения, зависит от местности.
В большом городе точность будет выше, а вот на
колхозном поле в Сибири + — гектар

в метки
ll4.text — текущая дата
ll5.text — текущее время

это для того, чтобы не путаться, к какому периоду относятся
полученные данные

веб сервер +на андроид - http://aeha.narod.ru/appinv/webserver/

************************
06
Есть большая картинка

и напоследок самое сладкое, процедура SAVE
которая по таймеру выполняется каждые 5 секунд

в начале текстовая метка l_cnt в ней путем несложных математических операций

происходит инкремент числового
значения, это просто счетчик вызовов процедуры SAVE
и служит для того чтобы определить, а не повис наш
веб сервер, в месте с телефоном?

затем увеличивается глобальна переменная REFRESH_IP
которая отмеряет положенные пять минут для обновления
IP на DynDns сервисе процедурой OUT_IP она описана выше

далее в глобальной переменной BODY, конструкцией из блоков
JOIN собирается тело всего сайта.
Верхняя часть из переменной META

затем передаваемая телеметрия вперемежку с тегами HTML
разметки, и закрывающие теги по концовке

затем вся эта красота передается компоненту веб сервера
(App Inventor Thunkable Extensions )


KIO4_SimpleWebserver1.ServeText.text

автор этого расширения вероятно испанец, так что
встречается этот компонент и с названиями на испанском

пока не удалось, передать с веб сервера на телефоне с андроид
картинку через тег <img src=»http://aeha.narod.ru/ws.png» >
то есть с флешь аппарата, но есть возможность прописать путь к сетевой картинке,
< img src=»http://aeha.narod.ru/ws.png» >
если уж без иллюстраций ни как не обойтись.

Естественно все чудеса которые творит на сайте разметка
HTML должна передаваться без проблем, JS JavaScript
также, ибо все это выполняется в браузере, и к веб серверу
отношение имеет слабое

пока получилось вот такое приложение , практически готовое
можно использовать для мониторинга, температуры жд или авторефрижератора , с

Connectivity

A component that can launch an activity using the StartActivity method.

Activities that can be launched include:

  • Starting another App Inventor for Android app. To do so, first find out the class of the other application by downloading the source code and using a file explorer or unzip utility to find a file named “youngandroidproject/project.properties”. The first line of the file will start with “main=” and be followed by the class name; for example, main=com.gmail.Bitdiddle.Ben.HelloPurr.Screen1 . (The first components indicate that it was created by Ben.Bitdiddle@gmail.com.) To make your ActivityStarter launch this application, set the following properties:
    • ActivityPackage to the class name, dropping the last component (for example, com.gmail.Bitdiddle.Ben.HelloPurr )
    • ActivityClass to the entire class name (for example, com.gmail.Bitdiddle.Ben.HelloPurr.Screen1 )
    • Action : android.intent.action.MAIN
    • ActivityPackage : com.android.camera
    • ActivityClass : com.android.camera.Camera
    • Action : android.intent.action.WEB_SEARCH
    • ExtraKey : query
    • ExtraValue : vampire
    • ActivityPackage : com.google.android.providers.enhancedgooglesearch
    • ActivityClass : com.google.android.providers.enhancedgooglesearch.Launcher
    • Action : android.intent.action.VIEW
    • DataUri : http://www.facebook.com

    Properties

    Events

    Methods

    BluetoothClient

    Use BluetoothClient to connect your device to other devices using Bluetooth. This component uses the Serial Port Profile (SPP) for communication. If you are interested in using Bluetooth low energy, please see the BluetoothLE extension.

    Properties

    Events

    Methods

    If numberOfBytes is negative, this method reads until a delimiter byte value is read. The delimiter byte value is included in the returned list.

    ReceiveText(numberOfBytes) Reads a number of bytes from the input stream and converts them to text.

    If numberOfBytes is negative, read until a delimiter byte value is read.

    ReceiveUnsigned1ByteNumber() Reads an unsigned 1-byte number. ReceiveUnsigned2ByteNumber() Reads an unsigned 2-byte number. ReceiveUnsigned4ByteNumber() Reads an unsigned 4-byte number. ReceiveUnsignedBytes(numberOfBytes) Reads a number of unsigned bytes from the input stream and returns them as a List.

    If numberOfBytes is negative, this method reads until a delimiter byte value is read. The delimiter byte value is included in the returned list.

    Send1ByteNumber(number) Decodes the given number String to an integer and writes it as one byte to the output stream.

    If the number could not be decoded to an integer, or the integer would not fit in one byte, then the Form’s ErrorOccurred event is triggered and this method returns without writing any bytes to the output stream.

    Send2ByteNumber(number) Decodes the given number String to an integer and writes it as two bytes to the output stream.

    If the number could not be decoded to an integer, or the integer would not fit in two bytes, then the Form’s ErrorOccurred event is triggered and this method returns without writing any bytes to the output stream.

    Send4ByteNumber(number) Decodes the given number String to an integer and writes it as four bytes to the output stream.

    If the number could not be decoded to an integer, or the integer would not fit in four bytes, then the Form’s ErrorOccurred event is triggered and this method returns without writing any bytes to the output stream.

    SendBytes(list) Takes each element from the given list, converts it to a String, decodes the String to an integer, and writes it as one byte to the output stream.

    If an element could not be decoded to an integer, or the integer would not fit in one byte, then the Form’s ErrorOccurred event is triggered and this method returns without writing any bytes to the output stream.

    SendText(text) Converts the given text to bytes and writes them to the output stream.

    BluetoothServer

    Use the BluetoothServer component to turn your device into a server that receive connections from other apps that use the BluetoothClient component.

    Properties

    Events

    Methods

    If numberOfBytes is negative, this method reads until a delimiter byte value is read. The delimiter byte value is included in the returned list.

    ReceiveText(numberOfBytes) Reads a number of bytes from the input stream and converts them to text.

    If numberOfBytes is negative, read until a delimiter byte value is read.

    ReceiveUnsigned1ByteNumber() Reads an unsigned 1-byte number. ReceiveUnsigned2ByteNumber() Reads an unsigned 2-byte number. ReceiveUnsigned4ByteNumber() Reads an unsigned 4-byte number. ReceiveUnsignedBytes(numberOfBytes) Reads a number of unsigned bytes from the input stream and returns them as a List.

    If numberOfBytes is negative, this method reads until a delimiter byte value is read. The delimiter byte value is included in the returned list.

    Send1ByteNumber(number) Decodes the given number String to an integer and writes it as one byte to the output stream.

    If the number could not be decoded to an integer, or the integer would not fit in one byte, then the Form’s ErrorOccurred event is triggered and this method returns without writing any bytes to the output stream.

    Send2ByteNumber(number) Decodes the given number String to an integer and writes it as two bytes to the output stream.

    If the number could not be decoded to an integer, or the integer would not fit in two bytes, then the Form’s ErrorOccurred event is triggered and this method returns without writing any bytes to the output stream.

    Send4ByteNumber(number) Decodes the given number String to an integer and writes it as four bytes to the output stream.

    If the number could not be decoded to an integer, or the integer would not fit in four bytes, then the Form’s ErrorOccurred event is triggered and this method returns without writing any bytes to the output stream.

    SendBytes(list) Takes each element from the given list, converts it to a String, decodes the String to an integer, and writes it as one byte to the output stream.

    If an element could not be decoded to an integer, or the integer would not fit in one byte, then the Form’s ErrorOccurred event is triggered and this method returns without writing any bytes to the output stream.

    SendText(text) Converts the given text to bytes and writes them to the output stream. StopAccepting() Stop accepting an incoming connection.

    Serial

    Component for Serial

    Properties

    Events

    Methods

    Non-visible component that provides functions for HTTP GET, POST, PUT, and DELETE requests.

    Properties

    Events

    Methods

    If the SaveResponse property is true, the response will be saved in a file and the GotFile event will be triggered. The ResponseFileName property can be used to specify the name of the file.

    If the SaveResponse property is false, the GotText event will be triggered.

    Get() Performs an HTTP GET request using the Url property and retrieves the response.

    If the SaveResponse property is true, the response will be saved in a file and the GotFile event will be triggered. The ResponseFileName property can be used to specify the name of the file.

    If the SaveResponse property is false, the GotText event will be triggered.

    HtmlTextDecode(htmlText) Decodes the given HTML text value.

    HTML Character Entities such as &amp; , &lt; , &gt; , &apos; , and &quot; are changed to & , < , > , ‘ , and » . Entities such as &#xhhhh; , and &#nnnn; are changed to the appropriate characters.

    JsonObjectEncode(jsonObject) Returns the value of a built-in type (i.e., boolean, number, text, list, dictionary) in its JavaScript Object Notation representation. If the value cannot be represented as JSON, the Screen’s ErrorOccurred event will be run, if any, and the Web component will return the empty string. JsonTextDecode(jsonText) Decodes the given JSON encoded value to produce a corresponding AppInventor value. A JSON list [x, y, z] decodes to a list (x y z) , A JSON object with key A and value B, (denoted as ) decodes to a list ((A B)) , that is, a list containing the two-element list (A B) .

    Use the method JsonTextDecodeWithDictionaries if you would prefer to get back dictionary objects rather than lists-of-lists in the result.

    JsonTextDecodeWithDictionaries(jsonText) Decodes the given JSON encoded value to produce a corresponding App Inventor value. A JSON list [x, y, z] decodes to a list (x y z). A JSON Object with name A and value B, denoted as decodes to a dictionary with the key a and value b. PatchFile(path) Performs an HTTP PATCH request using the Url property and data from the specified file.

    If the SaveResponse property is true, the response will be saved in a file and the GotFile event will be triggered. The ResponseFileName property can be used to specify the name of the file.

    If the SaveResponse property is false, the GotText event will be triggered.

    PatchText(text) Performs an HTTP PATCH request using the Url property and the specified text.

    The characters of the text are encoded using UTF-8 encoding.

    If the SaveResponse property is true, the response will be saved in a file and the GotFile event will be triggered. The responseFileName property can be used to specify the name of the file.

    If the SaveResponse property is false, the GotText event will be triggered.

    PatchTextWithEncoding(text,encoding) Performs an HTTP PATCH request using the Url property and the specified text.

    The characters of the text are encoded using the given encoding.

    If the SaveResponse property is true, the response will be saved in a file and the GotFile event will be triggered. The ResponseFileName property can be used to specify the name of the file.

    If the SaveResponse property is false, the GotText event will be triggered.

    PostFile(path) Performs an HTTP POST request using the Url property and data from the specified file.

    If the SaveResponse property is true, the response will be saved in a file and the GotFile event will be triggered. The ResponseFileName property can be used to specify the name of the file.

    If the SaveResponse property is false, the GotText event will be triggered.

    PostText(text) Performs an HTTP POST request using the Url property and the specified text.

    The characters of the text are encoded using UTF-8 encoding.

    If the SaveResponse property is true, the response will be saved in a file and the GotFile event will be triggered. The responseFileName property can be used to specify the name of the file.

    If the SaveResponse property is false, the GotText event will be triggered.

    PostTextWithEncoding(text,encoding) Performs an HTTP POST request using the Url property and the specified text.

    The characters of the text are encoded using the given encoding.

    If the SaveResponse property is true, the response will be saved in a file and the GotFile event will be triggered. The ResponseFileName property can be used to specify the name of the file.

    If the SaveResponse property is false, the GotText event will be triggered.

    PutFile(path) Performs an HTTP PUT request using the Url property and data from the specified file.

    If the SaveResponse property is true, the response will be saved in a file and the GotFile event will be triggered. The ResponseFileName property can be used to specify the name of the file.

    If the SaveResponse property is false, the GotText event will be triggered.

    PutText(text) Performs an HTTP PUT request using the Url property and the specified text.

    The characters of the text are encoded using UTF-8 encoding.

    If the SaveResponse property is true, the response will be saved in a file and the GotFile event will be triggered. The responseFileName property can be used to specify the name of the file.

    If the SaveResponse property is false, the GotText event will be triggered.

    PutTextWithEncoding(text,encoding) Performs an HTTP PUT request using the Url property and the specified text.

    The characters of the text are encoded using the given encoding.

    If the SaveResponse property is true, the response will be saved in a file and the GotFile event will be triggered. The ResponseFileName property can be used to specify the name of the file.

    If the SaveResponse property is false, the GotText event will be triggered.

    UriDecode(text) Decodes the encoded text value so that the values aren’t URL encoded anymore. UriEncode(text) Encodes the given text value so that it can be used in a URL. XMLTextDecode(XmlText) Decodes the given XML string to produce a list structure. <tag>string</tag> decodes to a list that contains a pair of tag and string. More generally, if obj1, obj2, … are tag-delimited XML strings, then <tag>obj1 obj2 . </tag> decodes to a list that contains a pair whose first element is tag and whose second element is the list of the decoded obj’s, ordered alphabetically by tags.

    • <foo><123/foo> decodes to a one-item list containing the pair (foo 123)
    • <foo>1 2 3</foo> decodes to a one-item list containing the pair (foo «1 2 3»)
    • <a><foo>1 2 3</foo><bar>456</bar></a> decodes to a list containing the pair (a X) where X is a 2-item list that contains the pair (bar 123) and the pair (foo «1 2 3») .

    If the sequence of obj’s mixes tag-delimited and non-tag-delimited items, then the non-tag-delimited items are pulled out of the sequence and wrapped with a “content” tag. For example, decoding <a><bar>456</bar>many<foo>1 2 3</foo>apples<a></code> is similar to above, except that the list X is a 3-item list that contains the additional pair whose first item is the string “content”, and whose second item is the list (many, apples). This method signals an error and returns the empty list if the result is not well-formed XML.

    XMLTextDecodeAsDictionary(XmlText) Decodes the given XML string to produce a dictionary structure. The dictionary includes the special keys $tag , $localName , $namespace , $namespaceUri , $attributes , and $content , as well as a key for each unique tag for every node, which points to a list of elements of the same structure as described here.

    Создаём игру на Android с помощью MIT App Inventor

    Для создания и публикации игр на Android сейчас есть множество доступных инструментов. Одним из них является конструктор MIT App Inventor, интерфейс которого во многом очень схож с визуальной средой Scratch. Благодаря этому с помощью MIT App Inventor даже дети могут самостоятельно создавать игры и приложения для Android.

    Пример рабочего окна в MIT App Inventor

    Код в MIT App Inventor во многом схож с языком программирования в среде Scratch

    MIT App Inventor – бесплатный облачный инструмент, изначально разработанный Google, сейчас поддерживается Массачусетским технологическим институтом (MIT). Платформа с открытым исходным кодом позволяет сразу приступить к визуальному дизайну игры или приложения.

    После создания проекта его сразу можно установить на мобильное устройство и запустить с помощью QR-кода, который можно отсканировать с помощью телефона.

    Пример QR-кода в MIT App Inventor

    Для начала на сайте http://www.appinventor.mit.edu/ необходимо создать аккаунт.

    При регистрации необходимо указывать данные аккаунта на Google.com

    После регистрации вы можете выбрать русский язык в настройках

    При создании проекта вам будет предложено выбрать пример приложения и инструкцию по его созданию, также можно выбрать кнопку «Проект с нуля».


    Например, выберем приложение HELLO PURR — простое приложение, где нужно коснуться котика, чтобы услышать его мяуканье. После выбора приложения откроется рабочее окно с редактором.

    Выберите и установите кнопку под фото с изображением кота. Переименовать кнопку можно, вбив название в поле «Текст».

    Отредактировать надпись можно на панели текст, изменив размер надписи и жирность текста.
    Иллюстрация: игра на Android
    Далее переходим в раздел «Блоки» в верхнем меню.
    Иллюстрация: игра на Android

    Здесь необходимо обозначить алгоритм появления звука «Мяу» после нажатия на надпись «Погладить кота». Далее разделе «Управление» выбираем следующий алгоритм.

    Иллюстрация: игра на Android
    акже добавляем действие, чтобы при нажатии кнопки телефон дополнительно вибрировал.
    Иллюстрация: игра на Android
    Далее добавим таймер в алгоритм.
    Иллюстрация: игра на Android
    В итоге должен получиться такой код.
    Иллюстрация: игра на Android
    Теперь сохраняем проект в разделе «Проекты» — «Сохранить проект как…». Также в верхнем меню выберите пункт «Построить Android App».
    Иллюстрация: игра на Android
    После этого начнется упаковка приложения для мобильного устройства, это займет какое-то время.
    Иллюстрация: игра на Android
    Далее вы сможете скачать приложение на телефон или запустить его на ПК.
    Иллюстрация: игра на Android
    Cкачать MIT App Inventor на телефон можно здесь.

    На ПК скачать можно здесь.
    Иллюстрация: игра на Android

    На телефоне MIT App Inventor выглядит так.

    Иллюстрация: игра на Android
    После сканирования приложения вы можете протестировать свое приложение: при нажатии на кнопку появляется звук «Мяу» и вибрация.
    Иллюстрация: игра на Android
    Подробная инструкция по созданию приложения находится по ссылке https://appinventor.mit.edu/explore/ai2/hellopurr. Также дополнительно можно запускать другие приложения в MIT App Inventor, подробные инструкции можно скачать по ссылке. Или посмотреть мануалы на Youtube.
    Иллюстрация: игра на Android
    В MIT App Inventor используется упрощенный код, позволяющий пользователям быстро создавать и разворачивать приложения для мобильных устройств, одновременно изучая основы кода и разработки приложений. Другим преимуществом MIT App Inventor является его доступность: с помощью этой платформы можно бесплатно и быстро реализовывать популярные игры.
    Иллюстрация: игра на Android
    Гибкая и простая в изучении платформа App Inventor будет полезна начинающим программистам для запуска первых приложений для Android. Особенно платформа будет полезна тем, кто уже умеет программировать на языке Scratch. Подборку видео по созданию игр на Scratch смотрите на Youtube.

    Как сделать интернет в mit app inventor

    Общение по Wi-Fi должно быть тем, на что все надеются. TaifunWiFi в Интернете кажется очень продвинутым, но простите меня за английскую мразь, и я не понимаю. , ,
    Я понимаю mac и ip, но ssid — это божественная лошадь. , , Кажется, мой tcp / ip еще не дошел до дома. , ,
    TaifunWiFi долго смотрит, и похоже, что так и должно быть.Подключиться к WiFiВместосообщатьсяA.
    Кажется, что потребности многих людей связаны с Arduino, кто может представить его, я не понимаю
    Многие в Android говорили о том, как использовать сокетную связь, но очень немногие портированы на изобретателя приложения.
    Тогда позвольте мне порадоваться и рассказать о том, как общаться в локальной сети, а не только по WiFi.

    1. Разрешение шагов

    1.1 Принцип

    Я не буду говорить о tcp / ip, и считается, что никто не заботится об этом.
    Вот лишь некоторые базовые знания, потому что этот плагин в настоящее время может передавать только строки, если вам нужно больше функций, вам нужно добавить его самостоятельно.
    Для связи между двумя компьютерами требуется следующее Три условия : IP-адрес, протокол, номер порта.
    IP-адрес Об этом наверняка слышали, это как порт в словах людей.
    Номер порта Он используется для различения нескольких различных приложений хоста. Диапазон 0-65535. Я беру 8000 и 0-1023 зарезервированы для системы. С человеческой точки зрения это похоже на то, что в порту много кораблей, и многие корабли могут быть припаркованы одновременно.
    Socket Он состоит из IP-адреса + номер порта. В Java сетевое взаимодействие реализовано с использованием протокола TCP.
    ServerSocket Это сервер.
    Поскольку сетевое соединение является очень трудоемкой операцией, оно требует больше времени, чем чтение и запись на жесткий диск, и требует отдельного потока, даже более одного.

    1.2 записи ошибок во время тестирования

    Клиент клиент находится в хорошем состоянии, может отправлять, получать и т. Д.
    Сервер Sever необъяснимо умственно неполноценен, не отвечает на звонки, не отправляет текстовые сообщения и, наконец, обнаружил, что это сообщение является новым. Полезно получить его из myHandler.obtainMessage (). я. , ,
    Это сообщение снова показало мне сообщение, и я должен получать сообщение снова каждый раз, когда sendMessage, или следующие несколько строк не используются, я не понимаю, в любом случае, я получаю его каждый раз. Проблема решена, иначе она отступит, и не будет даже ошибки. При подключении к adb вы получите сообщение об ошибке.
    Проверка сервера завершена успешно!
    Подождите, пока я переписываю его так, чтобы его можно было использовать.
    Это еще одна яма. flush () OutputStream — это пустой метод, и может быть создан только один BufferedOutputStream.
    конец строки чтения \ n! Это не проблема с OutputStream, это шаблон оформления, а пустой метод предназначен для перезаписи.
    Тест завершен, и он идентифицирован как съедобный.

    1.3 Объяснение исходного кода на стороне сервера

    Посмотреть полный текстSocketUtil.java
    Обратный звонок после получения сообщения, кстати добавьте возврат каретки

    Обработчик используется для возврата потока пользовательского интерфейса из дочернего процесса и вызова обратного вызова.
    Если вам необходимо различать разные сообщения, задайте значение what, if-else или переключатель в обработчике.

    Получить IP и код порта

    Внутренний класс, используемый для чтения данных до новой строки, является классом обработки сообщений при подключении нового устройства

    Способы запуска сервиса

    Порт 8000, инициализируй ip и порт, отправь сообщение

    Если есть новое подключение к устройству, создайте новый поток для получения

    1.4 Объяснение источника клиента

    Посмотреть полный текстSocketClient.java
    Дескрипторы и другие виды на стороне сервера не будут описаны
    Эту функцию вводить не нужно, она будет понятна с первого взгляда, фокус на этом потоке

    Ну, мне лень писать три класса.

    2. Сначала приезжайте несколько тестовых таблиц

    Редко я наконец отправил тестовую таблицу. , ,
    Но проблема в том, что для тестирования нужны два телефона. Я повернул коробку и обнаружил старый телефон со специальной картой, поэтому снимок экрана можно сделать только на новом телефоне.
    Поэтому я использовал новый телефон, чтобы сделать снимки экрана для клиента и сервера соответственно.
    Кроме того, сервер может быть открыт только один раз, и он будет мигать во второй раз, и его необходимо полностью отключить, чтобы открыть во второй раз.
    Я обнаружил очень удивительную вещь. После того, как точка доступа к компьютеру используется совместно, она может быть подключена напрямую, но только одним способом.
    Серверный сервер выглядит следующим образом

    Клиент выглядит так

    Введите IP-адрес второй строки сервера по IP-адресу клиента
    Код клиента

    код сервера

    Код виден не сильно, его удобнее использовать

    Connectivity

    A component that can launch an activity using the StartActivity method.

    Activities that can be launched include:

    • Starting another App Inventor for Android app. To do so, first find out the class of the other application by downloading the source code and using a file explorer or unzip utility to find a file named “youngandroidproject/project.properties”. The first line of the file will start with “main=” and be followed by the class name; for example, main=com.gmail.Bitdiddle.Ben.HelloPurr.Screen1 . (The first components indicate that it was created by Ben.Bitdiddle@gmail.com.) To make your ActivityStarter launch this application, set the following properties:
      • ActivityPackage to the class name, dropping the last component (for example, com.gmail.Bitdiddle.Ben.HelloPurr )
      • ActivityClass to the entire class name (for example, com.gmail.Bitdiddle.Ben.HelloPurr.Screen1 )
      • Action : android.intent.action.MAIN
      • ActivityPackage : com.android.camera
      • ActivityClass : com.android.camera.Camera
      • Action : android.intent.action.WEB_SEARCH
      • ExtraKey : query
      • ExtraValue : vampire
      • ActivityPackage : com.google.android.providers.enhancedgooglesearch
      • ActivityClass : com.google.android.providers.enhancedgooglesearch.Launcher
      • Action : android.intent.action.VIEW
      • DataUri : http://www.facebook.com
      Properties
      Events
      Methods

      BluetoothClient

      Use BluetoothClient to connect your device to other devices using Bluetooth. This component uses the Serial Port Profile (SPP) for communication. If you are interested in using Bluetooth low energy, please see the BluetoothLE extension.

      Properties
      Events
      Methods

      If numberOfBytes is negative, this method reads until a delimiter byte value is read. The delimiter byte value is included in the returned list.

      ReceiveText(numberOfBytes) Reads a number of bytes from the input stream and converts them to text.

      If numberOfBytes is negative, read until a delimiter byte value is read.

      ReceiveUnsigned1ByteNumber() Reads an unsigned 1-byte number. ReceiveUnsigned2ByteNumber() Reads an unsigned 2-byte number. ReceiveUnsigned4ByteNumber() Reads an unsigned 4-byte number. ReceiveUnsignedBytes(numberOfBytes) Reads a number of unsigned bytes from the input stream and returns them as a List.

      If numberOfBytes is negative, this method reads until a delimiter byte value is read. The delimiter byte value is included in the returned list.

      Send1ByteNumber(number) Decodes the given number String to an integer and writes it as one byte to the output stream.

      If the number could not be decoded to an integer, or the integer would not fit in one byte, then the Form’s ErrorOccurred event is triggered and this method returns without writing any bytes to the output stream.

      Send2ByteNumber(number) Decodes the given number String to an integer and writes it as two bytes to the output stream.

      If the number could not be decoded to an integer, or the integer would not fit in two bytes, then the Form’s ErrorOccurred event is triggered and this method returns without writing any bytes to the output stream.

      Send4ByteNumber(number) Decodes the given number String to an integer and writes it as four bytes to the output stream.

      If the number could not be decoded to an integer, or the integer would not fit in four bytes, then the Form’s ErrorOccurred event is triggered and this method returns without writing any bytes to the output stream.

      SendBytes(list) Takes each element from the given list, converts it to a String, decodes the String to an integer, and writes it as one byte to the output stream.

      If an element could not be decoded to an integer, or the integer would not fit in one byte, then the Form’s ErrorOccurred event is triggered and this method returns without writing any bytes to the output stream.

      SendText(text) Converts the given text to bytes and writes them to the output stream.

      BluetoothServer

      Use the BluetoothServer component to turn your device into a server that receive connections from other apps that use the BluetoothClient component.

      Properties
      Events
      Methods

      If numberOfBytes is negative, this method reads until a delimiter byte value is read. The delimiter byte value is included in the returned list.

      ReceiveText(numberOfBytes) Reads a number of bytes from the input stream and converts them to text.

      If numberOfBytes is negative, read until a delimiter byte value is read.

      ReceiveUnsigned1ByteNumber() Reads an unsigned 1-byte number. ReceiveUnsigned2ByteNumber() Reads an unsigned 2-byte number. ReceiveUnsigned4ByteNumber() Reads an unsigned 4-byte number. ReceiveUnsignedBytes(numberOfBytes) Reads a number of unsigned bytes from the input stream and returns them as a List.

      If numberOfBytes is negative, this method reads until a delimiter byte value is read. The delimiter byte value is included in the returned list.

      Send1ByteNumber(number) Decodes the given number String to an integer and writes it as one byte to the output stream.

      If the number could not be decoded to an integer, or the integer would not fit in one byte, then the Form’s ErrorOccurred event is triggered and this method returns without writing any bytes to the output stream.

      Send2ByteNumber(number) Decodes the given number String to an integer and writes it as two bytes to the output stream.

      If the number could not be decoded to an integer, or the integer would not fit in two bytes, then the Form’s ErrorOccurred event is triggered and this method returns without writing any bytes to the output stream.

      Send4ByteNumber(number) Decodes the given number String to an integer and writes it as four bytes to the output stream.

      If the number could not be decoded to an integer, or the integer would not fit in four bytes, then the Form’s ErrorOccurred event is triggered and this method returns without writing any bytes to the output stream.

      SendBytes(list) Takes each element from the given list, converts it to a String, decodes the String to an integer, and writes it as one byte to the output stream.

      If an element could not be decoded to an integer, or the integer would not fit in one byte, then the Form’s ErrorOccurred event is triggered and this method returns without writing any bytes to the output stream.

      SendText(text) Converts the given text to bytes and writes them to the output stream. StopAccepting() Stop accepting an incoming connection.

      Serial

      Component for Serial

      Properties
      Events
      Methods

      Non-visible component that provides functions for HTTP GET, POST, PUT, and DELETE requests.

      Properties
      Events
      Methods

      If the SaveResponse property is true, the response will be saved in a file and the GotFile event will be triggered. The ResponseFileName property can be used to specify the name of the file.

      If the SaveResponse property is false, the GotText event will be triggered.

      Get() Performs an HTTP GET request using the Url property and retrieves the response.

      If the SaveResponse property is true, the response will be saved in a file and the GotFile event will be triggered. The ResponseFileName property can be used to specify the name of the file.

      If the SaveResponse property is false, the GotText event will be triggered.

      HtmlTextDecode(htmlText) Decodes the given HTML text value.

      HTML Character Entities such as &amp; , &lt; , &gt; , &apos; , and &quot; are changed to & , < , > , ‘ , and » . Entities such as &#xhhhh; , and &#nnnn; are changed to the appropriate characters.

      JsonObjectEncode(jsonObject) Returns the value of a built-in type (i.e., boolean, number, text, list, dictionary) in its JavaScript Object Notation representation. If the value cannot be represented as JSON, the Screen’s ErrorOccurred event will be run, if any, and the Web component will return the empty string. JsonTextDecode(jsonText) Decodes the given JSON encoded value to produce a corresponding AppInventor value. A JSON list [x, y, z] decodes to a list (x y z) , A JSON object with key A and value B, (denoted as ) decodes to a list ((A B)) , that is, a list containing the two-element list (A B) .

      Use the method JsonTextDecodeWithDictionaries if you would prefer to get back dictionary objects rather than lists-of-lists in the result.

      JsonTextDecodeWithDictionaries(jsonText) Decodes the given JSON encoded value to produce a corresponding App Inventor value. A JSON list [x, y, z] decodes to a list (x y z). A JSON Object with name A and value B, denoted as decodes to a dictionary with the key a and value b. PatchFile(path) Performs an HTTP PATCH request using the Url property and data from the specified file.

      If the SaveResponse property is true, the response will be saved in a file and the GotFile event will be triggered. The ResponseFileName property can be used to specify the name of the file.

      If the SaveResponse property is false, the GotText event will be triggered.

      PatchText(text) Performs an HTTP PATCH request using the Url property and the specified text.

      The characters of the text are encoded using UTF-8 encoding.

      If the SaveResponse property is true, the response will be saved in a file and the GotFile event will be triggered. The responseFileName property can be used to specify the name of the file.

      If the SaveResponse property is false, the GotText event will be triggered.

      PatchTextWithEncoding(text,encoding) Performs an HTTP PATCH request using the Url property and the specified text.

      The characters of the text are encoded using the given encoding.

      If the SaveResponse property is true, the response will be saved in a file and the GotFile event will be triggered. The ResponseFileName property can be used to specify the name of the file.

      If the SaveResponse property is false, the GotText event will be triggered.

      PostFile(path) Performs an HTTP POST request using the Url property and data from the specified file.

      If the SaveResponse property is true, the response will be saved in a file and the GotFile event will be triggered. The ResponseFileName property can be used to specify the name of the file.

      If the SaveResponse property is false, the GotText event will be triggered.

      PostText(text) Performs an HTTP POST request using the Url property and the specified text.

      The characters of the text are encoded using UTF-8 encoding.

      If the SaveResponse property is true, the response will be saved in a file and the GotFile event will be triggered. The responseFileName property can be used to specify the name of the file.

      If the SaveResponse property is false, the GotText event will be triggered.

      PostTextWithEncoding(text,encoding) Performs an HTTP POST request using the Url property and the specified text.

      The characters of the text are encoded using the given encoding.

      If the SaveResponse property is true, the response will be saved in a file and the GotFile event will be triggered. The ResponseFileName property can be used to specify the name of the file.

      If the SaveResponse property is false, the GotText event will be triggered.

      PutFile(path) Performs an HTTP PUT request using the Url property and data from the specified file.

      If the SaveResponse property is true, the response will be saved in a file and the GotFile event will be triggered. The ResponseFileName property can be used to specify the name of the file.

      If the SaveResponse property is false, the GotText event will be triggered.

      PutText(text) Performs an HTTP PUT request using the Url property and the specified text.

      The characters of the text are encoded using UTF-8 encoding.

      If the SaveResponse property is true, the response will be saved in a file and the GotFile event will be triggered. The responseFileName property can be used to specify the name of the file.

      If the SaveResponse property is false, the GotText event will be triggered.

      PutTextWithEncoding(text,encoding) Performs an HTTP PUT request using the Url property and the specified text.

      The characters of the text are encoded using the given encoding.

      If the SaveResponse property is true, the response will be saved in a file and the GotFile event will be triggered. The ResponseFileName property can be used to specify the name of the file.

      If the SaveResponse property is false, the GotText event will be triggered.

      UriDecode(text) Decodes the encoded text value so that the values aren’t URL encoded anymore. UriEncode(text) Encodes the given text value so that it can be used in a URL. XMLTextDecode(XmlText) Decodes the given XML string to produce a list structure. <tag>string</tag> decodes to a list that contains a pair of tag and string. More generally, if obj1, obj2, … are tag-delimited XML strings, then <tag>obj1 obj2 . </tag> decodes to a list that contains a pair whose first element is tag and whose second element is the list of the decoded obj’s, ordered alphabetically by tags.

      • <foo><123/foo> decodes to a one-item list containing the pair (foo 123)
      • <foo>1 2 3</foo> decodes to a one-item list containing the pair (foo «1 2 3»)
      • <a><foo>1 2 3</foo><bar>456</bar></a> decodes to a list containing the pair (a X) where X is a 2-item list that contains the pair (bar 123) and the pair (foo «1 2 3») .

      If the sequence of obj’s mixes tag-delimited and non-tag-delimited items, then the non-tag-delimited items are pulled out of the sequence and wrapped with a “content” tag. For example, decoding <a><bar>456</bar>many<foo>1 2 3</foo>apples<a></code> is similar to above, except that the list X is a 3-item list that contains the additional pair whose first item is the string “content”, and whose second item is the list (many, apples). This method signals an error and returns the empty list if the result is not well-formed XML.

      XMLTextDecodeAsDictionary(XmlText) Decodes the given XML string to produce a dictionary structure. The dictionary includes the special keys $tag , $localName , $namespace , $namespaceUri , $attributes , and $content , as well as a key for each unique tag for every node, which points to a list of elements of the same structure as described here.

      Создаём игру на Android с помощью MIT App Inventor

      Для создания и публикации игр на Android сейчас есть множество доступных инструментов. Одним из них является конструктор MIT App Inventor, интерфейс которого во многом очень схож с визуальной средой Scratch. Благодаря этому с помощью MIT App Inventor даже дети могут самостоятельно создавать игры и приложения для Android.

      Пример рабочего окна в MIT App Inventor

      Код в MIT App Inventor во многом схож с языком программирования в среде Scratch

      MIT App Inventor – бесплатный облачный инструмент, изначально разработанный Google, сейчас поддерживается Массачусетским технологическим институтом (MIT). Платформа с открытым исходным кодом позволяет сразу приступить к визуальному дизайну игры или приложения.

      После создания проекта его сразу можно установить на мобильное устройство и запустить с помощью QR-кода, который можно отсканировать с помощью телефона.

      Пример QR-кода в MIT App Inventor

      Для начала на сайте http://www.appinventor.mit.edu/ необходимо создать аккаунт.

      При регистрации необходимо указывать данные аккаунта на Google.com

      После регистрации вы можете выбрать русский язык в настройках

      При создании проекта вам будет предложено выбрать пример приложения и инструкцию по его созданию, также можно выбрать кнопку «Проект с нуля».


      Например, выберем приложение HELLO PURR — простое приложение, где нужно коснуться котика, чтобы услышать его мяуканье. После выбора приложения откроется рабочее окно с редактором.

      Выберите и установите кнопку под фото с изображением кота. Переименовать кнопку можно, вбив название в поле «Текст».

      Отредактировать надпись можно на панели текст, изменив размер надписи и жирность текста.
      Иллюстрация: игра на Android
      Далее переходим в раздел «Блоки» в верхнем меню.
      Иллюстрация: игра на Android

      Здесь необходимо обозначить алгоритм появления звука «Мяу» после нажатия на надпись «Погладить кота». Далее разделе «Управление» выбираем следующий алгоритм.

      Иллюстрация: игра на Android
      акже добавляем действие, чтобы при нажатии кнопки телефон дополнительно вибрировал.
      Иллюстрация: игра на Android
      Далее добавим таймер в алгоритм.
      Иллюстрация: игра на Android
      В итоге должен получиться такой код.
      Иллюстрация: игра на Android
      Теперь сохраняем проект в разделе «Проекты» — «Сохранить проект как…». Также в верхнем меню выберите пункт «Построить Android App».
      Иллюстрация: игра на Android
      После этого начнется упаковка приложения для мобильного устройства, это займет какое-то время.
      Иллюстрация: игра на Android
      Далее вы сможете скачать приложение на телефон или запустить его на ПК.
      Иллюстрация: игра на Android
      Cкачать MIT App Inventor на телефон можно здесь.

      На ПК скачать можно здесь.
      Иллюстрация: игра на Android

      На телефоне MIT App Inventor выглядит так.

      Иллюстрация: игра на Android
      После сканирования приложения вы можете протестировать свое приложение: при нажатии на кнопку появляется звук «Мяу» и вибрация.
      Иллюстрация: игра на Android
      Подробная инструкция по созданию приложения находится по ссылке https://appinventor.mit.edu/explore/ai2/hellopurr. Также дополнительно можно запускать другие приложения в MIT App Inventor, подробные инструкции можно скачать по ссылке. Или посмотреть мануалы на Youtube.
      Иллюстрация: игра на Android
      В MIT App Inventor используется упрощенный код, позволяющий пользователям быстро создавать и разворачивать приложения для мобильных устройств, одновременно изучая основы кода и разработки приложений. Другим преимуществом MIT App Inventor является его доступность: с помощью этой платформы можно бесплатно и быстро реализовывать популярные игры.
      Иллюстрация: игра на Android
      Гибкая и простая в изучении платформа App Inventor будет полезна начинающим программистам для запуска первых приложений для Android. Особенно платформа будет полезна тем, кто уже умеет программировать на языке Scratch. Подборку видео по созданию игр на Scratch смотрите на Youtube.

      1. Знакомство с App Inventor

      App Inventor (App – сокращение от application, переводится как приложение. Inventor — переводится как изобретатель) — это среда визуальной разработки приложений, не требующая больших знаний в программировании. Приложение было разработано в Google Labs, а после передано Массачусетскому технологическому институту.

      App Inventor — это облачная среда визуальной разработки Android-приложений. Построение программ осуществляется в визуальном режиме с использованием блоков программного кода. На компьютер устанавливать ничего не требуется, просто откройте среду разработки ai2.appinventor.mit.edu в браузере Google Chrome и начинайте творить.

      Обратите внимание, что для работы с App Inventor требуется аккаунт Google. Если вы не зарегистрированы в Google, то перед началом работы вам надо будет пройти регистрацию и авторизацию. После этого приложение App Inventor и все ваши сохраненные проекты будут доступны на любом компьютере после авторизации.

      Видео. Применения App Inventor в робототехнике
      App Inventor состоит из конструктора и редактора блоков

      Конструктор App Inventor

      Конструктор App Inventor

      Редактор блоков App Inventor

      Редактор блоков App Inventor

      Программирование производится с помощью составления блоков

      Программирование производится с помощью блоков

      Блоки программы составляются подобно пазлам или конструктору лего

      Создание первого приложения для Android

      Создадим простое приложение в котором при нажатии кнопки на экране телефона, гаджет будет произносить определенную фразу. Следуйте пошаговой инструкции и обращайте внимание на подсказки под изображением.

      1. Заходим в среду разработки из браузера Google Chrome appinventor.mit.edu

      Заходим в среду разработки

      Можете скопировать ссылку http://appinventor.mit.edu/ и вставите ее в окно браузера

      2. Заходим в свой аккаунт Google (при необходимости регистрируемся)

      Заходим в свой аккаунт Google

      Если вы уже зарегистрированы в Google, то переходите к следующему пункту

      3. Открываем новый проект и присваиваем ему имя (без пробелов и цифр!)

      Открываем проект и присваиваем ему имя

      В названии будущего приложения можно использовать только латиницу

      4. При желании вы можете перейти на русский язык

      Переходим на русский язык

      Внимательно смотрите на изображении куда показывает стрелочка

      5. Захватите объект «Кнопка» мышкой и перенесите его на вкладку «Просмотр»

      Захватите объект мышкой и перенесите его

      Объект должен отобразиться в видимой части экрана «телефона»

      6. На вкладке «Свойства» задайте необходимые стили для кнопки

      Задайте необходимые стили для кнопки

      Также можно изменить текст на кнопке или загрузить картинку с компьютера

      7. Перейдите на вкладку «Медиа», захватите и перенесите объект «Текст в речь»

      Перейдите на вкладку Медиа

      Объект должен отобразиться под экраном «телефона», в невидимой части

      8. Переходите в режим редактора блоков

      Переходите в режим редактора блоков

      Вернуться в режим «Дизайнер» вы сможете в любой момент

      9. В панели блоков нажмите мышкой на объект «Кнопка»

      В панели блоков нажмите мышкой на объект

      На экране появится окно с различными блоками функций

      10. Выберите функцию «Когда кнопка нажата» и перенесите в окно «Просмотр»

      Выберите функцию Когда кнопка нажата

      Разместить блок можно в любом месте экрана, как вам удобно

      11. Выбираем объект «Текст в речь» и переносим блок «Сказать сообщение»

      Выбираем объект Текст в речь и переносим блок

      Можете сразу собрать два блока вместе

      12. Наведите мышкой один блок на другой, чтобы совпал «замок»

      Скомпануйте блоки вместе

      Если вы случайно выбрали не тот блок, то удалите его в корзину

      13. Выберите объект «Текст» и добавьте к программе новый блок

      Выберите объект Текст и добавьте к программе

      Соберите блок как на рисунке и напишите в нем любую фразу, например, «Привет»

      14. Осталось лишь создать QR-код для скачивания на телефон

      Осталось лишь создать QR-код для скачивания

      Если программа написана без ошибок, у вас появится шкала загрузки

      15. После построения программы у вас на экране появится похожий QR-код

      Загрузите на телефон приложение

      Загрузите на телефон приложение QR Code Reader в Play Market

      16. Откройте на телефоне приложение QR Code Reader и просканируйте QR-код

      Телефон запросит разрешение для перехода по ссылке. Нажмите «OK» и начнется загрузка вашего приложения. После загрузки установите приложение.

      Читать:
      Что скачать чтобы работал ватсап

Related Posts