Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastien Rouif committed Mar 26, 2015
0 parents commit 124eafe
Show file tree
Hide file tree
Showing 65 changed files with 1,346 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.gradle
/local.properties
/build/
/app/build/

# Android Studio/IntelliJ project files
/.idea/
*.iml

.DS_Store
189 changes: 189 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
# Android skeleton project

This project forms the basis for a new Android app, with support for Gradle and Android Studio.

It includes sample gradle files and common settings for Proguard, Checkstyle and Findbugs.

You can download a zip file of this repository from the Bitbucket web interface to use the skeleton
as a starting point for new projects.

This project is a work-in-progress and developers are welcome to make suggestions and improvements
to this skeleton project.

README.md Markdown Document
===========================

This is a document that is displayed on the BitBucket Repository page.

You can use the Markdown formatting style to produce this document and make it look pretty.

Examples
====================

## Headers
```
# Header 1
## Header 2
### Header 3
#### Header 4
##### Header 5
###### Header 6
```

## Styles
Emphasis, aka italics, with *asterisks* or _underscores_.

Strong emphasis, aka bold, with **asterisks** or __underscores__.

Combined emphasis with **asterisks and _underscores_**.

Strikethrough uses two tildes. ~~Scratch this.~~

```
Emphasis, aka italics, with *asterisks* or _underscores_.
Strong emphasis, aka bold, with **asterisks** or __underscores__.
Combined emphasis with **asterisks and _underscores_**.
Strikethrough uses two tildes. ~~Scratch this.~~
```

## Lists

Markdown supports ordered (numbered) and unordered (bulleted) lists. List markers typically start at the left margin, but may be indented by up to three spaces. List markers must be followed by one or more spaces or a tab.

Form bulleted lists with any of * (asterisk), + (plus), or - (dash). You can one or any or mix of these to form a list:

* Red
+ Green
- Blue

```
* Red
+ Green
- Blue
```

Read more [here](https://bitbucket.org/tutorials/markdowndemo/overview#markdown-header-lists) about lists as they can be quite complex.

## Links

[I'm an inline-style link](https://www.google.com)

```
[I'm an inline-style link](https://www.google.com)
```

## Images

Here's our logo (hover to see the title text):

Inline-style:
![alt text](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png "Logo Title Text 1")

```
Inline-style:
![alt text](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png "Logo Title Text 1")
```

## Code and Syntax Highlighting

Code blocks are part of the Markdown spec, but syntax highlighting isn't. However, many renderers -- like Github's and *Markdown Here* -- support syntax highlighting. *Markdown Here* supports highlighting for dozens of languages (and not-really-languages, like diffs and HTTP headers); to see the complete list, and how to write the language names, see the [highlight.js demo page](http://softwaremaniacs.org/media/soft/highlight/test.html).

Inline `code` has `back-ticks around` it.
```
Inline `code` has `back-ticks around` it.
```

Blocks of code are either fenced by lines with three back-ticks <code>```</code>, or are indented with four spaces. I recommend only using the fenced code blocks -- they're easier and only they support syntax highlighting.

See [here](https://bitbucket.org/tutorials/markdowndemo/overview#markdown-header-code-and-syntax-highlighting) for more information about BitBucket's code highlighting.

## Tables

Bitbucket does not support <html> so you need to use the - (dash) and the | (pipe) symbols to construct a table. The first line contains column headers. Separate columns with the pipe symbol.

The second line must be a mandatory separator line between the headers and the content. Subsequent lines are table rows. Columns are always separated by the pipe (|) character. For example this table:

First Header | Second Header
------------- | -------------
Content Cell | Content Cell
Content Cell | Content Cell

Comes from
```
First Header | Second Header
------------- | -------------
Content Cell | Content Cell
Content Cell | Content Cell
```

You can only put simple lines in a table.

You can specify alignment for each column by adding colons to separator lines. A colon at the left of the separator line, left-aligns the column. A colon on the right, right-aligns the column. Add colons to both sides to center the column is center-aligned.

Right | Left | Center
---------:| :----- |:-----:
Computer | $1600 | one
Phone | $12 | three
Pipe | $1 | eleven

Comes from:
```
Right | Left | Center
---------:| :----- |:-----:
Computer | $1600 | one
Phone | $12 | three
Pipe | $1 | eleven
```

More information can be found [here](https://bitbucket.org/tutorials/markdowndemo/overview#markdown-header-tables)

## Blockquotes

> Blockquotes are very handy in email to emulate reply text.
> This line is part of the same quote.
```
> Blockquotes are very handy in email to emulate reply text.
> This line is part of the same quote.
```

Quote break.

> This is a very long line that will still be quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can *put* **Markdown** into a blockquote.
```
> This is a very long line that will still be quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can *put* **Markdown** into a blockquote.
```

## Horizontal Rule

Three or more...

---

Hyphens

***

Asterisks

___

Underscores

```
Three or more...
---
Hyphens
***
Asterisks
___
Underscores
```

# More information

[Read this Document!](https://bitbucket.org/tutorials/markdowndemo)
103 changes: 103 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
apply plugin: 'com.android.application'

dependencies {
compile 'com.android.support:support-v4:21.0.3'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.okhttp:okhttp:2.2.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.2.0'
compile 'com.squareup.okio:okio:1.2.0'
compile 'com.google.code.gson:gson:2.3.1'

testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.9.5'
}

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

// Set versionCode and versionName based off Jenkins build number
def suffix = System.getenv("BUILD_NUMBER")
def branch = System.getenv("GIT_BRANCH")

defaultConfig {
applicationId "com.monitisecreate.myapp"
minSdkVersion 16
targetSdkVersion 21
versionCode 1
versionName "1.0.0"

if (suffix != null) {
def vers = Integer.parseInt(suffix)
versionCode vers
}
}

signingConfigs {
debug {
// Having a shared debug keystore means that the app only needs to be configured for
// APIs like Google Maps, Facebook etc with one key hash
storeFile rootProject.file("config/signing/debug.keystore")
}

release {
// IMPORTANT: Remember to create your own keystore or use the client's one before release!
storeFile rootProject.file("config/signing/release.keystore")
storePassword 'skeleton'
keyAlias 'skeleton'
keyPassword 'skeleton'
}
}

buildTypes {
debug {
signingConfig signingConfigs.debug
}

release {
signingConfig signingConfigs.release
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
// Project-specific Proguard file
rootProject.file('config/proguard/proguard-rules.pro'),
// Proguard for commonly-used libraries (see config/proguard/libraries for more)
// Derived from: https://github.com/krschultz/android-proguard-snippets
rootProject.file('config/proguard/libraries/proguard-gson.pro'),
rootProject.file('config/proguard/libraries/proguard-square-retrofit.pro')
}
}

productFlavors {
live {
}

staging {
// You can have a different package name for a staging build, so both flavors can be
// installed side-by-side.
// You will need to substitute the package name for ${applicationId} in
// AndroidManifest.xml for Content Providers etc.
applicationId "com.monitisecreate.myapp.staging"
}
}

// Append the branch name for sprint and development to the versionName to easily
// identify in Hockey
applicationVariants.all { variant ->
// Don't append the branch name for any builds off master
if (branch != null && !branch.equalsIgnoreCase("origin/master")) {
variant.mergedFlavor.versionName = android.defaultConfig.versionName + "." + suffix + branch.replace("origin/", "-") + "-" + variant.flavorName
} else {
if (suffix != null) {
variant.mergedFlavor.versionName = android.defaultConfig.versionName + "." + suffix
}
}
}

apply from: rootProject.file('config/checkstyle/checkstyle.gradle')
apply from: rootProject.file('config/findbugs/findbugs.gradle')

lintOptions {
abortOnError false
}
}
26 changes: 26 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="org.rouif.notes">

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:name=".ExampleApplication"
android:label="@string/app_name"
android:theme="@style/AppTheme">

<activity
android:name=".activity.MainActivity"
android:label="@string/app_name">

<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

</activity>

</application>

</manifest>
50 changes: 50 additions & 0 deletions app/src/main/java/org/rouif/notes/ExampleApplication.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package org.rouif.notes;

import android.app.Application;

import com.squareup.okhttp.OkHttpClient;

import org.rouif.notes.network.RetrofitInterface;

import java.util.concurrent.TimeUnit;

import retrofit.RestAdapter;
import retrofit.client.OkClient;

/**
* Add in cross application code here. Could provide access to API etc.
*/
public class ExampleApplication extends Application {

private static ExampleApplication sApplication;
private RetrofitInterface mWebApi;

@Override
public void onCreate() {
super.onCreate();
sApplication = this;
mWebApi = buildAdapter().create(RetrofitInterface.class);
}

private RestAdapter buildAdapter() {
OkHttpClient okHttpClient = new OkHttpClient();
int readTimeout = getResources().getInteger(R.integer.read_timeout);
int connectTimeout = getResources().getInteger(R.integer.connection_timeout);

okHttpClient.setReadTimeout(readTimeout, TimeUnit.MILLISECONDS);
okHttpClient.setConnectTimeout(connectTimeout, TimeUnit.MILLISECONDS);
OkClient client = new OkClient(okHttpClient);

return new RestAdapter.Builder().setEndpoint(getString(R.string.base_url))
.setLogLevel(RestAdapter.LogLevel.FULL).setClient(client).build();
}

private static ExampleApplication getInstance() {
return sApplication;
}

private RetrofitInterface getWebApi() {
return mWebApi;
}

}
Loading

0 comments on commit 124eafe

Please sign in to comment.