1 /* ownCloud Android client application 
   2  *   Copyright (C) 2012-2013 ownCloud Inc. 
   4  *   This program is free software: you can redistribute it and/or modify 
   5  *   it under the terms of the GNU General Public License version 2, 
   6  *   as published by the Free Software Foundation. 
   8  *   This program is distributed in the hope that it will be useful, 
   9  *   but WITHOUT ANY WARRANTY; without even the implied warranty of 
  10  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
  11  *   GNU General Public License for more details. 
  13  *   You should have received a copy of the GNU General Public License 
  14  *   along with this program.  If not, see <http://www.gnu.org/licenses/>. 
  17 package com
.owncloud
.android
; 
  19 import android
.app
.Application
; 
  20 import android
.content
.Context
; 
  22  * Main Application of the project 
  24  * Contains methods to build the "static" strings. These strings were before constants in different classes 
  28 public class MainApp 
extends Application 
{ 
  30     private static Context mContext
; 
  32     public void onCreate(){ 
  34         MainApp
.mContext 
= getApplicationContext(); 
  37     public static Context 
getAppContext() { 
  38         return MainApp
.mContext
; 
  41     // Methods to obtain Strings referring app_name  
  42     //   From AccountAuthenticator  
  43     //   public static final String ACCOUNT_TYPE = "owncloud";     
  44     public static String 
getAccountType() { 
  45         return getAppContext().getResources().getString(R
.string
.account_type
); 
  48     //  From AccountAuthenticator  
  49     //  public static final String AUTHORITY = "org.owncloud"; 
  50     public static String 
getAuthority() { 
  51         return getAppContext().getResources().getString(R
.string
.authority
); 
  54     //  From AccountAuthenticator 
  55     //  public static final String AUTH_TOKEN_TYPE = "org.owncloud"; 
  56     public static String 
getAuthTokenType() { 
  57         return getAppContext().getResources().getString(R
.string
.authority
); 
  61     //  public static final String DB_FILE = "owncloud.db"; 
  62     public static String 
getDBFile() { 
  63         return getAppContext().getResources().getString(R
.string
.db_file
); 
  67     //  private final String mDatabaseName = "ownCloud"; 
  68     public static String 
getDBName() { 
  69         return getAppContext().getResources().getString(R
.string
.db_name
); 
  73     public static String 
getDataFolder() { 
  74         return getAppContext().getResources().getString(R
.string
.data_folder
); 
  78     public static String 
getLogName() { 
  79         return getAppContext().getResources().getString(R
.string
.log_name
);