001package de.econda.droid; 002 003/** 004 * Settings used to create a new session. 005 * 006 * The Settings-Object can be constructed comfortable by using the SettingsBuilder 007 */ 008public class Settings { 009 010 private final PrivacySettings defaultPrivacySettingsNewUser; 011 private final String clientKey; 012 private final boolean secureTransmit; 013 private final String customHostName; 014 private final int batchAutoTransmitTimeout; 015 private final int samplingRate; 016 017 /** 018 * 019 * @param defaultPrivacySettingsNewUser the privacy settings the new session will start with 020 * @param clientKey the account identification id. This id is given you by econda support. 021 * @param secureTransmit use https only 022 * @param customHostName use this customized hostname as hostname, otherwise null 023 * @param batchAutoTransmitTimeout Submission should be tried to collected and submitted later perhaps together with other data. 024 * @param samplingRate A samplingRate can be used, to collect only data of a random part of users 025 */ 026 public Settings(PrivacySettings defaultPrivacySettingsNewUser, String clientKey, boolean secureTransmit, String customHostName, int batchAutoTransmitTimeout, int samplingRate) { 027 this.defaultPrivacySettingsNewUser = defaultPrivacySettingsNewUser; 028 this.clientKey = clientKey; 029 this.secureTransmit = secureTransmit; 030 this.customHostName = customHostName; 031 this.batchAutoTransmitTimeout = batchAutoTransmitTimeout; 032 this.samplingRate = samplingRate; 033 } 034 035 /** 036 * 037 * @return the privacy settings the new session will start with 038 */ 039 public PrivacySettings getDefaultPrivacySettingsNewUser() { 040 return defaultPrivacySettingsNewUser; 041 } 042 043 /** 044 * 045 * @return the account identification id. This id is given you by econda support. 046 */ 047 public String getClientKey() { 048 return clientKey; 049 } 050 051 /** 052 * 053 * @return use https only 054 */ 055 public boolean isSecureTransmit() { 056 return secureTransmit; 057 } 058 059 /** 060 * 061 * @return you can set a customized hostname. if null, a hostname will be constructed using Android/ and the packagename of the app 062 */ 063 public String getCustomHostName() { 064 return customHostName; 065 } 066 067 /** 068 * 069 * @return timeout in seconds. after this time all collected data will be submitted. 070 */ 071 public int getBatchAutoTransmitTimeout() { 072 return batchAutoTransmitTimeout; 073 } 074 075 /** 076 * 077 * @return The sampling rate. If samplingRate=5 each 5th Visitor will be analyzed. 078 */ 079 public int getSamplingRate() { 080 return samplingRate; 081 } 082}