Package com.bugfender.sdk
Class Bugfender
java.lang.Object
com.bugfender.sdk.Bugfender
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Debug Bugfender log method.static void
disableReflection
(boolean disable) Disable reflection when generation log lines.static void
Error Bugfender log method.static void
Enable crash reporting tool functionalitystatic void
Logs all logs written via Logcat.static void
enableLogcatLogging
(LogcatInterceptor logcatInterceptor) Logs all logs written via Logcat.static void
enableUIEventLogging
(android.app.Application application, Object... ignoredViewsTags) Logs all actions performed and screen changes in the application, such as button touches, etc...static void
Fatal Bugfender log method.static void
Synchronizes all logs and issues with the server once, regardless if this device is enabled or not.static URL
Get a URL pointing to the Bugfender dashboard page for the device.static URL
Get a URL pointing to the Bugfender dashboard page for the device and current session.static android.content.Intent
getUserFeedbackActivityIntent
(android.content.Context context, String title, String hint, String subjectHint, String messageHint, String sendButtonText) Provides an Intent for opening an Activity to gather the feedback of the users and sent it to Bugfender.static android.content.Intent
getUserFeedbackActivityIntent
(android.content.Context context, String title, String hint, String subjectHint, String messageHint, String sendButtonText, FeedbackStyle style) Provides an Intent for opening an Activity to gather the feedback of the users and sent it to Bugfender.static void
Info Bugfender log method.static void
Deprecated.static void
init
(android.content.Context context, String applicationToken, boolean debug, boolean autoFetchAndroidId) Initialize the Bugfender SDK with a specific application token.static void
Bugfender interface for logging, which takes a simple string as log message.static void
overrideDeviceName
(String name) Overrides the device name that will be shown in the Dashboard.static void
removeDeviceKey
(String key) Remove a device detail.static URL
Send a crash.static URL
Sends an issuestatic URL
sendUserFeedback
(String title, String message) Sends user feedbackstatic void
Sets the URL of the APIstatic void
setBaseUrl
(String url) Sets the URL of the Bugfender Dashboardstatic void
setDeviceBoolean
(String key, boolean value) Sets a device detail with boolean type.static void
setDeviceFloat
(String key, Float value) Sets a device detail with double type.static void
setDeviceInteger
(String key, Integer value) Sets a device detail with integer type.static void
setDeviceString
(String key, String value) Sets a device detail with string type.static void
setForceEnabled
(boolean enabled) Synchronizes all logs and issues with the server all the time, regardless if this device is enabled or not.static void
setMaximumLocalStorageSize
(long bytes) Set the maximum size to store local log files.static void
Trace Bugfender log method.static void
Warning Bugfender log method.
-
Constructor Details
-
Bugfender
public Bugfender()
-
-
Method Details
-
init
public static void init(android.content.Context context, String applicationToken, boolean debug, boolean autoFetchAndroidId) Initialize the Bugfender SDK with a specific application token.- Parameters:
context
- Application context.applicationToken
- The application token.debug
- Boolean that represent if Bugfender sdk should print the logs in console.autoFetchAndroidId
- Automatically fetch the ANDROID_ID and send it as$android_id
key-value. You may need to disable this for some types of apps.
-
init
Deprecated.Prefer to explicitly state if ANDROID_ID should be sent or not, withinit(Context, String, boolean, boolean)
.Initialize the Bugfender SDK with a specific application token. Automatically fetches the ANDROID_ID.- Parameters:
context
- Application context.applicationToken
- The application token.debug
- Boolean that represent if Bugfender sdk should print the logs in console.
-
setMaximumLocalStorageSize
public static void setMaximumLocalStorageSize(long bytes) Set the maximum size to store local log files.By default, the limit is 5 MB.
- Parameters:
bytes
- Maximum size in bytes. Range accepted is from 1 MB to 50 MB. If the value provider is below this range it will be set to 1 MB, if is above the range it will be set to 50 MB
-
t
Trace Bugfender log method.- Parameters:
tag
- String with the tag.message
- String with the message.
-
i
Info Bugfender log method.- Parameters:
tag
- String with the tag.message
- String with the message.
-
d
Debug Bugfender log method.- Parameters:
tag
- String with the tag.message
- String with the message.
-
w
Warning Bugfender log method.- Parameters:
tag
- String with the tag.message
- String with the message.
-
e
Error Bugfender log method.- Parameters:
tag
- String with the tag.message
- String with the message.
-
f
Fatal Bugfender log method.- Parameters:
tag
- String with the tag.message
- String with the message.
-
log
public static void log(int lineNumber, String method, String file, LogLevel logLevel, String tag, String message) Bugfender interface for logging, which takes a simple string as log message.- Parameters:
lineNumber
- The line number of the log.method
- The method where the log has happened.file
- The file where the log has happened.logLevel
- Log level.tag
- Tag to be applied to the log line.message
- Message to be logged. The message will be logged verbatim, no interpretation will be performed.
-
sendIssue
Sends an issue- Parameters:
title
- Short description of the issue.text
- Full details of the issue. Markdown format is accepted.- Returns:
- The URL pointing to the issue on the Bugfender dashboard or null if SDK is not initialized.
-
sendUserFeedback
Sends user feedback- Parameters:
title
- Title for the feedback.message
- Feedback message. Markdown format is accepted- Returns:
- The URL pointing to the feedback information on the Bugfender dashboard or null if SDK is not initialized.
-
sendCrash
Send a crash. Useful for controlled Exceptions- Parameters:
title
- Title for the crash.text
- Additional info for the crash, p.e. the Stack trace. Markdown format is accepted- Returns:
- The URL pointing to the crash information on the Bugfender dashboard or null if SDK is not initialized.
-
setForceEnabled
public static void setForceEnabled(boolean enabled) Synchronizes all logs and issues with the server all the time, regardless if this device is enabled or not.Logs and issues are synchronized continuously while forceEnabled is active.
- Parameters:
enabled
- Whether logs and issues should be sent regardless of the Bugfender Console settings.
-
forceSendOnce
public static void forceSendOnce()Synchronizes all logs and issues with the server once, regardless if this device is enabled or not.Logs and issues are synchronized only once. After that, the logs are again sent according to the enabled flag in the Bugfender Console.
-
getDeviceUrl
Get a URL pointing to the Bugfender dashboard page for the device.- Returns:
- The URL to the page if the Bugfender sdk is initialized otherwise return null.
-
getSessionUrl
Get a URL pointing to the Bugfender dashboard page for the device and current session.- Returns:
- The URL to the page if the Bugfender sdk is initialized otherwise return null.
-
setDeviceBoolean
Sets a device detail with boolean type.- Parameters:
key
- key.value
- A boolean value.
-
setDeviceString
Sets a device detail with string type.- Parameters:
key
- key.value
- A string value.
-
setDeviceInteger
Sets a device detail with integer type.- Parameters:
key
- key.value
- A integer value.
-
setDeviceFloat
Sets a device detail with double type.- Parameters:
key
- key.value
- A double value.
-
setApiUrl
Sets the URL of the API Usage of this function is not necessary in the general use case. Please use exclusively when directed from technical support. This method must be called before Bugfender.init().- Parameters:
url
- Custom url.
-
setBaseUrl
Sets the URL of the Bugfender Dashboard Usage of this function is not necessary in the general use case. Please use exclusively when directed from technical support. This method must be called before Bugfender.init()..- Parameters:
url
- base URL of the Bugfender's dashboard
-
removeDeviceKey
Remove a device detail.- Parameters:
key
- key.
-
enableLogcatLogging
public static void enableLogcatLogging()Logs all logs written via Logcat. -
enableLogcatLogging
Logs all logs written via Logcat.- Parameters:
logcatInterceptor
- Interceptor that allows to modify or block log entries.
-
enableCrashReporting
public static void enableCrashReporting()Enable crash reporting tool functionality -
disableReflection
public static void disableReflection(boolean disable) Disable reflection when generation log lines. This will save cpu-cycles but some extra information won't be available like the method name and the line on which the log was generated- Parameters:
disable
-
-
enableUIEventLogging
public static void enableUIEventLogging(android.app.Application application, Object... ignoredViewsTags) Logs all actions performed and screen changes in the application, such as button touches, etc...- Parameters:
application
- Application classignoredViewsTags
- Tags of views that should not be observed and logged by Bugfender
-
overrideDeviceName
Overrides the device name that will be shown in the Dashboard. This method must be called beforeinit(Context, String, boolean)
to have effect- Parameters:
name
- New device name
-
getUserFeedbackActivityIntent
public static android.content.Intent getUserFeedbackActivityIntent(android.content.Context context, String title, String hint, String subjectHint, String messageHint, String sendButtonText) Provides an Intent for opening an Activity to gather the feedback of the users and sent it to Bugfender. If the Activity is launched withActivity.startActivityForResult(Intent, int)
it will returnActivity.RESULT_OK
if the user clicked the send button orActivity.RESULT_CANCELED
otherwise- Parameters:
context
- Current activity contexttitle
- Title for the app barhint
- Short text that is shown above the subject and message inputssubjectHint
- Hint in the subject EditTextmessageHint
- Hint in the message EditTextsendButtonText
- Text to show on the button that will send- Returns:
- The Intent to be used for opening the feedback Activity
-
getUserFeedbackActivityIntent
public static android.content.Intent getUserFeedbackActivityIntent(android.content.Context context, String title, String hint, String subjectHint, String messageHint, String sendButtonText, FeedbackStyle style) Provides an Intent for opening an Activity to gather the feedback of the users and sent it to Bugfender. If the Activity is launched withActivity.startActivityForResult(Intent, int)
it will returnActivity.RESULT_OK
if the user clicked the send button orActivity.RESULT_CANCELED
otherwise- Parameters:
context
- Current activity contexttitle
- Title for the app barhint
- Short text that is shown above the subject and message inputssubjectHint
- Hint in the subject EditTextmessageHint
- Hint in the message EditTextsendButtonText
- Text to show on the button that will sendstyle
- Configuration object containing style customizations- Returns:
- The Intent to be used for opening the feedback Activity
-
init(Context, String, boolean, boolean)
.