Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Merge branch 'release/v1.0-beta.5'
Browse files Browse the repository at this point in the history
# Conflicts:
#	README.md
#	applicationinsights-android/src/main/java/com/microsoft/applicationinsights/library/ApplicationInsights.java
  • Loading branch information
Benjamin Reimold committed Jun 16, 2015
2 parents b8e42d2 + 997ce03 commit 7463e54
Show file tree
Hide file tree
Showing 36 changed files with 1,131 additions and 992 deletions.
10 changes: 10 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
source 'https://www.rubygems.org'

gem 'appium_lib', '~> 6.0.0'
gem 'rest-client', '~> 1.8.0'
gem 'rspec', '~> 2.14.1'
gem 'rspec-expectations', '~> 2.14.5'
gem 'spec', '~> 5.3.4'
gem 'sauce_whisk', '~> 0.0.14'
gem 'test-unit', '~> 2.5.5' # required for bundle exec ruby xunit_android.rb
gem 'byebug', '~> 4.0.5'
80 changes: 80 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
GEM
remote: https://www.rubygems.org/
specs:
appium_lib (6.0.0)
awesome_print (~> 1.6, >= 1.6.0)
json (~> 1.8, >= 1.8.1)
nokogiri (~> 1.6.3.1)
selenium-webdriver (~> 2.41, >= 2.41.0)
toml (~> 0.0, >= 0.0.4)
awesome_print (1.6.1)
blankslate (2.1.2.4)
byebug (4.0.5)
columnize (= 0.9.0)
childprocess (0.5.6)
ffi (~> 1.0, >= 1.0.11)
chronic_duration (0.10.6)
numerizer (~> 0.1.1)
columnize (0.9.0)
diff-lcs (1.2.5)
domain_name (0.5.24)
unf (>= 0.0.5, < 1.0.0)
ffi (1.9.8)
http-cookie (1.0.2)
domain_name (~> 0.5)
json (1.8.2)
mime-types (2.5)
mini_portile (0.6.0)
multi_json (1.11.0)
netrc (0.10.3)
nokogiri (1.6.3.1)
mini_portile (= 0.6.0)
numerizer (0.1.1)
parslet (1.5.0)
blankslate (~> 2.0)
rest-client (1.8.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 3.0)
netrc (~> 0.7)
rspec (2.14.1)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rspec-core (2.14.8)
rspec-expectations (2.14.5)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.6)
rubyzip (1.1.7)
sauce_whisk (0.0.18)
json (~> 1.8.1)
rest-client (~> 1.7)
selenium-webdriver (2.45.0)
childprocess (~> 0.5)
multi_json (~> 1.0)
rubyzip (~> 1.0)
websocket (~> 1.0)
spec (5.3.4)
chronic_duration (~> 0.10.2)
test-unit (2.5.5)
toml (0.1.2)
parslet (~> 1.5.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.1)
websocket (1.2.2)

PLATFORMS
ruby

DEPENDENCIES
appium_lib (~> 6.0.0)
byebug (~> 4.0.5)
rest-client (~> 1.8.0)
rspec (~> 2.14.1)
rspec-expectations (~> 2.14.5)
sauce_whisk (~> 0.0.14)
spec (~> 5.3.4)
test-unit (~> 2.5.5)

BUNDLED WITH
1.10.3
64 changes: 39 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[ ![Download](https://api.bintray.com/packages/appinsights-android/maven/ApplicationInsights-Android/images/download.svg) ](https://bintray.com/appinsights-android/maven/ApplicationInsights-Android/_latestVersion)

# Application Insights for Android (1.0-beta.4)
# Application Insights for Android (1.0-beta.5)

This project provides an Android SDK for Application Insights. [Application Insights](http://azure.microsoft.com/en-us/services/application-insights/) is a service that allows developers to keep their applications available, performing, and succeeding. This module allows you to send telemetry of various kinds (events, traces, exceptions, etc.) to the Application Insights service where your data can be visualized in the Azure Portal.

Expand All @@ -11,7 +11,7 @@ Automatic collection of lifecycle-events requires API level 15 and up (Ice Cream
## Content

1. [Release Notes](#1)
2. [Breaking Changes](#2)
2. [Breaking Changes & Deprecations](#2)
3. [Setup](#3)
4. [Advanced Setup](#4)
5. [Developer Mode](#5)
Expand All @@ -21,32 +21,47 @@ Automatic collection of lifecycle-events requires API level 15 and up (Ice Cream
9. [Additional configuration](#9)
10. [Documentation](#10)
11. [Contributing](#11)
12. [Contact](#12)

## <a name="1"></a> 1. Release Notes

* Improvements regarding threat safety
* Improved unit tests (now using Mockito)
* Simplified threading model (still deferring work to background tasks)
* Bugfix for sending logic (number of running operations wasn't decremented when we don't have a connection)
* Fix for potential memory leaks
* Updated code in sample app
* Data is now persisted when the user sends the app into the background (requires API level 14)
* Data is now persisted when the device is low on memory
* The SDK is now built using the Android Tools Gradle plugin 1.2.3
* Fix a null pointer exception in ```LifecycleTracking```[#43](https://github.com/Microsoft/ApplicationInsights-Android/pull/43)
* Refactored Autocollection – ```LifecycleTracking```has been deprecated [#51](https://github.com/Microsoft/ApplicationInsights-Android/pull/51)
* Fix for null pointer exceptions when trying to serialize ```null``` [#45](https://github.com/Microsoft/ApplicationInsights-Android/pull/45)
* Fix for ```Concurrent Modification Exception``` in case the same Telemetry-Object was after it was modified [#44](https://github.com/Microsoft/ApplicationInsights-Android/pull/44)
* **Fix for ```ClassNotFoundException``` when running the SDK on an Android 2.3 device** [#48](https://github.com/Microsoft/ApplicationInsights-Android/pull/48)
* **Fix a bug that was introduced in 1.0-beta.4 that caused crashes not to be sent under some circumstances** [#52](https://github.com/Microsoft/ApplicationInsights-Android/pull/52) & [e3b51e7927f238cc123c50b654fbeab448ba6df6](https://github.com/Microsoft/ApplicationInsights-Android/commit/e3b51e7927f238cc123c50b654fbeab448ba6df6)

##<a name="2"></a> 2. Breaking Changes

Starting with the first 1.0 stable release, we will start deprecating API instead of breaking old ones.
##<a name="2"></a> 2. Breaking Changes & deprecations

Starting with 1.0-beta.5, breaking changes will be announced 1 release in advance. Once a method has been deprecated, the next release of the SDK will remove the API.

**[1.0-beta.5]**

* Two previously deprecated setup-methods for ```ApplicationInsights```have been removed.
* ```LifecycleTracking```has been deprecated, use ```AutoCollection```instead.

**[1.0-beta.4]**

* **[1.0-beta.4]** **No breaking API changes**.
* Two setup-methods for ```ApplicationInsights```have been deprecated and will be removed in the next beta

* **[1.0-beta.3]** Configuration of the Application Insights SDK is now done using ```ApplicationInsightsConfig```. The previous config-classes have been removed
**[1.0-beta.3]**

Configuration of the Application Insights SDK is now done using ```ApplicationInsightsConfig```. The previous config-classes have been removed

**[1.0-beta.2]**

To enable automatic lifecycle-tracking, Application Insights has to be set up with an instance of Application (see [Life-cycle tracking] (#2)), otherwise, lifecycle-tracking is disabled.

**[1.0-beta.1]**

* **[1.0-beta.2]** To enable automatic lifecycle-tracking, Application Insights has to be set up with an instance of Application (see [Life-cycle tracking] (#2)), otherwise, lifecycle-tracking is disabled.
Setup and start of the Application Insights SDK are now done using the new umbrella class `ApplicationInsights` instead of `AppInsights `

* **[1.0-beta.1]** Setup and start of the Application Insights SDK are now done using the new umbrella class `ApplicationInsights` instead of `AppInsights `
**[1.0-Alpha.5]**

* **[1.0-Alpha.5]** Setup and start of the Application Insights SDK are now done using the new umbrella class `AppInsights` instead of `TelemetryClient`
Setup and start of the Application Insights SDK are now done using the new umbrella class `AppInsights` instead of `TelemetryClient`

##<a name="3"></a> 3. Setup

Expand All @@ -60,7 +75,7 @@ In your module's ```build.gradle```add a dependency for Application Insights

```groovy
dependencies {
compile 'com.microsoft.azure:applicationinsights-android:1.0-beta.4'
compile 'com.microsoft.azure:applicationinsights-android:1.0-beta.5'
}
```

Expand Down Expand Up @@ -110,7 +125,7 @@ ApplicationInsights.start();

in the activity's `onCreate`-callback.

**Congratulation, now you're all set to use Application Insights! See [Usage](#6) how to use Application Insights.**
**Congratulation, now you're all set to use Application Insights! See [Usage](#6) on how to use Application Insights.**

##<a name="4"></a> 4. Advanced Setup

Expand Down Expand Up @@ -146,7 +161,7 @@ ApplicationInsights.start();

## <a name="5"></a> 5. Developer Mode

The **developer mode** is enabled automatically in case the debugger is attached or if the app is running in the emulator. This will enable the console logging and decrease the number of telemetry items sent in a batch (5 items) as well as the interval items will be sent (3 seconds). If you don't want this behavior, disable the **developer mode**.
The **developer mode** is enabled automatically in case the debugger is attached or if the app is running in the emulator. This will enable the console logging and decrease the number of telemetry items per batch (5 items) as well as the sending interval (3 seconds). If you don't want this behavior, disable the **developer mode**.

You can explicitly enable/disable the developer mode like this:

Expand Down Expand Up @@ -206,7 +221,7 @@ client.trackEvent("sample event", properties);

## <a name="7"></a>7. Automatic collection of life-cycle events (Sessions & Page Views)

This only works in Android SDK version 15 and up (Ice Cream Sandwich+) and is **enabled by default**. Don't forget to provide an Application instance when setting up Application Insights (otherwise auto collection will be disabled):
This only works in Android SDK version 14 and up (Ice Cream Sandwich+) and is **enabled by default**. Don't forget to provide an Application instance when setting up Application Insights (otherwise auto collection will be disabled):

```java
ApplicationInsights.setup(this.getApplicationContext(), this.getApplication());
Expand All @@ -220,7 +235,7 @@ ApplicationInsights.setAutoCollectionDisabled(true); //disable the auto-collecti
ApplicationInsights.start();
```

After `ApplicationInsights.start()` was called, you can enable or disable those features at any point:
After `ApplicationInsights.start()` was called, you can enable or disable those features at any point, even if you have disabled it between setup and start of the Application Insights SDK:

```java
// Disable automatic session renewal & tracking
Expand Down Expand Up @@ -307,7 +322,7 @@ ApplicationInsights.renewSession("New session ID");

### 9.5 Other

For all available configarion options, see our [Javadoc](http://microsoft.github.io/ApplicationInsights-Android/) for ```ApplicationInisghtsConfig```
For all available configarion options, see our [Javadoc](http://microsoft.github.io/ApplicationInsights-Android/) for ```ApplicationInsightsConfig```

##<a name="10"></a> 10. Documentation

Expand All @@ -322,8 +337,7 @@ Our Javadoc can be found at [http://microsoft.github.io/ApplicationInsights-Andr
* [Get an instrumentation key](/Microsoft/ApplicationInsights-Home/wiki#getting-an-application-insights-instrumentation-key) and set it in the manifest
* Run tests from Android Studio

<a id="contact"></a>
## 12. Contact
##<a name="12"></a> 12. Contact

If you have further questions or are running into trouble that cannot be resolved by any of the steps here, feel free to contact us at [AppInsights-Android@microsoft.com](mailto:AppInsights-Android@microsoft.com)

Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,14 @@ public void onItemSelected(String id) {
public ItemListFragment() {
}

@SuppressLint("InlinedApi")
@TargetApi(11)
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

// TODO: replace with a real list adapter.
setListAdapter(new ArrayAdapter<DummyContent.DummyItem>(
getActivity(),
android.R.layout.simple_list_item_activated_1,
android.R.layout.simple_list_item_1,
android.R.id.text1,
DummyContent.ITEMS));
}
Expand Down
116 changes: 116 additions & 0 deletions appium/integration/prototype_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
require File.expand_path('spec_helper')

def defaultTestRun

it 'should should tap track 5 times' do
list_el = text('Track event')
list_el.click
back
list_el.click
back
list_el.click
back
list_el.click
back
list_el.click
back
end

it 'should background for 3s and foreground again 3 times' do
background_app(3)
sleep(2)
background_app(3)
sleep(2)
background_app(3)
end

it 'should should tap track 5 times' do
list_el = text('Track event')
list_el.click
back
list_el.click
back
list_el.click
back
list_el.click
back
list_el.click
back
end

it 'should background for 10s and foreground again' do
background_app(10)
sleep(2)
end

it 'should trigger a sync' do
list_el = text('Trigger Synchronize')
list_el.click
back
sleep(5)
list_el.click
back
end

it 'should crash the app' do
list_el = text('Crash the App!')
list_el.click
end

end

describe 'Run default tests' do
defaultTestRun
end


describe 'Run with disabled session management' do
it 'Can disable session management' do
list_el = text('Disable session management')
list_el.click
back
end
defaultTestRun
end

describe 'Run with re-enabled session management' do
it 'Can enable session management' do
list_el = text('Enable session management')
list_el.click
back
end
defaultTestRun
end

describe 'Run with disabled pageviews' do
it 'Can disable pageviews' do
list_el = text('Disable page view tracking')
list_el.click
back
end
defaultTestRun
end

describe 'Run with re-enabled pageviews' do
it 'Can re-enable pageviews' do
list_el = text('Enable page view tracking')
list_el.click
back
end
defaultTestRun
end

describe 'Run with disabled pageviews and session management' do
it 'Can disable pageviews' do
list_el = text('Disable page view tracking')
list_el.click
back
end
it 'Can disable session management' do
list_el = text('Disable session management')
list_el.click
back
end
defaultTestRun
end

Loading

0 comments on commit 7463e54

Please sign in to comment.