Index: lasspath
===================================================================
--- .classpath	(revision 999095f91ac79def9e2d4dbb14a6f4694a173ec4)
+++ 	(revision )
@@ -1,8 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
-	<classpathentry kind="src" path="gen"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/galconcommon"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
Index: gignore
===================================================================
--- .hgignore	(revision 999095f91ac79def9e2d4dbb14a6f4694a173ec4)
+++ 	(revision )
@@ -1,3 +1,0 @@
-
-syntax: regexp
-^bin$
Index: AndroidManifest.xml
===================================================================
--- AndroidManifest.xml	(revision 999095f91ac79def9e2d4dbb14a6f4694a173ec4)
+++ AndroidManifest.xml	(revision d936b97e809ae643d68921c564db77cc219b69ac)
@@ -1,14 +1,18 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.helloandroid">
-    <application android:icon="@drawable/app_lunar_lander" android:label="@string/app_name">
-        <activity android:name="Game">
+      package="com.example.helloandroid"
+      android:versionCode="1"
+      android:versionName="1.0">
+    <application android:icon="@drawable/icon" android:label="@string/app_name">
+        <activity android:name=".HelloAndroid"
+                  android:label="@string/app_name">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
-		</activity>
+        </activity>
+
     </application>
     <uses-sdk android:minSdkVersion="7" />
-    <uses-permission android:name="android.permission.INTERNET" />
-</manifest>
+
+</manifest> 
Index: ssage_spec.txt
===================================================================
--- message_spec.txt	(revision 999095f91ac79def9e2d4dbb14a6f4694a173ec4)
+++ 	(revision )
@@ -1,18 +1,0 @@
-Message Spec
-
-Message_Type	Sender		Contents					Description
-
-LOGIN			Client		[username],[password]
-ANON_LOGIN		Client		N/A							Sent if the client wants an anonymous login
-LOGIN_ACK		Server		N/A							Server accepted login. Maybe sends additional info, like stats
-ANON_LOGIN_ACK	Server		[username]					Server determines a username for the anon user
-LOGIN_ERR		Server		Error message				Indicates an error with the login, probably a wrong password
-
-GAME_INFO		Server		Info about one game			When a player joins the lobby, server sends one of these
-							(See below for format)		for each game that's currently looking for players. The
-														server also sends one (containing all info about the game)
-														each time something about an open game changes
-
-GAME_INFO format:
-
-[name],[current players],[max players]
Index: res/layout/main.xml
===================================================================
--- res/layout/main.xml	(revision 999095f91ac79def9e2d4dbb14a6f4694a173ec4)
+++ res/layout/main.xml	(revision d936b97e809ae643d68921c564db77cc219b69ac)
@@ -1,26 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
     android:layout_width="fill_parent"
-    android:layout_height="fill_parent">
-    
-    <com.example.helloandroid.GameView
-      android:id="@+id/lunar"
-      android:layout_width="fill_parent"
-      android:layout_height="fill_parent"/>
-    
-    <RelativeLayout
-        android:layout_width="fill_parent"
-        android:layout_height="fill_parent" >
-        <TextView
-          android:id="@+id/text"
-		  android:text="@string/lunar_layout_text_text"
-		  android:visibility="visible"
-          android:layout_width="wrap_content"
-          android:layout_height="wrap_content"
-          android:layout_centerInParent="true"
-          android:gravity="center_horizontal"
-          android:textColor="#88ffffff"
-          android:textSize="24sp"/>
-     </RelativeLayout>
-         
-</FrameLayout>
+    android:layout_height="fill_parent"
+    >
+<TextView  
+    android:layout_width="fill_parent" 
+    android:layout_height="wrap_content" 
+    android:text="@string/hello"
+    />
+</LinearLayout>
Index: res/values/strings.xml
===================================================================
--- res/values/strings.xml	(revision 999095f91ac79def9e2d4dbb14a6f4694a173ec4)
+++ res/values/strings.xml	(revision d936b97e809ae643d68921c564db77cc219b69ac)
@@ -1,24 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-
 <resources>
-	<string name="app_name">Galcon Clone</string>
-	
-    <string name="menu_start">Start</string>
-    <string name="menu_stop">Stop</string>
-    <string name="menu_pause">Pause</string>
-    <string name="menu_resume">Resume</string>
-    <string name="menu_connect">Connect</string>
-    
-    <string name="mode_ready">Lunar Lander\nPress Up To Play</string>
-	<string name="mode_pause">Paused\nPress Up To Resume</string>
-	<string name="mode_lose">Game Over\nPress Up To Play</string>
-	<string name="mode_win_prefix">Success!\n</string> 
-	<string name="mode_win_suffix">in a row\nPress Up to Play</string> 
-	
-	<string name="message_stopped">Stopped</string>
-	<string name="message_off_pad">Off Landing Pad</string> 
-	<string name="message_too_fast">Too Fast</string> 
-	<string name="message_bad_angle">Bad Angle</string> 
-
-    <string name="lunar_layout_text_text">This is the lunar layout text.</string>
+    <string name="hello">Hello World, HelloAndroid!</string>
+    <string name="app_name">Hello, Android</string>
 </resources>
Index: c/com/example/helloandroid/ClientThread.java
===================================================================
--- src/com/example/helloandroid/ClientThread.java	(revision 999095f91ac79def9e2d4dbb14a6f4694a173ec4)
+++ 	(revision )
@@ -1,47 +1,0 @@
-package com.example.helloandroid;
-
-import common.*;
-
-/*
- * This thread is responsible for interacting with the server. It waits to receive messages from the server and then handles them.
- */
-
-public class ClientThread extends Connection {
-	private Game main;
-	
-    public ClientThread(String ip, int port, Game main) {
-    	super(ip, port, "ClientThread");
-    	
-    	this.main = main;
-    }
-    
-    protected void processMessage(MessageType type, String input) {
-        
-    }
-    
-    protected void connectionStart() {
-    	main.mThread.connMessage = "Connection Started";
-    }
-    
-    protected void connectionSuccess() {
-    	main.mThread.connMessage = "Connected to Server";
-    	sendMessage(MessageType.Info, "Yo, youze beeze gay!");
-    }
-    
-    protected void connectionFailure(String str) {
-    	main.mThread.connMessage = "Server not found";
-    	main.mThread.connMessage = str;
-    }
-    
-    protected void connectionBreak() {
-    	main.mThread.connMessage = "Your connection was interrupted";
-    }
-    
-    protected void peerDisconnect() {
-    	main.mThread.connMessage = "The server disconnected";
-    }
-    
-    protected void connectionEnd() {
-    	
-    }
-}
Index: c/com/example/helloandroid/Fleet.java
===================================================================
--- src/com/example/helloandroid/Fleet.java	(revision 999095f91ac79def9e2d4dbb14a6f4694a173ec4)
+++ 	(revision )
@@ -1,307 +1,0 @@
-package com.example.helloandroid;
-
-import java.util.ArrayList;
-
-import android.graphics.Canvas;
-import android.graphics.Color;
-import android.graphics.Paint;
-import android.graphics.Path;
-import android.util.Log;
-
-public class Fleet {
-	private int x;
-	private int y;
-	private double dblX;
-	private double dblY;
-	private double slope, xIntercept; 
-	private double direction;
-	private Planet destination, nearPlanet;
-	private int numShips;
-	private int faction;
-	private boolean isNextToAPlanet;
-	private boolean isClockwise;
-
-	/* Optimizing: pre-calculate paths */
-	public Fleet(Planet source, Planet destination, int numShips, int faction) {
-		source.setNumShips(source.getNumShips()-numShips);
-		
-		//Calculate initial coordinates and direction 
-		if((destination.getX() - source.getX()) != 0){
-			//line formula 
-			slope = getSlope(source.getX(),source.getY(),destination.getX(),destination.getY());
-		
-			xIntercept = destination.getY() - (slope*destination.getX());
-
-			//direction
-			direction = Math.atan(slope);
-
-			//coordinates for all 4 coordinates
-			if((destination.getX() - source.getX()) < 0 )
-				direction += Math.PI;
-
-			dblX = ((Math.cos(direction)*(source.radius + 10) + source.getX()));
-			dblY = ((Math.sin(direction)*(source.radius + 10) + source.getY()));
-
-		} else {
-			if((destination.getY() - source.getY()) > 0 ){
-				direction = Math.PI/2;
-				dblX = destination.getX();
-				dblY = source.getY() + source.radius + 10;
-			} else {
-				direction = 3*Math.PI/2;
-				dblX = destination.getX();
-				dblY = source.getY() - source.radius - 10;
-			}
-			xIntercept = destination.getX();
-		}
-
-		x = (int)dblX;
-		y = (int)dblY;
-
-		this.numShips = numShips;
-		this.faction = faction;
-		this.destination = destination;
-		this.isNextToAPlanet = false;
-		
-		Log.d("Galcon", "Source: ("+source.getX()+", "+source.getY()+")");
-		Log.d("Galcon", "Destination: ("+destination.getX()+", "+destination.getY()+")");
-		Log.d("Galcon", "Initial direction: "+direction);
-		
-		if(direction < 0)
-			direction += Math.PI*2;
-	}
-
-
-	public int getX() {
-		return x;
-	}
-
-
-
-	public void setX(int x) {
-		this.x = x;
-	}
-
-
-
-	public int getY() {
-		return y;
-	}
-
-
-
-	public void setY(int y) {
-		this.y = y;
-	}
-
-
-
-	public double getDirection() {
-		return direction;
-	}
-
-
-
-	public void setDirection(double direction) {
-		this.direction = direction;
-	}
-
-
-
-	public Planet getDestination() {
-		return destination;
-	}
-
-
-
-	public void setDestination(Planet destination) {
-		this.destination = destination;
-	}
-
-
-
-	public int getNumShips() {
-		return numShips;
-	}
-
-
-
-	public void setNumShips(int numShips) {
-		this.numShips = numShips;
-	}
-
-
-
-	public int getFaction() {
-		return faction;
-	}
-
-
-
-	public void setFaction(int faction) {
-		this.faction = faction;
-	}
-
-	public void draw(Canvas canvas, Paint linePaint) {	
-		Path p = new Path();
-		
-		p.moveTo((float)(x+5*Math.cos(direction+Math.PI/2)), (float)(y+5*Math.sin(direction+Math.PI/2)));
-		p.lineTo((float)(x+5*Math.cos(direction-Math.PI/2)), (float)(y+5*Math.sin(direction-Math.PI/2)));
-		p.lineTo((float)(x+10*Math.cos(direction)), (float)(y+10*Math.sin(direction)));
-		p.lineTo((float)(x+5*Math.cos(direction+Math.PI/2)), (float)(y+5*Math.sin(direction+Math.PI/2)));
-		
-		int c, prevC = linePaint.getColor();
-		
-		switch(faction) {
-		case 0:
-			c = Color.argb(255, 100, 100, 100);
-			break;
-		case 1:
-			c = Color.argb(255, 255, 0, 0);
-			break;
-		case 2:
-			c = Color.argb(255, 0, 180, 0);
-			break;
-		case 3:
-			c = Color.argb(255, 0, 0, 255);
-			break;
-		case 4:
-			c = Color.argb(255, 150, 150, 0);
-			break;
-		default:
-			c = prevC;
-		}
-		
-		linePaint.setColor(c);
-		
-		canvas.drawPath(p, linePaint);
-		
-		linePaint.setColor(prevC);
-	}
-
-	public void update(ArrayList<Planet> planets) {
-		int speed = 3; //pixels per move
-		double distance, tangentAngle, angle;
-		
-		//is the ship going around a planet already
-		if(!isNextToAPlanet){
-			/*looks through all the planets to figure out if
-			the ship's path is about to intersect a planet*/
-			for(Planet p: planets){
-				//if two point of intersection are found save planet 
-				distance = getDistanceBetween(dblX,dblY,p.getX(),p.getY());
-				if(distance <= p.radius){
-					nearPlanet = p;
-					break;
-				}
-			}
-			//if temp planet is not picked move along the direction by #speed
-			if(nearPlanet == null) {
-				dblY += (Math.sin(direction)*speed);
-				dblX += (Math.cos(direction)*speed);
-
-				x = (int)dblX;
-				y = (int)dblY;
-			}else {				
-				if(nearPlanet == destination){
-					attack();
-					return;
-				} 
-				
-				tangentAngle = Math.atan(getSlope(nearPlanet.getX(),nearPlanet.getY(),dblX,dblY));
-				
-				if(dblX < nearPlanet.getX())
-					tangentAngle += Math.PI;
-				
-				tangentAngle += Math.PI/2;
-				
-				if(Math.abs(tangentAngle-direction) > Math.PI/2) {
-					isClockwise = false;
-					direction = tangentAngle-Math.PI;
-				}else {
-					isClockwise = true;
-					direction = tangentAngle;
-				}
-				
-				Log.d("Galcon", "isClockwise: "+isClockwise);
-				
-				xIntercept = dblY - (dblX*Math.tan(direction));
-				
-				isNextToAPlanet = true;
-			}
-		} else {
-			//can you reach the center of the planet by following this direction
-			//if so set isNextToAPlanet to false and move 
-			//otherwise continue moving along the circumference
-			
-			double dist = Math.abs(destination.getY() - (Math.tan(direction)*destination.getX()) - xIntercept)/(double)Math.sqrt(Math.pow(direction,2)+1);
-			int allowedError = 2;
-			if(nearPlanet.radius <= 10)
-				allowedError = 10;
-			else if(nearPlanet.radius <= 30)
-				allowedError = 5;
-			if(dist < allowedError){
-				dblY += (Math.sin(direction)*speed);
-				dblX += (Math.cos(direction)*speed);
-
-				x = (int)dblX;
-				y = (int)dblY;
-				
-				if (getDistanceBetween(dblX,dblY,nearPlanet.getX(),nearPlanet.getY()) > nearPlanet.radius){
-					isNextToAPlanet = false;
-					nearPlanet = null;
-					
-					slope = getSlope(x,y,destination.getX(),destination.getY());
-					
-					xIntercept = destination.getY() - (slope*destination.getX());
-
-					//direction
-					direction = Math.atan(slope);
-
-					//coordinates for all 4 coordinates
-					if((destination.getX() - x) < 0 )
-						direction += Math.PI;
-				}
-			} else {
-				angle = speed/(double)nearPlanet.radius;
-				
-				if(isClockwise){
-					dblX = Math.cos(direction - (Math.PI/2) + angle)*nearPlanet.radius + nearPlanet.getX();
-					dblY = Math.sin(direction - (Math.PI/2) + angle)*nearPlanet.radius + nearPlanet.getY();
-					direction = direction + angle;
-				} else {
-					dblX = Math.cos(direction + (Math.PI/2) - angle)*nearPlanet.radius + nearPlanet.getX();
-					dblY = Math.sin(direction + (Math.PI/2) - angle)*nearPlanet.radius + nearPlanet.getY();
-					direction = direction - angle;
-				}
-				
-				x = (int)dblX;
-				y = (int)dblY;
-				xIntercept = dblY - (dblX*Math.tan(direction));
-			}
-		}
-	}
-
-	// attack the destination planet
-	//after the method is called the fleet needs to removed
-	public void attack() {
-		if(this.faction == destination.getFaction())
-			destination.setNumShips(destination.getNumShips() + numShips);
-		else if(numShips <= destination.getNumShips()){
-			destination.setNumShips(destination.getNumShips() - numShips);
-		} else {
-			destination.setNumShips(numShips - destination.getNumShips());
-			destination.setFaction(this.faction);
-		}
-		this.numShips = 0;
-	}
-
-	//helper functions
-	private double getDistanceBetween(double x1, double y1, double x2, double y2) {
-		return Math.sqrt(Math.pow((x2 - x1),2) + Math.pow((y2 - y1),2));
-	}
-
-	private double getSlope(double x1, double y1, double x2, double y2) {
-		return ((y2 - y1)/(double)(x2 - x1));
-	}
-}
Index: c/com/example/helloandroid/Game.java
===================================================================
--- src/com/example/helloandroid/Game.java	(revision 999095f91ac79def9e2d4dbb14a6f4694a173ec4)
+++ 	(revision )
@@ -1,130 +1,0 @@
-package com.example.helloandroid;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.util.Log;
-import android.view.Menu;
-import android.view.MenuItem;
-import android.view.Window;
-import android.widget.TextView;
-import com.example.helloandroid.GameView.DrawingThread;
-
-public class Game extends Activity {
-    private static final int MENU_PAUSE = 1;
-    private static final int MENU_RESUME = 2;
-    private static final int MENU_START = 3;
-    private static final int MENU_STOP = 4;
-    private static final int MENU_CONNECT = 5;
-
-    /** A handle to the thread that's actually running the animation. */
-    public DrawingThread mThread;
-
-    /** A handle to the View in which the game is running. */
-    private GameView mGameView;
-
-    private ClientThread client;
-    
-    /**
-     * Invoked during init to give the Activity a chance to set up its Menu.
-     * 
-     * @param menu the Menu to which entries may be added
-     * @return true
-     */
-    @Override
-    public boolean onCreateOptionsMenu(Menu menu) {
-        super.onCreateOptionsMenu(menu);
-
-        menu.add(0, MENU_START, 0, R.string.menu_start);
-        menu.add(0, MENU_STOP, 0, R.string.menu_stop);
-        menu.add(0, MENU_PAUSE, 0, R.string.menu_pause);
-        menu.add(0, MENU_RESUME, 0, R.string.menu_resume);
-        menu.add(0, MENU_CONNECT, 0, R.string.menu_connect);
-
-        return true;
-    }
-
-    /**
-     * Invoked when the user selects an item from the Menu.
-     * 
-     * @param item the Menu entry which was selected
-     * @return true if the Menu item was legit (and we consumed it), false
-     *         otherwise
-     */
-    @Override
-    public boolean onOptionsItemSelected(MenuItem item) {
-        switch (item.getItemId()) {
-            case MENU_START:
-            	mThread.doStart();
-                return true;
-            case MENU_STOP:
-            	mThread.setState(DrawingThread.STATE_LOSE, getText(R.string.message_stopped));
-                return true;
-            case MENU_PAUSE:
-            	mThread.pause();
-                return true;
-            case MENU_RESUME:
-            	mThread.unpause();
-                return true;
-            case MENU_CONNECT:
-            	mThread.connectionStarted = true;
-                client = new ClientThread("192.168.1.6", 1337, this);
-				client.start();
-				mThread.doStart();
-				return true;
-        }
-
-        return false;
-    }
-
-    /**
-     * Invoked when the Activity is created.
-     * 
-     * @param savedInstanceState a Bundle containing state saved from a previous
-     *        execution, or null if this is a new execution
-     */
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-
-        // turn off the window's title bar
-        requestWindowFeature(Window.FEATURE_NO_TITLE);
-
-        // tell system to use the layout defined in our XML file
-        setContentView(R.layout.main);
-
-        mGameView = (GameView) findViewById(R.id.lunar);
-        mThread = mGameView.getThread();
-
-        mGameView.setTextView((TextView) findViewById(R.id.text));
-
-        if (savedInstanceState == null) {
-            // we were just launched: set up a new game
-        	mThread.setState(DrawingThread.STATE_RUNNING);
-            Log.w("Galcon", "SIS is null");
-        } else {
-            Log.w("Galcon", "SIS is nonnull");
-        }
-    }
-
-    /**
-     * Invoked when the Activity loses user focus.
-     */
-    @Override
-    protected void onPause() {
-        super.onPause();
-        mGameView.getThread().pause(); // pause game when Activity pauses
-    }
-
-    /**
-     * Notification that something is about to happen, to give the Activity a
-     * chance to save state.
-     * 
-     * @param outState a Bundle into which this Activity should save its state
-     */
-    @Override
-    protected void onSaveInstanceState(Bundle outState) {
-        // just have the View's thread save its state into our Bundle
-        super.onSaveInstanceState(outState);
-        Log.w("Galcon", "SIS called");
-    }
-}
Index: c/com/example/helloandroid/GameView.java
===================================================================
--- src/com/example/helloandroid/GameView.java	(revision 999095f91ac79def9e2d4dbb14a6f4694a173ec4)
+++ 	(revision )
@@ -1,562 +1,0 @@
-package com.example.helloandroid;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.Random;
-
-import android.content.Context;
-import android.content.res.Resources;
-import android.graphics.Canvas;
-import android.graphics.Color;
-import android.graphics.Paint;
-import android.graphics.RectF;
-import android.graphics.Paint.FontMetrics;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.Message;
-import android.util.AttributeSet;
-import android.util.Log;
-import android.view.KeyEvent;
-import android.view.MotionEvent;
-import android.view.SurfaceHolder;
-import android.view.SurfaceView;
-import android.widget.TextView;
-
-/**
- * View that draws, takes keystrokes, etc. for a simple LunarLander game.
- * 
- * Has a mode which RUNNING, PAUSED, etc. Has a x, y, dx, dy, ... capturing the
- * current ship physics. All x/y etc. are measured with (0,0) at the lower left.
- * updatePhysics() advances the physics based on realtime. draw() renders the
- * ship, and does an invalidate() to prompt another draw() as soon as possible
- * by the system.
- */
-class GameView extends SurfaceView implements SurfaceHolder.Callback {
-    class DrawingThread extends Thread {
-        /*
-         * State-tracking constants
-         */
-        public static final int STATE_LOSE = 1;
-        public static final int STATE_PAUSE = 2;
-        public static final int STATE_READY = 3;
-        public static final int STATE_RUNNING = 4;
-        public static final int STATE_WIN = 5;
-
-        /*
-         * UI constants (i.e. the speed & fuel bars)
-         */
-        public static final int UI_BAR = 100; // width of the bar(s)
-        public static final int UI_BAR_HEIGHT = 10; // height of the bar(s)
-
-        /*
-         * Member (state) fields
-         */
-
-        private int mCanvasHeight = 1;
-        private int mCanvasWidth = 1;
-
-        /** Message handler used by thread to interact with TextView */
-        private Handler mHandler;
-
-        /** Used to figure out elapsed time between frames */
-        private long mLastTime;
-
-        /** Paint to draw the lines on screen. */
-        private Paint mLinePaint, mTextPaint;
-
-        /** The state of the game. One of READY, RUNNING, PAUSE, LOSE, or WIN */
-        private int mMode;
-
-        /** Indicate whether the surface has been created & is ready to draw */
-        private boolean mRun = false;
-
-        /** Handle to the surface manager object we interact with */
-        private SurfaceHolder mSurfaceHolder;
-        
-        public Object planetsLock, fleetsLock;
-        
-        public ArrayList<Planet> planets;
-        public ArrayList<Fleet> fleets;
-        public Planet planetSelected;
-        
-        int mFleetSize;
-        
-        public boolean connectionStarted;
-        public String connMessage;
-
-        public DrawingThread(SurfaceHolder surfaceHolder, Context context,
-                Handler handler) {
-            // get handles to some important objects
-            mSurfaceHolder = surfaceHolder;
-            mHandler = handler;
-            mContext = context;
-
-            // Initialize paints for speedometer
-            mLinePaint = new Paint();
-            mLinePaint.setAntiAlias(true);
-            mLinePaint.setARGB(255, 0, 255, 0);
-
-            mTextPaint = new Paint();
-            mTextPaint.setAntiAlias(true);
-            mTextPaint.setARGB(255, 255, 255, 255);
-        
-            planetsLock = new Object();
-            fleetsLock = new Object();
-            
-            planets = new ArrayList<Planet>();
-            planetSelected = null;
-            
-            fleets = new ArrayList<Fleet>();
-            
-            mFleetSize = 50;
-            
-            connectionStarted = false;
-            connMessage = "";
-        }
-
-        /**
-         * Starts the game, setting parameters for the current difficulty.
-         */
-        public void doStart() {
-            synchronized (mSurfaceHolder) {
-                mLastTime = System.currentTimeMillis() + 100;
-                setState(STATE_RUNNING);
-            }
-        }
-
-        /**
-         * Pauses the physics update & animation.
-         */
-        public void pause() {
-            synchronized (mSurfaceHolder) {
-                if (mMode == STATE_RUNNING) setState(STATE_PAUSE);
-            }
-        }
-
-        @Override
-        public void run() {
-            while (mRun) {
-                Canvas c = null;
-                try {
-                    c = mSurfaceHolder.lockCanvas(null);
-                    synchronized(mSurfaceHolder) {
-                        if(mMode == STATE_RUNNING)
-                        	updatePhysics();
-                        doDraw(c);
-                    }
-                } finally {
-                    // do this in a finally so that if an exception is thrown
-                    // during the above, we don't leave the Surface in an
-                    // inconsistent state
-                    if (c != null) {
-                        mSurfaceHolder.unlockCanvasAndPost(c);
-                    }
-                }
-            }
-        }
-
-        /**
-         * Used to signal the thread whether it should be running or not.
-         * Passing true allows the thread to run; passing false will shut it
-         * down if it's already running. Calling start() after this was most
-         * recently called with false will result in an immediate shutdown.
-         * 
-         * @param b true to run, false to shut down
-         */
-        public void setRunning(boolean b) {
-            mRun = b;
-        }
-
-        /**
-         * Sets the game mode. That is, whether we are running, paused, in the
-         * failure state, in the victory state, etc.
-         * 
-         * @see #setState(int, CharSequence)
-         * @param mode one of the STATE_* constants
-         */
-        public void setState(int mode) {
-            synchronized (mSurfaceHolder) {
-                setState(mode, null);
-            }
-        }
-
-        /**
-         * Sets the game mode. That is, whether we are running, paused, in the
-         * failure state, in the victory state, etc.
-         * 
-         * @param mode one of the STATE_* constants
-         * @param message string to add to screen or null
-         */
-        public void setState(int mode, CharSequence message) {
-            /*
-             * This method optionally can cause a text message to be displayed
-             * to the user when the mode changes. Since the View that actually
-             * renders that text is part of the main View hierarchy and not
-             * owned by this thread, we can't touch the state of that View.
-             * Instead we use a Message + Handler to relay commands to the main
-             * thread, which updates the user-text View.
-             */
-            synchronized (mSurfaceHolder) {
-                mMode = mode;
-
-                if (mMode == STATE_RUNNING) {
-                    Message msg = mHandler.obtainMessage();
-                    Bundle b = new Bundle();
-                    b.putString("text", "");
-                    b.putInt("viz", GameView.INVISIBLE);
-                    msg.setData(b);
-                    mHandler.sendMessage(msg);
-                } else {
-                    Resources res = mContext.getResources();
-                    CharSequence str = "";
-                    if (mMode == STATE_READY)
-                        str = res.getText(R.string.mode_ready);
-                    else if (mMode == STATE_PAUSE)
-                        str = res.getText(R.string.mode_pause);
-                    else if (mMode == STATE_LOSE)
-                        str = res.getText(R.string.mode_lose);
-
-                    if (message != null) {
-                        str = message + "\n" + str;
-                    }
-
-                    Message msg = mHandler.obtainMessage();
-                    Bundle b = new Bundle();
-                    b.putString("text", str.toString());
-                    b.putInt("viz", GameView.VISIBLE);
-                    msg.setData(b);
-                    mHandler.sendMessage(msg);
-                }
-            }
-        }
-        
-        /* Callback invoked when the surface dimensions change. */
-        public void setSurfaceSize(int width, int height) {
-            // synchronized to make sure these all change atomically
-            synchronized (mSurfaceHolder) {
-                mCanvasWidth = width;
-                mCanvasHeight = height;
-                
-                Log.i("Gencon", "width: "+mCanvasWidth+", height: "+mCanvasHeight);
-                
-                Random rand = new Random();
-
-                synchronized(planetsLock) {
-	                for(int x=0; x<15; x++) {
-	                	Planet p = new Planet(rand.nextInt(45)+5, rand.nextInt(mCanvasWidth), rand.nextInt(mCanvasHeight));
-	                	
-	                	if(Planet.collisionDetected(p, planets)) {
-	                		x--;
-	                	}else if(p.getX()-p.getRadius() < 0 || mCanvasWidth-20<=p.getX()+p.getRadius() ||
-	                			 p.getY()-p.getRadius() < 0 || mCanvasHeight-20<=p.getY()+p.getRadius()) {
-	                		x--;
-	                	}else {
-	                		p.setNumShips(rand.nextInt(150));
-	                		p.setFaction(rand.nextInt(5));
-	                		planets.add(p);
-	                	}
-	                }
-                }
-            }
-        }
-
-        /**
-         * Resumes from a pause.
-         */
-        public void unpause() {
-            // Move the real time clock up to now
-            synchronized (mSurfaceHolder) {
-                mLastTime = System.currentTimeMillis() + 100;
-            }
-            setState(STATE_RUNNING);
-        }
-
-        /**
-         * Handles a key-down event.
-         * 
-         * @param keyCode the key that was pressed
-         * @param msg the original event object
-         * @return true
-         */
-        boolean doKeyDown(int keyCode, KeyEvent msg) {
-            synchronized (mSurfaceHolder) {
-                boolean okStart = false;
-                if (keyCode == KeyEvent.KEYCODE_DPAD_UP) okStart = true;
-                if (keyCode == KeyEvent.KEYCODE_DPAD_DOWN) okStart = true;
-                if (keyCode == KeyEvent.KEYCODE_S) okStart = true;
-
-                if (okStart
-                        && (mMode == STATE_READY || mMode == STATE_LOSE || mMode == STATE_WIN)) {
-                    // ready-to-start -> start
-                    doStart();
-                    return true;
-                } else if (mMode == STATE_PAUSE && okStart) {
-                    // paused -> running
-                    unpause();
-                    return true;
-                } else if (mMode == STATE_RUNNING) {
-                    return true;
-                }
-
-                return false;
-            }
-        }
-
-        /**
-         * Handles a key-up event.
-         * 
-         * @param keyCode the key that was pressed
-         * @param msg the original event object
-         * @return true if the key was handled and consumed, or else false
-         */
-        boolean doKeyUp(int keyCode, KeyEvent msg) {
-            boolean handled = false;
-
-            synchronized (mSurfaceHolder) {
-                if (mMode == STATE_RUNNING) {
-                    if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER
-                            || keyCode == KeyEvent.KEYCODE_SPACE) {
-                        handled = true;
-                    } else if (keyCode == KeyEvent.KEYCODE_DPAD_LEFT
-                            || keyCode == KeyEvent.KEYCODE_Q
-                            || keyCode == KeyEvent.KEYCODE_DPAD_RIGHT
-                            || keyCode == KeyEvent.KEYCODE_W) {
-                        handled = true;
-                    }
-                }
-            }
-
-            return handled;
-        }
-
-        /**
-         * Draws the ship, fuel/speed bars, and background to the provided
-         * Canvas.
-         */
-        private void doDraw(Canvas canvas) {
-        	canvas.drawColor(Color.BLACK);
-        	
-        	synchronized(planetsLock) {
-        		for(Planet p : planets) {
-            		p.draw(canvas, mLinePaint, mTextPaint);
-            	}
-        	}
-            
-        	if(planetSelected != null) {
-    			planetSelected.drawSelectionCircle(canvas);
-    		}
-        	
-        	synchronized(fleetsLock) {
-        		for(Fleet f : fleets) {
-            		f.draw(canvas, mLinePaint);
-            	}
-        	}
-        
-        	//draw the fleet size bar on the bottom of the screen
-        	float textSize = mTextPaint.getTextSize();
-        	mTextPaint.setTextSize(24);
-        	FontMetrics metrics = mTextPaint.getFontMetrics();
-        	mTextPaint.setColor(Color.WHITE);
-        	
-        	canvas.drawText(mFleetSize+"%", mCanvasWidth-mTextPaint.measureText(mFleetSize+"%"), mCanvasHeight-20-(metrics.ascent+metrics.descent), mTextPaint);
-        	
-        	mTextPaint.setTextSize(textSize);
-        
-        	mLinePaint.setColor(Color.YELLOW);
-        	canvas.drawRoundRect(new RectF(70, mCanvasHeight-15, mCanvasWidth-70, mCanvasHeight-5), 5, 5, mLinePaint);
-        	
-        	mLinePaint.setColor(Color.GREEN);
-        	canvas.drawRoundRect(new RectF(70, mCanvasHeight-15, 70+(mCanvasWidth-140)*mFleetSize/100, mCanvasHeight-5), 5, 5, mLinePaint);
-        	
-        	//draw connection info
-        	if(connectionStarted) {
-        		canvas.drawText(connMessage, (mCanvasWidth-mTextPaint.measureText(connMessage))/2, mCanvasHeight-200-(metrics.ascent+metrics.descent), mTextPaint);
-        	}
-        }
-
-        /**
-         * Figures the lander state (x, y, fuel, ...) based on the passage of
-         * realtime. Does not invalidate(). Called at the start of draw().
-         * Detects the end-of-game and sets the UI to the next state.
-         */
-        private void updatePhysics() {
-            long now = System.currentTimeMillis();
-
-            // Do nothing if mLastTime is in the future.
-            // This allows the game-start to delay the start of the physics
-            // by 100ms or whatever.
-            if (mLastTime > now) return;
-            
-            synchronized(planetsLock) {
-            	for(Planet p : planets) {
-            		p.update();
-            	}
-            }
-            
-            synchronized(fleetsLock) {
-            	Iterator<Fleet> i = fleets.iterator();
-            	Fleet f = null;
-            	while(i.hasNext()){
-            		f = i.next();
-            		if(f.getNumShips() == 0) {
-            			i.remove();
-            		}else
-            			f.update(planets);
-            	}
-            }
-
-            mLastTime = now+50;
-        }
-    }
-
-    /** Handle to the application context, used to e.g. fetch Drawables. */
-    private Context mContext;
-
-    /** Pointer to the text view to display "Paused.." etc. */
-    private TextView mStatusText;
-
-    /** The thread that actually draws the animation */
-    private DrawingThread thread;
-
-    public GameView(Context context, AttributeSet attrs) {
-        super(context, attrs);
-
-        // register our interest in hearing about changes to our surface
-        SurfaceHolder holder = getHolder();
-        holder.addCallback(this);
-
-        // create thread only; it's started in surfaceCreated()
-        thread = new DrawingThread(holder, context, new Handler() {
-            @Override
-            public void handleMessage(Message m) {
-                mStatusText.setVisibility(m.getData().getInt("viz"));
-                mStatusText.setText(m.getData().getString("text"));
-            }
-        });
-
-        setFocusable(true); // make sure we get key events
-    }
-
-    @Override public boolean onTouchEvent(MotionEvent event) {
-    	Log.i("Gencon", "Detected touch event");
-    	
-    	if(event.getAction() == MotionEvent.ACTION_UP) {
-    		if(70 <= event.getX() && event.getX() <= thread.mCanvasWidth-70 &&
-    		   thread.mCanvasHeight-15 <= event.getY() && event.getY() <= thread.mCanvasHeight-5) {
-    			thread.mFleetSize = ((int)event.getX()-70)*100/(thread.mCanvasWidth-140);
-    		}
-    	}else if(event.getAction() == MotionEvent.ACTION_DOWN) {
-	    	synchronized(thread.planetsLock) {
-	    		if(thread.planetSelected != null) {
-	    			Planet target = null;
-	    			
-	    			for(Planet p : thread.planets) {
-			        	if(p.contains((int)event.getX(), (int)event.getY())) {
-			        		target = p;
-			        		break;
-			        	}
-			        }
-	    			
-	    			if(target != null && target != thread.planetSelected && thread.planetSelected.getFaction() != 0) {
-	    				synchronized(thread.fleetsLock) {
-	    	                	Fleet f = new Fleet(thread.planetSelected, target, thread.planetSelected.getNumShips()*thread.mFleetSize/100, thread.planetSelected.getFaction());
-	    	                	f.setFaction(thread.planetSelected.getFaction());
-	    	                	thread.fleets.add(f);
-	                    }
-	    			}
-	    				
-	    			thread.planetSelected.unselect();
-	    			thread.planetSelected = null;
-	    		}else {
-			        for(Planet p : thread.planets) {
-			        	if(p.contains((int)event.getX(), (int)event.getY())) {
-			        		p.select();
-			        		thread.planetSelected = p;
-			        		break;
-			        	}
-			        }
-	    		}
-	    	}
-    	}
-        
-        return true;
-    }
-    
-    /**
-     * Fetches the animation thread corresponding to this LunarView.
-     * 
-     * @return the animation thread
-     */
-    public DrawingThread getThread() {
-        return thread;
-    }
-
-    /**
-     * Standard override to get key-press events.
-     */
-    @Override
-    public boolean onKeyDown(int keyCode, KeyEvent msg) {
-        return thread.doKeyDown(keyCode, msg);
-    }
-
-    /**
-     * Standard override for key-up. We actually care about these, so we can
-     * turn off the engine or stop rotating.
-     */
-    @Override
-    public boolean onKeyUp(int keyCode, KeyEvent msg) {
-        return thread.doKeyUp(keyCode, msg);
-    }
-
-    /**
-     * Standard window-focus override. Notice focus lost so we can pause on
-     * focus lost. e.g. user switches to take a call.
-     */
-    @Override
-    public void onWindowFocusChanged(boolean hasWindowFocus) {
-        if (!hasWindowFocus) thread.pause();
-    }
-
-    /**
-     * Installs a pointer to the text view used for messages.
-     */
-    public void setTextView(TextView textView) {
-        mStatusText = textView;
-    }
-
-    /* Callback invoked when the surface dimensions change. */
-    public void surfaceChanged(SurfaceHolder holder, int format, int width,
-            int height) {
-        thread.setSurfaceSize(width, height);
-    }
-
-    /*
-     * Callback invoked when the Surface has been created and is ready to be
-     * used.
-     */
-    public void surfaceCreated(SurfaceHolder holder) {
-        // start the thread here so that we don't busy-wait in run()
-        // waiting for the surface to be created
-        thread.setRunning(true);
-        thread.start();
-    }
-
-    /*
-     * Callback invoked when the Surface has been destroyed and must no longer
-     * be touched. WARNING: after this method returns, the Surface/Canvas must
-     * never be touched again!
-     */
-    public void surfaceDestroyed(SurfaceHolder holder) {
-        // we have to tell thread to shut down & wait for it to finish, or else
-        // it might touch the Surface after we return and explode
-        boolean retry = true;
-        thread.setRunning(false);
-        while (retry) {
-            try {
-                thread.join();
-                retry = false;
-            } catch (InterruptedException e) {
-            }
-        }
-    }
-}
Index: src/com/example/helloandroid/HelloAndroid.java
===================================================================
--- src/com/example/helloandroid/HelloAndroid.java	(revision d936b97e809ae643d68921c564db77cc219b69ac)
+++ src/com/example/helloandroid/HelloAndroid.java	(revision d936b97e809ae643d68921c564db77cc219b69ac)
@@ -0,0 +1,13 @@
+package com.example.helloandroid;
+
+import android.app.Activity;
+import android.os.Bundle;
+
+public class HelloAndroid extends Activity {
+    /** Called when the activity is first created. */
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.main);
+    }
+}
Index: c/com/example/helloandroid/Planet.java
===================================================================
--- src/com/example/helloandroid/Planet.java	(revision 999095f91ac79def9e2d4dbb14a6f4694a173ec4)
+++ 	(revision )
@@ -1,169 +1,0 @@
-package com.example.helloandroid;
-
-import java.util.ArrayList;
-
-import android.graphics.Bitmap;
-import android.graphics.Canvas;
-import android.graphics.Color;
-import android.graphics.Paint;
-import android.graphics.Paint.FontMetrics;
-
-public class Planet {
-	int radius;
-	private int x;
-	private int y;
-	int faction;
-	int numShips;
-	boolean selected;
-	private Bitmap selection;
-	private int frameCount, framesUntilSpawn;
-	
-	public Planet(int radius, int x, int y) {
-		this.radius = radius;
-		this.x = x;
-		this.y = y;
-		faction = 0;
-		numShips = 0;
-		selected = false;
-		
-		frameCount = 0;
-		framesUntilSpawn = 100/radius;
-		
-		int size = getRadius()+15;
-		
-		selection = Bitmap.createBitmap(size*2, size*2, Bitmap.Config.ARGB_8888);
-		Canvas c = new Canvas(selection);
-		c.drawColor(Color.argb(0, 0, 0, 0));
-		
-		Paint p = new Paint();
-        p.setAntiAlias(true);
-		
-		p.setColor(Color.argb(255, 255, 255, 255));
-		c.drawCircle(size, size, getRadius()+9, p);
-		
-		p.setColor(Color.argb(255, 100, 100, 100));
-		c.drawCircle(size, size, getRadius()+5, p);
-		
-		for(int i=0; i<size*2; i++) {
-			for(int j=0; j<size*2; j++) {
-				if(selection.getPixel(i,j) == Color.argb(255, 100, 100, 100))
-					selection.setPixel(i, j, Color.argb(0, 0, 0, 0));
-			}
-		}
-	}
-	
-	public int getX() {
-		return x;
-	}
-	
-	public int getY() {
-		return y;
-	}
-	
-	public int getRadius() {
-		return radius;
-	}
-	
-	public int getFaction() {
-		return faction;
-	}
-	
-	public int getNumShips() {
-		return numShips;
-	}
-	
-	public boolean isSelected() {
-		return selected;
-	}
-	
-	public void setNumShips(int num) {
-		numShips = num;
-	}
-
-	public void setFaction(int faction) {
-		this.faction = faction;
-	}
-	
-	public void select() {
-		selected = true;
-	}
-	
-	public void unselect() {
-		selected = false;
-	}
-	
-	public void draw(Canvas canvas, Paint linePaint, Paint textPaint) {
-		FontMetrics metrics = textPaint.getFontMetrics();
-		
-		int c, prevC = linePaint.getColor();
-		
-		switch(faction) {
-		case 0:
-			c = Color.argb(255, 100, 100, 100);
-			break;
-		case 1:
-			c = Color.argb(255, 255, 0, 0);
-			break;
-		case 2:
-			c = Color.argb(255, 0, 180, 0);
-			break;
-		case 3:
-			c = Color.argb(255, 0, 0, 255);
-			break;
-		case 4:
-			c = Color.argb(255, 150, 150, 0);
-			break;
-		default:
-			c = prevC;
-		}
-		
-		linePaint.setColor(c);
-		
-		canvas.drawCircle(x, y, getRadius(), linePaint);
-    	canvas.drawText(Integer.toString(numShips), x-textPaint.measureText(Integer.toString(numShips))/2, y-(metrics.ascent+metrics.descent)/2, textPaint);
-	
-    	linePaint.setColor(prevC);
-	}
-	
-	public void drawSelectionCircle(Canvas canvas) {
-		int size = getRadius()+15;
-		
-		canvas.drawBitmap(selection, x-size, y-size, null);
-	}
-	
-	public void update() {
-		if(faction != 0) {
-			frameCount++;
-			
-			if(frameCount == framesUntilSpawn) {
-				frameCount = 0;
-				numShips++;
-			}
-		}
-	}
-	
-	public void sendFleet(Planet p, int numShips) {
-		
-	}
-	
-	public boolean contains(int x, int y) {
-		double dist = Math.sqrt(Math.pow(this.x-x, 2) + Math.pow(this.y-y, 2));
-		
-		return dist <= this.radius;
-	}
-	
-	public boolean collides(Planet p) {
-		double dist = Math.sqrt(Math.pow(this.x-p.x, 2) + Math.pow(this.y-p.y, 2));
-		
-		return dist <= this.radius + p.radius;
-	}
-	
-	public static boolean collisionDetected(Planet p, ArrayList<Planet> curPlanets) {
-		for(Planet p2 : curPlanets) {
-			if(p.collides(p2))
-				return true;
-		}
-		
-		return false;
-	}
-}
