@@ -0,0 +1,2662 @@
+package com.teameight.vhud;%0A%0Aimport android.app.Activity;%0Aimport android.content.Context;%0Aimport android.content.res.ColorStateList;%0Aimport android.graphics.Color;%0Aimport android.location.Location;%0Aimport android.location.LocationListener;%0Aimport android.location.LocationManager;%0Aimport android.os.Bundle;%0Aimport android.view.Menu;%0Aimport android.widget.TextView;%0A%0Apublic class Dashboard extends Activity %7B%0A%0A%09public float speed;%0A%09public TextView speedometer;%0A%09%0A%09@Override%0A%09protected void onCreate(Bundle savedInstanceState) %7B%0A%09%09super.onCreate(savedInstanceState);%0A%09%09setContentView(R.layout.dashboard);%0A%09%09%0A%09%09LocationManager lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE); %0A        //Location location = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);%0A%09%09%0A%09%09speedometer = (TextView) findViewById(R.id.textView1);%0A%0A        final LocationListener locationListener = new LocationListener() %7B%0A            public void onLocationChanged(Location location) %7B%0A            %09speed = location.getSpeed();%0A            %09speedometer.setText(speed + %22 m/s%22);%0A            %09if (speed %3C 10.0 )%7B%0A            %09%09speedometer.setTextColor(Color.GREEN);%0A            %09%7D%0A            %09else if ( speed %3C 40.0 ) %7B%0A            %09%09speedometer.setTextColor(Color.YELLOW);%0A            %09%7D%0A            %09else if ( speed %3C 100.0 ) %7B%0A            %09%09speedometer.setTextColor(Color.RED);%0A            %09%7D%0A            %7D%0A%0A            public void onProviderDisabled(String arg0) %7B%0A%0A            %7D%0A%0A            public void onProviderEnabled(String arg0) %7B%0A%0A            %7D%0A%0A            public void onStatusChanged(String arg0, int arg1, Bundle arg2) %7B%0A%0A            %7D%0A        %7D;%0A%0A        lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 500, 1, locationListener);%0A%09%7D%0A%09%0A%09@Override%0A    protected void onStart() %7B%0A        super.onStart();%0A        // The activity is about to become visible.%0A    %7D%0A    @Override%0A    protected void onResume() %7B%0A        super.onResume();%0A        // The activity has become visible (it is now %22resumed%22).%0A    %7D%0A    @Override%0A    protected void onPause() %7B%0A        super.onPause();%0A        // Another activity is taking focus (this activity is about to be %22paused%22).%0A    %7D%0A    @Override%0A    protected void onStop() %7B%0A        super.onStop();%0A        // The activity is no longer visible (it is now %22stopped%22)%0A    %7D%0A    @Override%0A    protected void onDestroy() %7B%0A        super.onDestroy();%0A        // The activity is about to be destroyed.%0A    %7D%0A%0A%09@Override%0A%09public boolean onCreateOptionsMenu(Menu menu) %7B%0A%09%09// Inflate the menu; this adds items to the action bar if it is present.%0A%09%09getMenuInflater().inflate(R.menu.activity_main, menu);%0A%09%09return true;%0A%09%7D%0A%0A%7D%0A

Add files via upload