To get the Sphero to move we use the the accelerometer in your phone to figure out how fast to move the Sphero. We used the linear accelerometer because in our case we did not want to have gravity applied to force. In our testing of the accelerometer we discovered that a light swing registered 3 and a hard swing registered in the mid 20s. Since the Sphero drive command only accepts values between 0 and 1, we divided the force by 10 to get it in the right range and to make the game feel natural to play. We also only registered values above 3 because anything lower would cause the backswing to make Sphero move.
One problem we had was with the Sphero documentation for the Calibration view. The documentation on their GitHub page gave the wrong package name for the CalibrationView class. We ended up looking through the jar file to find the actual package name.
The only research we had to do was look at Android documentation for the accelerometer and the Parceble class.
Here is the screen where you create the course
]]>
For our final project we would like to create a golfing app with sphero. To control the sphero, you would swing your phone like a golf club and sphero would move based on how fast you swung your phone. You would be able to aim the ball by specifying a direction on the phone. The first screen the user would see is one that allows them to create the course they are playing by specifying the number of strokes per hole. The next screen would be where the user would swing the phone. It would have a picture of a golf club and use the Sphero calibration screen to aim. The final screen would show a scorecard for the round.
Joe will be working on GUI portion and David will be working on the accelerometer part of the app. The accelerometer must be done first because the GUI just responds to the ball moving.
]]>
This screen shot shows all the people you’ve entered and the number of gifts for each person
This screen shows how to add gifts
This screen shows a detailed view of a person
Here is a detailed view of each gift
]]>The app then calculates the total tip, the total tip per person, and the total each person should pay.
One lesson I learned is how to use the TableLayout. It was really easy to use and is much better for aligning data then using nested LinearLayouts.
]]>
2. An SSH terminal app that allows to connect and issue commands to your server. It would have the same look and feel of terminals that you find on your computer.
3. A guitar utility app. It would be able to show you all the scales, chords, and have a built in tuner that would use the microphone to detect pitch. The tuner part might be a bit complicated to code.
4. A to-do list/reminder app. It would be very basic and have a clean interface. A lot of the other apps I see have too many features and it makes the app seem bloated.
5. An app that uses the GPS on phone in some way. Like an app that would remind of something when you arrive at a location.
]]>This screen allows you to enter a keyword to search for.
This screen displays the results in a ListView. The GitHub developer API is going through some changes right now so there is no way to limit how many results will be returned. This could be a problem if you are on a slow network.
After you select a repository to view, this screen will pop up and give more details about it. The button on the bottom opens up the browser and allows you to visit the actual repo on GitHub.
The only problem I ran into was getting everything aligned correctly on the details screen. I was able to do it by nesting vertical linear layouts inside of a horizontal linear layout and adjusting the margins of each text view manually. I’m sure there is a better way to do this as this seems like a pretty common way to display data.
]]>