File tree Expand file tree Collapse file tree 17 files changed +183
-0
lines changed
androidTest/java/com/wenping/android Expand file tree Collapse file tree 17 files changed +183
-0
lines changed Original file line number Diff line number Diff line change
1
+ apply plugin : ' com.android.application'
2
+
3
+ android {
4
+ compileSdkVersion 23
5
+ buildToolsVersion " 23.0.1"
6
+
7
+ defaultConfig {
8
+ applicationId " com.wenping.android"
9
+ minSdkVersion 11
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
+ dependencies {
23
+ compile fileTree(dir : ' libs' , include : [' *.jar' ])
24
+ compile ' com.android.support:appcompat-v7:23.1.0'
25
+ }
Original file line number Diff line number Diff line change
1
+ package com .wenping .android ;
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 ApplicationTest extends ApplicationTestCase <Application > {
10
+ public ApplicationTest () {
11
+ super (Application .class );
12
+ }
13
+ }
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" utf-8" ?>
2
+ <manifest xmlns : android =" http://schemas.android.com/apk/res/android"
3
+ package =" com.wenping.android" >
4
+
5
+ <uses-permission android : name =" android.permission.internet" />
6
+
7
+ <application
8
+ android : allowBackup =" true"
9
+ android : icon =" @mipmap/ic_launcher"
10
+ android : label =" @string/app_name"
11
+ android : theme =" @style/AppTheme" >
12
+ <activity
13
+ android : name =" .MainActivity"
14
+ android : label =" @string/app_name" >
15
+ <intent-filter >
16
+ <action android : name =" android.intent.action.MAIN" />
17
+
18
+ <category android : name =" android.intent.category.LAUNCHER" />
19
+ </intent-filter >
20
+ </activity >
21
+
22
+
23
+
24
+
25
+
26
+ </application >
27
+
28
+ </manifest >
Original file line number Diff line number Diff line change
1
+ package com .wenping .android ;
2
+
3
+ import android .support .v7 .app .AppCompatActivity ;
4
+ import android .os .Bundle ;
5
+ import android .view .Menu ;
6
+ import android .view .MenuItem ;
7
+
8
+ public class MainActivity extends AppCompatActivity {
9
+
10
+ @ Override
11
+ protected void onCreate (Bundle savedInstanceState ) {
12
+ super .onCreate (savedInstanceState );
13
+ setContentView (R .layout .activity_main );
14
+ }
15
+
16
+ @ Override
17
+ public boolean onCreateOptionsMenu (Menu menu ) {
18
+ // Inflate the menu; this adds items to the action bar if it is present.
19
+ getMenuInflater ().inflate (R .menu .menu_main , menu );
20
+ return true ;
21
+ }
22
+
23
+ @ Override
24
+ public boolean onOptionsItemSelected (MenuItem item ) {
25
+ // Handle action bar item clicks here. The action bar will
26
+ // automatically handle clicks on the Home/Up button, so long
27
+ // as you specify a parent activity in AndroidManifest.xml.
28
+ int id = item .getItemId ();
29
+
30
+ //noinspection SimplifiableIfStatement
31
+ if (id == R .id .action_settings ) {
32
+ return true ;
33
+ }
34
+
35
+ return super .onOptionsItemSelected (item );
36
+ }
37
+ }
Original file line number Diff line number Diff line change
1
+ <RelativeLayout xmlns : android =" http://schemas.android.com/apk/res/android"
2
+ xmlns : tools =" http://schemas.android.com/tools" android : layout_width =" match_parent"
3
+ android : layout_height =" match_parent" android : paddingLeft =" @dimen/activity_horizontal_margin"
4
+ android : paddingRight =" @dimen/activity_horizontal_margin"
5
+ android : paddingTop =" @dimen/activity_vertical_margin"
6
+ android : paddingBottom =" @dimen/activity_vertical_margin" tools : context =" .MainActivity" >
7
+
8
+ <TextView android : text =" @string/hello_world" android : layout_width =" wrap_content"
9
+ android : layout_height =" wrap_content" />
10
+
11
+ </RelativeLayout >
Original file line number Diff line number Diff line change
1
+ <menu xmlns : android =" http://schemas.android.com/apk/res/android"
2
+ xmlns : app =" http://schemas.android.com/apk/res-auto"
3
+ xmlns : tools =" http://schemas.android.com/tools" tools : context =" .MainActivity" >
4
+ <item android : id =" @+id/action_settings" android : title =" @string/action_settings"
5
+ android : orderInCategory =" 100" app : showAsAction =" never" />
6
+ </menu >
Original file line number Diff line number Diff line change
1
+ <resources >
2
+ <!-- Example customization of dimensions originally defined in res/values/dimens.xml
3
+ (such as screen margins) for screens with more than 820dp of available width. This
4
+ would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
5
+ <dimen name =" activity_horizontal_margin" >64dp</dimen >
6
+ </resources >
Original file line number Diff line number Diff line change
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 >
Original file line number Diff line number Diff line change
1
+ <resources >
2
+ <string name =" app_name" >android</string >
3
+
4
+ <string name =" hello_world" >Hello world!</string >
5
+ <string name =" action_settings" >Settings</string >
6
+ </resources >
Original file line number Diff line number Diff line change
1
+ <resources >
2
+
3
+ <!-- Base application theme. -->
4
+ <style name =" AppTheme" parent =" Theme.AppCompat.Light.DarkActionBar" >
5
+ <!-- Customize your theme here. -->
6
+ </style >
7
+
8
+ </resources >
Original file line number Diff line number Diff line change
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.2.3'
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
+ }
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
1
+ include ' :app'
You can’t perform that action at this time.
0 commit comments