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.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/ConversationsPlusApplication.java b/src/main/java/de/thedevstack/conversationsplus/ConversationsPlusApplication.java
index f86c509a..4a67aa3e 100644
--- a/src/main/java/de/thedevstack/conversationsplus/ConversationsPlusApplication.java
+++ b/src/main/java/de/thedevstack/conversationsplus/ConversationsPlusApplication.java
@@ -7,6 +7,7 @@ import android.preference.PreferenceManager;
import java.io.File;
+import de.thedevstack.conversationsplus.utils.ImageUtil;
import eu.siacs.conversations.R;
/**
@@ -25,8 +26,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;
}
@@ -47,6 +53,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) {
@@ -60,10 +71,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();
}