2012-07-12 20:25:35 -04:00
|
|
|
package com.newsblur.util;
|
|
|
|
|
|
|
|
public class AppConstants {
|
2013-07-10 21:56:15 +00:00
|
|
|
|
2016-04-29 04:20:00 -07:00
|
|
|
private AppConstants() {} // util class - no instances
|
|
|
|
|
2013-07-10 21:56:15 +00:00
|
|
|
// Enables high-volume logging that may be useful for debugging. This should
|
|
|
|
// never be enabled for releases, as it not only slows down the app considerably,
|
|
|
|
// it will log sensitive info such as passwords!
|
2016-08-19 05:48:10 -07:00
|
|
|
public static final boolean VERBOSE_LOG = false;
|
2014-09-16 14:21:51 -07:00
|
|
|
public static final boolean VERBOSE_LOG_DB = false;
|
2014-09-30 14:45:47 -07:00
|
|
|
public static final boolean VERBOSE_LOG_NET = false;
|
2012-09-14 01:17:58 -04:00
|
|
|
|
2012-09-10 15:31:51 -04:00
|
|
|
public static final String FOLDER_PRE = "folder_collapsed";
|
2014-01-21 23:16:39 +00:00
|
|
|
|
2016-06-30 04:12:49 -07:00
|
|
|
// reading view font sizes. in em
|
2014-01-21 16:11:59 -08:00
|
|
|
public static final float[] READING_FONT_SIZE = {0.75f, 0.9f, 1.0f, 1.2f, 1.5f, 2.0f};
|
2016-06-30 04:12:49 -07:00
|
|
|
|
|
|
|
// story list view font sizes. as a fraction of the default font sizes used
|
|
|
|
public static final float[] LIST_FONT_SIZE = {0.7f, 0.85f, 1.0f, 1.2f, 1.4f, 1.8f};
|
2012-09-10 15:31:51 -04:00
|
|
|
|
2013-04-17 10:57:16 +00:00
|
|
|
// the name to give the "root" folder in the local DB since the API does not assign it one.
|
|
|
|
// this name should be unique and such that it will sort to the beginning of a list, ideally.
|
|
|
|
public static final String ROOT_FOLDER = "0000_TOP_LEVEL_";
|
2013-04-26 07:17:09 +00:00
|
|
|
|
|
|
|
public static final String LAST_APP_VERSION = "LAST_APP_VERSION";
|
2013-05-10 21:06:41 +00:00
|
|
|
|
2013-05-13 22:12:31 +00:00
|
|
|
// a pref for the time we completed the last full sync of the feed/fodler list
|
|
|
|
public static final String LAST_SYNC_TIME = "LAST_SYNC_TIME";
|
|
|
|
|
|
|
|
// how long to wait before auto-syncing the feed/folder list
|
2016-12-01 05:56:48 -08:00
|
|
|
public static final long AUTO_SYNC_TIME_MILLIS = 15L * 60L * 1000L;
|
2014-08-22 15:53:24 -07:00
|
|
|
|
2014-12-22 00:22:38 -08:00
|
|
|
// how often to rebuild the DB
|
2015-03-18 11:36:26 -07:00
|
|
|
public static final long VACUUM_TIME_MILLIS = 12L * 60L * 60L * 1000L;
|
2014-12-22 00:22:38 -08:00
|
|
|
|
2014-08-22 15:53:24 -07:00
|
|
|
// how often to trigger the BG service. slightly longer than how often we will find new stories,
|
|
|
|
// to account for the fact that it is approximate, and missing a cycle is bad.
|
|
|
|
public static final long BG_SERVICE_CYCLE_MILLIS = AUTO_SYNC_TIME_MILLIS + 30L * 1000L;
|
2013-07-03 08:49:31 +00:00
|
|
|
|
|
|
|
// how many total attemtps to make at a single API call
|
|
|
|
public static final int MAX_API_TRIES = 3;
|
|
|
|
|
|
|
|
// the base amount for how long to sleep during exponential API failure backoff
|
2015-08-27 03:54:47 -07:00
|
|
|
public static final long API_BACKOFF_BASE_MILLIS = 750L;
|
2013-07-23 02:36:10 +00:00
|
|
|
|
2015-08-31 16:59:47 -07:00
|
|
|
// for how long to back off from background syncs after a hard API failure
|
|
|
|
public static final long API_BACKGROUND_BACKOFF_MILLIS = 5L * 60L * 1000L;
|
|
|
|
|
2016-02-12 13:46:05 -08:00
|
|
|
// timeouts for API calls, set to something more sane than the default of infinity
|
2017-08-29 16:36:28 -07:00
|
|
|
public static final long API_CONN_TIMEOUT_SECONDS = 30L;
|
2016-02-12 13:46:05 -08:00
|
|
|
public static final long API_READ_TIMEOUT_SECONDS = 120L;
|
|
|
|
|
|
|
|
// timeouts for image prefetching, which are a bit tighter, since they are only for caching
|
|
|
|
public static final long IMAGE_PREFETCH_CONN_TIMEOUT_SECONDS = 10L;
|
|
|
|
public static final long IMAGE_PREFETCH_READ_TIMEOUT_SECONDS = 30L;
|
|
|
|
|
2013-07-23 02:36:10 +00:00
|
|
|
// when generating a request for multiple feeds, limit the total number requested to prevent
|
|
|
|
// unworkably long URLs
|
|
|
|
public static final int MAX_FEED_LIST_SIZE = 250;
|
2014-01-23 03:31:51 +00:00
|
|
|
|
|
|
|
// when reading stories, how many stories worth of buffer to keep loaded ahead of the user
|
2015-01-05 13:11:59 -08:00
|
|
|
public static final int READING_STORY_PRELOAD = 10;
|
2014-06-04 13:46:10 -07:00
|
|
|
|
2014-06-05 04:04:14 -07:00
|
|
|
// how many unread stories to fetch via hash at a time
|
2016-01-29 04:11:18 -08:00
|
|
|
public static final int UNREAD_FETCH_BATCH_SIZE = 50;
|
2014-07-09 17:01:09 -07:00
|
|
|
|
2014-07-24 03:23:06 -07:00
|
|
|
// how many images to prefetch before updating the countdown UI
|
2015-01-05 14:41:24 -08:00
|
|
|
public static final int IMAGE_PREFETCH_BATCH_SIZE = 6;
|
2014-07-24 03:23:06 -07:00
|
|
|
|
2014-09-10 16:02:32 -07:00
|
|
|
// should the feedback link be enabled (read: is this a beta?)
|
|
|
|
public static final boolean ENABLE_FEEDBACK = true;
|
|
|
|
|
|
|
|
// link to app feedback page
|
2014-12-18 17:48:58 -08:00
|
|
|
public static final String FEEDBACK_URL = "https://getsatisfaction.com/newsblur/topics/new/add_details?topic[subject]=Android%3A+&topic[categories][][id]=80957&topic[type]=question&topic[content]=";
|
2014-09-10 16:02:32 -07:00
|
|
|
|
2014-12-17 03:27:47 -08:00
|
|
|
// how long to wait for sync threads to shutdown. ideally we would wait the max network timeout,
|
|
|
|
// but the system like to force-kill terminating services that take too long, so it is often
|
|
|
|
// moot to tune.
|
|
|
|
public final static long SHUTDOWN_SLACK_SECONDS = 60L;
|
|
|
|
|
2015-01-05 04:26:51 -08:00
|
|
|
// the maximum duty cycle for expensive background tasks. Tune to <1.0 to force sync loops
|
2017-05-31 17:00:25 -07:00
|
|
|
// to pause periodically and yield network/CPU to the foreground UI
|
|
|
|
public final static double MAX_BG_DUTY_CYCLE = 0.8;
|
2015-01-05 04:26:51 -08:00
|
|
|
|
|
|
|
// cap duty cycle backoffs to prevent unnecessarily large backoffs
|
|
|
|
public final static long DUTY_CYCLE_BACKOFF_CAP_MILLIS = 5L * 1000L;
|
|
|
|
|
2016-05-30 14:34:31 -07:00
|
|
|
// link to the web-based forgot password flow
|
|
|
|
public final static String FORGOT_PASWORD_URL = "http://www.newsblur.com/folder_rss/forgot_password";
|
|
|
|
|
2016-11-08 12:40:20 -08:00
|
|
|
// how many helper threads to use for loading icons and thumbnails. things look smoother
|
|
|
|
// if this is set to 3+, but as of late 2016, too many devices get resource constrained past 2
|
|
|
|
public final static int IMAGE_LOADER_THREAD_COUNT = 2;
|
|
|
|
|
2012-07-12 20:25:35 -04:00
|
|
|
}
|