roadlabs / appinventor-java-translation Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/appinventor-java-translation
Automatically exported from code.google.com/p/appinventor-java-translation
What steps will reproduce the problem?
1. Make a canvas, make brick containing the Dragged-event
2. Convert
3. Look in src
What is the expected output?
private void Canvas1_Dragged( float startX, float startY, float prevX, float prevY, float currentX, float currentY, boolean draggedSprite )
{
...
public void dispatchEvent( Object component, String id, String eventName, Object[] args )
{
...
if( eventName.equals( "Dragged" ) && component.equals( cnvDrawingCanvas ))
cnvDrawingCanvas_Dragged( (Float)args[0], (Float)args[1], (Float)args[2], (Float)args[3], (Float)args[4], (Float)args[5], (Boolean)args[6] );
What do you see instead?
private void Canvas1_Dragged()
{
... (noncopmpi)
}
public void dispatchEvent( Object component, String componentName, String eventName, Object[] params )
{
...
if( component.equals( Canvas1 ) && eventName.equals( "Dragged" ) )
{
Canvas1_Dragged();
}
What version of the product are you using? On what operating system?
trunk from SVN
Of course, this can be fixed manually. Other people might use the above manual
fix as a workaround untill the code generation has been fixed.
Original issue reported on code.google.com by jacob.nordfalk
on 20 Jun 2012 at 10:01
Decompiling an appinventor APK I can see that this is missing:
<activity android:name="com.google.appinventor.components.runtime.ListPickerActivity" android:screenOrientation="behind" android:configChanges="keyboardHidden|orientation" />
<activity android:name="com.google.appinventor.components.runtime.WebViewActivity" android:screenOrientation="behind" android:configChanges="keyboardHidden|orientation">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
Original issue reported on code.google.com by jacob.nordfalk
on 20 Jun 2012 at 9:41
What steps will reproduce the problem?
1. Download project source which was build with latest App Inventor version
2. Do everything like the tutorial said
3. Fail
What is the expected output? What do you see instead?
I expected to see no errors and java files in the output map.
What version of the product are you using? On what operating system?
Build 72
Please provide any additional information below.
This is te error:
C:\Users\Mitchell\Downloads>java -jar build-72.jar
256 [AWT-EventQueue-0] INFO org.reflections.Reflections - Reflections took 91 ms
to scan 1 urls, producing 22 keys and 51 values
383 [AWT-EventQueue-0] INFO org.reflections.Reflections - Reflections took 28 ms
to scan 1 urls, producing 22 keys and 51 values
423 [AWT-EventQueue-0] INFO org.reflections.Reflections - Reflections took 27 ms
to scan 1 urls, producing 22 keys and 51 values
java.lang.NoSuchMethodException: com.google.devtools.simple.runtime.components.a
ndroid.HorizontalArrangement.AlignVertical()
at java.lang.Class.getMethod(Unknown Source)
at org.translator.java.AppInventorProperties.getParamType(AppInventorPro
perties.java:215)
at org.translator.java.AppInventorProperties.instantiation(AppInventorPr
operties.java:107)
at org.translator.java.AppInventorProperties.instantiation(AppInventorPr
operties.java:116)
at org.translator.java.AppInventorProperties.generateFormBlock(AppInvent
orProperties.java:158)
at org.translator.java.AppInventorProperties.generateCode(AppInventorPro
perties.java:75)
at org.translator.java.AppInventorScreen.generateJavaFile(AppInventorScr
een.java:156)
at org.translator.java.AppInventorProject.generateSource(AppInventorProj
ect.java:354)
at org.translator.java.AppInventorProject.load(AppInventorProject.java:1
09)
at org.translator.java.AppInventorProject.load(AppInventorProject.java:6
8)
at org.translator.java.AppInventorProject.<init>(AppInventorProject.java
:58)
at org.translator.java.gui.AndroidToJavaForm.btnConvertActionPerformed(A
ndroidToJavaForm.java:204)
at org.translator.java.gui.AndroidToJavaForm.access$2(AndroidToJavaForm.
java:195)
at org.translator.java.gui.AndroidToJavaForm$3.actionPerformed(AndroidTo
JavaForm.java:98)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
ce)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
ce)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
ce)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
ce)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at org.translator.java.AppInventorProperties.getValueString(AppInventorP
roperties.java:224)
at org.translator.java.AppInventorProperties.instantiation(AppInventorPr
operties.java:108)
at org.translator.java.AppInventorProperties.instantiation(AppInventorPr
operties.java:116)
at org.translator.java.AppInventorProperties.generateFormBlock(AppInvent
orProperties.java:158)
at org.translator.java.AppInventorProperties.generateCode(AppInventorPro
perties.java:75)
at org.translator.java.AppInventorScreen.generateJavaFile(AppInventorScr
een.java:156)
at org.translator.java.AppInventorProject.generateSource(AppInventorProj
ect.java:354)
at org.translator.java.AppInventorProject.load(AppInventorProject.java:1
09)
at org.translator.java.AppInventorProject.load(AppInventorProject.java:6
8)
at org.translator.java.AppInventorProject.<init>(AppInventorProject.java
:58)
at org.translator.java.gui.AndroidToJavaForm.btnConvertActionPerformed(A
ndroidToJavaForm.java:204)
at org.translator.java.gui.AndroidToJavaForm.access$2(AndroidToJavaForm.
java:195)
at org.translator.java.gui.AndroidToJavaForm$3.actionPerformed(AndroidTo
JavaForm.java:98)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
ce)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
ce)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
ce)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
ce)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Original issue reported on code.google.com by [email protected]
on 12 Sep 2012 at 3:49
I converted some code using list pickers and bluetooth.
Most of the code seems actually to be OK!
But I stumbled into this showstopper:
The generated code was:
ListPicker1.Elements( BluetoothClient1.AddressesAndNames() );
But ListPicker1.Elements( ) expects an YailList, and
BluetoothClient1.AddressesAndNames() returns a List<String>.
So I changed to
List<String> l = BluetoothClient1.AddressesAndNames();
YailList yl = YailList.makeList(l);
ListPicker1.Elements( yl );
which seems to accepted in the editor. However, when I compile I get:
Compiling 3 source files to
/home/j/android/AppInventor/appinventor-til-java/xxx/bin/classes
/home/j/android/AppInventor/appinventor-til-java/xxx/src/org/robot1/Screen3.java
:78: cannot access gnu.lists.Pair
class file for gnu.lists.Pair not found
YailList yl = YailList.makeList(l);
1 error
Looking at the libSimpleAndroidRuntime.jar I can see that it depends on the GNU
classes, but they are not included.
Original issue reported on code.google.com by jacob.nordfalk
on 19 Jun 2012 at 7:44
What steps will reproduce the problem?
1. C:\users\myname\desktop\app_inventor_java_conversion> java -jar
AppInventorToJava.jar
2. INPUT: C:\Users\myname\Desktop\install checklist source code.zip
OUTPUT: C:\Users\emmertw\workspace\installChecklist2.zip
3. Click Convert
What is the expected output? What do you see instead?
I started a new project in the Eclipse program and after starting a project,
made a copy and zipped the contents. I then downloaded my app inventor code
from google docs where google put them when app inventor shut down. I then made
a copy of that file and zipped it. I then followed the steps listed above with
the App Inventor zip as the input, and the Eclipse zip as the output. I had
expected to see some sort of output that tells me it's working. I get the
message Error Generating Manifest: java.lang.NullPointerException in the
command prompt when I hit convert. Then, it corrupts the output zip file.
What version of the product are you using? On what operating system?
build 67
Please provide any additional information below.
That is all I can tell you, I suck as actual Java Programming, but actually
managed to eek out an awesome application in App-inventor. I figured I could
just use this to translate it (to some degree) and use that as a launch-pad to
start actual Java Programming.
I've attached the Google Supplied app-inventor code and my zipped project from
Eclipse (un corrupted) so you can see.
Original issue reported on code.google.com by [email protected]
on 11 Feb 2012 at 9:39
Attachments:
What steps will reproduce the problem?
1. Choose the App Inventor downloaded zip file (Robotar.zip)as input.
2. Choose a directory for the output (RoboTar)
3. Click Convert.
What is the expected output? What do you see instead?
I was expecting the source to be created in the RoboTar director.
What version of the product are you using? On what operating system?
build-72.jar
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 14 Jan 2013 at 4:18
What steps will reproduce the problem?
1. run appinventor2java.jar
2. select zip input (my project) & zip ouput(i suppose, the zip with source
translated)
3. click in convert
What is the expected output? What do you see instead?
i expected the zip with the new source.
nothing
What version of the product are you using? On what operating system?
build 67 & win7 x64
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 13 Dec 2011 at 11:09
Your code should be changed from using the project name as key for the screens
to using the screen name
Change from:
private void loadSourceFile( String path, InputStream inputStream ) throws IOException
{
projectName = getFolder( path );
AppInventorScreen screen = screens.get( projectName );
if( screen == null )
screen = new AppInventorScreen( projectName );
if( path.endsWith( ".blk" ))
screen.loadBlocksFile( inputStream );
else if( path.endsWith( ".scm" ))
screen.loadComponentFile( inputStream );
else if( path.endsWith( ".yail" ))
screen.loadInterfaceFile( inputStream );
screens.put( projectName, screen );
}
to:
private String getScreenName( String path )
{
int lastSlash = path.lastIndexOf( '/' );
path = path.substring(lastSlash);
int lastDot = path.lastIndexOf( '.' );
return path.substring(0, lastDot);
}
private void loadSourceFile( String path, InputStream inputStream ) throws IOException
{
projectName = getFolder( path );
String screenName = getScreenName( path );
AppInventorScreen screen = screens.get( screenName );
if( screen == null )
screen = new AppInventorScreen( projectName );
if( path.endsWith( ".blk" ))
screen.loadBlocksFile( inputStream );
else if( path.endsWith( ".scm" ))
screen.loadComponentFile( inputStream );
else if( path.endsWith( ".yail" ))
screen.loadInterfaceFile( inputStream );
screens.put( screenName, screen );
}
Original issue reported on code.google.com by jacob.nordfalk
on 20 Jun 2012 at 8:42
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.