This week we we're told to write an application that interfaces with an input and/or output device that i made. my final project is a smart camera slider controlled over bluetooth with android app. so i started to make an android application to control the camera slider. i found that amazing website called mit app inventor its an educational tool provided by mit that helps you buid android apps with drag and drop scratch style coding. i googled for tutorials and i found this youtube tutorial that teaches you how to build an android app that interacts with arduino over bluetooth.
after signing in the website and starting a new project you will have 2 tabs the first one is the designer tab is where you design the user interface for your application and the second tab is the blocks tab where you dragndrop blocks of code to write your own android app, so i started designing my android app.
in my app i need to control the direction of movement, speed, time, distance. so i added 3 buttons for movement (forward,stop,backward) and another one for connecting to the bluetooth, 3 sliders(speed,time,distance) then i changed the parameters of every single element like the text, colors and the postion.
in order to write the code i had to drag and drop blocks of code and snap them together so they can make sense. i followed the youtube tutorial instructions to build my app.
the first two group of blocks are in control of the bluetooth and how to connect and pair.
the left side group is in charge of the sliders for example "when sliderspeed postion changed do the following: send the char V and the slider postion over the bluetooth and set speed text to slider postion".
the right side is in charge of the buttons. for example "when button forward clicked do the following: send the char F over the bluetooth".
after finnishing my app i saved it on my mobile phone. and it worked like charm!.