2016년 12월 24일 토요일

Publishing an App with an Extension


I've made a simple app that uses the Bluetooth Low Energy (BLE) extension. When I go to publish it to the Gallery, it says that we are not allowed to publish apps with extensions to the Gallery. Does anyone know if that 'feature' will be supported in the future?

I've downloaded the .apk and installed it on my Android phone, but it doesn't seem to be able to work with the my bluetooth radio. Everything else with the app works, but when I scan for BLE devices nothing ever gets found. Perhaps there's something else I should be doing in the app to initialize the BLE component that doesn't need to be done when using the MIT InventorApp in companion mode?

-- 
Whether extension will be supported in the future: maybe. So far extensions are experimental and until they mature, it is not likely that you can add them to the gallery, but you can publish your apps in the Play store as you can any other AI app.

I am wondering now how you developed uyour BLE app. Did you try to use the AI Companion on your phone and run it that way? If that works, your .apk should work too.
Post a screenashot of your relevant blocks, then we can take a look.

-- 
I thought that the BLE extension was considered mature and supported because it is not in the 'unsupported' section of this site: http://appinventor.mit.edu/extensions/ perhaps 'supported' doesn't necessarily mean 'mature enough for gallery usage'?

I did use the AI Companion app on my phone and I connected it via wifi. That did seem to work. 

Attached is the .aia file that has everything, as well as the compiled .apk file. I still have all of my blocks on one 'page' within the blocks editor. I assume the best way to organize all of those is to make them into procedures, but I just haven't done that yet. Let me know if I should take multiple screenshots and post them up here.

When you open the app there is a button to start scanning, and it should show a list of all the BLE devices, then if you press the button at the top, that sets a variable that then allows you to connect to the BLE device that is at that index in the list of BLE devices. When I first installed the app on my phone I got a pop up warning saying that BLE advertisements were not available. I had seen this error before when my Bluetooth was turned off on my phone, but after I turned the radio back on and I hit 'scan' it never found any devices, even though there were multiple in range that were sending advertising packets. 


-- 
Both the BLE extension and extensions itself are still experimental as far as I know. Which does not mean that you cannot make apps, but there is no guarantee that what you will make now will still work in a next release (well... is there ever?)
The warning about advertisements means that the BLE implementation on your phone does not support them, therefore you cannot run an app that needs then. But there is still a bug in the BLE extension that gives this warning even if you do not intend to use it. The problem then is that your app does not have the required permissions and will not work.
The easy work around is to include the old BT compionent in your app. You do not need to use it, just drag it into your design area.
If you now compile your app the necessary permisson will be included and your app should work (provided it did this using the companion on your phone).

-- 
When I go to publish it to the Gallery, it says that we are not allowed to publish apps with extensions to the Gallery


it seems to be, the Gallery needs an update to accept apps having extensions, too...
@Dave?


Both the BLE extension and extensions itself are still experimental as far as I know. Which does not mean that you cannot make apps, but there is no guarantee that what you will make now will still work in a next release 
@MIT: is Ghica's assumption correct?
as far as I know, the extension feature has been finally released 6 months ago... however the AppinventorExtensions document still needs an update...

-- 
Extensions are still experimental, as Ghica says.   We will be updating them, and that might require updating the extension aix files.
Two issues we are looking at are the need for extensions that provide more than one component, and interaction between extensions and the library.
Jeff can provide more information.  He is working on this, but no ETA.

-- 


댓글 없음:

댓글 쓰기