本文整理汇总了Java中com.google.samples.apps.iosched.BuildConfig类的典型用法代码示例。如果您正苦于以下问题:Java BuildConfig类的具体用法?Java BuildConfig怎么用?Java BuildConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BuildConfig类属于com.google.samples.apps.iosched包,在下文中一共展示了BuildConfig类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getScheduleData
import com.google.samples.apps.iosched.BuildConfig; //导入依赖的package包/类
public ArrayList<ScheduleItem> getScheduleData(long start, long end) {
// get sessions in my schedule and blocks, starting anytime in the conference day
ArrayList<ScheduleItem> mutableItems = new ArrayList<ScheduleItem>();
ArrayList<ScheduleItem> immutableItems = new ArrayList<ScheduleItem>();
addBlocks(start, end, mutableItems, immutableItems);
addSessions(start, end, mutableItems, immutableItems);
ArrayList<ScheduleItem> result = ScheduleItemHelper.processItems(mutableItems, immutableItems);
if (BuildConfig.DEBUG || Log.isLoggable(TAG, Log.DEBUG)) {
ScheduleItem previous = null;
for (ScheduleItem item: result) {
if ((item.flags & ScheduleItem.FLAG_CONFLICTS_WITH_PREVIOUS) != 0) {
Log.d(TAG, "Schedule Item conflicts with previous. item="+item+" previous="+previous);
}
previous = item;
}
}
setSessionCounters(result, start, end);
return result;
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:22,代码来源:ScheduleHelper.java
示例2: initializeAnalyticsTracker
import com.google.samples.apps.iosched.BuildConfig; //导入依赖的package包/类
/**
* Initialize the analytics tracker in use by the application. This should only be called
* once, when the TOS is signed. The {@code applicationContext} parameter MUST be the
* application context or an object leak could occur.
*/
private static synchronized void initializeAnalyticsTracker(Context applicationContext) {
sAppContext = applicationContext;
if (mTracker == null) {
int useProfile;
if (BuildConfig.DEBUG) {
LOGD(TAG, "Analytics manager using DEBUG ANALYTICS PROFILE.");
useProfile = R.xml.analytics_debug;
} else {
useProfile = R.xml.analytics_release;
}
try {
mTracker = GoogleAnalytics.getInstance(applicationContext).newTracker(useProfile);
} catch (Exception e) {
// If anything goes wrong, force an opt-out of tracking. It's better to accidentally
// protect privacy than accidentally collect data.
setAnalyticsEnabled(false);
}
}
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:26,代码来源:AnalyticsHelper.java
示例3: getManifestUrl
import com.google.samples.apps.iosched.BuildConfig; //导入依赖的package包/类
/**
* Returns the remote manifest file's URL. This is stored as a resource in the app,
* but can be overriden by a file in the filesystem for debug purposes.
* @return The URL of the remote manifest file.
*/
private String getManifestUrl() {
String manifestUrl = BuildConfig.SERVER_MANIFEST_ENDPOINT;
// check for an override file
File urlOverrideFile = new File(mContext.getFilesDir(), URL_OVERRIDE_FILE_NAME);
if (urlOverrideFile.exists()) {
try {
String overrideUrl = IOUtils.readFileAsString(urlOverrideFile).trim();
LOGW(TAG, "Debug URL override active: " + overrideUrl);
return overrideUrl;
} catch (IOException ex) {
return manifestUrl;
}
} else {
return manifestUrl;
}
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:24,代码来源:RemoteConferenceDataFetcher.java
示例4: unregister
import com.google.samples.apps.iosched.BuildConfig; //导入依赖的package包/类
/**
* Unregister this account/device pair within the server.
*
* @param context Current context
* @param gcmId The GCM registration ID for this device
*/
static void unregister(final Context context, final String gcmId) {
if (!checkGcmEnabled()) {
return;
}
LOGI(TAG, "unregistering device (gcmId = " + gcmId + ")");
String serverUrl = BuildConfig.GCM_SERVER_URL + "/unregister";
Map<String, String> params = new HashMap<String, String>();
params.put("gcm_id", gcmId);
try {
post(serverUrl, params, BuildConfig.GCM_API_KEY);
setRegisteredOnServer(context, false, gcmId, null);
} catch (IOException e) {
// At this point the device is unregistered from GCM, but still
// registered in the server.
// We could try to unregister again, but it is not necessary:
// if the server tries to send a message to the device, it will get
// a "NotRegistered" error message and should unregister the device.
LOGD(TAG, "Unable to unregister from application server", e);
} finally {
// Regardless of server success, clear local settings_prefs
setRegisteredOnServer(context, false, null, null);
}
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:31,代码来源:ServerUtilities.java
示例5: notifyUserDataChanged
import com.google.samples.apps.iosched.BuildConfig; //导入依赖的package包/类
/**
* Request user data sync.
*
* @param context Current context
*/
public static void notifyUserDataChanged(final Context context) {
if (!checkGcmEnabled()) {
return;
}
LOGI(TAG, "Notifying GCM that user data changed");
String serverUrl = BuildConfig.GCM_SERVER_URL + "/send/self/sync_user";
try {
String gcmKey = AccountUtils.getGcmKey(context, AccountUtils.getActiveAccountName(context));
if (gcmKey != null) {
post(serverUrl, new HashMap<String, String>(), gcmKey);
}
} catch (IOException e) {
LOGE(TAG, "Unable to notify GCM about user data change", e);
}
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:22,代码来源:ServerUtilities.java
示例6: isSessionOngoing_OngoingSession_ReturnsTrue
import com.google.samples.apps.iosched.BuildConfig; //导入依赖的package包/类
@Test
public void isSessionOngoing_OngoingSession_ReturnsTrue() {
// Only possible to mock current time in debug build
if (BuildConfig.DEBUG) {
// Given a mock cursor for a session in progress
initMockCursorWithOngoingSession(mMockCursor);
SessionDetailModel spyModel = setSpyModelForSessionLoading();
// When session is loaded
spyModel.readDataFromCursor(mMockCursor,
SessionDetailModel.SessionDetailQueryEnum.SESSIONS);
// Then session is ongoing
assertThat(spyModel.isSessionOngoing(), is(true));
}
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:17,代码来源:SessionDetailModelTest.java
示例7: isSessionOngoing_SessionNotStarted_ReturnsFalse
import com.google.samples.apps.iosched.BuildConfig; //导入依赖的package包/类
@Test
public void isSessionOngoing_SessionNotStarted_ReturnsFalse() {
// Only possible to mock current time in debug build
if (BuildConfig.DEBUG) {
// Given a mock cursor for a session in future
initMockCursorWithNotStartedSession(mMockCursor);
SessionDetailModel spyModel = setSpyModelForSessionLoading();
// When session is loaded
spyModel.readDataFromCursor(mMockCursor,
SessionDetailModel.SessionDetailQueryEnum.SESSIONS);
// Then session is not ongoing
assertThat(spyModel.isSessionOngoing(), is(false));
}
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:17,代码来源:SessionDetailModelTest.java
示例8: isSessionOngoing_SessionEnded_ReturnsFalse
import com.google.samples.apps.iosched.BuildConfig; //导入依赖的package包/类
@Test
public void isSessionOngoing_SessionEnded_ReturnsFalse() {
// Only possible to mock current time in debug build
if (BuildConfig.DEBUG) {
// Given a mock cursor for a session that has ended
initMockCursorWithEndedSession(mMockCursor);
SessionDetailModel spyModel = setSpyModelForSessionLoading();
// When session is loaded
spyModel.readDataFromCursor(mMockCursor,
SessionDetailModel.SessionDetailQueryEnum.SESSIONS);
// Then session is not ongoing
assertThat(spyModel.isSessionOngoing(), is(false));
}
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:17,代码来源:SessionDetailModelTest.java
示例9: hasSessionStarted_OnGoingSession_ReturnsTrue
import com.google.samples.apps.iosched.BuildConfig; //导入依赖的package包/类
@Test
public void hasSessionStarted_OnGoingSession_ReturnsTrue() {
// Only possible to mock current time in debug build
if (BuildConfig.DEBUG) {
// Given a mock cursor for a session in progress
initMockCursorWithOngoingSession(mMockCursor);
SessionDetailModel spyModel = setSpyModelForSessionLoading();
// When session is loaded
spyModel.readDataFromCursor(mMockCursor,
SessionDetailModel.SessionDetailQueryEnum.SESSIONS);
// Then session has started
assertThat(spyModel.hasSessionStarted(), is(true));
}
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:17,代码来源:SessionDetailModelTest.java
示例10: hasSessionStarted_SessionNotStarted_ReturnsFalse
import com.google.samples.apps.iosched.BuildConfig; //导入依赖的package包/类
@Test
public void hasSessionStarted_SessionNotStarted_ReturnsFalse() {
// Only possible to mock current time in debug build
if (BuildConfig.DEBUG) {
// Given a mock cursor for a session in future
initMockCursorWithNotStartedSession(mMockCursor);
SessionDetailModel spyModel = setSpyModelForSessionLoading();
// When session is loaded
spyModel.readDataFromCursor(mMockCursor,
SessionDetailModel.SessionDetailQueryEnum.SESSIONS);
// Then session has not started
assertThat(spyModel.hasSessionStarted(), is(false));
}
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:17,代码来源:SessionDetailModelTest.java
示例11: hasSessionStarted_SessionEnded_ReturnsTrue
import com.google.samples.apps.iosched.BuildConfig; //导入依赖的package包/类
@Test
public void hasSessionStarted_SessionEnded_ReturnsTrue() {
// Only possible to mock current time in debug build
if (BuildConfig.DEBUG) {
// Given a mock cursor for a session that has ended
initMockCursorWithEndedSession(mMockCursor);
SessionDetailModel spyModel = setSpyModelForSessionLoading();
// When session is loaded
spyModel.readDataFromCursor(mMockCursor,
SessionDetailModel.SessionDetailQueryEnum.SESSIONS);
// Then session has started
assertThat(spyModel.hasSessionStarted(), is(true));
}
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:17,代码来源:SessionDetailModelTest.java
示例12: hasSessionEnded_SessionNotStarted_ReturnsFalse
import com.google.samples.apps.iosched.BuildConfig; //导入依赖的package包/类
@Test
public void hasSessionEnded_SessionNotStarted_ReturnsFalse() {
// Only possible to mock current time in debug build
if (BuildConfig.DEBUG) {
// Given a mock cursor for a session in progress
initMockCursorWithNotStartedSession(mMockCursor);
SessionDetailModel spyModel = setSpyModelForSessionLoading();
// When session is loaded
spyModel.readDataFromCursor(mMockCursor,
SessionDetailModel.SessionDetailQueryEnum.SESSIONS);
// Then session has not ended
assertThat(spyModel.hasSessionEnded(), is(false));
}
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:17,代码来源:SessionDetailModelTest.java
示例13: hasSessionEnded_OngoingSession_ReturnsFalse
import com.google.samples.apps.iosched.BuildConfig; //导入依赖的package包/类
@Test
public void hasSessionEnded_OngoingSession_ReturnsFalse() {
// Only possible to mock current time in debug build
if (BuildConfig.DEBUG) {
// Given a mock cursor for a session in progress
initMockCursorWithOngoingSession(mMockCursor);
SessionDetailModel spyModel = setSpyModelForSessionLoading();
// When session is loaded
spyModel.readDataFromCursor(mMockCursor,
SessionDetailModel.SessionDetailQueryEnum.SESSIONS);
// Then session has not ended
assertThat(spyModel.hasSessionEnded(), is(false));
}
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:17,代码来源:SessionDetailModelTest.java
示例14: hasSessionEnded_SessionEnded_ReturnsTrue
import com.google.samples.apps.iosched.BuildConfig; //导入依赖的package包/类
@Test
public void hasSessionEnded_SessionEnded_ReturnsTrue() {
// Only possible to mock current time in debug build
if (BuildConfig.DEBUG) {
// Given a mock cursor for a session that has ended
initMockCursorWithEndedSession(mMockCursor);
SessionDetailModel spyModel = setSpyModelForSessionLoading();
// When session is loaded
spyModel.readDataFromCursor(mMockCursor,
SessionDetailModel.SessionDetailQueryEnum.SESSIONS);
// Then session has ended
assertThat(spyModel.hasSessionEnded(), is(true));
}
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:17,代码来源:SessionDetailModelTest.java
示例15: minutesSinceSessionStarted_SessionNotStarted_ReturnsCorrectMinutes
import com.google.samples.apps.iosched.BuildConfig; //导入依赖的package包/类
@Test
public void minutesSinceSessionStarted_SessionNotStarted_ReturnsCorrectMinutes() {
// Only possible to mock current time in debug build
if (BuildConfig.DEBUG) {
// Given a mock cursor for a session not started
initMockCursorWithNotStartedSession(mMockCursor);
SessionDetailModel spyModel = setSpyModelForSessionLoading();
// When session is loaded
spyModel.readDataFromCursor(mMockCursor,
SessionDetailModel.SessionDetailQueryEnum.SESSIONS);
// Then session is ongoing
assertThat(spyModel.minutesSinceSessionStarted(), is(0l));
}
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:17,代码来源:SessionDetailModelTest.java
示例16: minutesSinceSessionStarted_SessionStarted_ReturnsCorrectMinutes
import com.google.samples.apps.iosched.BuildConfig; //导入依赖的package包/类
@Test
public void minutesSinceSessionStarted_SessionStarted_ReturnsCorrectMinutes() {
// Only possible to mock current time in debug build
if (BuildConfig.DEBUG) {
// Given a mock cursor for a session in progress that started 1 hour ago
initMockCursorWithOngoingSession(mMockCursor);
SessionDetailModel spyModel = setSpyModelForSessionLoading();
// When session is loaded
spyModel.readDataFromCursor(mMockCursor,
SessionDetailModel.SessionDetailQueryEnum.SESSIONS);
// Then session is ongoing
assertThat(spyModel.minutesSinceSessionStarted(), is(60l));
}
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:17,代码来源:SessionDetailModelTest.java
示例17: minutesUntilSessionStarts_SessionNotStarted_ReturnsCorrectMinutes
import com.google.samples.apps.iosched.BuildConfig; //导入依赖的package包/类
@Test
public void minutesUntilSessionStarts_SessionNotStarted_ReturnsCorrectMinutes() {
// Only possible to mock current time in debug build
if (BuildConfig.DEBUG) {
// Given a mock cursor for a session starting in 1 hour
initMockCursorWithNotStartedSession(mMockCursor);
SessionDetailModel spyModel = setSpyModelForSessionLoading();
// When session is loaded
spyModel.readDataFromCursor(mMockCursor,
SessionDetailModel.SessionDetailQueryEnum.SESSIONS);
// Then session is ongoing
assertThat(spyModel.minutesUntilSessionStarts(), is(60l));
}
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:17,代码来源:SessionDetailModelTest.java
示例18: minutesUntilSessionStarts_SessionStarted_ReturnsCorrectMinutes
import com.google.samples.apps.iosched.BuildConfig; //导入依赖的package包/类
@Test
public void minutesUntilSessionStarts_SessionStarted_ReturnsCorrectMinutes() {
// Only possible to mock current time in debug build
if (BuildConfig.DEBUG) {
// Given a mock cursor for a session in progress
initMockCursorWithOngoingSession(mMockCursor);
SessionDetailModel spyModel = setSpyModelForSessionLoading();
// When session is loaded
spyModel.readDataFromCursor(mMockCursor,
SessionDetailModel.SessionDetailQueryEnum.SESSIONS);
// Then session is ongoing
assertThat(spyModel.minutesUntilSessionStarts(), is(0l));
}
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:17,代码来源:SessionDetailModelTest.java
示例19: isSessionReadyForFeedback_SessionNotStarted_ReturnsFalse
import com.google.samples.apps.iosched.BuildConfig; //导入依赖的package包/类
@Test
public void isSessionReadyForFeedback_SessionNotStarted_ReturnsFalse() {
// Only possible to mock current time in debug build
if (BuildConfig.DEBUG) {
// Given a mock cursor for a session not started
initMockCursorWithNotStartedSession(mMockCursor);
SessionDetailModel spyModel = setSpyModelForSessionLoading();
// When session is loaded
spyModel.readDataFromCursor(mMockCursor,
SessionDetailModel.SessionDetailQueryEnum.SESSIONS);
// Then session is ongoing
assertThat(spyModel.isSessionReadyForFeedback(), is(false));
}
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:17,代码来源:SessionDetailModelTest.java
示例20: isSessionReadyForFeedback_OnGoingSessionJustStarted_ReturnsFalse
import com.google.samples.apps.iosched.BuildConfig; //导入依赖的package包/类
@Test
public void isSessionReadyForFeedback_OnGoingSessionJustStarted_ReturnsFalse() {
// Only possible to mock current time in debug build
if (BuildConfig.DEBUG) {
// Given a mock cursor for a session in progress that started 1 minute ago and lasts 2 hours
initMockCursorWithJustStartedSession(mMockCursor);
SessionDetailModel spyModel = setSpyModelForSessionLoading();
// When session is loaded
spyModel.readDataFromCursor(mMockCursor,
SessionDetailModel.SessionDetailQueryEnum.SESSIONS);
// Then session is ongoing
assertThat(spyModel.isSessionReadyForFeedback(), is(false));
}
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:17,代码来源:SessionDetailModelTest.java
注:本文中的com.google.samples.apps.iosched.BuildConfig类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论