A.Functioning Principle: In order to add IOIO support to App Inventor, the authors propose to develop an Android service that incorporates IOIO command. App Inventor Apps will call that service in order to add IOIO support and extend its features. In this section, the whole system will be presented as well as the different steps to establish the connection between IOIO and AppInventor.
The App Inventor application will communicate with a second application called IOIOAI, which is the Android service to develop. To execute IOIO commands and retrieve data from IOIO pins. Since Android services run in the background and do not have a screen interface, a notification indicates the service running state.
Before starting the activity, some settings needs to be configured first. For every App Inventor Application, this group of blocks should always be inserted in order to be able to call the service: •In order to call an app, it must be identified first, the two elements that allow a unique App identification are the package name and the class name. that is the role of the first two groups of blocks: setActivityPackage and setActivityClass•When AppInventor calls an application, the equivalent code in Android is startActivityForResult, which means that it expects something in return, this scenario is needed especially when desiring to read the value of IOIO’s analog and digital pins. ieee android projects with source code The developed IOIOAI Service will store that result inside a variable called “ai” and send it back to the app Inventor App. That’s the role of the setResultName block •When AppInventor wants to execute an IOIO command, it needs first to send the command to IOIOAI Service, the two applications will communicate between themselves using intents, which is an Android method to exchange data between and inside Apps. The setExtraKey and setExtraValue are used to transmit the command in a variable called “key_command”, the “value_command” is a parameter that is passed when calling the IOIO function For example, in order to set the digital pin 1 to the HIGH state, call the IOIO function and pass the parameter “digitalWrite,1,true”, that parameter will be affected to the key_command variable as illustrated in Fig.3
This section presents a demo to showcase the new possibilities unlocked by the combination of IOIO and App Inventor. Usually, HW tasks are very difficult to achieve by strictly Android programming and requires an electrical component on top of that. In addition, HW programmable devices like microcontrollers are not fit to execute complex tasks such as signal processing or establish a call. By using App Inventor and a smartphone, the programming complexity challenge is tackled and the additional costs related to purchasing new electrical components are avoided. https://codeshoppy.com/android-project-with-source-code-students.html The scenario is as follows: a biker want to determine if his bike’s turning angle is above the critical limit that will lead him to fall. He wants a device that tells him while turning if he has reached that limit, so he can adjust his turning angle before falling.
App inventor provides blocks to interface the orientation sensor. The developed App will read the angle and process to comparison: if the orientation angle is below 35° (turning left) or above 145° (turning right), then the speaker will be ON, otherwise, it is set to OFF.
Though the prototype seems simple and other better alternatives may exist, the plus here is that coming with an idea and concretize it has become a lot faster and easier. This demo featured a speaker to control, but an enthousiast can consider replacing it with a propulsion system that pushes the bike in the opposite direction and maintain the equilibrum, getting therefore one step closer to a self balancing bike and more importantly, to creative thinking .