User Tools

Site Tools


android-mobapps:documentation

Documentation

The Code

In the tarball, there is a CS707Code directory. Below is a description of all the contents of CS707Code.

AppGrader
AppGrader.java: 
	this is the code for the Android application that collects data that can be used to grade applications.
AndroidManifest.xml: 
	this is the manifest file for the AppGrader.java
post.php: 
	this is an HTML form that allows you to test insert.php and the database by entering data in the form to be posted.
insert.php: 
	this receives data via HTML posts, connects to our database, and inserts the posted data.
Grade_Query.sql: 
	This is an example query that calculates grades several applications during some time interval according to the metrics described in .ppt
ProcessorLoadCalculator
ProcessorLoadCalculator.java: 
	this is the code for our program that helps us evaluate how accurate CPU grades are.
AndroidManifest.xml: 
	this is the manifest file corresponding to ProcessorLoadCalculator.java.
FormatProcessorInfo
FormatProcessorInfo.py: 
	this processes the the output of ProcessorLoadCalculator.java.
MemoryIntensiveActivity
MemoryIntensiveActivity.java: 
	this is the code for a program that is designed to be memory hungery.  The idea is that our AppGrader should give it a bad grade if it is grading well.
AndroidManifest.xml: 
	this is the manifest corresponding to MemoryIntensiveActivity.java.

Compiling/Installing AppGrader

  1. Create a new project in Eclipse or via the command line with the “android create project” command.
  2. Add the ProcessorLoadCalculator.java code file.
  3. Use AndroidManifest.xml as the manifest file. Note that special permissions are set here (for example, to access the SDCARD).
  4. Create the /sdcard/cs707 directory on the target phone
  5. Install the service
  6. Reboot the phone. The service should run automatically in the background. To make sure it is running, try running “adb shell” from the terminal your desktop/laptop and then run “ps -x” and find com.cs707.AppGrader in the list. The service will run in the background, updating /sdcard/cs707/grades.txt. The contents of this file will occasionally be posted to the server.

Server Side

Our server is running at mysql.cs.wisc.edu, username=harter. post.php inserts posted data into the database. Post fields are imei, table, and data. imei is the identifier for the phone, table is the name of the table in the database where the data is to be inserted, and data is a “multiline” field where the first line contains the names of the columns in the table and following lines contain data to be inserted. Fields within a line are separated by commas, and lines are delimited by ”@@@”. The user/application posting data to post.php is responsible for properly formatting data (for instance, putting quotes around strings), as post.php just blindly attempts to insert the data into the specified table.

Using Processor Load Calculator

This application is used to evaluate how well AppGrader grades applications. The idea is that if AppGrader gives a bad CPU grade to an application, that application should be competing with other applications for CPU usage. To see that this is actually the case, the ProcessorLoadCalculator runs in the background, incrementing a counter from 1 to 30M. If the application that was given a bad grade is running, it should be hogging the CPU, causing the counter to count slower. Every time ProcessorLoadCalculator reaches 30M, it writes an entry to /sdcard/processorCalc.txt that indicates the number of milliseconds it took to do the count.

android-mobapps/documentation.txt · Last modified: 2009/12/21 00:59 by tylerharter