AIA to Java Code

Hi,
I wanted to convert my aia file to java. Is there any way to do it if yes please tell me how ?

No you can’t.

See next post :point_down::point_down:

Yes you can, but not with Kodular. The App Inventor Java Bridge is an exploratory (alpha) version of App Inventor that allows you to generate a Java equivalent of the apps you have built.

http://www.appinventor.org/jbridge

5 Likes

Ahh… It’s interesting Thx @Peter I didn’t knew it.

1 Like

I tried it but whenever I tried to export to anyone of them a error occurs.


Edit : when tried in another browser it worked :grin::v:

Screen1.java (1.1 KB)

Blocks :

Java Code :

 package org.appinventor;
import com.google.appinventor.components.runtime.HandlesEventDispatching;
import com.google.appinventor.components.runtime.EventDispatcher;
import com.google.appinventor.components.runtime.Form;
import com.google.appinventor.components.runtime.Component;
import com.google.appinventor.components.runtime.Label;
import com.google.appinventor.components.runtime.Button;
class Screen1 extends Form implements HandlesEventDispatching {
  private Label Label1;
  private Button Button1;
  protected void $define() {
    this.AppName("Test");
    this.Title("Screen1");
    Label1 = new Label(this);
    Label1.Text("Text for Label1");
    Button1 = new Button(this);
    Button1.Text("Click");
    EventDispatcher.registerEventForDelegation(this, "ClickEvent", "Click" );
  }
  public boolean dispatchEvent(Component component, String componentName, String eventName, Object[] params){
    if( component.equals(Button1) && eventName.equals("Click") ){
      Button1Click();
      return true;
    }
    return false;
  }
  public void Button1Click(){
    Label1.Text("Hello World");
  }
}

Don’t use the new components from App Inventor like dictionaries or openstreetmap. I don’t think that will work.

2 Likes

Can it be implemented in Kodular :thinking:

1 Like

I don’t think Kodular will implement it because there are a lot of components source code that can be stolen by others.

2 Likes

is it possible to create extension using java code which is generated from aia using app inventor java bridge?

1 Like

#off-topic
Nope.I tried and it gave me some errors and i couldn’t export the java code.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.