Create Extensions App inventor 2 Build Extensions App Inventor, easy tutorial - Juan Antonio Villalpando

Similar documents
Creating Android Apps from Rh10

Dspace 5.1. Installation on Windows 7 (32 bit system)

Before you start working with Java, you need to set up a Java development

Setting up your Computer

CSC116: Introduction to Computing - Java

Purpose. Why use Java? Installing the Software. Java

Default Route de la configuración en el EIGRP

CSC116: Introduction to Computing - Java

Android Studio Setup Procedure

Openbravo Oracle quick-start. installation guide

JADE development for CDC on COMBO Setting up the tool chain

JPA - INSTALLATION. Java version "1.7.0_60" Java TM SE Run Time Environment build b19

Software Installation for CS121

Dspace Installation Guide (Windows 2003 Server)

Software Installation Guide

EDITRAN/XAdES. Installation Manual. XAdES Signing and verification. z/os

WA1958 Mobile Software Design Patterns and Architecture Android Edition. Classroom Setup Guide. Web Age Solutions Inc.

Sesión 2: PL 1b: Gestión de sistemas en tiempo real para prototipado rápido de controladores (MathWorks).

PHOTOSHOP CS6 TEST QUESTIONS AND ANSWERS EPUB

KX-TG5566 KX-TG5576 KX-TGA552

Fineract-platform Installation on Windows

Openbravo quick-start. installation guide

Openbravo r2.10 quick-start. installation guide

Simple Step-by-Step Install Guide for Stand-Alone Apache Spark on Windows 10 Jonathan Haynes Last Updated September 14, 2018

11/8/17 GETTING STARTED

Certified Core Java Developer VS-1036

Here are the steps that I got Oscar running with Netbeans IDE from a clean Windows 7 64-bit installation.

DOC - MANUAL DE ACTIONSCRIPT

Important Change to the Year End W2 Process

1. Apéndice E: Comunicación Electrónica con Parallel Graphics

GIT. A free and open source distributed version control system. User Guide. January, Department of Computer Science and Engineering

Advanced Activities - Information and Ideas

Optical Character Recognition. SDK Reference. Issue 04 Date

Getting Started with Eclipse/Java

DOC / 275 DE JAVA USER GUIDE EBOOK

Las 20 Definiciones más comunes en el e-marketing

Jdk Linux Ubuntu Bit Desktop Iso >>>CLICK HERE<<<

Manual Install Windows Xp Service Pack 3 From Usb Pen Drive

MICROSOFT Course 20411: Administering Windows Server 2012

CSC116: Introduction to Computing - Java

This is a list of vocabulary related to information and communication technology. Coloque el significado en español sobre las líneas.

How to set up FMOD*, Cocos2D-x*, and OpenAL* Libraries for Android* on Intel Architecture

Propedéutico de Programación

Tutorial Como Hacer Jailbreak Iphone 3g 4.2 1

Error Received When Compiling Java Code Files Jasper Report

esdk Storage Plugins 1.0.RC4 Compilation Guide 01(vRO) Issue 01 Date HUAWEI TECHNOLOGIES CO., LTD.

IntelliJ IDEA Getting Started Guide for FIRST Robotics Competition

WA2271 Continuous Integration with Jenkins-CI. Classroom Setup Guide. Web Age Solutions Inc.

Visual Basic Microsoft Docs Visual Basic is engineered for productively building type safe and object oriented applications Visual Basic enables

PROGRAMACIÓN ORIENTADA A OBJETOS

Appendix A: Courseware setup

Tutorial 3 Q&A. En la pregunta 7 de la sección 2.2 el cual dice: 7. Prove the domination laws in Table 1 by showing that: a)a U = U b)a =

Configuring Windows 8.1

Dspace on Windows. Pre-requisite Software: 1. Java Development Kit. 2. PostgreSQL 3. Apache Tomcat 4. Apache Maven 5. Apache ANT 6.

Uninstall Netbeans Manually Windows 7.2

Como Hacer Jailbreak A Ipad 2 Ios Ipod Touch 3g

Getting Started with Java. Atul Prakash

Apache Tomcat Installation guide step by step on windows

Kewill Customs Installations Guide

Elastix Installation. Version PaloSanto Solutions. June 2009

Anexos. Diseño y construcción de un puente grúa automatizado de precisión

Windows movie maker for linux. Windows movie maker for linux.zip

[PDF] MANUAL PORTABLE ADOBE PHOTOSHOP CS3 EN ESPAOL DOWNLOAD

Running Java Programs

Homework 9: Stock Search Android App with Facebook Post A Mobile Phone Exercise

INTOSAI EXPERTS DATABASE

TEMPO INSTALLATION I O A. Platform Independent Notes 1. Installing Tempo 3. Installing Tools for the Plugins 5. v0.2.

Instructions. First, download the file

Kewill Customs Installations Guide

Oracle Real-Time Scheduler

OCTOBEAM. LED Lighting Effect USER MANUAL / MANUAL DE USUARIO

How to utilize the CM-9 source

Module Road Map. 7. Version Control with Subversion Introduction Terminology

Informatica Cloud Platform Building Connectors with the Toolkit Student Lab: Prerequisite Installations. Version Connectors Toolkit Training

WA1884 Introduction to Java. using Oracle JDeveloper 11g. Classroom Setup Guide. Web Age Solutions Inc. Copyright Web Age Solutions Inc.

Aware IM Version 8.1 Installation Guide

Standard Edition (SE) application development Enterprise Edition (EE) enterprise development Micro Edition (ME) Internet of Things (IoT) development

The Computer System. Hardware = Physical Computer. Software = Computer Programs. People = End Users & Programmers. people

Choose OS and click on it

WA1739 Oracle WebLogic Server 10.3 Performance Tuning. Classroom Setup Guide. Web Age Solutions Inc. Copyright 2009 Web Age Solutions Inc.

Migrating vrealize Automation 6.2 to 7.1

VI-CENTER EXTENDED ENTERPRISE EDITION GETTING STARTED GUIDE. Version: 4.5

Directory structure and development environment set up

[FILE] JAVA INTELLIGENCE SERVICE MANUAL EBOOK

ORACLE SQL DEVELOPER

FORMAS DE IMPLEMENTAR LOS OYENTES. A).- El oyente en una clase independiente con el constructor con un argumento y usando el método getactioncommand.

Sample Spark Web-App. Overview. Prerequisites

GENERALIDADES INICIAR DE LA HOJA DE CALCULO TEMPORIZADOR. This guide is of virtual use, so it is not necessary to print

IWeb. Installation Guide. v5.16.5

Installation Instructions

WA2387 Hands-On soapui - Classroom Setup Guide. WA2387 Hands-On soapui. Classroom Setup Guide. Web Age Solutions Inc.

HOW TO DEVELOP FOR GLASS ENTERPRISE

PHP PROGRAMMING PATTERN FOR THE PREFERENCES USABILITY MECHANISM

Chapter 1. ELMA ECM+ Application Chapter 2. Creating Electronic Document Flow... 6

Tutorial 4 Data Persistence in Java

Bison web camera driver windows 7 fujitsu. Bison web camera driver windows 7 fujitsu.zip

SAP NETWEAVER AS ABAP SYSTEM ADMINISTRATION

This section contains information you should review before using this book. Any updates to the information presented here will be posted at:

Connect Raspberry Pi to ThingWorx 0

EPUB - JAVA SCRIPT MANUAL EBOOK

Transcription:

1 von 11 09.01.2019, 10:12 Inicio FOROS Elastix - VoIP B4A (Basic4Android) App inventor 2 PHP - MySQL Estación meteorológica B4J (Basic4Java) ADB Shell - Android Arduino AutoIt (Programación) Visual Basic Script (VBS) FireBase (BD autoactualizable) NodeMCU como Arduino Teleco - Emisora de A.M. Visual Basic Cosas de Windows Webs interesantes T Búsqueda en este sitio: Hola amigos, rellena el formulario para recibir los tutoriales correspondientes al curso de App. Create Extensions App inventor 2 Build Extensions App Inventor, easy tutorial - Juan Antonio Villalpando Index tutorial -- Tutorial de iniciación de App Inventor 2 en español -- 125B.- Extensions. Pythagoras theorem. Join texts. - Create an extension to calculate Pythagoras theorem. 0.- In our PC-Windows, we create a folder in disk C:\, call AppInventorExtensiones. In this folder download three packets: 1.- Java SE Development Kit, I have gone down 8u131 version (jdk-8u131-windows-x64.exe of 198 MB). [you can download other recent version]. http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

2 von 11 09.01.2019, 10:12 2.- Apache Ant is a JAVA library for build applications, http://ant.apache.org/bindownload.cgi, download: Ant 1.10.1 (Binary Distributions) (apache-ant-1.10.1-bin.zip of 8,6 MB) 3.- Git bash of https://git-scm.com/download/win (Git-2.13.2-32-bit.exe of 32 MB). This is as LINUX terminal to run ant. [I have gone down 32-bit, if you download 64-bit also works.] - These are our 3 packets in folder C:\AppInventorExtensiones. 4.- Now unzip Apache Ant. When you unzip, perhaps get a double folder: C:\AppInventorExtensiones\apache-ant-1.10.1-bin\apache-ant-1.10.1-bin\

3 von 11 09.01.2019, 10:12 - Change a simple folder C:\AppInventorExtensiones\apache-ant-1.10.1-bin\ 5.- Now install Git Bash. All default installation. - In Windows Start button you can look. 6.- Install Java SE Development Kit. Perharps is necessary restart PC for installation. - Environment Variables. - Lets with Environment Variables: Control Panel / System / Advanced System Settings / Advanced Options / Environment Variables...

4 von 11 09.01.2019, 10:12 - We can use "Edit..." or "New..." button. - In User variables for yourname, by "New..." button we create this variables... _JAVA_OPTIONS ------------------> -Xmx1024m ANT_HOME ------------------> C:\AppInventorExtensiones\apache-ant-1.10.1-bin [folder unzip apache-ant] ANT_OPTS ------------------> -Xmx256M JAVA_HOME ------------------> C:\Program Files\Java\jdk1.8.0_131 [Look! is jdk NOT jdr] CLASSPATH ------------------> %ANT_HOME%\lib;%JAVA_HOME%\lib En PATH ------ Edit ---------> ;%ANT_HOME%\bin;%JAVA_HOME%\bin [Look! ;start with semicolon; ] - Create a clon of App Inventor in our PC. - We create a clon of App Inventor direct from Internet. - Run Git Bash - write: git clone https://github.com/mit-cml/appinventor-sources.git

5 von 11 09.01.2019, 10:12 - In 5 or 10 minutes, we get a folder: appinventor-sources with sources files of App Inventor. - Where is image App Inventor source? - Disk C:, folder Users, your name user, in my case juan, look this folder: C:\Users\juan\appinventor-sources - You can pry this sub-folders, look many files with.java..\appinventor\components\src\com\google\appinventor\components\runtime - Create extension. Pythagoras theorem. - Careful with upper and lower case, it isn't equal Cathetus what cathetus. - Our first extension: Pythagoras theorem.

6 von 11 09.01.2019, 10:12 - We need a Text Editor, I recomend Notepad++, create a file with name Pitagoras.java and paste this code: Pitagoras.java package com.pitagoras; // Juan Antonio Villalpando // kio4.com // Creacion de extensiones. Junio 2017. // Esta extension calcula la hipotenusa mediante el Teorema de Pitagoras. import com.google.appinventor.components.annotations.designercomponent; import com.google.appinventor.components.annotations.designerproperty; import com.google.appinventor.components.annotations.propertycategory; import com.google.appinventor.components.annotations.simpleevent; import com.google.appinventor.components.annotations.simplefunction; import com.google.appinventor.components.annotations.simpleobject; import com.google.appinventor.components.annotations.simpleproperty; import com.google.appinventor.components.common.componentcategory; import com.google.appinventor.components.common.propertytypeconstants; import com.google.appinventor.components.runtime.util.mediautil; import com.google.appinventor.components.runtime.*; @DesignerComponent(version = Pitagoras.VERSION, description = "Teorema de Pitagoras. " + "Juan Antonio Villalpando - KIO4.COM ", category = ComponentCategory.EXTENSION, nonvisible = true, iconname = "") @SimpleObject(external = true) public class Pitagoras extends AndroidNonvisibleComponent implements Component { public static final int VERSION = 1; public static final float DEFAULT_CATETO_A = 3f; public static final float DEFAULT_CATETO_B = 4f; private ComponentContainer container; private double cateto_a = 0; private double cateto_b = 0; public Pitagoras(ComponentContainer container) { super(container.$form()); this.container = container; Cateto_A(DEFAULT_CATETO_A); Cateto_B(DEFAULT_CATETO_B); // Creacion de las Propiedades. @SimpleProperty( category = PropertyCategory.BEHAVIOR) public double Cateto_A() { return cateto_a; @SimpleProperty( category = PropertyCategory.BEHAVIOR) public double Cateto_B() { return cateto_b; // Establecimiento de las Propiedades. @DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_NON_NEGATIVE_FLOAT, defaultvalue = Pitagoras.DEFAULT_CATETO_A + "") @SimpleProperty(description = "Asigna el valor del cateto A. " + "El separador decimal es el punto.") public void Cateto_A(double nuevocateto_a) { this.cateto_a = nuevocateto_a; @DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_NON_NEGATIVE_FLOAT, defaultvalue = Pitagoras.DEFAULT_CATETO_B + "") @SimpleProperty(description = "Asigna el valor del cateto B. " + "El separador decimal es el punto.") public void Cateto_B(double nuevocateto_b) { this.cateto_b = nuevocateto_b; // Funcion para calcular la hipotenusa. @SimpleFunction(description = "Introduce los dos catetos y obtendras la hipotenusa.") public double Pitagoras(double catetoa, double catetob) { double hipotenusa, cuadrado; hipotenusa = Math.sqrt((catetoA*catetoA)+(catetoB*catetoB)); cuadrado = hipotenusa * hipotenusa; // Calcula el cuadrado de la hipotenusa. YaCalculada(cuadrado); return hipotenusa; // Bloque disponible despues de calcular la hipotenusa. @SimpleEvent(description = "Muestra la hipotenusa al cuadrado.") public void YaCalculada(double sucuadrado){ EventDispatcher.dispatchEvent(this, "YaCalculada", sucuadrado); - Copy file Pitagoras.java in: C:\Users\juan\appinventor-sources\appinventor\components\src\com\google\appinventor\components\runtime

7 von 11 09.01.2019, 10:12 - Let's go to folder with App Inventor sources (C:\Users\juan\appinventor-sources\appinventor) - Click with Right button mouse, then click Git Bash Here. - Git bash get directory... C:\Users\juan\appinventor-sources\appinventor (master) [In Git bash, another way to get that directory is write: cd c/users/juan/appinventor-sources/appinventor ] - In Git Bash write: ant extensions - If all is perfect, you get: BUILD SUCESSFUL - Our extension is create in... C:\Users\juan\appinventor-sources\appinventor\components\build\extensions

8 von 11 09.01.2019, 10:12 - This is our extension: com.pitagoras.aix - Now in App Inventor. Import extension com.pitagoras.aix and look as works. - Important. - When write your extension, change name package with your name, file name,... change this word in all file.java package com.pitagoras; package com.juan; - This mean we build an EXTENSION, extensions aren't visible in Screen. category = ComponentCategory.EXTENSION, nonvisible = true, - This are DEFAULTS valors, you can look extension Properties. Letter f is float (also is possible: int, String, double,...) public static final float DEFAULT_CATETO_A = 3f; public static final float DEFAULT_CATETO_B = 4f;

9 von 11 09.01.2019, 10:12 - It is highly recommended to back up the file Pitagoras.java in other folder. - Pitagoras.aix can not convert to Pitagoras.java - You can put an icon image of 16x16 pixels: iconname = "imagenes/extension.png") - Also external link: iconname = "http://kio4.com/appinventor/imagenes/extension.png") - Look at the comments: - - Another example similar to the previous one. Join 2 texts. - This code is an adaptation to Pitagoras.java. This code join 2 texts. - Example, in TextoPrimero set "Hola" and TextoSegundo send "Adios", result is "HolaAdios". unidos = TextoPrimero + TextoSegundo; - Fíjate que en la aplicación de Pitágoras las variables eran numéricas double, ahora son de cadena de texto String. - Cuidado con las mayúsculas, no es igual String que string. UneTexto.java package com.unetexto; // Juan Antonio Villalpando // kio4.com // Creacion de extensiones. Junio 2017. // Esta extension se utiliza para unir dos textos. import com.google.appinventor.components.annotations.designercomponent; import com.google.appinventor.components.annotations.designerproperty; import com.google.appinventor.components.annotations.propertycategory; import com.google.appinventor.components.annotations.simpleevent; import com.google.appinventor.components.annotations.simplefunction;

10 von 11 09.01.2019, 10:12 import com.google.appinventor.components.annotations.simpleobject; import com.google.appinventor.components.annotations.simpleproperty; import com.google.appinventor.components.common.componentcategory; import com.google.appinventor.components.common.propertytypeconstants; import com.google.appinventor.components.runtime.util.mediautil; import com.google.appinventor.components.runtime.*; @DesignerComponent(version = UneTexto.VERSION, description = "Une dos textos. " + "Juan Antonio Villalpando - KIO4.COM ", category = ComponentCategory.EXTENSION, nonvisible = true, iconname = "") @SimpleObject(external = true) public class UneTexto extends AndroidNonvisibleComponent implements Component { public static final int VERSION = 1; public static final String DEFAULT_TEXTO_1 = "Hola"; public static final String DEFAULT_TEXTO_2 = "Adios"; private ComponentContainer container; private String texto_1 = ""; private String texto_2 = ""; public UneTexto(ComponentContainer container) { super(container.$form()); this.container = container; Texto_1(DEFAULT_TEXTO_1); Texto_2(DEFAULT_TEXTO_2); // Creacion de las Propiedades. @SimpleProperty( category = PropertyCategory.BEHAVIOR) public String Texto_1() { return texto_1; @SimpleProperty( category = PropertyCategory.BEHAVIOR) public String Texto_2() { return texto_2; // Establecimiento de las Propiedades. @DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_STRING, defaultvalue = UneTexto.DEFAULT_TEXTO_1 + "") @SimpleProperty(description = "Asigna el valor del texto 1. ") public void Texto_1(String nuevotexto_1) { this.texto_1 = nuevotexto_1; @DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_STRING, defaultvalue = UneTexto.DEFAULT_TEXTO_2 + "") @SimpleProperty(description = "Asigna el valor del texto 2. ") public void Texto_2(String nuevotexto_2) { this.texto_2 = nuevotexto_2; // Funcion que une los dos textos. @SimpleFunction(description = "Une dos textos.") public String UneTexto(String TextoPrimero, String TextoSegundo) { String unidos; unidos = TextoPrimero + TextoSegundo; YaUnidos(unidos); return unidos; // Bloque disponible despues de la union de los textos. @SimpleEvent(description = "Esto sale despues de unir los textos.") public void YaUnidos(String unidos){ EventDispatcher.dispatchEvent(this, "YaUnidos", unidos); - Ejemplo. - Every time you make a.java file, make a backup copy of it, copy it to another folder since at any moment you can block the clone of app-inventor-source and lose what you have.

11 von 11 09.01.2019, 10:12 - Mi correo: juana1991@yahoo.com - KIO4.COM - Política de cookies. Textos e imágenes propiedad del autor: Juan A. Villalpando No se permite la copia de información ni imágenes.