-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: convert api interfaces to kotlin
- Loading branch information
1 parent
aca6464
commit 5c03be0
Showing
4 changed files
with
72 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 40 additions & 39 deletions
79
...android/embracesdk/EmbraceAndroidApi.java → ...e/android/embracesdk/EmbraceAndroidApi.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,115 +1,116 @@ | ||
package io.embrace.android.embracesdk; | ||
package io.embrace.android.embracesdk | ||
|
||
import android.content.Context; | ||
|
||
import androidx.annotation.NonNull; | ||
import android.content.Context | ||
|
||
/** | ||
* Declares the functions that consist of Embrace's public API - specifically | ||
* those that are only declared on Android. You should not use | ||
* {@link EmbraceAndroidApi} directly or implement it in your own custom classes, | ||
* as new functions may be added in future. Use the {@link Embrace} class instead. | ||
* [EmbraceAndroidApi] directly or implement it in your own custom classes, | ||
* as new functions may be added in future. Use the [Embrace] class instead. | ||
*/ | ||
interface EmbraceAndroidApi extends EmbraceApi { | ||
internal interface EmbraceAndroidApi : EmbraceApi { | ||
|
||
/** | ||
* Starts instrumentation of the Android application using the Embrace SDK. This should be | ||
* called during creation of the application, as early as possible. | ||
* <p> | ||
* See <a href="https://embrace.io/docs/android/">Embrace Docs</a> for | ||
* | ||
* See [Embrace Docs](https://embrace.io/docs/android/) for | ||
* integration instructions. For compatibility with other networking SDKs such as Akamai, | ||
* the Embrace SDK must be initialized after any other SDK. | ||
* | ||
* @param context an instance of the application context | ||
*/ | ||
void start(@NonNull Context context); | ||
fun start(context: Context) | ||
|
||
/** | ||
* Starts instrumentation of the Android application using the Embrace SDK. This should be | ||
* called during creation of the application, as early as possible. | ||
* <p> | ||
* See <a href="https://embrace.io/docs/android/">Embrace Docs</a> for | ||
* | ||
* See [Embrace Docs](https://embrace.io/docs/android/) for | ||
* integration instructions. For compatibility with other networking SDKs such as Akamai, | ||
* the Embrace SDK must be initialized after any other SDK. | ||
* | ||
* @param context an instance of context | ||
* @param appFramework the AppFramework of the application | ||
*/ | ||
void start(@NonNull Context context, | ||
@NonNull Embrace.AppFramework appFramework); | ||
fun start( | ||
context: Context, | ||
appFramework: Embrace.AppFramework | ||
) | ||
|
||
/** | ||
* Starts instrumentation of the Android application using the Embrace SDK. This should be | ||
* called during creation of the application, as early as possible. | ||
* <p> | ||
* See <a href="https://embrace.io/docs/android/">Embrace Docs</a> for | ||
* | ||
* See [Embrace Docs](https://embrace.io/docs/android/) for | ||
* integration instructions. For compatibility with other networking SDKs such as Akamai, | ||
* the Embrace SDK must be initialized after any other SDK. | ||
* | ||
* @param context an instance of context | ||
* @param isDevMode if true, and the build type is debuggable, it | ||
* sets the environment for all sessions to 'Development'. | ||
* | ||
* @deprecated Use {@link #start(Context)} instead. The isDevMode parameter has no effect. | ||
* sets the environment for all sessions to 'Development'. | ||
*/ | ||
@Deprecated | ||
void start(@NonNull Context context, | ||
boolean isDevMode); | ||
@Deprecated("Use {@link #start(Context)} instead. The isDevMode parameter has no effect.") | ||
fun start( | ||
context: Context, | ||
isDevMode: Boolean | ||
) | ||
|
||
/** | ||
* Starts instrumentation of the Android application using the Embrace SDK. This should be | ||
* called during creation of the application, as early as possible. | ||
* <p> | ||
* See <a href="https://embrace.io/docs/android/">Embrace Docs</a> for | ||
* | ||
* See [Embrace Docs](https://embrace.io/docs/android/) for | ||
* integration instructions. For compatibility with other networking SDKs such as Akamai, | ||
* the Embrace SDK must be initialized after any other SDK. | ||
* | ||
* @param context an instance of context | ||
* @param isDevMode if true, and the build type is debuggable, it | ||
* sets the environment for all sessions to 'Development'. | ||
* sets the environment for all sessions to 'Development'. | ||
* @param appFramework the AppFramework of the application | ||
* | ||
* @deprecated Use {@link #start(Context, Embrace.AppFramework)} instead. The isDevMode parameter has no effect. | ||
*/ | ||
@Deprecated | ||
void start(@NonNull Context context, | ||
boolean isDevMode, | ||
@NonNull Embrace.AppFramework appFramework); | ||
@Deprecated("Use {@link #start(Context, Embrace.AppFramework)} instead. The isDevMode parameter has no effect.") | ||
fun start( | ||
context: Context, | ||
isDevMode: Boolean, | ||
appFramework: Embrace.AppFramework | ||
) | ||
|
||
/** | ||
* Whether or not the SDK has been started. | ||
* | ||
* @return true if the SDK is started, false otherwise | ||
*/ | ||
boolean isStarted(); | ||
val isStarted: Boolean | ||
|
||
/** | ||
* Records that a view 'started'. You should call this when your app starts displaying an | ||
* activity, a fragment, a screen, or any custom UI element, and you want to capture a | ||
* breadcrumb that this happens. | ||
* <p> | ||
* A matching call to {@link #endView(String)} must be made when the view is no longer | ||
* | ||
* A matching call to [.endView] must be made when the view is no longer | ||
* displayed. | ||
* <p> | ||
* | ||
* A maximum of 100 breadcrumbs will be recorded per session, with a maximum length of 256 | ||
* characters per view name. | ||
* | ||
* @param name the name of the view to log | ||
*/ | ||
boolean startView(@NonNull String name); | ||
fun startView(name: String): Boolean | ||
|
||
/** | ||
* Records that a view 'ended'. You should call this when your app stops displaying an | ||
* activity, a fragment, a screen, or any custom UI element, and you want to capture a | ||
* breadcrumb that this happens. | ||
* <p> | ||
* A matching call to {@link #startView(String)} must be made when the view is first | ||
* | ||
* A matching call to [.startView] must be made when the view is first | ||
* displayed, or no breadcrumb will be logged. | ||
* <p> | ||
* | ||
* A maximum of 100 breadcrumbs will be recorded per session, with a maximum length of 256 | ||
* characters per view name. | ||
* | ||
* @param name the name of the view to log | ||
*/ | ||
boolean endView(@NonNull String name); | ||
fun endView(name: String): Boolean | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters