Skip to content

Commit

Permalink
Final tweaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
leenookx committed Jan 2, 2011
1 parent f23ffd7 commit 456bf9b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 11 deletions.
14 changes: 7 additions & 7 deletions .classpath
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="output" path="bin"/>
</classpath>
2 changes: 1 addition & 1 deletion AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="uk.co.purplemonkeys.spengler"
android:versionCode="1"
android:versionName="1.0">
android:versionName="v0.0.1" android:installLocation="preferExternal">
<application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true">
<activity android:name=".SpengDroid"
android:label="@string/app_name">
Expand Down
20 changes: 17 additions & 3 deletions src/uk/co/purplemonkeys/spengler/SpengDroid.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.Toast;

public class SpengDroid extends Activity
{
SharedPreferences preferences;

String version_info;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
Expand All @@ -22,6 +25,17 @@ public void onCreate(Bundle savedInstanceState) {

// Initialise preferences
preferences = PreferenceManager.getDefaultSharedPreferences(this);

try
{
PackageManager pm = getPackageManager();
PackageInfo pi = pm.getPackageInfo("uk.co.purplemonkeys.spengler", 0);
version_info = "SpengDroid " + pi.versionName;
}
catch (NameNotFoundException e)
{
version_info = "Couldn't determine version info.";
}
}

@Override
Expand All @@ -40,7 +54,7 @@ public boolean onOptionsItemSelected(MenuItem item)
startActivity(new Intent(this, Preferences.class));
return true;
case R.id.about_menu_id:
Common.showAlertMessage(this, "SpengDroid v0.0.0");
Common.showAlertMessage(this, version_info);
return true;
default:
break;
Expand Down

0 comments on commit 456bf9b

Please sign in to comment.