Skip to content

Commit

Permalink
Merge pull request #26 from rudderlabs/v1.0.1
Browse files Browse the repository at this point in the history
V1.0.1 Release
  • Loading branch information
arnabp92 authored Apr 7, 2020
2 parents 6b747bc + 4400089 commit cd28c56
Show file tree
Hide file tree
Showing 58 changed files with 1,390 additions and 162 deletions.
24 changes: 8 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[ ![Download](https://api.bintray.com/packages/rudderstack/rudderstack/core/images/download.svg?version=1.0) ](https://bintray.com/rudderstack/rudderstack/core/1.0/link)

# What is Rudder?

**Short answer:**
Expand All @@ -15,31 +13,27 @@ Released under [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0)
1. Add these lines to your ```app/build.gradle```
```
repositories {
maven {
url "https://dl.bintray.com/rudderstack/rudderstack"
}
maven { url "https://dl.bintray.com/rudderstack/rudderstack" }
}
```
2. Add the dependency under ```dependencies```
```
implementation 'com.rudderstack.android.sdk:core:1.0'
implementation 'com.rudderstack.android.sdk:core:1.0.1'
```

## Initialize ```RudderClient```
```
val rudderClient: RudderClient = RudderClient.getInstance(
this,
WRITE_KEY,
<WRITE_KEY>,
RudderConfig.Builder()
.withEndPointUri(END_POINT_URI)
.withLogLevel(RudderLogger.RudderLogLevel.DEBUG)
.withDataPlaneUrl(<DATA_PLANE_URL>)
.build()
)
```
or (compatible with existing Segment code)
```
RudderClient.Builder builder = new RudderClient.Builder(this, WRITE_KEY);
builder.logLevel(RudderLogger.RudderLogLevel.VERBOSE);
RudderClient.Builder builder = new RudderClient.Builder(this, <WRITE_KEY>);
RudderClient.setSingletonInstance(builder.build());
```

Expand Down Expand Up @@ -67,9 +61,7 @@ RudderClient.with(this).track(
);
```

For more detailed documentation check [here](https://docs.rudderstack.com/sdk-integration-guide/getting-started-with-android-sdk)
For more detailed documentation check [the documentation page](https://docs.rudderstack.com/sdk-integration-guide/getting-started-with-android-sdk).

# Coming Soon
1. Install attribution support using ```referrer``` API.
2. Option to opt-out from tracking any Analytics Event.
3. RudderOption implementation for custom destination support.
## Contact Us
If you come across any issues while configuring or using RudderStack, please feel free to [contact us](https://rudderstack.com/contact/) or start a conversation on our [Discord](https://discordapp.com/invite/xNEdEGw) channel. We will be happy to help you.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.android.tools.build:gradle:3.6.2'
}
}

Expand Down
2 changes: 1 addition & 1 deletion core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ android {
minSdkVersion 14
targetSdkVersion 29
versionCode 1
versionName "1.0"
versionName "1.0.1"
}

buildTypes {
Expand Down
2 changes: 1 addition & 1 deletion core/maven.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ext {
siteUrl = 'https://github.com/rudderlabs/rudder-sdk-android'
gitUrl = 'https://github.com/rudderlabs/rudder-sdk-android.git'

libraryVersion = '1.0'
libraryVersion = '1.0.1'

developerId = 'arnabp92'
developerName = 'Arnab Pal'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Constants {
// how often config should be fetched from the server (in hours) (2 hrs by default)
static final int CONFIG_REFRESH_INTERVAL = 2;
// default base url or rudder-backend-server
static final String BASE_URL = "https://api.rudderlabs.com";
static final String DATA_PLANE_URL = "https://hosted.rudderlabs.com";
// default flush queue size for the events to be flushed to server
static final int FLUSH_QUEUE_SIZE = 30;
// default threshold of number of events to be persisted in sqlite db
Expand All @@ -17,8 +17,7 @@ class Constants {
// events will be flushed to server after sleepTimeOut seconds
static final int SLEEP_TIMEOUT = 10;
// config-plane url to get the config for the writeKey
static final String CONFIG_PLANE_URL = "https://api.rudderlabs.com";
// static final String CONFIG_PLANE_URL = "https://f7572250.ngrok.io";
static final String CONTROL_PLANE_URL = "https://api.rudderlabs.com";
// whether we should trackLifecycle events
static final boolean TRACK_LIFECYCLE_EVENTS = true;
// whether we should record screen views automatically
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,21 @@ void clearEventFromDB(int messageId) {
clearEventsFromDB(messageIds);
}

/**
* flush the events from the database
*/
void flushEvents() {
SQLiteDatabase database = getWritableDatabase();
if (database.isOpen()) {
String deleteSQL = String.format(Locale.US, "DELETE FROM %s", EVENTS_TABLE_NAME);
RudderLogger.logDebug(String.format(Locale.US, "DBPersistentManager: flushEvents: deleteSQL: %s", deleteSQL));
database.execSQL(deleteSQL);
RudderLogger.logInfo("DBPersistentManager: flushEvents: Messages deleted from DB");
} else {
RudderLogger.logError("DBPersistentManager: flushEvents: database is not writable");
}
}

/*
* remove selected events from persistence database storage
* */
Expand Down
Loading

0 comments on commit cd28c56

Please sign in to comment.