aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/ConversationsPlusApplication.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/ConversationsPlusApplication.java')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/ConversationsPlusApplication.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/ConversationsPlusApplication.java b/src/main/java/de/thedevstack/conversationsplus/ConversationsPlusApplication.java
index 9ec39de8..a9b09551 100644
--- a/src/main/java/de/thedevstack/conversationsplus/ConversationsPlusApplication.java
+++ b/src/main/java/de/thedevstack/conversationsplus/ConversationsPlusApplication.java
@@ -7,6 +7,8 @@ import android.preference.PreferenceManager;
import java.io.File;
+import de.thedevstack.conversationsplus.utils.ImageUtil;
+
/**
* This class is used to provide static access to the applicationcontext.
*/
@@ -23,8 +25,13 @@ public class ConversationsPlusApplication extends Application {
super.onCreate();
ConversationsPlusApplication.instance = this;
ConversationsPlusPreferences.init(PreferenceManager.getDefaultSharedPreferences(getAppContext()));
+ ImageUtil.initBitmapCache();
}
+ /**
+ * Returns the instance of the application
+ * @return this application instance
+ */
public static ConversationsPlusApplication getInstance() {
return ConversationsPlusApplication.instance;
}
@@ -45,6 +52,11 @@ public class ConversationsPlusApplication extends Application {
return ConversationsPlusApplication.instance.getFilesDir();
}
+ /**
+ * Returns the version of the application.
+ * @see android.content.pm.PackageInfo#versionName
+ * @return a string representation of the version stored in packageInfo
+ */
public static String getVersion() {
final String packageName = ConversationsPlusApplication.getAppContext().getPackageName();
if (packageName != null) {
@@ -58,10 +70,19 @@ public class ConversationsPlusApplication extends Application {
}
}
+ /**
+ * Returns the application's name.
+ * @return the name as it is defined in R.string.app_name
+ */
public static String getName() {
return ConversationsPlusApplication.getAppContext().getString(R.string.app_name);
}
+ /**
+ * Returns the name and the version of this application.
+ * @see #getName() and #getVersion
+ * @return a concatination of name and version with a whitespace in between
+ */
public static String getNameAndVersion() {
return getName() + " " + getVersion();
}