Skip to content

Commit 083f1d4

Browse files
committed
Initial commit
1 parent e5194e4 commit 083f1d4

File tree

24 files changed

+502
-0
lines changed

24 files changed

+502
-0
lines changed

Starter/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.gradle
2+
/local.properties
3+
/.idea/workspace.xml
4+
.DS_Store

Starter/StarterApp/.gitignore

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

Starter/StarterApp/build.gradle

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
buildscript {
2+
repositories {
3+
mavenCentral()
4+
}
5+
dependencies {
6+
classpath 'com.android.tools.build:gradle:0.6.+'
7+
}
8+
}
9+
10+
apply plugin: 'android'
11+
12+
sourceSets {
13+
unitTest {
14+
java.srcDir file('src/test/java')
15+
resources.srcDir file('src/test/res')
16+
}
17+
}
18+
19+
configurations {
20+
unitTestCompile.extendsFrom runtime
21+
unitTestRuntime.extendsFrom unitTestCompile
22+
}
23+
24+
dependencies {
25+
repositories {
26+
mavenCentral()
27+
}
28+
unitTestCompile files("$project.buildDir/classes/release")
29+
unitTestCompile 'junit:junit:4.10'
30+
unitTestCompile 'org.robolectric:robolectric:2.1.+'
31+
unitTestCompile 'com.google.android:android:4.0.1.2'
32+
}
33+
34+
task unitTest(type:Test, dependsOn: assemble) {
35+
testClassesDir = project.sourceSets.unitTest.output.classesDir
36+
classpath = project.sourceSets.unitTest.runtimeClasspath
37+
}
38+
check.dependsOn unitTest
39+
40+
android {
41+
compileSdkVersion 17
42+
buildToolsVersion "17.0.0"
43+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.element84.starter"
4+
android:versionCode="1"
5+
android:versionName="1.0" >
6+
7+
<uses-sdk
8+
android:minSdkVersion="14"
9+
android:targetSdkVersion="17" />
10+
11+
<application
12+
android:allowBackup="true"
13+
android:icon="@drawable/ic_launcher"
14+
android:label="@string/app_name"
15+
android:theme="@style/AppTheme" >
16+
<activity
17+
android:name="com.element84.starter.MainActivity"
18+
android:label="@string/app_name" >
19+
<intent-filter>
20+
<action android:name="android.intent.action.MAIN" />
21+
22+
<category android:name="android.intent.category.LAUNCHER" />
23+
</intent-filter>
24+
</activity>
25+
</application>
26+
27+
</manifest>
46 KB
Loading
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
package com.element84.starter;
2+
3+
import android.app.Activity;
4+
import android.app.ActionBar;
5+
import android.app.Fragment;
6+
import android.os.Bundle;
7+
import android.view.LayoutInflater;
8+
import android.view.Menu;
9+
import android.view.MenuItem;
10+
import android.view.View;
11+
import android.view.ViewGroup;
12+
import android.os.Build;
13+
14+
public class MainActivity extends Activity {
15+
16+
@Override
17+
protected void onCreate(Bundle savedInstanceState) {
18+
super.onCreate(savedInstanceState);
19+
setContentView(R.layout.activity_main);
20+
21+
if (savedInstanceState == null) {
22+
getFragmentManager().beginTransaction()
23+
.add(R.id.container, new PlaceholderFragment())
24+
.commit();
25+
}
26+
}
27+
28+
29+
@Override
30+
public boolean onCreateOptionsMenu(Menu menu) {
31+
32+
// Inflate the menu; this adds items to the action bar if it is present.
33+
getMenuInflater().inflate(R.menu.main, menu);
34+
return true;
35+
}
36+
37+
@Override
38+
public boolean onOptionsItemSelected(MenuItem item) {
39+
// Handle action bar item clicks here. The action bar will
40+
// automatically handle clicks on the Home/Up button, so long
41+
// as you specify a parent activity in AndroidManifest.xml.
42+
switch (item.getItemId()) {
43+
case R.id.action_settings:
44+
return true;
45+
}
46+
return super.onOptionsItemSelected(item);
47+
}
48+
49+
/**
50+
* A placeholder fragment containing a simple view.
51+
*/
52+
public static class PlaceholderFragment extends Fragment {
53+
54+
public PlaceholderFragment() {
55+
}
56+
57+
@Override
58+
public View onCreateView(LayoutInflater inflater, ViewGroup container,
59+
Bundle savedInstanceState) {
60+
View rootView = inflater.inflate(R.layout.fragment_main, container, false);
61+
return rootView;
62+
}
63+
}
64+
65+
}
7.6 KB
Loading
3.67 KB
Loading
12.1 KB
Loading
24.2 KB
Loading

0 commit comments

Comments
 (0)