aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/ConversationsPlusApplication.java
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2015-11-06 20:23:43 +0100
committersteckbrief <steckbrief@chefmail.de>2015-11-06 20:23:43 +0100
commit8838a5094812e0540ccfef3334e49e1a5c1a564b (patch)
tree353f4513b8f38b77fd4219c2d92a46b0f87694ff /src/main/java/de/thedevstack/conversationsplus/ConversationsPlusApplication.java
parentb22d863c362bb6492240700c0f69f1a5d926f46b (diff)
FileBackend splitted into several util classes for separate concerns: AvatarUtil, StreamUtil, ImageUtil. Unused imports removed.
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();
}