this tutorial is very funny, is just a useless machine, but this time in app for android phones.
I think is a simple project for the first time app so enjoy
I use the Mit inventor and my cellphone, maybe in the future improve the instructable or the app, that depends of how much popular is!!!
Do you don't know about useless machine???
yeah, is just that, the machine just turn off it self
here is link to the google playstore to install the final app if you wish
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: The Sprites
I used my Nintendo 3DS whit flipnote to make simple gifs for this, later I edit them in http://www.online-image-editor.com/ to make the transparency effect at background... you can use the way you want to do this, paint, photoshop or taking pictures, please be free to chose the path you want. also remember take note about the width and height of your sprites.
I used only tree sprites, button pressed, unpresed and the instructables robot's arm.
NOTE: make the background transparent is is important, if you skip this the app will not work properly, because it will check the collides between sprites at borders of the GIF image.
Step 2: The Project at the MIT Inventor
http://ai2.appinventor.mit.edu/ please open the MIT inventor in an tab, this will ask you for a google account and you sign in and that is the app inventor.
if is your first project just press in new project, if isn't press My projects and new one up of the projects list. then name it.
now in the down right side you have a Media titled rectangle with a button for upload, upload the sprites
then in the right side are the properties of your app, I set someones like
AppName : Useless Machine App
Title : press on
icon : Arm.gif
Align vertical : Bottom (this is not in the image)
Step 3: Dragging Things
- now from the left side, press the drawing and media from the palette, and drag a Canvas from there to the screen of the app, now next to the properties rectangles in the components, we see the Canvas, select it and set the canvas properties as width and height to fill the parent. now we see the canvas is filling the screen.
- drag now a image sprite,select in the component window an rename it as arm, then select the Picture property of the arm sprite to "arm.gif" also check the z property and put it in 2.0 and uncheck the Rotates
- drag another image sprite component from the palette, name it as button and set the picture to "off.gif" (keep z property in 1.0)
- drag from the sensor palette a clock component
now drag the button sprite to their final position and check the visual is fine when you are finished this, up of the properties are the designer and block buttons, the designer is the visual part and the block is the program part, so now we move to the block.
Step 4: The Block
press the block button at the right up side of the properties and now you see a empty canvas, this block part is little bit tricky, but easy when you catch it. it work like a jigsaw puzzle so you select some blocks and put in others.
select in the blocks menu the purple square with procedures and drag the first to the Viewer canvas, then rename it as pressonoff, (just for reference) in order for that you only press in the "procedure" name in the block you dragged.
then in the block is the Control one, look for a "If" block, the first one will fit inside of the pressonoff one, then press the little blue square and drag an else block to the right side If block. this blue square is call as mutator, and serve to change the shape of blocks.
now in the logic block drag a = to the first space of the if
look in the blocks, for button sprite and search Button Picture block and set in the = block
select the text block, the first one is a empty " " and put in the other empty space of the = block, then press the block and write off.gif
with that means, when the pressonoff action is called, it checks if the picture in the sprite is off.gif
now when you catch the idea of where are the blocks and how to put it, I ask you to see the pics and I will explain the idea
complete the pressonoff procedure with this, Set button picture to on.gif, set arm speed to 5 and the else with set the picture to off.gif and spped to -5
that means, when the pressonoff is called, it will change the speed of the arm and set the button in the other position.
Step 5: More Block
now the explanation in counter clockwise
- pressonoff.... I had explain this, but also put the instruction to change the title
- when screen 1 initialize..., this set up the canvas, more high than the screen, set the arm off the sight and pointing down to wait the user press on
- when button is touch, turn on or off the machine
- when the arm sprite reach the button, also turn off the machine
- this close the app when the user press the cellphone's back button, this is for avoid keep open the app and save energy
Step 6: Build the Apk
in the up left is the build menu, I downloaded the apk and send to my phone, if you want you can do it, or use the qr, it's your choice.
may you are not enable to install the app in your device, if that happen, the most probable solution is this
"How to Enable Third Party Apps Installation on Android Phones
One should perform these steps to enable third party apps installation on the Android phone/ device with APK file (already downloaded on SD memory Card of Phone/Device):
For Android OS version 2.3 and earlier:
Step 1 – Go to Settings.
Step 2 – Go to Applications.
Step 3 – Tap and check “Unknown sources” box.
Step 4 – Tap ‘OK” when it show the warning. Thats how you can enable the installation of APK files on your phone manually.
For Android OS version 4.0+:
Step 1 – Go to Settings.
Step 2 – Go to Security.
Step 3 – Scroll down and check “Unknown sources” box.
Step 4 – Tap ‘OK” when it show the warning. All Done, Now you can install 3rd party Apps through APK files on your device with Android 4.0+ OS."
Step 7: Try It
is very funny
Here is a video with a preview
please comment or ask if you want!