Skip to content

Commit 6d17b3d

Browse files
author
Mohamed Sobhy
committed
Initial commit, with just bare bones sample app
0 parents  commit 6d17b3d

27 files changed

+561
-0
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/workspace.xml
5+
/.idea/libraries
6+
.DS_Store
7+
/build
8+
/captures

README.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
Instabug Sample
2+
========
3+
4+
An in-depth journey depicting all the ways to use [Instabug Android SDK][1]
5+
6+
For more information about Instabug check [our website][2].
7+
8+
9+
Usage
10+
--------
11+
12+
1. <b>Adding Instabug to your dependencies</b>
13+
14+
Grab it via Gradle:
15+
```groovy
16+
compile 'com.instabug.library:instabugsupport:1.7'
17+
```
18+
or via Maven: (if you're that kind of person :bowtie:)
19+
```xml
20+
<dependency>
21+
<groupId>com.instabug.library</groupId>
22+
<artifactId>instabugsupport</artifactId>
23+
<version>1.7</version>
24+
</dependency>
25+
```
26+
27+
1. <b>Initialising Instabug</b>
28+
29+
In your `Application` class add the following:
30+
```
31+
@Override
32+
public void onCreate() {
33+
super.onCreate();
34+
// ...
35+
Instabug
36+
.initialize(this, "<yourAppToken>")
37+
.setInvocationEvent(Instabug.IBGInvocationEvent.IBGInvocationEventShake);
38+
// ...
39+
}
40+
```
41+
42+
Development SNAPSHOTs are available in [Sonatype's `snapshots` repository][snap].
43+
44+
Instabug requires Android 2.3+ (10+)
45+
46+
License
47+
=======
48+
49+
Copyright 2012 Instabug, Inc.
50+
51+
Licensed under the Apache License, Version 2.0 (the "License");
52+
you may not use this file except in compliance with the License.
53+
You may obtain a copy of the License at
54+
55+
http://www.apache.org/licenses/LICENSE-2.0
56+
57+
Unless required by applicable law or agreed to in writing, software
58+
distributed under the License is distributed on an "AS IS" BASIS,
59+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
60+
See the License for the specific language governing permissions and
61+
limitations under the License.
62+
63+
64+
[1]: https://instabug.com/sdk-integration#android
65+
[2]: https://instabug.com/
66+
[snap]: https://oss.sonatype.org/content/repositories/snapshots/

app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 23
5+
buildToolsVersion "23.0.2"
6+
7+
defaultConfig {
8+
applicationId "com.example.instabug"
9+
minSdkVersion 10
10+
targetSdkVersion 23
11+
versionCode 1
12+
versionName "1.0"
13+
}
14+
buildTypes {
15+
release {
16+
minifyEnabled false
17+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18+
}
19+
}
20+
}
21+
22+
repositories {
23+
maven {
24+
// NOTE (NOT RECOMMENDED) add this if interested in getting SNAPSHOT releases
25+
url "https://oss.sonatype.org/content/repositories/snapshots"
26+
}
27+
}
28+
29+
dependencies {
30+
compile fileTree(dir: 'libs', include: ['*.jar'])
31+
testCompile 'junit:junit:4.12'
32+
compile 'com.android.support:appcompat-v7:23.1.1'
33+
compile 'com.instabug.library:instabugsupport:1.7.2-SNAPSHOT'
34+
}

app/proguard-rules.pro

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in /Users/mSobhy/Library/Android/sdk/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# Add any project specific keep options here:
11+
12+
# If your project uses WebView with JS, uncomment the following
13+
# and specify the fully qualified class name to the JavaScript interface
14+
# class:
15+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16+
# public *;
17+
#}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.example.instabug;
2+
3+
import android.app.Application;
4+
import android.test.ApplicationTestCase;
5+
6+
/**
7+
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
8+
*/
9+
public class SampleApplicationTest extends ApplicationTestCase<Application> {
10+
public SampleApplicationTest() {
11+
super(Application.class);
12+
}
13+
}

app/src/main/AndroidManifest.xml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<manifest
2+
package="com.example.instabug"
3+
xmlns:android="http://schemas.android.com/apk/res/android">
4+
5+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
6+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
7+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
8+
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
9+
<uses-permission android:name="android.permission.INTERNET"/>
10+
11+
<application
12+
android:name=".SampleApplication"
13+
android:allowBackup="true"
14+
android:icon="@mipmap/ic_launcher"
15+
android:label="@string/app_name"
16+
android:supportsRtl="true"
17+
android:theme="@style/AppTheme">
18+
19+
<activity
20+
android:name=".activities.MainActivity"
21+
android:label="@string/app_name">
22+
<intent-filter>
23+
<action android:name="android.intent.action.MAIN"/>
24+
<category android:name="android.intent.category.LAUNCHER"/>
25+
</intent-filter>
26+
</activity>
27+
28+
</application>
29+
30+
</manifest>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.example.instabug;
2+
3+
import android.app.Application;
4+
5+
import com.instabug.library.Instabug;
6+
7+
/**
8+
* @author mSobhy
9+
*/
10+
public class SampleApplication extends Application {
11+
@Override
12+
public void onCreate() {
13+
super.onCreate();
14+
Instabug
15+
.initialize(this, "cbeaee267486966ed22499bd554f8924")
16+
.setInvocationEvent(Instabug.IBGInvocationEvent.IBGInvocationEventShake)
17+
.setEmailIsRequired(false);
18+
}
19+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.example.instabug.activities;
2+
3+
import android.os.Bundle;
4+
5+
import com.example.instabug.R;
6+
import com.instabug.wrapper.support.activity.InstabugActionBarActivity;
7+
8+
/**
9+
* @author mSobhy
10+
*/
11+
public class MainActivity extends InstabugActionBarActivity {
12+
13+
@Override
14+
protected void onCreate(Bundle savedInstanceState) {
15+
super.onCreate(savedInstanceState);
16+
setContentView(R.layout.activity_main);
17+
}
18+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:tools="http://schemas.android.com/tools"
3+
android:layout_width="match_parent"
4+
android:layout_height="match_parent"
5+
android:paddingBottom="@dimen/activity_vertical_margin"
6+
android:paddingLeft="@dimen/activity_horizontal_margin"
7+
android:paddingRight="@dimen/activity_horizontal_margin"
8+
android:paddingTop="@dimen/activity_vertical_margin"
9+
tools:context=".MainActivity">
10+
11+
<TextView
12+
android:layout_width="wrap_content"
13+
android:layout_height="wrap_content"
14+
android:text="@string/hello_world"/>
15+
16+
</RelativeLayout>
7.42 KB
Loading
5.65 KB
Loading
9.83 KB
Loading
13.7 KB
Loading
16.2 KB
Loading

app/src/main/res/values/colors.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<color name="colorPrimary">#3F51B5</color>
4+
<color name="colorPrimaryDark">#303F9F</color>
5+
<color name="colorAccent">#FF4081</color>
6+
</resources>

app/src/main/res/values/dimens.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<resources>
2+
<!-- Default screen margins, per the Android Design guidelines. -->
3+
<dimen name="activity_horizontal_margin">16dp</dimen>
4+
<dimen name="activity_vertical_margin">16dp</dimen>
5+
</resources>

app/src/main/res/values/strings.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<resources>
2+
<string name="app_name">Instabug Sample</string>
3+
<string name="hello_world">Hello Instabug world</string>
4+
</resources>

app/src/main/res/values/styles.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<resources>
2+
3+
<!-- Base application theme. -->
4+
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
5+
<!-- Customize your theme here. -->
6+
<item name="colorPrimary">@color/colorPrimary</item>
7+
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
8+
<item name="colorAccent">@color/colorAccent</item>
9+
</style>
10+
11+
</resources>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.example.instabug;
2+
3+
import org.junit.Test;
4+
5+
import static org.junit.Assert.*;
6+
7+
/**
8+
* To work on unit tests, switch the Test Artifact in the Build Variants view.
9+
*/
10+
public class ExampleUnitTest {
11+
@Test
12+
public void addition_isCorrect() throws Exception {
13+
assertEquals(4, 2 + 2);
14+
}
15+
}

build.gradle

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2+
3+
buildscript {
4+
repositories {
5+
jcenter()
6+
}
7+
dependencies {
8+
classpath 'com.android.tools.build:gradle:1.5.0'
9+
10+
// NOTE: Do not place your application dependencies here; they belong
11+
// in the individual module build.gradle files
12+
}
13+
}
14+
15+
allprojects {
16+
repositories {
17+
jcenter()
18+
}
19+
}
20+
21+
task clean(type: Delete) {
22+
delete rootProject.buildDir
23+
}

gradle.properties

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Project-wide Gradle settings.
2+
3+
# IDE (e.g. Android Studio) users:
4+
# Gradle settings configured through the IDE *will override*
5+
# any settings specified in this file.
6+
7+
# For more details on how to configure your build environment visit
8+
# http://www.gradle.org/docs/current/userguide/build_environment.html
9+
10+
# Specifies the JVM arguments used for the daemon process.
11+
# The setting is particularly useful for tweaking memory settings.
12+
# Default value: -Xmx10248m -XX:MaxPermSize=256m
13+
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14+
15+
# When configured, Gradle will run in incubating parallel mode.
16+
# This option should only be used with decoupled projects. More details, visit
17+
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18+
# org.gradle.parallel=true

gradle/wrapper/gradle-wrapper.jar

52.4 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Wed Oct 21 11:34:03 PDT 2015
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip

0 commit comments

Comments
 (0)