2017년 6월 15일 목요일

Important information for extension developers


With our upcoming IOT release there will be some improvements to how extensions work:

1) Extension bundles: If you have two or more extension in the same package, they will be put into a single .aix file named with the package. When you import this .aix into App Inventor, you will get multiple extensions listed in the palette. This allows extension developers to group related extensions into a single package rather than asking users to upload many extensions. It also cuts down on the time needed to package up AIA and build server requests by reducing the number of files in a project.

2) Extension icons: Until now, icons needed to be compiled as part of the MIT AppInventor build or hosted externally using an HTTP or HTTPS URL. Now it is possible to include icons in the extension. To do so, create a directory aiwebres in the same package as the extension. Add a PNG file for the icon, and name it in the iconName field of the @DesignerComponent annotation, for example "aiwebres/icon.png". When the extension is packaged it will be pulled into the AIX and the SimplePaletteItem will correctly load the icon from the MIT App Inventor server.

3) Extension properties: There is a Bluetooth component property type that is used by the LEGO MINDSTORMS code to limit selection of a component to a BluetoothClient component. We have extended this functionality for our IOT work so that you can now name a component by its fully-qualified class name and the list of current components will be restricted to only those components that are instances of the named class. This can be useful for having multiple extensions that connect to one another in some meaningful way. For example, we use this in our Arduino and Micro:bit extension to limit the BluetoothDevice property to BluetoothLE instances. To take advantage of this, set the editorType of the @DesignerProperty annotation to PropertyTypeConstants.PROPERTY_TYPE_COMPONENT + ":" + the fully qualified class name of the target component type.

4) Extension loading: We have improved extension loading in the companion so that multiple extensions can link with one another for more complex extension interactions. For example, we can have one extension call methods in another extension's classes. Extensions may also be imported/upgraded after connecting the companion if using the ai2-test server with companion 2.41t2 or higher.

5) Extension help URLs: The @DesignerComponent annotation now has a helpUrl field that can be used to specify a URL for documentation. This will be used to populate the href attribute of the "More information" link that appears in the palette help when user's click on the ? icon. If no helpUrl is provided the link will no longer appear.

If you have any questions, concerns, or suggestions, please let us know.

--
Nice improvements.

--
Does the Power Users Group include the major Arduino posters?

--
Some, but not all. We've also been reaching out to individuals posting on the public forum who have been asking questions about Bluetooth LE specifically. If you have any suggestions for candidates to do testing we are glad to expand the test cohort.

--
The authors of the Arduino or BLE projects on my FAQ would probably qualify ...

--
I should also point out that you can test these new additions using the latest master branch and the ai2-test.appinventor.mit.edu server.

--
Is Android API level upgraded?

--
We are working on an upgrade path to 7.1.1, but it will take some time because we need to do some significant refactoring of existing components due to the change in the permission model from 5.1.1 to 6.0 and a number of APIs have been deprecated or removed. Once we are a little bit closer to a release there will be community testing on ai2-test so that we can identify any problem points.

--

2) Extension icons: Until now, icons needed to be compiled as part of the MIT AppInventor build or hosted externally using an HTTP or HTTPS URL. Now it is possible to include icons in the extension. To do so, create a directory aiwebres in the same package as the extension. Add a PNG file for the icon, and name it in the iconName field of the @DesignerComponent annotation, for example "aiwebres/icon.png". When the extension is packaged it will be pulled into the AIX and the SimplePaletteItem will correctly load the icon from the MIT App Inventorserver.


What should be the recommended size for icons? Also, can it be transparent? 

--
I started updating some of my extensions and just saw that on importing new version, the extension didn't upgrade. Instead, I got a dialog box saying that I have been adding duplicate extension. 

So, after deleting old extension and importing new one again, it doesn't show Class name, but it used the last word after dot from the package name. For eg, it take pavitra from com.pavitra (package name), where the class name is Arduino.

In my opinion, I think you should make some modifications in this point quoted below.

1) Extension bundles: If you have two or more extension in the same package, they will be put into a single .aix file named with the package. When you import this .aix into App Inventor, you will get multiple extensions listed in the palette. This allows extension developers to group related extensions into a single package rather than asking users to upload many extensions. It also cuts down on the time needed to package up AIA and build server requests by reducing the number of files in a project.


 I mean it maybe good for multiple extensions, but is not useful for single extensions. 

--
Sorry, it's my fault. It works well as expected. There's nothing wrong with AppInventor.

--
Just as a follow-up to this. Starting with companion release 2.42 released on 2017-06-14, extension developers can now report errors via the Screen.ErrorOccurred event using the constant ErrorMessages.ERROR_EXTENSION_ERROR. Additional arguments that will need to be pass for the format string are (1) an integer value to indicate an error code specific to the extension (only significant to the extension developer, e.g., 9001), (2) a String naming the extension (e.g., "BluetoothLE"), and (3) a string with a textual description for the error (e.g., "Device index out of bounds"). The goal is to make it easier to report extension errors through the existing error handling mechanisms in App Inventor. As part of this release, all of the items mentioned in the earlier post are now available on the production instance as well. If you have any issues, please let us know as soon as possible so we can address them.

--

댓글 없음:

댓글 쓰기