diff --git a/CPJ/helloandroid.apk b/CPJ/helloandroid.apk new file mode 100644 index 0000000..bee0e92 Binary files /dev/null and b/CPJ/helloandroid.apk differ diff --git a/LZM/HelloWorld/.gitignore b/LZM/HelloWorld/.gitignore new file mode 100644 index 0000000..9c4de58 --- /dev/null +++ b/LZM/HelloWorld/.gitignore @@ -0,0 +1,7 @@ +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures diff --git a/LZM/HelloWorld/.idea/.name b/LZM/HelloWorld/.idea/.name new file mode 100644 index 0000000..8970971 --- /dev/null +++ b/LZM/HelloWorld/.idea/.name @@ -0,0 +1 @@ +HelloWorld \ No newline at end of file diff --git a/LZM/HelloWorld/.idea/compiler.xml b/LZM/HelloWorld/.idea/compiler.xml new file mode 100644 index 0000000..96cc43e --- /dev/null +++ b/LZM/HelloWorld/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/LZM/HelloWorld/.idea/copyright/profiles_settings.xml b/LZM/HelloWorld/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/LZM/HelloWorld/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/LZM/HelloWorld/.idea/gradle.xml b/LZM/HelloWorld/.idea/gradle.xml new file mode 100644 index 0000000..c51a3aa --- /dev/null +++ b/LZM/HelloWorld/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + \ No newline at end of file diff --git a/LZM/HelloWorld/.idea/misc.xml b/LZM/HelloWorld/.idea/misc.xml new file mode 100644 index 0000000..c709013 --- /dev/null +++ b/LZM/HelloWorld/.idea/misc.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + Android + + + Android Lint + + + Java + + + Java language level migration aidsJava + + + + + Android + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/LZM/HelloWorld/.idea/modules.xml b/LZM/HelloWorld/.idea/modules.xml new file mode 100644 index 0000000..985142d --- /dev/null +++ b/LZM/HelloWorld/.idea/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/LZM/HelloWorld/.idea/vcs.xml b/LZM/HelloWorld/.idea/vcs.xml new file mode 100644 index 0000000..6564d52 --- /dev/null +++ b/LZM/HelloWorld/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/LZM/HelloWorld/HelloWorld.iml b/LZM/HelloWorld/HelloWorld.iml new file mode 100644 index 0000000..4fe3585 --- /dev/null +++ b/LZM/HelloWorld/HelloWorld.iml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/LZM/HelloWorld/app/.gitignore b/LZM/HelloWorld/app/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/LZM/HelloWorld/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/LZM/HelloWorld/app/app-release.apk b/LZM/HelloWorld/app/app-release.apk new file mode 100644 index 0000000..b4fdc1d Binary files /dev/null and b/LZM/HelloWorld/app/app-release.apk differ diff --git a/LZM/HelloWorld/app/app.iml b/LZM/HelloWorld/app/app.iml new file mode 100644 index 0000000..cacef64 --- /dev/null +++ b/LZM/HelloWorld/app/app.iml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/LZM/HelloWorld/app/build.gradle b/LZM/HelloWorld/app/build.gradle new file mode 100644 index 0000000..13c8517 --- /dev/null +++ b/LZM/HelloWorld/app/build.gradle @@ -0,0 +1,25 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 22 + buildToolsVersion "22.0.1" + + defaultConfig { + applicationId "com.example.hp.helloworld" + minSdkVersion 17 + targetSdkVersion 22 + versionCode 1 + versionName "1.0" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) + compile 'com.android.support:appcompat-v7:22.2.1' +} diff --git a/LZM/HelloWorld/app/proguard-rules.pro b/LZM/HelloWorld/app/proguard-rules.pro new file mode 100644 index 0000000..22cef25 --- /dev/null +++ b/LZM/HelloWorld/app/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in D:\AndroidSDK\sdk/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/LZM/HelloWorld/app/src/androidTest/java/com/example/hp/helloworld/ApplicationTest.java b/LZM/HelloWorld/app/src/androidTest/java/com/example/hp/helloworld/ApplicationTest.java new file mode 100644 index 0000000..c6fa91c --- /dev/null +++ b/LZM/HelloWorld/app/src/androidTest/java/com/example/hp/helloworld/ApplicationTest.java @@ -0,0 +1,13 @@ +package com.example.hp.helloworld; + +import android.app.Application; +import android.test.ApplicationTestCase; + +/** + * Testing Fundamentals + */ +public class ApplicationTest extends ApplicationTestCase { + public ApplicationTest() { + super(Application.class); + } +} \ No newline at end of file diff --git a/LZM/HelloWorld/app/src/main/AndroidManifest.xml b/LZM/HelloWorld/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..0a64a80 --- /dev/null +++ b/LZM/HelloWorld/app/src/main/AndroidManifest.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + diff --git a/LZM/HelloWorld/app/src/main/java/com/example/hp/helloworld/MainActivity.java b/LZM/HelloWorld/app/src/main/java/com/example/hp/helloworld/MainActivity.java new file mode 100644 index 0000000..8b7392b --- /dev/null +++ b/LZM/HelloWorld/app/src/main/java/com/example/hp/helloworld/MainActivity.java @@ -0,0 +1,76 @@ +package com.example.hp.helloworld; + +import android.support.v7.app.ActionBarActivity; +import android.os.Bundle; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; +import android.widget.TextView; + + +public class MainActivity extends ActionBarActivity { + + private EditText mEdtSex, mEdtAge; + private Button mBtnOK; + private TextView mTxtR; + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + mEdtSex = (EditText) findViewById(R.id.edtSex); + mEdtAge = (EditText)findViewById(R.id.edtAge); + mBtnOK = (Button) findViewById(R.id.btnOK); + mTxtR = (TextView) findViewById(R.id.txtR); + + mBtnOK.setOnClickListener(btnOKOnClick); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + // Inflate the menu; this adds items to the action bar if it is present. + getMenuInflater().inflate(R.menu.menu_main, menu); + return true; + } + + private View.OnClickListener btnOKOnClick = new View.OnClickListener() { + @Override + public void onClick(View v) { + String strSex = mEdtSex.getText().toString(); + int iAge = Integer.parseInt(mEdtAge.getText().toString()); + + String strSug = getString(R.string.result); + if (strSex.equals(getString(R.string.sex_male))) + if (iAge < 28) + strSug += getString(R.string.sug_not_hurry); + else if (iAge > 33) + strSug += getString(R.string.sug_get_married); + else + strSug += getString(R.string.sug_find_couple); + else if (iAge < 25) + strSug += getString(R.string.sug_not_hurry); + else if (iAge > 30) + strSug += getString(R.string.sug_get_married); + else + strSug += getString(R.string.sug_find_couple); + + mTxtR.setText(strSug); + } + }; + @Override + public boolean onOptionsItemSelected(MenuItem item) { + // Handle action bar item clicks here. The action bar will + // automatically handle clicks on the Home/Up button, so long + // as you specify a parent activity in AndroidManifest.xml. + int id = item.getItemId(); + + //noinspection SimplifiableIfStatement + if (id == R.id.action_settings) { + return true; + } + + return super.onOptionsItemSelected(item); + } +} diff --git a/LZM/HelloWorld/app/src/main/res/layout/activity_main.xml b/LZM/HelloWorld/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..3e3895d --- /dev/null +++ b/LZM/HelloWorld/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + +