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!
|
2018-04-30 05:19:35 -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";
|
|
|
|
|
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
|
|
|
|
2018-01-31 16:09:37 -08:00
|
|
|
// how often to clean up stories from the DB
|
|
|
|
public static final long CLEANUP_TIME_MILLIS = 6L * 60L * 60L * 1000L;
|
|
|
|
|
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
|
|
|
|
2021-12-28 16:51:17 -08:00
|
|
|
// how often to trigger the job scheduler to sync subscription state.
|
|
|
|
public static final long BG_SUBSCRIPTION_SYNC_CYCLE_MILLIS = 24L * 60 * 60 * 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
|
|
|
// link to app feedback page
|
2018-04-20 17:02:10 -07:00
|
|
|
public static final String FEEDBACK_URL = "https://forum.newsblur.com/new-topic?title=Android%3A+&body=";
|
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";
|
|
|
|
|
2020-08-16 15:29:50 -07:00
|
|
|
// Shiloh photo
|
|
|
|
public final static String SHILOH_PHOTO_URL = "https://newsblur.com/media//img/reader/shiloh.jpg";
|
|
|
|
|
2020-08-30 16:57:15 -07:00
|
|
|
// Premium subscription SKU
|
|
|
|
public final static String PREMIUM_SKU = "nb.premium.36";
|
|
|
|
|
2020-09-12 18:23:21 -07:00
|
|
|
// Free standard account sites limit
|
|
|
|
public final static int FREE_ACCOUNT_SITE_LIMIT = 64;
|
|
|
|
|
2022-10-25 21:09:45 -07:00
|
|
|
// The following keys are used to mark the position of the special meta-folders within
|
|
|
|
// the folders array. Since the ExpandableListView doesn't handle collapsing of views
|
|
|
|
// set to View.GONE, we have to totally remove any hidden groups from the group count
|
|
|
|
// and adjust all folder indicies accordingly. Fake folders are created with these
|
|
|
|
// very unlikely names and layout methods check against them before assuming a row is
|
|
|
|
// a normal folder. All the string comparison is a small price to pay to avoid the
|
|
|
|
// alternative of index-counting in a situation where some rows might be disabled.
|
|
|
|
public static final String GLOBAL_SHARED_STORIES_GROUP_KEY = "GLOBAL_SHARED_STORIES_GROUP_KEY";
|
|
|
|
public static final String ALL_SHARED_STORIES_GROUP_KEY = "ALL_SHARED_STORIES_GROUP_KEY";
|
|
|
|
public static final String ALL_STORIES_GROUP_KEY = "ALL_STORIES_GROUP_KEY";
|
|
|
|
public static final String INFREQUENT_SITE_STORIES_GROUP_KEY = "INFREQUENT_SITE_STORIES_GROUP_KEY";
|
|
|
|
public static final String READ_STORIES_GROUP_KEY = "READ_STORIES_GROUP_KEY";
|
|
|
|
public static final String SAVED_STORIES_GROUP_KEY = "SAVED_STORIES_GROUP_KEY";
|
|
|
|
public static final String SAVED_SEARCHES_GROUP_KEY = "SAVED_SEARCHES_GROUP_KEY";
|
|
|
|
|
2012-07-12 20:25:35 -04:00
|
|
|
}
|