code of app

16 views
Skip to first unread message

Lam Henry

unread,
Jun 23, 2019, 9:32:25 AM6/23/19
to MIT App Inventor Forum
How can we read the code of the app?

SteveJG

unread,
Jun 23, 2019, 9:45:34 AM6/23/19
to MIT App Inventor Forum
Not sure what you mean Lam.  The 'code' is your Blocks.

Here is an explanation by one of the developers This Forum discussion explains how the App Inventor compiler uses several programming languages https://groups.google.com/forum/#!msg/mitappinventortest/cMkhyGqvFFA/ioqpC7jAL8MJ;context-place=categories/mitappinventortest 

The aia file (if you create one) contains the source code .   Do you want to look inside?   The aia file is actually a special kind of zip file.   Change the suffix of your Project aia ( myProject.aia    to  myProject.zip )  Use the program you use to look at zipped file and you will find something like this

7sip.PNG


This was done with 7-zip ... then you can open the folders.  Not much to see other than the Screenblkly file (which are your Blocks in digital form) and if you have resources in Media, you can find the files.

Is this what you wanted to know?


Regards,
Steve

Lam Henry

unread,
Jun 23, 2019, 9:51:53 AM6/23/19
to MIT App Inventor Forum
e.g. <a href=" .......><b><font size = 2>

Lam Henry

unread,
Jun 23, 2019, 10:13:36 AM6/23/19
to MIT App Inventor Forum
can't open .bky file.
x4.jpg

Peter Mathijssen

unread,
Jun 23, 2019, 10:23:53 AM6/23/19
to mitappinv...@googlegroups.com
This is how the aia file looks on the inside.

aiafilestructure.png


Some text used and adapted from 

"ENCOURAGING COLLABORATION THROUGH APP INVENTOR" 

By

Katherine Kyle Feeney


App Inventor allows users to download the project files (or source file) for their projects, which can then be reloaded. The structure will look something like this:


The assets folders hold all files that have been uploaded to the project as an asset. If no assets are associated with a project then there will be no assets folder. 

If you import an extension a folder named external_comps will be created inside the assets folder. The extension will be uploaded to the external_comps folder. There will be a folder created inside the external_comps folder for every extension. 


The  /src/appinventor/ai_username/example folder holds a .blk file and a .scm file for every screen in the project. For example every project will have a Screen1.blk file and a Screen1.scm file. The Screen1.blk file holds all information about the blocks associated with Screen1 and the Screen1.scm file holds information about the layout of Screen1. 


The youngandroidproject folder holds only one file, the project.properties file. This file holds basic information

about the project, such as name, main screen and file structure.


SteveJG

unread,
Jun 23, 2019, 12:17:00 PM6/23/19
to mitappinv...@googlegroups.com
open the bky file with Notepad and you should see something that looks like this stuff below.  the bky file is an xml file.

  <block type="procedures_defnoreturn" id="K_$YZQP1AO!-t%c/1CeU" x="0" y="0">
    <field name="NAME">searchText</field>
    <statement name="STACK">
      <block type="lexical_variable_set" id="-d.-iE6/cjI@4C{$(WWn">
        <field name="VAR">global temporaryList</field>
        <value name="VALUE">
          <block type="lists_create_with" id="PzU^!DzWPYkkI^uuq)Hn">
            <mutation items="0"></mutation>
          </block>
        </value>
        <next>
          <block type="component_set_get" id="_N%*ej=njWCM_107~C=X">
            <mutation component_type="ListView" set_or_get="set" property_name="Elements" is_generic="false" instance_name="ListView2"></mutation>
            <field name="COMPONENT_SELECTOR">ListView2</field>
            <field name="PROP">Elements</field>
            <value name="VALUE">
              <block type="lists_create_with" id="*u+Ov5j0]$nz7_K!=z4%">
                <mutation items="0"></mutation>
              </block>
            </value>
            <next>
              <block type="component_set_get" id="|pf:%zgAklh+Lld/QEbk">
                <mutation component_type="Label" set_or_get="set" property_name="Text" is_generic="false" instance_name="Label1"></mutation>
            etc. etc. etc.
Reply all
Reply to author
Forward
0 new messages