diff --git a/ActivityExamples/.idea/codeStyles/Project.xml b/ActivityExamples/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..30aa626
--- /dev/null
+++ b/ActivityExamples/.idea/codeStyles/Project.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActivityExamples/.idea/gradle.xml b/ActivityExamples/.idea/gradle.xml
index 7ac24c7..2996d53 100644
--- a/ActivityExamples/.idea/gradle.xml
+++ b/ActivityExamples/.idea/gradle.xml
@@ -3,14 +3,11 @@
diff --git a/ActivityExamples/.idea/inspectionProfiles/Project_Default.xml b/ActivityExamples/.idea/inspectionProfiles/Project_Default.xml
deleted file mode 100644
index 44ddf1a..0000000
--- a/ActivityExamples/.idea/inspectionProfiles/Project_Default.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ActivityExamples/.idea/inspectionProfiles/profiles_settings.xml b/ActivityExamples/.idea/inspectionProfiles/profiles_settings.xml
deleted file mode 100644
index 3b31283..0000000
--- a/ActivityExamples/.idea/inspectionProfiles/profiles_settings.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ActivityExamples/.idea/misc.xml b/ActivityExamples/.idea/misc.xml
index ba7052b..af0bbdd 100644
--- a/ActivityExamples/.idea/misc.xml
+++ b/ActivityExamples/.idea/misc.xml
@@ -1,30 +1,11 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
+
diff --git a/ActivityExamples/app/build.gradle b/ActivityExamples/app/build.gradle
index 4875273..c001eb0 100644
--- a/ActivityExamples/app/build.gradle
+++ b/ActivityExamples/app/build.gradle
@@ -16,12 +16,11 @@ repositories {
android {
- compileSdkVersion 25
- buildToolsVersion "25.0.0"
+ compileSdkVersion 28
defaultConfig {
applicationId "com.example.mahesha.activityexamples"
minSdkVersion 18
- targetSdkVersion 25
+ targetSdkVersion 28
versionCode 2
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
@@ -60,33 +59,38 @@ android {
}
dependencies {
- compile fileTree(include: ['*.jar'], dir: 'libs')
- androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
- exclude group: 'com.android.support', module: 'support-annotations'
- })
- compile('com.crashlytics.sdk.android:crashlytics:2.6.7@aar') {
- transitive = true;
- }
- compile 'com.android.support:appcompat-v7:25.0.1'
- compile 'com.google.android.gms:play-services-maps:9.2.1'
- compile 'com.android.support:support-v4:25.0.1'
- compile 'com.android.support:design:25.0.1'
- compile 'com.weiwangcn.betterspinner:library-material:1.1.0'
- compile 'com.google.android.gms:play-services-auth:9.2.1'
- compile 'com.android.support:cardview-v7:25.0.1'
- compile 'com.android.support:recyclerview-v7:25.0.1'
- compile 'com.mikhaellopez:circularimageview:3.0.2'
- compile 'com.google.android.gms:play-services-appindexing:9.2.1'
- compile 'com.google.android.gms:play-services-location:9.2.1'
- compile 'com.jakewharton:butterknife:8.5.1'
- compile 'com.google.code.gson:gson:2.7'
- testCompile 'junit:junit:4.12'
- androidTestCompile 'com.android.support.test:runner:0.5'
- androidTestCompile 'com.android.support.test:rules:0.5'
- androidTestCompile 'org.mockito:mockito-core:1.+'
- androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
- androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'
- annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
- compile 'com.android.support.constraint:constraint-layout:1.0.2'
+ implementation fileTree(include: ['*.jar'], dir: 'libs')
+ implementation 'com.android.support:appcompat-v7:28.0.0'
+ implementation 'com.google.android.gms:play-services-maps:9.2.1'
+ implementation 'com.android.support:support-v4:28.0.0'
+ implementation 'com.android.support:design:28.0.0'
+ implementation 'com.weiwangcn.betterspinner:library-material:1.1.0'
+ implementation 'com.google.android.gms:play-services-auth:9.2.1'
+ implementation 'com.android.support:cardview-v7:28.0.0'
+ implementation 'com.android.support:recyclerview-v7:28.0.0'
+ implementation 'com.mikhaellopez:circularimageview:3.0.2'
+ implementation 'com.google.android.gms:play-services-appindexing:9.2.1'
+ implementation 'com.google.android.gms:play-services-location:9.2.1'
+ implementation 'com.jakewharton:butterknife:8.5.1'
+ implementation 'com.google.code.gson:gson:2.8.5'
+
+ implementation 'com.squareup.retrofit2:retrofit:2.5.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
+
+
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'com.android.support.test:runner:1.0.2'
+ androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
+ def power_mockito_version = "2.0.0-beta.5"
+ testImplementation 'junit:junit:4.12'
+ testImplementation 'org.json:json:20171018'
+ testImplementation 'org.mockito:mockito-core:2.21.0'
+ testImplementation "org.powermock:powermock-module-junit4:$power_mockito_version"
+ testImplementation "org.powermock:powermock-module-junit4-rule:$power_mockito_version"
+ testImplementation "org.powermock:powermock-api-mockito2:$power_mockito_version"
+ testImplementation "org.powermock:powermock-classloading-xstream:$power_mockito_version"
+ testImplementation "org.powermock:powermock-core:2.0.0-beta.5$power_mockito_version"
+
+ implementation 'com.android.support.constraint:constraint-layout:1.1.3'
}
apply plugin: 'com.google.gms.google-services'
diff --git a/ActivityExamples/app/src/debug/res/anim/fade.xml b/ActivityExamples/app/src/debug/res/anim/fade.xml
index 0ea1764..be378fd 100644
--- a/ActivityExamples/app/src/debug/res/anim/fade.xml
+++ b/ActivityExamples/app/src/debug/res/anim/fade.xml
@@ -5,9 +5,4 @@
android:fromAlpha="0"
android:toAlpha="1"/>
-
\ No newline at end of file
diff --git a/ActivityExamples/app/src/main/AndroidManifest.xml b/ActivityExamples/app/src/main/AndroidManifest.xml
index 1e3a0b2..5d41cdc 100644
--- a/ActivityExamples/app/src/main/AndroidManifest.xml
+++ b/ActivityExamples/app/src/main/AndroidManifest.xml
@@ -1,7 +1,7 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BluetoothPrinter/app/src/main/res/layout/device_name.xml b/BluetoothPrinter/app/src/main/res/layout/device_name.xml
new file mode 100644
index 0000000..6a9e4b0
--- /dev/null
+++ b/BluetoothPrinter/app/src/main/res/layout/device_name.xml
@@ -0,0 +1,20 @@
+
+
+
diff --git a/BluetoothPrinter/app/src/main/res/layout/main.xml b/BluetoothPrinter/app/src/main/res/layout/main.xml
new file mode 100644
index 0000000..1932cc3
--- /dev/null
+++ b/BluetoothPrinter/app/src/main/res/layout/main.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BluetoothPrinter/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/BluetoothPrinter/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/BluetoothPrinter/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/BluetoothPrinter/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/BluetoothPrinter/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/BluetoothPrinter/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/BluetoothPrinter/app/src/main/res/mipmap-hdpi/ic_launcher.png b/BluetoothPrinter/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..a2f5908
Binary files /dev/null and b/BluetoothPrinter/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/BluetoothPrinter/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/BluetoothPrinter/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 0000000..1b52399
Binary files /dev/null and b/BluetoothPrinter/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/BluetoothPrinter/app/src/main/res/mipmap-mdpi/ic_launcher.png b/BluetoothPrinter/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..ff10afd
Binary files /dev/null and b/BluetoothPrinter/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/BluetoothPrinter/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/BluetoothPrinter/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 0000000..115a4c7
Binary files /dev/null and b/BluetoothPrinter/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/BluetoothPrinter/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/BluetoothPrinter/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..dcd3cd8
Binary files /dev/null and b/BluetoothPrinter/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/BluetoothPrinter/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/BluetoothPrinter/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..459ca60
Binary files /dev/null and b/BluetoothPrinter/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/BluetoothPrinter/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/BluetoothPrinter/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..8ca12fe
Binary files /dev/null and b/BluetoothPrinter/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/BluetoothPrinter/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/BluetoothPrinter/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..8e19b41
Binary files /dev/null and b/BluetoothPrinter/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/BluetoothPrinter/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/BluetoothPrinter/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..b824ebd
Binary files /dev/null and b/BluetoothPrinter/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/BluetoothPrinter/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/BluetoothPrinter/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..4c19a13
Binary files /dev/null and b/BluetoothPrinter/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/BluetoothPrinter/app/src/main/res/values/colors.xml b/BluetoothPrinter/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..3ab3e9c
--- /dev/null
+++ b/BluetoothPrinter/app/src/main/res/values/colors.xml
@@ -0,0 +1,6 @@
+
+
+ #3F51B5
+ #303F9F
+ #FF4081
+
diff --git a/BluetoothPrinter/app/src/main/res/values/strings.xml b/BluetoothPrinter/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..14c06a1
--- /dev/null
+++ b/BluetoothPrinter/app/src/main/res/values/strings.xml
@@ -0,0 +1,16 @@
+
+ BluetoothPrinter
+ No devices have been paired
+ scanning for devices...
+ select a device to connect
+ No devices found
+ Connect Bluetooth Printer
+ Print
+ Print Test Page
+ Close
+ Sample Bill
+ ""
+ set
+ en
+ Scan for devices
+
diff --git a/BluetoothPrinter/app/src/main/res/values/styles.xml b/BluetoothPrinter/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..5885930
--- /dev/null
+++ b/BluetoothPrinter/app/src/main/res/values/styles.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
diff --git a/BluetoothPrinter/app/src/test/java/com/amvlabs/bluetoothprinter/ExampleUnitTest.java b/BluetoothPrinter/app/src/test/java/com/amvlabs/bluetoothprinter/ExampleUnitTest.java
new file mode 100644
index 0000000..723ea7b
--- /dev/null
+++ b/BluetoothPrinter/app/src/test/java/com/amvlabs/bluetoothprinter/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.amvlabs.bluetoothprinter;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/BluetoothPrinter/build.gradle b/BluetoothPrinter/build.gradle
new file mode 100644
index 0000000..077cb2f
--- /dev/null
+++ b/BluetoothPrinter/build.gradle
@@ -0,0 +1,27 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+
+ repositories {
+ google()
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:3.1.4'
+
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ google()
+ jcenter()
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/BluetoothPrinter/gradle.properties b/BluetoothPrinter/gradle.properties
new file mode 100644
index 0000000..743d692
--- /dev/null
+++ b/BluetoothPrinter/gradle.properties
@@ -0,0 +1,13 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx1536m
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
diff --git a/BluetoothPrinter/gradle/wrapper/gradle-wrapper.jar b/BluetoothPrinter/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..7a3265e
Binary files /dev/null and b/BluetoothPrinter/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/BluetoothPrinter/gradle/wrapper/gradle-wrapper.properties b/BluetoothPrinter/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..90d4c8a
--- /dev/null
+++ b/BluetoothPrinter/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Sun Aug 26 13:34:19 IST 2018
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
diff --git a/BluetoothPrinter/gradlew b/BluetoothPrinter/gradlew
new file mode 100644
index 0000000..cccdd3d
--- /dev/null
+++ b/BluetoothPrinter/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/BluetoothPrinter/gradlew.bat b/BluetoothPrinter/gradlew.bat
new file mode 100644
index 0000000..f955316
--- /dev/null
+++ b/BluetoothPrinter/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/BluetoothPrinter/settings.gradle b/BluetoothPrinter/settings.gradle
new file mode 100644
index 0000000..e7b4def
--- /dev/null
+++ b/BluetoothPrinter/settings.gradle
@@ -0,0 +1 @@
+include ':app'
diff --git a/BroadCast/.idea/caches/build_file_checksums.ser b/BroadCast/.idea/caches/build_file_checksums.ser
index 6d6c600..4e16cba 100644
Binary files a/BroadCast/.idea/caches/build_file_checksums.ser and b/BroadCast/.idea/caches/build_file_checksums.ser differ
diff --git a/BroadCast/.idea/compiler.xml b/BroadCast/.idea/compiler.xml
deleted file mode 100644
index 96cc43e..0000000
--- a/BroadCast/.idea/compiler.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/BroadCast/.idea/copyright/profiles_settings.xml b/BroadCast/.idea/copyright/profiles_settings.xml
deleted file mode 100644
index e7bedf3..0000000
--- a/BroadCast/.idea/copyright/profiles_settings.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/BroadCast/.idea/misc.xml b/BroadCast/.idea/misc.xml
index 635999d..7bfef59 100644
--- a/BroadCast/.idea/misc.xml
+++ b/BroadCast/.idea/misc.xml
@@ -1,30 +1,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/BroadCast/app/build.gradle b/BroadCast/app/build.gradle
index d34d3c5..38a44da 100644
--- a/BroadCast/app/build.gradle
+++ b/BroadCast/app/build.gradle
@@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion 25
- buildToolsVersion "25.0.3"
+ buildToolsVersion '28.0.2'
defaultConfig {
applicationId "com.broadcast.softgen.broadcast"
minSdkVersion 15
diff --git a/BroadCast/app/src/main/AndroidManifest.xml b/BroadCast/app/src/main/AndroidManifest.xml
index 135b62c..b2813a3 100644
--- a/BroadCast/app/src/main/AndroidManifest.xml
+++ b/BroadCast/app/src/main/AndroidManifest.xml
@@ -32,9 +32,17 @@
android:enabled="true"
android:exported="true">
-
+
+
+
\ No newline at end of file
diff --git a/BroadCast/app/src/main/java/com/broadcast/softgen/broadcast/DAB.java b/BroadCast/app/src/main/java/com/broadcast/softgen/broadcast/DAB.java
new file mode 100644
index 0000000..b40bc6d
--- /dev/null
+++ b/BroadCast/app/src/main/java/com/broadcast/softgen/broadcast/DAB.java
@@ -0,0 +1,21 @@
+package com.broadcast.softgen.broadcast;
+
+import android.content.Context;
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteOpenHelper;
+
+public class DAB extends SQLiteOpenHelper {
+ public DAB(Context context) {
+ super(context, "sdf", null, 1);
+ }
+
+ @Override
+ public void onCreate(SQLiteDatabase db) {
+
+ }
+
+ @Override
+ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
+
+ }
+}
diff --git a/BroadCast/app/src/main/java/com/broadcast/softgen/broadcast/MainActivity.java b/BroadCast/app/src/main/java/com/broadcast/softgen/broadcast/MainActivity.java
index f1e9134..cfaac0c 100644
--- a/BroadCast/app/src/main/java/com/broadcast/softgen/broadcast/MainActivity.java
+++ b/BroadCast/app/src/main/java/com/broadcast/softgen/broadcast/MainActivity.java
@@ -25,7 +25,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-public class MainActivity extends AppCompatActivity {
+public class MainActivity extends AppCompatActivity implements SmsListener {
private RecyclerView recyclerView;
private TextView alertText;
private RecyclerView.LayoutManager layoutManager;
@@ -39,6 +39,7 @@ public class MainActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
+
getPermissions(this, REQUEST_CODE_READ_PHONE_STATE);
recyclerView = (RecyclerView) findViewById(R.id.listRecycle);
alertText = (TextView) findViewById(R.id.alertText);
@@ -59,6 +60,8 @@ public void onReceive(Context context, Intent intent) {
}
private void getMessages() {
+
+// SMSReceiver.bindListener(this);
SMSReceiver.bindListener(new SmsListener() {
@Override
public void messageReceived(String messageText) {
@@ -80,6 +83,11 @@ public void messageReceived(String messageText) {
Toast.makeText(MainActivity.this, "OTP: " + otp, Toast.LENGTH_LONG).show();
}
+
+ @Override
+ public void senderAddress(String messageText) {
+
+ }
});
}
@@ -147,4 +155,14 @@ public void onRequestPermissionsResult(int requestCode,
}
}
}
+
+ @Override
+ public void messageReceived(String messageText) {
+
+ }
+
+ @Override
+ public void senderAddress(String messageText) {
+
+ }
}
diff --git a/BroadCast/app/src/main/java/com/broadcast/softgen/broadcast/MessageReceiver.java b/BroadCast/app/src/main/java/com/broadcast/softgen/broadcast/MessageReceiver.java
new file mode 100644
index 0000000..398e7b2
--- /dev/null
+++ b/BroadCast/app/src/main/java/com/broadcast/softgen/broadcast/MessageReceiver.java
@@ -0,0 +1,15 @@
+package com.broadcast.softgen.broadcast;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+
+public class MessageReceiver extends BroadcastReceiver {
+
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ // TODO: This method is called when the BroadcastReceiver is receiving
+ // an Intent broadcast.
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+}
diff --git a/BroadCast/app/src/main/java/com/broadcast/softgen/broadcast/OTPReceiver.java b/BroadCast/app/src/main/java/com/broadcast/softgen/broadcast/OTPReceiver.java
new file mode 100644
index 0000000..d1b54cb
--- /dev/null
+++ b/BroadCast/app/src/main/java/com/broadcast/softgen/broadcast/OTPReceiver.java
@@ -0,0 +1,15 @@
+package com.broadcast.softgen.broadcast;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+
+public class OTPReceiver extends BroadcastReceiver {
+
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ // TODO: This method is called when the BroadcastReceiver is receiving
+ // an Intent broadcast.
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+}
diff --git a/BroadCast/app/src/main/java/com/broadcast/softgen/broadcast/SMSReceiver.java b/BroadCast/app/src/main/java/com/broadcast/softgen/broadcast/SMSReceiver.java
index 2dd0060..6226054 100644
--- a/BroadCast/app/src/main/java/com/broadcast/softgen/broadcast/SMSReceiver.java
+++ b/BroadCast/app/src/main/java/com/broadcast/softgen/broadcast/SMSReceiver.java
@@ -25,6 +25,7 @@ public void onReceive(Context context, Intent intent) {
String messageBody = smsMessage.getMessageBody();
//Pass the message text to interface
mListener.messageReceived(messageBody);
+ mListener.senderAddress(sender);
}
}
diff --git a/BroadCast/app/src/main/java/com/broadcast/softgen/broadcast/SmsListener.java b/BroadCast/app/src/main/java/com/broadcast/softgen/broadcast/SmsListener.java
index 29d6d34..b4f950c 100644
--- a/BroadCast/app/src/main/java/com/broadcast/softgen/broadcast/SmsListener.java
+++ b/BroadCast/app/src/main/java/com/broadcast/softgen/broadcast/SmsListener.java
@@ -6,4 +6,5 @@
public interface SmsListener {
void messageReceived(String messageText);
+ void senderAddress(String messageText);
}
diff --git a/BroadCast/build.gradle b/BroadCast/build.gradle
index c2eea8e..07b964b 100644
--- a/BroadCast/build.gradle
+++ b/BroadCast/build.gradle
@@ -3,9 +3,10 @@
buildscript {
repositories {
jcenter()
+ google()
}
dependencies {
- classpath 'com.android.tools.build:gradle:2.3.3'
+ classpath 'com.android.tools.build:gradle:3.3.0-alpha11'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@@ -15,6 +16,7 @@ buildscript {
allprojects {
repositories {
jcenter()
+ google()
}
}
diff --git a/BroadCast/gradle/wrapper/gradle-wrapper.jar b/BroadCast/gradle/wrapper/gradle-wrapper.jar
index 13372ae..f6b961f 100644
Binary files a/BroadCast/gradle/wrapper/gradle-wrapper.jar and b/BroadCast/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/BroadCast/gradle/wrapper/gradle-wrapper.properties b/BroadCast/gradle/wrapper/gradle-wrapper.properties
index 08e4bb2..8eb1ad7 100644
--- a/BroadCast/gradle/wrapper/gradle-wrapper.properties
+++ b/BroadCast/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,5 @@
-#Wed Jun 14 11:40:43 IST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-all.zip
\ No newline at end of file
diff --git a/BroadCast/gradlew b/BroadCast/gradlew
index 9d82f78..cccdd3d 100644
--- a/BroadCast/gradlew
+++ b/BroadCast/gradlew
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
##############################################################################
##
@@ -6,20 +6,38 @@
##
##############################################################################
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
-warn ( ) {
+warn () {
echo "$*"
}
-die ( ) {
+die () {
echo
echo "$*"
echo
@@ -30,6 +48,7 @@ die ( ) {
cygwin=false
msys=false
darwin=false
+nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
@@ -40,26 +59,11 @@ case "`uname`" in
MINGW* )
msys=true
;;
+ NONSTOP* )
+ nonstop=true
+ ;;
esac
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`"/$link"
- fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >/dev/null
-APP_HOME="`pwd -P`"
-cd "$SAVED" >/dev/null
-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
@@ -85,7 +89,7 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@@ -150,11 +154,19 @@ if $cygwin ; then
esac
fi
-# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
-function splitJvmOpts() {
- JVM_OPTS=("$@")
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
}
-eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
-JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
-exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
+exec "$JAVACMD" "$@"
diff --git a/BroadCast/gradlew.bat b/BroadCast/gradlew.bat
index 8a0b282..f955316 100644
--- a/BroadCast/gradlew.bat
+++ b/BroadCast/gradlew.bat
@@ -8,14 +8,14 @@
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
@@ -46,10 +46,9 @@ echo location of your Java installation.
goto fail
:init
-@rem Get command-line arguments, handling Windowz variants
+@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
@@ -60,11 +59,6 @@ set _SKIP=2
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
-@rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
diff --git a/ContactsReading/.gitignore b/ContactsReading/.gitignore
new file mode 100644
index 0000000..5edb4ee
--- /dev/null
+++ b/ContactsReading/.gitignore
@@ -0,0 +1,10 @@
+*.iml
+.gradle
+/local.properties
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
diff --git a/ContactsReading/.idea/caches/build_file_checksums.ser b/ContactsReading/.idea/caches/build_file_checksums.ser
new file mode 100644
index 0000000..d5439ee
Binary files /dev/null and b/ContactsReading/.idea/caches/build_file_checksums.ser differ
diff --git a/ContactsReading/.idea/codeStyles/Project.xml b/ContactsReading/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..30aa626
--- /dev/null
+++ b/ContactsReading/.idea/codeStyles/Project.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ContactsReading/.idea/encodings.xml b/ContactsReading/.idea/encodings.xml
new file mode 100644
index 0000000..97626ba
--- /dev/null
+++ b/ContactsReading/.idea/encodings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ContactsReading/.idea/gradle.xml b/ContactsReading/.idea/gradle.xml
new file mode 100644
index 0000000..7ac24c7
--- /dev/null
+++ b/ContactsReading/.idea/gradle.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ContactsReading/.idea/misc.xml b/ContactsReading/.idea/misc.xml
new file mode 100644
index 0000000..99202cc
--- /dev/null
+++ b/ContactsReading/.idea/misc.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ContactsReading/.idea/runConfigurations.xml b/ContactsReading/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/ContactsReading/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ContactsReading/app/.gitignore b/ContactsReading/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/ContactsReading/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/ContactsReading/app/build.gradle b/ContactsReading/app/build.gradle
new file mode 100644
index 0000000..4f02f0b
--- /dev/null
+++ b/ContactsReading/app/build.gradle
@@ -0,0 +1,28 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 27
+ defaultConfig {
+ applicationId "com.glowroad.contactsreading"
+ minSdkVersion 21
+ targetSdkVersion 27
+ versionCode 1
+ versionName "1.0"
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+ implementation 'com.android.support:appcompat-v7:27.1.1'
+ implementation 'com.android.support.constraint:constraint-layout:1.1.2'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'com.android.support.test:runner:1.0.2'
+ androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
+}
diff --git a/ContactsReading/app/proguard-rules.pro b/ContactsReading/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/ContactsReading/app/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# 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 *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/ContactsReading/app/src/androidTest/java/com/glowroad/contactsreading/ExampleInstrumentedTest.java b/ContactsReading/app/src/androidTest/java/com/glowroad/contactsreading/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..fbb7d75
--- /dev/null
+++ b/ContactsReading/app/src/androidTest/java/com/glowroad/contactsreading/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.glowroad.contactsreading;
+
+import android.content.Context;
+import android.support.test.InstrumentationRegistry;
+import android.support.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getTargetContext();
+
+ assertEquals("com.glowroad.contactsreading", appContext.getPackageName());
+ }
+}
diff --git a/ContactsReading/app/src/main/AndroidManifest.xml b/ContactsReading/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..b02a8e3
--- /dev/null
+++ b/ContactsReading/app/src/main/AndroidManifest.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ContactsReading/app/src/main/java/com/glowroad/contactsreading/AddPhoneActivity.java b/ContactsReading/app/src/main/java/com/glowroad/contactsreading/AddPhoneActivity.java
new file mode 100644
index 0000000..b6ce865
--- /dev/null
+++ b/ContactsReading/app/src/main/java/com/glowroad/contactsreading/AddPhoneActivity.java
@@ -0,0 +1,137 @@
+package com.glowroad.contactsreading;
+
+import android.content.ContentUris;
+import android.content.ContentValues;
+import android.content.Context;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Bundle;
+import android.provider.ContactsContract;
+import android.support.v7.app.AppCompatActivity;
+import android.view.View;
+import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.Spinner;
+import android.widget.Toast;
+
+public class AddPhoneActivity extends AppCompatActivity {
+ private EditText displayNameEditor;
+
+ private EditText phoneNumberEditor;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_add_phone);
+ displayNameEditor = (EditText)findViewById(R.id.add_phone_contact_display_name);
+
+ phoneNumberEditor = (EditText)findViewById(R.id.add_phone_contact_number);
+
+ // Initialize phone type dropdown spinner.
+ final Spinner phoneTypeSpinner = (Spinner)findViewById(R.id.add_phone_contact_type);
+ String phoneTypeArr[] = {"Mobile", "Home", "Work"};
+ ArrayAdapter phoneTypeSpinnerAdaptor = new ArrayAdapter(this, android.R.layout.simple_spinner_item, phoneTypeArr);
+ phoneTypeSpinner.setAdapter(phoneTypeSpinnerAdaptor);
+
+ // Click this button to save user input phone contact info.
+ Button savePhoneContactButton = (Button)findViewById(R.id.add_phone_contact_save_button);
+ savePhoneContactButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ // Get android phone contact content provider uri.
+ //Uri addContactsUri = ContactsContract.CommonDataKinds.Phone.CONTENT_URI;
+ // Below uri can avoid java.lang.UnsupportedOperationException: URI: content://com.android.contacts/data/phones error.
+ Uri addContactsUri = ContactsContract.Data.CONTENT_URI;
+
+ // Add an empty contact and get the generated id.
+ long rowContactId = getRawContactId();
+
+ // Add contact name data.
+ String displayName = displayNameEditor.getText().toString();
+ insertContactDisplayName(addContactsUri, rowContactId, displayName);
+
+ // Add contact phone data.
+ String phoneNumber = phoneNumberEditor.getText().toString();
+ String phoneTypeStr = (String)phoneTypeSpinner.getSelectedItem();
+ insertContactPhoneNumber(addContactsUri, rowContactId, phoneNumber, phoneTypeStr);
+
+ Toast.makeText(getApplicationContext(),"New contact has been added, go back to previous page to see it in contacts list." , Toast.LENGTH_LONG).show();
+
+ finish();
+ }
+ });
+ }
+
+ // This method will only insert an empty data to RawContacts.CONTENT_URI
+ // The purpose is to get a system generated raw contact id.
+ private long getRawContactId()
+ {
+ // Inser an empty contact.
+ ContentValues contentValues = new ContentValues();
+ Uri rawContactUri = getContentResolver().insert(ContactsContract.RawContacts.CONTENT_URI, contentValues);
+ // Get the newly created contact raw id.
+ long ret = ContentUris.parseId(rawContactUri);
+ return ret;
+ }
+
+
+ // Insert newly created contact display name.
+ private void insertContactDisplayName(Uri addContactsUri, long rawContactId, String displayName)
+ {
+ ContentValues contentValues = new ContentValues();
+
+ contentValues.put(ContactsContract.Data.RAW_CONTACT_ID, rawContactId);
+
+ // Each contact must has an mime type to avoid java.lang.IllegalArgumentException: mimetype is required error.
+ contentValues.put(ContactsContract.Data.MIMETYPE, ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE);
+
+ // Put contact display name value.
+ contentValues.put(ContactsContract.CommonDataKinds.StructuredName.GIVEN_NAME, displayName);
+
+ getContentResolver().insert(addContactsUri, contentValues);
+
+ }
+
+ private void insertContactPhoneNumber(Uri addContactsUri, long rawContactId, String phoneNumber, String phoneTypeStr)
+ {
+ // Create a ContentValues object.
+ ContentValues contentValues = new ContentValues();
+
+ // Each contact must has an id to avoid java.lang.IllegalArgumentException: raw_contact_id is required error.
+ contentValues.put(ContactsContract.Data.RAW_CONTACT_ID, rawContactId);
+
+ // Each contact must has an mime type to avoid java.lang.IllegalArgumentException: mimetype is required error.
+ contentValues.put(ContactsContract.Data.MIMETYPE, ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE);
+
+ // Put phone number value.
+ contentValues.put(ContactsContract.CommonDataKinds.Phone.NUMBER, phoneNumber);
+
+ // Calculate phone type by user selection.
+ int phoneContactType = ContactsContract.CommonDataKinds.Phone.TYPE_HOME;
+
+ if("home".equalsIgnoreCase(phoneTypeStr))
+ {
+ phoneContactType = ContactsContract.CommonDataKinds.Phone.TYPE_HOME;
+ }else if("mobile".equalsIgnoreCase(phoneTypeStr))
+ {
+ phoneContactType = ContactsContract.CommonDataKinds.Phone.TYPE_MOBILE;
+ }else if("work".equalsIgnoreCase(phoneTypeStr))
+ {
+ phoneContactType = ContactsContract.CommonDataKinds.Phone.TYPE_WORK;
+ }
+ // Put phone type value.
+ contentValues.put(ContactsContract.CommonDataKinds.Phone.TYPE, phoneContactType);
+
+ // Insert new contact data into phone contact list.
+ getContentResolver().insert(addContactsUri, contentValues);
+
+ }
+
+ // ListPhoneContactsActivity use this method to start this activity.
+ public static void start(Context context)
+ {
+ Intent intent = new Intent(context, AddPhoneActivity.class);
+ context.startActivity(intent);
+ }
+}
diff --git a/ContactsReading/app/src/main/java/com/glowroad/contactsreading/ContactDTO.java b/ContactsReading/app/src/main/java/com/glowroad/contactsreading/ContactDTO.java
new file mode 100644
index 0000000..d7d62c2
--- /dev/null
+++ b/ContactsReading/app/src/main/java/com/glowroad/contactsreading/ContactDTO.java
@@ -0,0 +1,291 @@
+package com.glowroad.contactsreading;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ContactDTO {
+ // Contact belong group fields.
+ private long groupId;
+
+ // Contacts id.
+ private long contactId;
+
+ // Raw contacts id. Has same value of contact id.
+ private long rawContactId;
+
+ // Contact structured name fields.
+ private String displayName;
+ private String givenName;
+ private String familyName;
+
+ // Contact nickname fields.
+ private String nickName;
+
+ // Contact organization fields.
+ private String company;
+ private String department;
+ private String title;
+ private String jobDescription;
+ private String officeLocation;
+
+ // Contact phone list.
+ private List phoneList = new ArrayList();
+
+ // Contact email list
+ private List emailList = new ArrayList();
+
+ // Contact address list.
+ private List addressList = new ArrayList();
+
+ // Contact website list.
+ private List websiteList = new ArrayList();
+
+ // Contact note.
+ private String note;
+
+ // Contact im list.
+ private List imList = new ArrayList();
+
+ // Contact postal fields.
+ private String country;
+ private String city;
+ private String postCode;
+ private String street;
+ private String region;
+ private long postType;
+
+ // Contact identity fields.
+ // Identity value
+ private String identity;
+ // Identity card, passport etc.
+ private String namespace;
+
+ // Contact photo fields.
+ private String photo;
+ private String photoFieldId;
+
+ public long getContactId() {
+ return contactId;
+ }
+
+ public void setContactId(long contactId) {
+ this.contactId = contactId;
+ }
+
+ public long getRawContactId() {
+ return rawContactId;
+ }
+
+ public void setRawContactId(long rawContactId) {
+ this.rawContactId = rawContactId;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public String getGivenName() {
+ return givenName;
+ }
+
+ public void setGivenName(String givenName) {
+ this.givenName = givenName;
+ }
+
+ public String getFamilyName() {
+ return familyName;
+ }
+
+ public void setFamilyName(String familyName) {
+ this.familyName = familyName;
+ }
+
+ public String getNickName() {
+ return nickName;
+ }
+
+ public void setNickName(String nickName) {
+ this.nickName = nickName;
+ }
+
+ public String getCompany() {
+ return company;
+ }
+
+ public void setCompany(String company) {
+ this.company = company;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public List getPhoneList() {
+ return phoneList;
+ }
+
+ public void setPhoneList(List phoneList) {
+ this.phoneList = phoneList;
+ }
+
+ public List getEmailList() {
+ return emailList;
+ }
+
+ public void setEmailList(List emailList) {
+ this.emailList = emailList;
+ }
+
+ public List getAddressList() {
+ return addressList;
+ }
+
+ public void setAddressList(List addressList) {
+ this.addressList = addressList;
+ }
+
+ public List getWebsiteList() {
+ return websiteList;
+ }
+
+ public void setWebsiteList(List websiteList) {
+ this.websiteList = websiteList;
+ }
+
+ public String getNote() {
+ return note;
+ }
+
+ public void setNote(String note) {
+ this.note = note;
+ }
+
+ public String getDepartment() {
+ return department;
+ }
+
+ public void setDepartment(String department) {
+ this.department = department;
+ }
+
+ public String getJobDescription() {
+ return jobDescription;
+ }
+
+ public void setJobDescription(String jobDescription) {
+ this.jobDescription = jobDescription;
+ }
+
+ public String getOfficeLocation() {
+ return officeLocation;
+ }
+
+ public void setOfficeLocation(String officeLocation) {
+ this.officeLocation = officeLocation;
+ }
+
+ public List getImList() {
+ return imList;
+ }
+
+ public void setImList(List imList) {
+ this.imList = imList;
+ }
+
+ public String getCountry() {
+ return country;
+ }
+
+ public void setCountry(String country) {
+ this.country = country;
+ }
+
+ public String getCity() {
+ return city;
+ }
+
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+
+ public String getStreet() {
+ return street;
+ }
+
+ public void setStreet(String street) {
+ this.street = street;
+ }
+
+ public String getRegion() {
+ return region;
+ }
+
+ public void setRegion(String region) {
+ this.region = region;
+ }
+
+ public String getIdentity() {
+ return identity;
+ }
+
+ public void setIdentity(String identity) {
+ this.identity = identity;
+ }
+
+ public String getNamespace() {
+ return namespace;
+ }
+
+ public void setNamespace(String namespace) {
+ this.namespace = namespace;
+ }
+
+ public String getPhoto() {
+ return photo;
+ }
+
+ public void setPhoto(String photo) {
+ this.photo = photo;
+ }
+
+ public String getPhotoFieldId() {
+ return photoFieldId;
+ }
+
+ public void setPhotoFieldId(String photoFieldId) {
+ this.photoFieldId = photoFieldId;
+ }
+
+ public long getGroupId() {
+ return groupId;
+ }
+
+ public void setGroupId(long groupId) {
+ this.groupId = groupId;
+ }
+
+ public String getPostCode() {
+ return postCode;
+ }
+
+ public void setPostCode(String postCode) {
+ this.postCode = postCode;
+ }
+
+ public long getPostType() {
+ return postType;
+ }
+
+ public void setPostType(long postType) {
+ this.postType = postType;
+ }
+}
diff --git a/ContactsReading/app/src/main/java/com/glowroad/contactsreading/ContactOperationActivity.java b/ContactsReading/app/src/main/java/com/glowroad/contactsreading/ContactOperationActivity.java
new file mode 100644
index 0000000..2616c39
--- /dev/null
+++ b/ContactsReading/app/src/main/java/com/glowroad/contactsreading/ContactOperationActivity.java
@@ -0,0 +1,423 @@
+package com.glowroad.contactsreading;
+
+import android.Manifest;
+import android.content.ContentResolver;
+import android.content.pm.PackageManager;
+import android.database.Cursor;
+import android.net.Uri;
+import android.os.Build;
+import android.os.Bundle;
+import android.provider.ContactsContract;
+import android.support.annotation.NonNull;
+import android.support.v4.app.ActivityCompat;
+import android.support.v4.content.ContextCompat;
+import android.support.v7.app.AppCompatActivity;
+import android.util.Log;
+import android.view.View;
+import android.widget.Button;
+import android.widget.Toast;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ContactOperationActivity extends AppCompatActivity {
+ private static final String TAG_ANDROID_CONTACTS = "ANDROID_CONTACTS";
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_contact_operation);
+ // Load all contacts, and print each contact as log debug info.
+ Button loadButton = (Button) findViewById(R.id.contact_operate_load);
+ loadButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ if (!hasPhoneContactsPermission(Manifest.permission.READ_CONTACTS)) {
+ requestPermission(Manifest.permission.READ_CONTACTS);
+ } else {
+ getAllContacts();
+ Toast.makeText(ContactOperationActivity.this, "Contact data has been printed in the android monitor log..", Toast.LENGTH_SHORT).show();
+ }
+ }
+ });
+ }
+
+ /* Return all contacts and show each contact data in android monitor console as debug info. */
+ private List getAllContacts() {
+ List ret = new ArrayList();
+
+ // Get all raw contacts id list.
+ List rawContactsIdList = getRawContactsIdList();
+
+ int contactListSize = rawContactsIdList.size();
+
+ ContentResolver contentResolver = getContentResolver();
+
+ // Loop in the raw contacts list.
+ for (int i = 0; i < contactListSize; i++) {
+ // Get the raw contact id.
+ Integer rawContactId = rawContactsIdList.get(i);
+
+ Log.d(TAG_ANDROID_CONTACTS, "raw contact id : " + rawContactId.intValue());
+
+ // Data content uri (access data table. )
+ Uri dataContentUri = ContactsContract.Data.CONTENT_URI;
+
+ // Build query columns name array.
+ List queryColumnList = new ArrayList();
+
+ // ContactsContract.Data.CONTACT_ID = "contact_id";
+ queryColumnList.add(ContactsContract.Data.CONTACT_ID);
+
+ // ContactsContract.Data.MIMETYPE = "mimetype";
+ queryColumnList.add(ContactsContract.Data.MIMETYPE);
+
+ queryColumnList.add(ContactsContract.Data.DATA1);
+ queryColumnList.add(ContactsContract.Data.DATA2);
+ queryColumnList.add(ContactsContract.Data.DATA3);
+ queryColumnList.add(ContactsContract.Data.DATA4);
+ queryColumnList.add(ContactsContract.Data.DATA5);
+ queryColumnList.add(ContactsContract.Data.DATA6);
+ queryColumnList.add(ContactsContract.Data.DATA7);
+ queryColumnList.add(ContactsContract.Data.DATA8);
+ queryColumnList.add(ContactsContract.Data.DATA9);
+ queryColumnList.add(ContactsContract.Data.DATA10);
+ queryColumnList.add(ContactsContract.Data.DATA11);
+ queryColumnList.add(ContactsContract.Data.DATA12);
+ queryColumnList.add(ContactsContract.Data.DATA13);
+ queryColumnList.add(ContactsContract.Data.DATA14);
+ queryColumnList.add(ContactsContract.Data.DATA15);
+
+ // Translate column name list to array.
+ String queryColumnArr[] = queryColumnList.toArray(new String[queryColumnList.size()]);
+
+ // Build query condition string. Query rows by contact id.
+ StringBuffer whereClauseBuf = new StringBuffer();
+ whereClauseBuf.append(ContactsContract.Data.RAW_CONTACT_ID);
+ whereClauseBuf.append("=");
+ whereClauseBuf.append(rawContactId);
+
+ // Query data table and return related contact data.
+ Cursor cursor = contentResolver.query(dataContentUri, queryColumnArr, whereClauseBuf.toString(), null, null);
+
+ /* If this cursor return database table row data.
+ If do not check cursor.getCount() then it will throw error
+ android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0.
+ */
+ if (cursor != null && cursor.getCount() > 0) {
+ StringBuffer lineBuf = new StringBuffer();
+ cursor.moveToFirst();
+
+ lineBuf.append("Raw Contact Id : ");
+ lineBuf.append(rawContactId);
+
+ long contactId = cursor.getLong(cursor.getColumnIndex(ContactsContract.Data.CONTACT_ID));
+ lineBuf.append(" , Contact Id : ");
+ lineBuf.append(contactId);
+
+ do {
+ // First get mimetype column value.
+ String mimeType = cursor.getString(cursor.getColumnIndex(ContactsContract.Data.MIMETYPE));
+ lineBuf.append(" \r\n , MimeType : ");
+ lineBuf.append(mimeType);
+
+ List dataValueList = getColumnValueByMimetype(cursor, mimeType);
+ int dataValueListSize = dataValueList.size();
+ for (int j = 0; j < dataValueListSize; j++) {
+ String dataValue = dataValueList.get(j);
+ lineBuf.append(" , ");
+ lineBuf.append(dataValue);
+ }
+
+ } while (cursor.moveToNext());
+
+ Log.d(TAG_ANDROID_CONTACTS, lineBuf.toString());
+ }
+
+ Log.d(TAG_ANDROID_CONTACTS, "=========================================================================");
+ }
+
+ return ret;
+ }
+
+ /*
+ * Get email type related string format value.
+ * */
+ private String getEmailTypeString(int dataType) {
+ String ret = "";
+
+ if (ContactsContract.CommonDataKinds.Email.TYPE_HOME == dataType) {
+ ret = "Home";
+ } else if (ContactsContract.CommonDataKinds.Email.TYPE_WORK == dataType) {
+ ret = "Work";
+ }
+ return ret;
+ }
+
+ /*
+ * Get phone type related string format value.
+ * */
+ private String getPhoneTypeString(int dataType) {
+ String ret = "";
+
+ if (ContactsContract.CommonDataKinds.Phone.TYPE_HOME == dataType) {
+ ret = "Home";
+ } else if (ContactsContract.CommonDataKinds.Phone.TYPE_WORK == dataType) {
+ ret = "Work";
+ } else if (ContactsContract.CommonDataKinds.Phone.TYPE_MOBILE == dataType) {
+ ret = "Mobile";
+ }
+ return ret;
+ }
+
+ /*
+ * Return data column value by mimetype column value.
+ * Because for each mimetype there has not only one related value,
+ * such as Organization.CONTENT_ITEM_TYPE need return company, department, title, job description etc.
+ * So the return is a list string, each string for one column value.
+ * */
+ private List getColumnValueByMimetype(Cursor cursor, String mimeType) {
+ List ret = new ArrayList();
+
+ switch (mimeType) {
+ // Get email data.
+ case ContactsContract.CommonDataKinds.Email.CONTENT_ITEM_TYPE:
+ // Email.ADDRESS == data1
+ String emailAddress = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Email.ADDRESS));
+ // Email.TYPE == data2
+ int emailType = cursor.getInt(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Email.TYPE));
+ String emailTypeStr = getEmailTypeString(emailType);
+
+ ret.add("Email Address : " + emailAddress);
+ ret.add("Email Int Type : " + emailType);
+ ret.add("Email String Type : " + emailTypeStr);
+ break;
+
+ // Get im data.
+ case ContactsContract.CommonDataKinds.Im.CONTENT_ITEM_TYPE:
+ // Im.PROTOCOL == data5
+ String imProtocol = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Im.PROTOCOL));
+ // Im.DATA == data1
+ String imId = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Im.DATA));
+
+ ret.add("IM Protocol : " + imProtocol);
+ ret.add("IM ID : " + imId);
+ break;
+
+ // Get nickname
+ case ContactsContract.CommonDataKinds.Nickname.CONTENT_ITEM_TYPE:
+ // Nickname.NAME == data1
+ String nickName = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Nickname.NAME));
+ ret.add("Nick name : " + nickName);
+ break;
+
+ // Get organization data.
+ case ContactsContract.CommonDataKinds.Organization.CONTENT_ITEM_TYPE:
+ // Organization.COMPANY == data1
+ String company = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Organization.COMPANY));
+ // Organization.DEPARTMENT == data5
+ String department = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Organization.DEPARTMENT));
+ // Organization.TITLE == data4
+ String title = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Organization.TITLE));
+ // Organization.JOB_DESCRIPTION == data6
+ String jobDescription = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Organization.JOB_DESCRIPTION));
+ // Organization.OFFICE_LOCATION == data9
+ String officeLocation = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Organization.OFFICE_LOCATION));
+
+ ret.add("Company : " + company);
+ ret.add("department : " + department);
+ ret.add("Title : " + title);
+ ret.add("Job Description : " + jobDescription);
+ ret.add("Office Location : " + officeLocation);
+ break;
+
+ // Get phone number.
+ case ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE:
+ // Phone.NUMBER == data1
+ String phoneNumber = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
+ // Phone.TYPE == data2
+ int phoneTypeInt = cursor.getInt(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.TYPE));
+ String phoneTypeStr = getPhoneTypeString(phoneTypeInt);
+
+ ret.add("Phone Number : " + phoneNumber);
+ ret.add("Phone Type Integer : " + phoneTypeInt);
+ ret.add("Phone Type String : " + phoneTypeStr);
+ break;
+
+ // Get sip address.
+ case ContactsContract.CommonDataKinds.SipAddress.CONTENT_ITEM_TYPE:
+ // SipAddress.SIP_ADDRESS == data1
+ String address = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.SipAddress.SIP_ADDRESS));
+ // SipAddress.TYPE == data2
+ int addressTypeInt = cursor.getInt(cursor.getColumnIndex(ContactsContract.CommonDataKinds.SipAddress.TYPE));
+ String addressTypeStr = getEmailTypeString(addressTypeInt);
+
+ ret.add("Address : " + address);
+ ret.add("Address Type Integer : " + addressTypeInt);
+ ret.add("Address Type String : " + addressTypeStr);
+ break;
+
+ // Get display name.
+ case ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE:
+ // StructuredName.DISPLAY_NAME == data1
+ String displayName = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME));
+ // StructuredName.GIVEN_NAME == data2
+ String givenName = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.StructuredName.GIVEN_NAME));
+ // StructuredName.FAMILY_NAME == data3
+ String familyName = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.StructuredName.FAMILY_NAME));
+
+ ret.add("Display Name : " + displayName);
+ ret.add("Given Name : " + givenName);
+ ret.add("Family Name : " + familyName);
+ break;
+
+ // Get postal address.
+ case ContactsContract.CommonDataKinds.StructuredPostal.CONTENT_ITEM_TYPE:
+ // StructuredPostal.COUNTRY == data10
+ String country = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.StructuredPostal.COUNTRY));
+ // StructuredPostal.CITY == data7
+ String city = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.StructuredPostal.CITY));
+ // StructuredPostal.REGION == data8
+ String region = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.StructuredPostal.REGION));
+ // StructuredPostal.STREET == data4
+ String street = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.StructuredPostal.STREET));
+ // StructuredPostal.POSTCODE == data9
+ String postcode = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.StructuredPostal.POSTCODE));
+ // StructuredPostal.TYPE == data2
+ int postType = cursor.getInt(cursor.getColumnIndex(ContactsContract.CommonDataKinds.StructuredPostal.TYPE));
+ String postTypeStr = getEmailTypeString(postType);
+
+ ret.add("Country : " + country);
+ ret.add("City : " + city);
+ ret.add("Region : " + region);
+ ret.add("Street : " + street);
+ ret.add("Postcode : " + postcode);
+ ret.add("Post Type Integer : " + postType);
+ ret.add("Post Type String : " + postTypeStr);
+ break;
+
+ // Get identity.
+ case ContactsContract.CommonDataKinds.Identity.CONTENT_ITEM_TYPE:
+ // Identity.IDENTITY == data1
+ String identity = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Identity.IDENTITY));
+ // Identity.NAMESPACE == data2
+ String namespace = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Identity.NAMESPACE));
+
+ ret.add("Identity : " + identity);
+ ret.add("Identity Namespace : " + namespace);
+ break;
+
+ // Get photo.
+ case ContactsContract.CommonDataKinds.Photo.CONTENT_ITEM_TYPE:
+ // Photo.PHOTO == data15
+ String photo = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Photo.PHOTO));
+ // Photo.PHOTO_FILE_ID == data14
+ String photoFileId = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Photo.PHOTO_FILE_ID));
+
+ ret.add("Photo : " + photo);
+ ret.add("Photo File Id: " + photoFileId);
+ break;
+
+ // Get group membership.
+ case ContactsContract.CommonDataKinds.GroupMembership.CONTENT_ITEM_TYPE:
+ // GroupMembership.GROUP_ROW_ID == data1
+ int groupId = cursor.getInt(cursor.getColumnIndex(ContactsContract.CommonDataKinds.GroupMembership.GROUP_ROW_ID));
+ ret.add("Group ID : " + groupId);
+ break;
+
+ // Get website.
+ case ContactsContract.CommonDataKinds.Website.CONTENT_ITEM_TYPE:
+ // Website.URL == data1
+ String websiteUrl = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Website.URL));
+ // Website.TYPE == data2
+ int websiteTypeInt = cursor.getInt(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Website.TYPE));
+ String websiteTypeStr = getEmailTypeString(websiteTypeInt);
+
+ ret.add("Website Url : " + websiteUrl);
+ ret.add("Website Type Integer : " + websiteTypeInt);
+ ret.add("Website Type String : " + websiteTypeStr);
+ break;
+
+ // Get note.
+ case ContactsContract.CommonDataKinds.Note.CONTENT_ITEM_TYPE:
+ // Note.NOTE == data1
+ String note = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Note.NOTE));
+ ret.add("Note : " + note);
+ break;
+
+ }
+
+ return ret;
+ }
+
+ // Return all raw_contacts _id in a list.
+ private List getRawContactsIdList() {
+ List ret = new ArrayList();
+
+ ContentResolver contentResolver = getContentResolver();
+
+ // Row contacts content uri( access raw_contacts table. ).
+ Uri rawContactUri = ContactsContract.RawContacts.CONTENT_URI;
+ // Return _id column in contacts raw_contacts table.
+ String queryColumnArr[] = {ContactsContract.RawContacts._ID};
+ // Query raw_contacts table and return raw_contacts table _id.
+ Cursor cursor = contentResolver.query(rawContactUri, queryColumnArr, null, null, null);
+ if (cursor != null) {
+ cursor.moveToFirst();
+ do {
+ int idColumnIndex = cursor.getColumnIndex(ContactsContract.RawContacts._ID);
+ int rawContactsId = cursor.getInt(idColumnIndex);
+ ret.add(new Integer(rawContactsId));
+ } while (cursor.moveToNext());
+ }
+
+ cursor.close();
+
+ return ret;
+ }
+
+
+ // Check whether user has phone contacts manipulation permission or not.
+ private boolean hasPhoneContactsPermission(String permission) {
+ boolean ret = false;
+
+ // If android sdk version is bigger than 23 the need to check run time permission.
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+
+ // return phone read contacts permission grant status.
+ int hasPermission = ContextCompat.checkSelfPermission(getApplicationContext(), permission);
+ // If permission is granted then return true.
+ if (hasPermission == PackageManager.PERMISSION_GRANTED) {
+ ret = true;
+ }
+ } else {
+ ret = true;
+ }
+ return ret;
+ }
+
+ // Request a runtime permission to app user.
+ private void requestPermission(String permission) {
+ String requestPermissionArray[] = {permission};
+ ActivityCompat.requestPermissions(this, requestPermissionArray, 1);
+ }
+
+ // After user select Allow or Deny button in request runtime permission dialog
+ // , this method will be invoked.
+ @Override
+ public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
+ super.onRequestPermissionsResult(requestCode, permissions, grantResults);
+
+ int length = grantResults.length;
+ if (length > 0) {
+ int grantResult = grantResults[0];
+
+ if (grantResult == PackageManager.PERMISSION_GRANTED) {
+
+ Toast.makeText(getApplicationContext(), "You allowed permission, please click the button again.", Toast.LENGTH_LONG).show();
+ } else {
+ Toast.makeText(getApplicationContext(), "You denied permission.", Toast.LENGTH_LONG).show();
+ }
+ }
+ }
+}
diff --git a/ContactsReading/app/src/main/java/com/glowroad/contactsreading/DataDTO.java b/ContactsReading/app/src/main/java/com/glowroad/contactsreading/DataDTO.java
new file mode 100644
index 0000000..ae6dbb3
--- /dev/null
+++ b/ContactsReading/app/src/main/java/com/glowroad/contactsreading/DataDTO.java
@@ -0,0 +1,4 @@
+package com.glowroad.contactsreading;
+
+class DataDTO {
+}
diff --git a/ContactsReading/app/src/main/java/com/glowroad/contactsreading/MainActivity.java b/ContactsReading/app/src/main/java/com/glowroad/contactsreading/MainActivity.java
new file mode 100644
index 0000000..6382243
--- /dev/null
+++ b/ContactsReading/app/src/main/java/com/glowroad/contactsreading/MainActivity.java
@@ -0,0 +1,192 @@
+package com.glowroad.contactsreading;
+
+import android.Manifest;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.database.Cursor;
+import android.net.Uri;
+import android.os.Build;
+import android.os.Bundle;
+import android.provider.ContactsContract;
+import android.support.annotation.NonNull;
+import android.support.v4.app.ActivityCompat;
+import android.support.v4.content.ContextCompat;
+import android.support.v7.app.AppCompatActivity;
+import android.view.View;
+import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.ListView;
+import android.widget.Toast;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class MainActivity extends AppCompatActivity {
+ // Store all phone contacts list.
+ // Each String format is " DisplayName \r\n Phone Number \r\n Phone Type " ( Jerry \r\n 111111 \r\n Home) .
+ private List phoneContactsList = new ArrayList();
+
+ // This is the phone contacts list view's data adapter.
+ private ArrayAdapter contactsListDataAdapter;
+
+ ListView contactsListView = null;
+
+ private int PERMISSION_REQUEST_CODE_READ_CONTACTS = 1;
+
+ private int PERMISSION_REQUEST_CODE_WRITE_CONTACTS = 2;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ // Get contacts list view.
+ contactsListView = (ListView) findViewById(R.id.display_phone_ocntacts_list_view);
+ // Create the list view data adapter.
+ contactsListDataAdapter = new ArrayAdapter(getApplicationContext(), android.R.layout.simple_list_item_1, phoneContactsList);
+ // Set data adapter to the list view.
+ contactsListView.setAdapter(contactsListDataAdapter);
+
+ // Click this button start add phone contact activity.
+ Button addPhoneContactsButton = (Button) findViewById(R.id.add_phone_contacts_button);
+ addPhoneContactsButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ if (!hasPhoneContactsPermission(Manifest.permission.WRITE_CONTACTS)) {
+ requestPermission(Manifest.permission.WRITE_CONTACTS, PERMISSION_REQUEST_CODE_WRITE_CONTACTS);
+ } else {
+ AddPhoneActivity.start(getApplicationContext());
+ }
+ }
+ });
+
+ // Click this button to get and display phone contacts in the list view.
+ Button readPhoneContactsButton = (Button) findViewById(R.id.read_phone_contacts_button);
+ readPhoneContactsButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ if (!hasPhoneContactsPermission(Manifest.permission.READ_CONTACTS)) {
+ requestPermission(Manifest.permission.READ_CONTACTS, PERMISSION_REQUEST_CODE_READ_CONTACTS);
+ } else {
+ readPhoneContacts();
+ }
+ }
+ });
+
+ Button contactsButton = (Button) findViewById(R.id.contacts_button);
+ contactsButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ if (!hasPhoneContactsPermission(Manifest.permission.READ_CONTACTS)) {
+ requestPermission(Manifest.permission.READ_CONTACTS, PERMISSION_REQUEST_CODE_READ_CONTACTS);
+ } else {
+ startActivity(new Intent(MainActivity.this,ContactOperationActivity.class));
+ }
+ }
+ });
+ }
+
+ // Check whether user has phone contacts manipulation permission or not.
+ private boolean hasPhoneContactsPermission(String permission) {
+ boolean ret = false;
+
+ // If android sdk version is bigger than 23 the need to check run time permission.
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+
+ // return phone read contacts permission grant status.
+ int hasPermission = ContextCompat.checkSelfPermission(getApplicationContext(), permission);
+ // If permission is granted then return true.
+ if (hasPermission == PackageManager.PERMISSION_GRANTED) {
+ ret = true;
+ }
+ } else {
+ ret = true;
+ }
+ return ret;
+ }
+
+ // Request a runtime permission to app user.
+ private void requestPermission(String permission, int requestCode) {
+ String requestPermissionArray[] = {permission};
+ ActivityCompat.requestPermissions(this, requestPermissionArray, requestCode);
+ }
+
+ // After user select Allow or Deny button in request runtime permission dialog
+ // , this method will be invoked.
+ @Override
+ public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
+ super.onRequestPermissionsResult(requestCode, permissions, grantResults);
+
+ int length = grantResults.length;
+ if (length > 0) {
+ int grantResult = grantResults[0];
+
+ if (grantResult == PackageManager.PERMISSION_GRANTED) {
+
+ if (requestCode == PERMISSION_REQUEST_CODE_READ_CONTACTS) {
+ // If user grant read contacts permission.
+ readPhoneContacts();
+ } else if (requestCode == PERMISSION_REQUEST_CODE_WRITE_CONTACTS) {
+ // If user grant write contacts permission then start add phone contact activity.
+ AddPhoneActivity.start(getApplicationContext());
+ }
+ } else {
+ Toast.makeText(getApplicationContext(), "You denied permission.", Toast.LENGTH_LONG).show();
+ }
+ }
+ }
+
+ // Read and display android phone contacts in list view.
+ private void readPhoneContacts() {
+
+ // First empty current phone contacts list data.
+ int size = phoneContactsList.size();
+ for (int i = 0; i < size; i++) {
+ phoneContactsList.remove(i);
+ i--;
+ size = phoneContactsList.size();
+ }
+
+ // Get query phone contacts cursor object.
+ Uri readContactsUri = ContactsContract.CommonDataKinds.Phone.CONTENT_URI;
+ Cursor cursor = getContentResolver().query(readContactsUri, null, null, null, null);
+
+ if (cursor != null) {
+ cursor.moveToFirst();
+
+ // Loop in the phone contacts cursor to add each contacts in phoneContactsList.
+ do {
+ // Get contact display name.
+ int displayNameIndex = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME);
+ String userDisplayName = cursor.getString(displayNameIndex);
+
+ // Get contact phone number.
+ int phoneNumberIndex = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER);
+ String phoneNumber = cursor.getString(phoneNumberIndex);
+
+ // Get contact phone type.
+ String phoneTypeStr = "Mobile";
+ int phoneTypeColumnIndex = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.TYPE);
+ int phoneTypeInt = cursor.getInt(phoneTypeColumnIndex);
+ if (phoneTypeInt == ContactsContract.CommonDataKinds.Phone.TYPE_HOME) {
+ phoneTypeStr = "Home";
+ } else if (phoneTypeInt == ContactsContract.CommonDataKinds.Phone.TYPE_MOBILE) {
+ phoneTypeStr = "Mobile";
+ } else if (phoneTypeInt == ContactsContract.CommonDataKinds.Phone.TYPE_WORK) {
+ phoneTypeStr = "Work";
+ }
+
+ StringBuffer contactStringBuf = new StringBuffer();
+ contactStringBuf.append(userDisplayName);
+ contactStringBuf.append("\r\n");
+ contactStringBuf.append(phoneNumber);
+ contactStringBuf.append("\r\n");
+ contactStringBuf.append(phoneTypeStr);
+
+ phoneContactsList.add(contactStringBuf.toString());
+ } while (cursor.moveToNext());
+
+ // Refresh the listview to display read out phone contacts.
+ contactsListDataAdapter.notifyDataSetChanged();
+ }
+ }
+}
diff --git a/ContactsReading/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/ContactsReading/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 0000000..c7bd21d
--- /dev/null
+++ b/ContactsReading/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ContactsReading/app/src/main/res/drawable/ic_launcher_background.xml b/ContactsReading/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..d5fccc5
--- /dev/null
+++ b/ContactsReading/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ContactsReading/app/src/main/res/layout/activity_add_phone.xml b/ContactsReading/app/src/main/res/layout/activity_add_phone.xml
new file mode 100644
index 0000000..e0d7963
--- /dev/null
+++ b/ContactsReading/app/src/main/res/layout/activity_add_phone.xml
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ContactsReading/app/src/main/res/layout/activity_contact_operation.xml b/ContactsReading/app/src/main/res/layout/activity_contact_operation.xml
new file mode 100644
index 0000000..a05f90c
--- /dev/null
+++ b/ContactsReading/app/src/main/res/layout/activity_contact_operation.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ContactsReading/app/src/main/res/layout/activity_main.xml b/ContactsReading/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..918f18f
--- /dev/null
+++ b/ContactsReading/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ContactsReading/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/ContactsReading/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/ContactsReading/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/ContactsReading/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/ContactsReading/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/ContactsReading/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/ContactsReading/app/src/main/res/mipmap-hdpi/ic_launcher.png b/ContactsReading/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..a2f5908
Binary files /dev/null and b/ContactsReading/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/ContactsReading/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/ContactsReading/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 0000000..1b52399
Binary files /dev/null and b/ContactsReading/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/ContactsReading/app/src/main/res/mipmap-mdpi/ic_launcher.png b/ContactsReading/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..ff10afd
Binary files /dev/null and b/ContactsReading/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/ContactsReading/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/ContactsReading/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 0000000..115a4c7
Binary files /dev/null and b/ContactsReading/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/ContactsReading/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/ContactsReading/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..dcd3cd8
Binary files /dev/null and b/ContactsReading/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/ContactsReading/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/ContactsReading/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..459ca60
Binary files /dev/null and b/ContactsReading/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/ContactsReading/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/ContactsReading/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..8ca12fe
Binary files /dev/null and b/ContactsReading/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/ContactsReading/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/ContactsReading/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..8e19b41
Binary files /dev/null and b/ContactsReading/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/ContactsReading/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/ContactsReading/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..b824ebd
Binary files /dev/null and b/ContactsReading/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/ContactsReading/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/ContactsReading/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..4c19a13
Binary files /dev/null and b/ContactsReading/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/ContactsReading/app/src/main/res/values/colors.xml b/ContactsReading/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..3ab3e9c
--- /dev/null
+++ b/ContactsReading/app/src/main/res/values/colors.xml
@@ -0,0 +1,6 @@
+
+
+ #3F51B5
+ #303F9F
+ #FF4081
+
diff --git a/ContactsReading/app/src/main/res/values/strings.xml b/ContactsReading/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..d338d1b
--- /dev/null
+++ b/ContactsReading/app/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ ContactsReading
+
diff --git a/ContactsReading/app/src/main/res/values/styles.xml b/ContactsReading/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..5885930
--- /dev/null
+++ b/ContactsReading/app/src/main/res/values/styles.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
diff --git a/ContactsReading/app/src/test/java/com/glowroad/contactsreading/ExampleUnitTest.java b/ContactsReading/app/src/test/java/com/glowroad/contactsreading/ExampleUnitTest.java
new file mode 100644
index 0000000..aea6cdc
--- /dev/null
+++ b/ContactsReading/app/src/test/java/com/glowroad/contactsreading/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.glowroad.contactsreading;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/ContactsReading/build.gradle b/ContactsReading/build.gradle
new file mode 100644
index 0000000..077cb2f
--- /dev/null
+++ b/ContactsReading/build.gradle
@@ -0,0 +1,27 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+
+ repositories {
+ google()
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:3.1.4'
+
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ google()
+ jcenter()
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/ContactsReading/gradle.properties b/ContactsReading/gradle.properties
new file mode 100644
index 0000000..743d692
--- /dev/null
+++ b/ContactsReading/gradle.properties
@@ -0,0 +1,13 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx1536m
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
diff --git a/ContactsReading/gradle/wrapper/gradle-wrapper.jar b/ContactsReading/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..7a3265e
Binary files /dev/null and b/ContactsReading/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/ContactsReading/gradle/wrapper/gradle-wrapper.properties b/ContactsReading/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..26c97bd
--- /dev/null
+++ b/ContactsReading/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Mon Aug 13 13:29:00 IST 2018
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
diff --git a/ContactsReading/gradlew b/ContactsReading/gradlew
new file mode 100644
index 0000000..cccdd3d
--- /dev/null
+++ b/ContactsReading/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/ContactsReading/gradlew.bat b/ContactsReading/gradlew.bat
new file mode 100644
index 0000000..f955316
--- /dev/null
+++ b/ContactsReading/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/ContactsReading/settings.gradle b/ContactsReading/settings.gradle
new file mode 100644
index 0000000..e7b4def
--- /dev/null
+++ b/ContactsReading/settings.gradle
@@ -0,0 +1 @@
+include ':app'
diff --git a/DownloadImages/.gitignore b/DownloadImages/.gitignore
new file mode 100644
index 0000000..39fb081
--- /dev/null
+++ b/DownloadImages/.gitignore
@@ -0,0 +1,9 @@
+*.iml
+.gradle
+/local.properties
+/.idea/workspace.xml
+/.idea/libraries
+.DS_Store
+/build
+/captures
+.externalNativeBuild
diff --git a/DownloadImages/.idea/caches/build_file_checksums.ser b/DownloadImages/.idea/caches/build_file_checksums.ser
new file mode 100644
index 0000000..82e0874
Binary files /dev/null and b/DownloadImages/.idea/caches/build_file_checksums.ser differ
diff --git a/DownloadImages/.idea/codeStyles/Project.xml b/DownloadImages/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..30aa626
--- /dev/null
+++ b/DownloadImages/.idea/codeStyles/Project.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/DownloadImages/.idea/gradle.xml b/DownloadImages/.idea/gradle.xml
new file mode 100644
index 0000000..7ac24c7
--- /dev/null
+++ b/DownloadImages/.idea/gradle.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/DownloadImages/.idea/misc.xml b/DownloadImages/.idea/misc.xml
new file mode 100644
index 0000000..e0d5b93
--- /dev/null
+++ b/DownloadImages/.idea/misc.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/DownloadImages/.idea/modules.xml b/DownloadImages/.idea/modules.xml
new file mode 100644
index 0000000..9d792ba
--- /dev/null
+++ b/DownloadImages/.idea/modules.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/DownloadImages/.idea/runConfigurations.xml b/DownloadImages/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/DownloadImages/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/DownloadImages/app/.gitignore b/DownloadImages/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/DownloadImages/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/DownloadImages/app/build.gradle b/DownloadImages/app/build.gradle
new file mode 100644
index 0000000..4c4a4a8
--- /dev/null
+++ b/DownloadImages/app/build.gradle
@@ -0,0 +1,31 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 26
+ defaultConfig {
+ applicationId "com.walmart.downloadimages"
+ minSdkVersion 21
+ targetSdkVersion 26
+ versionCode 1
+ versionName "1.0"
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+ implementation 'com.android.support:appcompat-v7:26.1.0'
+ implementation 'com.android.support:design:26.1.0'
+ implementation 'com.android.support.constraint:constraint-layout:1.0.2'
+ implementation 'com.android.support:support-v4:26.1.0'
+ implementation 'com.squareup.okhttp3:okhttp:3.10.0'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'com.android.support.test:runner:1.0.1'
+ androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
+}
diff --git a/DownloadImages/app/proguard-rules.pro b/DownloadImages/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/DownloadImages/app/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# 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 *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/DownloadImages/app/src/androidTest/java/com/walmart/downloadimages/ExampleInstrumentedTest.java b/DownloadImages/app/src/androidTest/java/com/walmart/downloadimages/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..c9f5bbb
--- /dev/null
+++ b/DownloadImages/app/src/androidTest/java/com/walmart/downloadimages/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.walmart.downloadimages;
+
+import android.content.Context;
+import android.support.test.InstrumentationRegistry;
+import android.support.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() throws Exception {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getTargetContext();
+
+ assertEquals("com.walmart.downloadimages", appContext.getPackageName());
+ }
+}
diff --git a/DownloadImages/app/src/main/AndroidManifest.xml b/DownloadImages/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..0853808
--- /dev/null
+++ b/DownloadImages/app/src/main/AndroidManifest.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/DownloadImages/app/src/main/java/com/walmart/downloadimages/activity/DownloadActivity.java b/DownloadImages/app/src/main/java/com/walmart/downloadimages/activity/DownloadActivity.java
new file mode 100644
index 0000000..95d5e7a
--- /dev/null
+++ b/DownloadImages/app/src/main/java/com/walmart/downloadimages/activity/DownloadActivity.java
@@ -0,0 +1,31 @@
+package com.walmart.downloadimages.activity;
+
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentTransaction;
+import android.support.v7.app.AppCompatActivity;
+
+import com.walmart.downloadimages.R;
+import com.walmart.downloadimages.fragment.NetworkFragment;
+
+public class DownloadActivity extends AppCompatActivity {
+
+ private static FragmentManager fragmentManager;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_download);
+ fragmentManager = getSupportFragmentManager();
+ replaceFragment(new NetworkFragment(), NetworkFragment.class.getSimpleName(), false);
+ }
+
+ public static void replaceFragment(Fragment fragment, String tag, boolean isBackStack) {
+ FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
+ fragmentTransaction.replace(R.id.fragCont, fragment, tag);
+ if (isBackStack)
+ fragmentTransaction.addToBackStack(tag);
+ fragmentTransaction.commit();
+ }
+}
diff --git a/DownloadImages/app/src/main/java/com/walmart/downloadimages/activity/TActivity.java b/DownloadImages/app/src/main/java/com/walmart/downloadimages/activity/TActivity.java
new file mode 100644
index 0000000..9b83a41
--- /dev/null
+++ b/DownloadImages/app/src/main/java/com/walmart/downloadimages/activity/TActivity.java
@@ -0,0 +1,15 @@
+package com.walmart.downloadimages.activity;
+
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+
+import com.walmart.downloadimages.R;
+
+public class TActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.fragment_output);
+ }
+}
diff --git a/DownloadImages/app/src/main/java/com/walmart/downloadimages/fragment/Collection.java b/DownloadImages/app/src/main/java/com/walmart/downloadimages/fragment/Collection.java
new file mode 100644
index 0000000..200b575
--- /dev/null
+++ b/DownloadImages/app/src/main/java/com/walmart/downloadimages/fragment/Collection.java
@@ -0,0 +1,67 @@
+package com.walmart.downloadimages.fragment;
+
+public class Collection {
+ private int collection_id;
+ private int res_count;
+ private String image_url;
+ private String url;
+ private String title;
+ private String description;
+ private String share_url;
+
+ public int getCollection_id() {
+ return collection_id;
+ }
+
+ public void setCollection_id(int collection_id) {
+ this.collection_id = collection_id;
+ }
+
+ public int getRes_count() {
+ return res_count;
+ }
+
+ public void setRes_count(int res_count) {
+ this.res_count = res_count;
+ }
+
+ public String getImage_url() {
+ return image_url;
+ }
+
+ public void setImage_url(String image_url) {
+ this.image_url = image_url;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getShare_url() {
+ return share_url;
+ }
+
+ public void setShare_url(String share_url) {
+ this.share_url = share_url;
+ }
+}
diff --git a/DownloadImages/app/src/main/java/com/walmart/downloadimages/fragment/Collections.java b/DownloadImages/app/src/main/java/com/walmart/downloadimages/fragment/Collections.java
new file mode 100644
index 0000000..ad72e1d
--- /dev/null
+++ b/DownloadImages/app/src/main/java/com/walmart/downloadimages/fragment/Collections.java
@@ -0,0 +1,13 @@
+package com.walmart.downloadimages.fragment;
+
+public class Collections {
+ private Collection collection;
+
+ public Collection getCollection() {
+ return collection;
+ }
+
+ public void setCollection(Collection collection) {
+ this.collection = collection;
+ }
+}
diff --git a/DownloadImages/app/src/main/java/com/walmart/downloadimages/fragment/JsonParser.java b/DownloadImages/app/src/main/java/com/walmart/downloadimages/fragment/JsonParser.java
new file mode 100644
index 0000000..20957ac
--- /dev/null
+++ b/DownloadImages/app/src/main/java/com/walmart/downloadimages/fragment/JsonParser.java
@@ -0,0 +1,51 @@
+package com.walmart.downloadimages.fragment;
+
+import java.util.ArrayList;
+
+public class JsonParser {
+ private ArrayList collections;
+ private String displayText;
+ private String shareUrl;
+ private int hasMore;
+ private int hasTotal;
+
+ public int getHasTotal() {
+ return hasTotal;
+ }
+
+ public void setHasTotal(int hasTotal) {
+ this.hasTotal = hasTotal;
+ }
+
+ public int getHasMore() {
+ return hasMore;
+ }
+
+ public void setHasMore(int hasMore) {
+ this.hasMore = hasMore;
+ }
+
+ public String getShareUrl() {
+ return shareUrl;
+ }
+
+ public void setShareUrl(String shareUrl) {
+ this.shareUrl = shareUrl;
+ }
+
+ public String getDisplayText() {
+ return displayText;
+ }
+
+ public void setDisplayText(String displayText) {
+ this.displayText = displayText;
+ }
+
+ public ArrayList getCollections() {
+ return collections;
+ }
+
+ public void setCollections(ArrayList collections) {
+ this.collections = collections;
+ }
+}
diff --git a/DownloadImages/app/src/main/java/com/walmart/downloadimages/fragment/NetworkFragment.java b/DownloadImages/app/src/main/java/com/walmart/downloadimages/fragment/NetworkFragment.java
new file mode 100644
index 0000000..9b88c14
--- /dev/null
+++ b/DownloadImages/app/src/main/java/com/walmart/downloadimages/fragment/NetworkFragment.java
@@ -0,0 +1,158 @@
+package com.walmart.downloadimages.fragment;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.Handler;
+import android.support.design.widget.TextInputEditText;
+import android.support.design.widget.TextInputLayout;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.ProgressBar;
+import android.widget.Toast;
+
+import com.walmart.downloadimages.receiver.DownActInterface;
+import com.walmart.downloadimages.receiver.DownloadReceiver;
+import com.walmart.downloadimages.R;
+import com.walmart.downloadimages.activity.TActivity;
+import com.walmart.downloadimages.services.DownAsync;
+import com.walmart.downloadimages.services.DownloadService;
+
+public class NetworkFragment extends Fragment implements DownActInterface {
+ private String mResult;
+ private TextInputEditText mUrlLink;
+ private TextInputLayout tilUrl;
+ private ProgressBar progressBar;
+ private Button mDownload;
+ private Button mNextAct;
+ private Activity mActivity;
+
+ public NetworkFragment() {
+ // Required empty public constructor
+ }
+
+ @Override
+ public void onAttachFragment(Fragment childFragment) {
+ super.onAttachFragment(childFragment);
+ if (childFragment.getActivity() instanceof NetworkRequestListener) {
+ mListener = (NetworkRequestListener) childFragment.getActivity();
+ } else {
+ throw new IllegalStateException("Parent activity must implement NetworkRequestListener");
+ }
+ }
+
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setRetainInstance(true);
+ }
+
+
+ @Override
+ public void onActivityCreated(Bundle savedInstanceState) {
+ super.onActivityCreated(savedInstanceState);
+ if ((mResult != null) && (mListener != null)) {
+ mListener.onRequestFinished(mResult);
+ mResult = null;
+ }
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ View view = inflater.inflate(R.layout.fragment_network, container, false);
+ mActivity = getActivity();
+ initViews(view);
+ return view;
+ }
+
+ private void initViews(View view) {
+ mUrlLink = view.findViewById(R.id.etDownload);
+ tilUrl = view.findViewById(R.id.tilDownload);
+ mDownload = view.findViewById(R.id.download);
+ mNextAct = view.findViewById(R.id.playYoutube);
+ progressBar = view.findViewById(R.id.progressBar);
+ setListeners();
+ }
+
+ private void setListeners() {
+ mDownload.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ isValid(mUrlLink.getText().toString());
+ }
+ });
+ mNextAct.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ startActivity(new Intent(getActivity(), TActivity.class));
+ }
+ });
+ }
+
+
+ private void isValid(String link) {
+ if (link.isEmpty()) {
+ tilUrl.setError("Please Enter the URL");
+ } else {
+ tilUrl.setError(null);
+ mListener.onRequestStarted();
+ Intent intent = new Intent(getActivity(), DownloadService.class);
+ intent.putExtra("url", "http://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_30mb.mp4");
+ intent.putExtra("receiver", new DownloadReceiver(new Handler(), mListener));
+ getActivity().startService(intent);
+ new DownAsync(this).execute(23);
+ }
+ }
+
+ @Override
+ public void onDetach() {
+ super.onDetach();
+ mListener = null;
+ }
+
+ @Override
+ public void onDestroy() {
+ super.onDestroy();
+ }
+
+
+ private NetworkRequestListener mListener = new NetworkRequestListener() {
+
+ @Override
+ public void onRequestProgressUpdate(int progress) {
+ progressBar.setProgress(progress);
+ }
+
+ @Override
+ public void onRequestFinished(String result) {
+ mDownload.setEnabled(true);
+ Toast.makeText(mActivity, "Completed Downloading", Toast.LENGTH_SHORT).show();
+ }
+
+ @Override
+ public void onRequestStarted() {
+ mUrlLink.setText("");
+ mDownload.setEnabled(false);
+ }
+ };
+
+ @Override
+ public String onFinishTask(String op) {
+ mNextAct.setText(op);
+ return null;
+ }
+
+ public interface NetworkRequestListener {
+ void onRequestProgressUpdate(int progress);
+
+ void onRequestFinished(String result);
+
+ void onRequestStarted();
+ }
+
+}
diff --git a/DownloadImages/app/src/main/java/com/walmart/downloadimages/receiver/DownActInterface.java b/DownloadImages/app/src/main/java/com/walmart/downloadimages/receiver/DownActInterface.java
new file mode 100644
index 0000000..e7a9dd0
--- /dev/null
+++ b/DownloadImages/app/src/main/java/com/walmart/downloadimages/receiver/DownActInterface.java
@@ -0,0 +1,5 @@
+package com.walmart.downloadimages.receiver;
+
+public interface DownActInterface {
+ public String onFinishTask(String op);
+}
diff --git a/DownloadImages/app/src/main/java/com/walmart/downloadimages/receiver/DownloadReceiver.java b/DownloadImages/app/src/main/java/com/walmart/downloadimages/receiver/DownloadReceiver.java
new file mode 100644
index 0000000..469209d
--- /dev/null
+++ b/DownloadImages/app/src/main/java/com/walmart/downloadimages/receiver/DownloadReceiver.java
@@ -0,0 +1,29 @@
+package com.walmart.downloadimages.receiver;
+
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.ResultReceiver;
+
+import com.walmart.downloadimages.fragment.NetworkFragment;
+import com.walmart.downloadimages.services.DownloadService;
+
+public class DownloadReceiver extends ResultReceiver {
+ NetworkFragment.NetworkRequestListener requestListener;
+
+ public DownloadReceiver(Handler handler, NetworkFragment.NetworkRequestListener mListener) {
+ super(handler);
+ requestListener = mListener;
+ }
+
+ @Override
+ protected void onReceiveResult(int resultCode, Bundle resultData) {
+ super.onReceiveResult(resultCode, resultData);
+ if (resultCode == DownloadService.UPDATE_PROGRESS) {
+ int progress = resultData.getInt("progress");
+ requestListener.onRequestProgressUpdate(progress);
+ if (progress == 100) {
+ requestListener.onRequestFinished("Completed");
+ }
+ }
+ }
+}
diff --git a/DownloadImages/app/src/main/java/com/walmart/downloadimages/services/DownAsync.java b/DownloadImages/app/src/main/java/com/walmart/downloadimages/services/DownAsync.java
new file mode 100644
index 0000000..9f0acfd
--- /dev/null
+++ b/DownloadImages/app/src/main/java/com/walmart/downloadimages/services/DownAsync.java
@@ -0,0 +1,38 @@
+package com.walmart.downloadimages.services;
+
+import android.os.AsyncTask;
+
+import com.walmart.downloadimages.receiver.DownActInterface;
+
+public class DownAsync extends AsyncTask {
+ private DownActInterface downActInterface;
+
+ public DownAsync(DownActInterface downAct) {
+ downActInterface = downAct;
+ }
+
+ @Override
+ protected void onPreExecute() {
+ super.onPreExecute();
+ }
+
+ @Override
+ protected void onProgressUpdate(Void... values) {
+ super.onProgressUpdate(values);
+ }
+
+ @Override
+ protected void onPostExecute(String s) {
+ super.onPostExecute(s);
+
+ }
+
+ @Override
+ protected String doInBackground(Integer... integers) {
+ downActInterface.onFinishTask("Hello Wordld" + integers);
+ return "Hello Wordld" + integers;
+ }
+}
+
+
+// Retrofit
\ No newline at end of file
diff --git a/DownloadImages/app/src/main/java/com/walmart/downloadimages/services/DownloadService.java b/DownloadImages/app/src/main/java/com/walmart/downloadimages/services/DownloadService.java
new file mode 100644
index 0000000..396c3d2
--- /dev/null
+++ b/DownloadImages/app/src/main/java/com/walmart/downloadimages/services/DownloadService.java
@@ -0,0 +1,63 @@
+package com.walmart.downloadimages.services;
+
+import android.app.IntentService;
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.Environment;
+import android.os.ResultReceiver;
+import android.util.Log;
+
+import java.io.BufferedInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
+import java.net.URLConnection;
+
+public class DownloadService extends IntentService {
+ public static final int UPDATE_PROGRESS = 8344;
+
+ public DownloadService() {
+ super("DownloadService");
+ }
+
+ @Override
+ protected void onHandleIntent(Intent intent) {
+ String urlToDownload = intent.getStringExtra("url");
+ ResultReceiver receiver = (ResultReceiver) intent.getParcelableExtra("receiver");
+ try {
+ URL url = new URL(urlToDownload);
+ URLConnection connection = url.openConnection();
+ connection.connect();
+ String fileName = urlToDownload.substring(urlToDownload.lastIndexOf('/'));
+ int fileLength = connection.getContentLength();
+
+ InputStream input = new BufferedInputStream(connection.getInputStream());
+ OutputStream output = new FileOutputStream(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MOVIES)
+ +fileName);
+
+ byte data[] = new byte[1024];
+ long total = 0;
+ int count;
+ while ((count = input.read(data)) != -1) {
+ total += count;
+ Bundle resultData = new Bundle();
+ resultData.putInt("progress", (int) (total * 100 / fileLength));
+ receiver.send(UPDATE_PROGRESS, resultData);
+ output.write(data, 0, count);
+ Log.d("Service", resultData + " "+total);
+ }
+
+ output.flush();
+ output.close();
+ input.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ Bundle resultData = new Bundle();
+ resultData.putInt("progress", 100);
+ receiver.send(UPDATE_PROGRESS, resultData);
+ }
+}
diff --git a/DownloadImages/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/DownloadImages/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 0000000..c7bd21d
--- /dev/null
+++ b/DownloadImages/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DownloadImages/app/src/main/res/drawable/ic_launcher_background.xml b/DownloadImages/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..d5fccc5
--- /dev/null
+++ b/DownloadImages/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DownloadImages/app/src/main/res/layout/activity_download.xml b/DownloadImages/app/src/main/res/layout/activity_download.xml
new file mode 100644
index 0000000..30d54f8
--- /dev/null
+++ b/DownloadImages/app/src/main/res/layout/activity_download.xml
@@ -0,0 +1,9 @@
+
+
+
+
diff --git a/DownloadImages/app/src/main/res/layout/fragment_network.xml b/DownloadImages/app/src/main/res/layout/fragment_network.xml
new file mode 100644
index 0000000..ae39bb3
--- /dev/null
+++ b/DownloadImages/app/src/main/res/layout/fragment_network.xml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DownloadImages/app/src/main/res/layout/fragment_output.xml b/DownloadImages/app/src/main/res/layout/fragment_output.xml
new file mode 100644
index 0000000..4060479
--- /dev/null
+++ b/DownloadImages/app/src/main/res/layout/fragment_output.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/DownloadImages/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/DownloadImages/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/DownloadImages/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/DownloadImages/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/DownloadImages/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/DownloadImages/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/DownloadImages/app/src/main/res/mipmap-hdpi/ic_launcher.png b/DownloadImages/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..a2f5908
Binary files /dev/null and b/DownloadImages/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/DownloadImages/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/DownloadImages/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 0000000..1b52399
Binary files /dev/null and b/DownloadImages/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/DownloadImages/app/src/main/res/mipmap-mdpi/ic_launcher.png b/DownloadImages/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..ff10afd
Binary files /dev/null and b/DownloadImages/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/DownloadImages/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/DownloadImages/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 0000000..115a4c7
Binary files /dev/null and b/DownloadImages/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/DownloadImages/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/DownloadImages/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..dcd3cd8
Binary files /dev/null and b/DownloadImages/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/DownloadImages/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/DownloadImages/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..459ca60
Binary files /dev/null and b/DownloadImages/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/DownloadImages/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/DownloadImages/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..8ca12fe
Binary files /dev/null and b/DownloadImages/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/DownloadImages/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/DownloadImages/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..8e19b41
Binary files /dev/null and b/DownloadImages/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/DownloadImages/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/DownloadImages/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..b824ebd
Binary files /dev/null and b/DownloadImages/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/DownloadImages/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/DownloadImages/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..4c19a13
Binary files /dev/null and b/DownloadImages/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/DownloadImages/app/src/main/res/values/colors.xml b/DownloadImages/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..3ab3e9c
--- /dev/null
+++ b/DownloadImages/app/src/main/res/values/colors.xml
@@ -0,0 +1,6 @@
+
+
+ #3F51B5
+ #303F9F
+ #FF4081
+
diff --git a/DownloadImages/app/src/main/res/values/strings.xml b/DownloadImages/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..92dee85
--- /dev/null
+++ b/DownloadImages/app/src/main/res/values/strings.xml
@@ -0,0 +1,7 @@
+
+ DownloadImages
+ Enter URL
+ Test Counter
+ Download
+ Please Enter the Link
+
diff --git a/DownloadImages/app/src/main/res/values/styles.xml b/DownloadImages/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..5885930
--- /dev/null
+++ b/DownloadImages/app/src/main/res/values/styles.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
diff --git a/DownloadImages/app/src/test/java/com/walmart/downloadimages/ExampleUnitTest.java b/DownloadImages/app/src/test/java/com/walmart/downloadimages/ExampleUnitTest.java
new file mode 100644
index 0000000..1e8e1ae
--- /dev/null
+++ b/DownloadImages/app/src/test/java/com/walmart/downloadimages/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.walmart.downloadimages;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() throws Exception {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/DownloadImages/build.gradle b/DownloadImages/build.gradle
new file mode 100644
index 0000000..47825b2
--- /dev/null
+++ b/DownloadImages/build.gradle
@@ -0,0 +1,27 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+
+ repositories {
+ google()
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:3.1.0'
+
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ google()
+ jcenter()
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/DownloadImages/gradle.properties b/DownloadImages/gradle.properties
new file mode 100644
index 0000000..aac7c9b
--- /dev/null
+++ b/DownloadImages/gradle.properties
@@ -0,0 +1,17 @@
+# Project-wide Gradle settings.
+
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx1536m
+
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
diff --git a/DownloadImages/gradle/wrapper/gradle-wrapper.jar b/DownloadImages/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..13372ae
Binary files /dev/null and b/DownloadImages/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/DownloadImages/gradle/wrapper/gradle-wrapper.properties b/DownloadImages/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..5dac3bb
--- /dev/null
+++ b/DownloadImages/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Tue Mar 27 09:31:35 IST 2018
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
diff --git a/DownloadImages/gradlew b/DownloadImages/gradlew
new file mode 100644
index 0000000..9d82f78
--- /dev/null
+++ b/DownloadImages/gradlew
@@ -0,0 +1,160 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/DownloadImages/gradlew.bat b/DownloadImages/gradlew.bat
new file mode 100644
index 0000000..8a0b282
--- /dev/null
+++ b/DownloadImages/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/DownloadImages/settings.gradle b/DownloadImages/settings.gradle
new file mode 100644
index 0000000..e7b4def
--- /dev/null
+++ b/DownloadImages/settings.gradle
@@ -0,0 +1 @@
+include ':app'
diff --git a/FCMExample/.idea/misc.xml b/FCMExample/.idea/misc.xml
index c0f68ed..b0c7b20 100644
--- a/FCMExample/.idea/misc.xml
+++ b/FCMExample/.idea/misc.xml
@@ -5,22 +5,26 @@
-
+
+
+
-
+
+
+
diff --git a/FCMExample/app/build.gradle b/FCMExample/app/build.gradle
index 16b321f..9c13154 100644
--- a/FCMExample/app/build.gradle
+++ b/FCMExample/app/build.gradle
@@ -38,8 +38,8 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
- implementation 'com.google.firebase:firebase-messaging:15.0.0'
- implementation 'com.google.firebase:firebase-core:15.0.0'
+ implementation 'com.google.firebase:firebase-messaging:17.3.1'
+ implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.google.android.gms:play-services-maps:15.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
diff --git a/FCMExample/app/google-services.json b/FCMExample/app/google-services.json
index 894fb28..94af94f 100644
--- a/FCMExample/app/google-services.json
+++ b/FCMExample/app/google-services.json
@@ -1,27 +1,27 @@
{
"project_info": {
- "project_number": "172390265560",
- "firebase_url": "https://tecmaxfcm.firebaseio.com",
- "project_id": "tecmaxfcm",
- "storage_bucket": "tecmaxfcm.appspot.com"
+ "project_number": "265792995462",
+ "firebase_url": "https://fcm-example-2bda9.firebaseio.com",
+ "project_id": "fcm-example-2bda9",
+ "storage_bucket": "fcm-example-2bda9.appspot.com"
},
"client": [
{
"client_info": {
- "mobilesdk_app_id": "1:172390265560:android:a9e3dd3041d8b8a9",
+ "mobilesdk_app_id": "1:265792995462:android:a9e3dd3041d8b8a9",
"android_client_info": {
"package_name": "com.example.mahesh.fcmexample"
}
},
"oauth_client": [
{
- "client_id": "172390265560-qi1ciinbrq7amg5u82ler85r4n8uklhs.apps.googleusercontent.com",
+ "client_id": "265792995462-olv8ssepjcbi9odpdvrgifvl9sid1u32.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
- "current_key": "AIzaSyBqHvYNN9DuLrb9N8KAbNLqw4wvNK2Th2U"
+ "current_key": "AIzaSyA-n_Bh0RlYwtxZlF7D8PiUCWXzjd79ayA"
}
],
"services": {
diff --git a/FireBaseTecmax/.gitignore b/FireBaseTecmax/.gitignore
new file mode 100644
index 0000000..fd45b12
--- /dev/null
+++ b/FireBaseTecmax/.gitignore
@@ -0,0 +1,11 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches/build_file_checksums.ser
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
diff --git a/FireBaseTecmax/.idea/codeStyles/Project.xml b/FireBaseTecmax/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..30aa626
--- /dev/null
+++ b/FireBaseTecmax/.idea/codeStyles/Project.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/FireBaseTecmax/.idea/gradle.xml b/FireBaseTecmax/.idea/gradle.xml
new file mode 100644
index 0000000..7ac24c7
--- /dev/null
+++ b/FireBaseTecmax/.idea/gradle.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/FireBaseTecmax/.idea/misc.xml b/FireBaseTecmax/.idea/misc.xml
new file mode 100644
index 0000000..e0d5b93
--- /dev/null
+++ b/FireBaseTecmax/.idea/misc.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/FireBaseTecmax/.idea/runConfigurations.xml b/FireBaseTecmax/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/FireBaseTecmax/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/FireBaseTecmax/app/.gitignore b/FireBaseTecmax/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/FireBaseTecmax/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/FireBaseTecmax/app/build.gradle b/FireBaseTecmax/app/build.gradle
new file mode 100644
index 0000000..175cbfc
--- /dev/null
+++ b/FireBaseTecmax/app/build.gradle
@@ -0,0 +1,31 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 28
+ defaultConfig {
+ applicationId "com.mearsk.firebasetecmax"
+ minSdkVersion 15
+ targetSdkVersion 28
+ versionCode 1
+ versionName "1.0"
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+ implementation 'com.android.support:appcompat-v7:28.0.0'
+ implementation 'com.android.support.constraint:constraint-layout:1.1.3'
+ implementation 'com.google.firebase:firebase-core:16.0.1'
+ implementation 'com.google.firebase:firebase-messaging:17.3.4'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'com.android.support.test:runner:1.0.2'
+ androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
+}
+apply plugin: 'com.google.gms.google-services'
\ No newline at end of file
diff --git a/FireBaseTecmax/app/google-services.json b/FireBaseTecmax/app/google-services.json
new file mode 100644
index 0000000..bc9f37b
--- /dev/null
+++ b/FireBaseTecmax/app/google-services.json
@@ -0,0 +1,42 @@
+{
+ "project_info": {
+ "project_number": "263809971822",
+ "firebase_url": "https://fir-tecmax.firebaseio.com",
+ "project_id": "fir-tecmax",
+ "storage_bucket": "fir-tecmax.appspot.com"
+ },
+ "client": [
+ {
+ "client_info": {
+ "mobilesdk_app_id": "1:263809971822:android:f15af3bab92b8a09",
+ "android_client_info": {
+ "package_name": "com.mearsk.firebasetecmax"
+ }
+ },
+ "oauth_client": [
+ {
+ "client_id": "263809971822-dt0gegn8bt2o8mbkgnrmoah4t0hvn3u3.apps.googleusercontent.com",
+ "client_type": 3
+ }
+ ],
+ "api_key": [
+ {
+ "current_key": "AIzaSyDm65kQb0diK3KgboA44esZY797VbxkV-c"
+ }
+ ],
+ "services": {
+ "analytics_service": {
+ "status": 1
+ },
+ "appinvite_service": {
+ "status": 1,
+ "other_platform_oauth_client": []
+ },
+ "ads_service": {
+ "status": 2
+ }
+ }
+ }
+ ],
+ "configuration_version": "1"
+}
\ No newline at end of file
diff --git a/FireBaseTecmax/app/proguard-rules.pro b/FireBaseTecmax/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/FireBaseTecmax/app/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# 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 *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/FireBaseTecmax/app/src/androidTest/java/com/mearsk/firebasetecmax/ExampleInstrumentedTest.java b/FireBaseTecmax/app/src/androidTest/java/com/mearsk/firebasetecmax/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..defb732
--- /dev/null
+++ b/FireBaseTecmax/app/src/androidTest/java/com/mearsk/firebasetecmax/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.mearsk.firebasetecmax;
+
+import android.content.Context;
+import android.support.test.InstrumentationRegistry;
+import android.support.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getTargetContext();
+
+ assertEquals("com.mearsk.firebasetecmax", appContext.getPackageName());
+ }
+}
diff --git a/FireBaseTecmax/app/src/main/AndroidManifest.xml b/FireBaseTecmax/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..55a0236
--- /dev/null
+++ b/FireBaseTecmax/app/src/main/AndroidManifest.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/FireBaseTecmax/app/src/main/java/com/mearsk/firebasetecmax/FirebaseActivity.java b/FireBaseTecmax/app/src/main/java/com/mearsk/firebasetecmax/FirebaseActivity.java
new file mode 100644
index 0000000..b6ea07e
--- /dev/null
+++ b/FireBaseTecmax/app/src/main/java/com/mearsk/firebasetecmax/FirebaseActivity.java
@@ -0,0 +1,13 @@
+package com.mearsk.firebasetecmax;
+
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+
+public class FirebaseActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_firebase);
+ }
+}
diff --git a/FireBaseTecmax/app/src/main/java/com/mearsk/firebasetecmax/MyFirebaseMessagingService.java b/FireBaseTecmax/app/src/main/java/com/mearsk/firebasetecmax/MyFirebaseMessagingService.java
new file mode 100644
index 0000000..13c5669
--- /dev/null
+++ b/FireBaseTecmax/app/src/main/java/com/mearsk/firebasetecmax/MyFirebaseMessagingService.java
@@ -0,0 +1,51 @@
+package com.mearsk.firebasetecmax;
+
+import android.app.NotificationManager;
+import android.app.PendingIntent;
+import android.content.Context;
+import android.content.Intent;
+import android.media.RingtoneManager;
+import android.net.Uri;
+import android.support.v4.app.NotificationCompat;
+import android.util.Log;
+
+import com.google.firebase.messaging.FirebaseMessagingService;
+import com.google.firebase.messaging.RemoteMessage;
+
+public class MyFirebaseMessagingService extends FirebaseMessagingService {
+ final String TAG = MyFirebaseMessagingService.class.getSimpleName();
+
+ @Override
+ public void onMessageReceived(RemoteMessage remoteMessage) {
+ super.onMessageReceived(remoteMessage);
+ Log.e(TAG, "From: " + remoteMessage.getFrom());
+ Log.e(TAG, "Notification Message Body: " + remoteMessage.getNotification().getBody());
+ //create notification
+ createNotification(remoteMessage.getNotification().getBody(), remoteMessage.getFrom());
+ }
+
+
+ private void createNotification(String messageBody, String title) {
+ Intent intent = new Intent(this, FirebaseActivity.class);
+ intent.putExtra("Body", messageBody);
+ intent.putExtra("title", title);
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+ PendingIntent resultIntent = PendingIntent.getActivity(this,
+ 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
+
+ Uri notificationSoundURI = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE);
+
+ NotificationCompat.Builder mNotificationBuilder = new NotificationCompat.Builder(this)
+ .setSmallIcon(R.mipmap.ic_launcher)
+ .setContentTitle("Tecmax")
+ .setContentText(messageBody)
+ .setAutoCancel(true)
+ .setSound(notificationSoundURI)
+ .setContentIntent(resultIntent);
+
+ NotificationManager notificationManager =
+ (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
+
+ notificationManager.notify(0, mNotificationBuilder.build());
+ }
+}
diff --git a/FireBaseTecmax/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/FireBaseTecmax/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 0000000..1f6bb29
--- /dev/null
+++ b/FireBaseTecmax/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/FireBaseTecmax/app/src/main/res/drawable/ic_launcher_background.xml b/FireBaseTecmax/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..0d025f9
--- /dev/null
+++ b/FireBaseTecmax/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/FireBaseTecmax/app/src/main/res/layout/activity_firebase.xml b/FireBaseTecmax/app/src/main/res/layout/activity_firebase.xml
new file mode 100644
index 0000000..b0fb329
--- /dev/null
+++ b/FireBaseTecmax/app/src/main/res/layout/activity_firebase.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/FireBaseTecmax/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/FireBaseTecmax/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/FireBaseTecmax/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/FireBaseTecmax/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/FireBaseTecmax/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/FireBaseTecmax/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/FireBaseTecmax/app/src/main/res/mipmap-hdpi/ic_launcher.png b/FireBaseTecmax/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..898f3ed
Binary files /dev/null and b/FireBaseTecmax/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/FireBaseTecmax/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/FireBaseTecmax/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 0000000..dffca36
Binary files /dev/null and b/FireBaseTecmax/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/FireBaseTecmax/app/src/main/res/mipmap-mdpi/ic_launcher.png b/FireBaseTecmax/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..64ba76f
Binary files /dev/null and b/FireBaseTecmax/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/FireBaseTecmax/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/FireBaseTecmax/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 0000000..dae5e08
Binary files /dev/null and b/FireBaseTecmax/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/FireBaseTecmax/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/FireBaseTecmax/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..e5ed465
Binary files /dev/null and b/FireBaseTecmax/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/FireBaseTecmax/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/FireBaseTecmax/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..14ed0af
Binary files /dev/null and b/FireBaseTecmax/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/FireBaseTecmax/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/FireBaseTecmax/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..b0907ca
Binary files /dev/null and b/FireBaseTecmax/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/FireBaseTecmax/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/FireBaseTecmax/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..d8ae031
Binary files /dev/null and b/FireBaseTecmax/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/FireBaseTecmax/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/FireBaseTecmax/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..2c18de9
Binary files /dev/null and b/FireBaseTecmax/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/FireBaseTecmax/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/FireBaseTecmax/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..beed3cd
Binary files /dev/null and b/FireBaseTecmax/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/FireBaseTecmax/app/src/main/res/values/colors.xml b/FireBaseTecmax/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..69b2233
--- /dev/null
+++ b/FireBaseTecmax/app/src/main/res/values/colors.xml
@@ -0,0 +1,6 @@
+
+
+ #008577
+ #00574B
+ #D81B60
+
diff --git a/FireBaseTecmax/app/src/main/res/values/strings.xml b/FireBaseTecmax/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..a1f1e90
--- /dev/null
+++ b/FireBaseTecmax/app/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ FireBaseTecmax
+
diff --git a/FireBaseTecmax/app/src/main/res/values/styles.xml b/FireBaseTecmax/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..5885930
--- /dev/null
+++ b/FireBaseTecmax/app/src/main/res/values/styles.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
diff --git a/FireBaseTecmax/app/src/test/java/com/mearsk/firebasetecmax/ExampleUnitTest.java b/FireBaseTecmax/app/src/test/java/com/mearsk/firebasetecmax/ExampleUnitTest.java
new file mode 100644
index 0000000..fb7462f
--- /dev/null
+++ b/FireBaseTecmax/app/src/test/java/com/mearsk/firebasetecmax/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.mearsk.firebasetecmax;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/FireBaseTecmax/build.gradle b/FireBaseTecmax/build.gradle
new file mode 100644
index 0000000..a9ca315
--- /dev/null
+++ b/FireBaseTecmax/build.gradle
@@ -0,0 +1,27 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+
+ repositories {
+ google()
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:3.2.1'
+ classpath 'com.google.gms:google-services:4.0.1'
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ google()
+ jcenter()
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/FireBaseTecmax/gradle.properties b/FireBaseTecmax/gradle.properties
new file mode 100644
index 0000000..82618ce
--- /dev/null
+++ b/FireBaseTecmax/gradle.properties
@@ -0,0 +1,15 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx1536m
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
+
+
diff --git a/FireBaseTecmax/gradle/wrapper/gradle-wrapper.jar b/FireBaseTecmax/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..f6b961f
Binary files /dev/null and b/FireBaseTecmax/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/FireBaseTecmax/gradle/wrapper/gradle-wrapper.properties b/FireBaseTecmax/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..9a4163a
--- /dev/null
+++ b/FireBaseTecmax/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/FireBaseTecmax/gradlew b/FireBaseTecmax/gradlew
new file mode 100755
index 0000000..cccdd3d
--- /dev/null
+++ b/FireBaseTecmax/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/FireBaseTecmax/gradlew.bat b/FireBaseTecmax/gradlew.bat
new file mode 100644
index 0000000..f955316
--- /dev/null
+++ b/FireBaseTecmax/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/FireBaseTecmax/settings.gradle b/FireBaseTecmax/settings.gradle
new file mode 100644
index 0000000..e7b4def
--- /dev/null
+++ b/FireBaseTecmax/settings.gradle
@@ -0,0 +1 @@
+include ':app'
diff --git a/Header_Footer_Demo/.gitignore b/Header_Footer_Demo/.gitignore
new file mode 100644
index 0000000..9c4de58
--- /dev/null
+++ b/Header_Footer_Demo/.gitignore
@@ -0,0 +1,7 @@
+.gradle
+/local.properties
+/.idea/workspace.xml
+/.idea/libraries
+.DS_Store
+/build
+/captures
diff --git a/Header_Footer_Demo/.idea/codeStyles/Project.xml b/Header_Footer_Demo/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..30aa626
--- /dev/null
+++ b/Header_Footer_Demo/.idea/codeStyles/Project.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Header_Footer_Demo/.idea/gradle.xml b/Header_Footer_Demo/.idea/gradle.xml
new file mode 100644
index 0000000..76a4349
--- /dev/null
+++ b/Header_Footer_Demo/.idea/gradle.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Header_Footer_Demo/.idea/misc.xml b/Header_Footer_Demo/.idea/misc.xml
new file mode 100644
index 0000000..4872587
--- /dev/null
+++ b/Header_Footer_Demo/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Header_Footer_Demo/.idea/modules.xml b/Header_Footer_Demo/.idea/modules.xml
new file mode 100644
index 0000000..b82fe06
--- /dev/null
+++ b/Header_Footer_Demo/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Header_Footer_Demo/.idea/runConfigurations.xml b/Header_Footer_Demo/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/Header_Footer_Demo/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Header_Footer_Demo/Header_Footer_Demo.iml b/Header_Footer_Demo/Header_Footer_Demo.iml
new file mode 100644
index 0000000..0fe7ea9
--- /dev/null
+++ b/Header_Footer_Demo/Header_Footer_Demo.iml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Header_Footer_Demo/app/.gitignore b/Header_Footer_Demo/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/Header_Footer_Demo/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/Header_Footer_Demo/app/app.iml b/Header_Footer_Demo/app/app.iml
new file mode 100644
index 0000000..37c9b0a
--- /dev/null
+++ b/Header_Footer_Demo/app/app.iml
@@ -0,0 +1,101 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ generateDebugAndroidTestSources
+ generateDebugSources
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Header_Footer_Demo/app/build.gradle b/Header_Footer_Demo/app/build.gradle
new file mode 100644
index 0000000..a6982f4
--- /dev/null
+++ b/Header_Footer_Demo/app/build.gradle
@@ -0,0 +1,27 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 23
+ buildToolsVersion "23.0.3"
+
+ defaultConfig {
+ applicationId "com.header_footer_demo"
+ minSdkVersion 8
+ targetSdkVersion 23
+ 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:23.0.1'
+ compile 'com.android.support:design:23.0.1'
+ compile 'com.android.support:recyclerview-v7:23.0.1'
+}
diff --git a/Header_Footer_Demo/app/proguard-rules.pro b/Header_Footer_Demo/app/proguard-rules.pro
new file mode 100644
index 0000000..9c83bcb
--- /dev/null
+++ b/Header_Footer_Demo/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 /Users/admin/Library/Android/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/Header_Footer_Demo/app/src/androidTest/java/com/header_footer_demo/ApplicationTest.java b/Header_Footer_Demo/app/src/androidTest/java/com/header_footer_demo/ApplicationTest.java
new file mode 100644
index 0000000..5dcd7df
--- /dev/null
+++ b/Header_Footer_Demo/app/src/androidTest/java/com/header_footer_demo/ApplicationTest.java
@@ -0,0 +1,13 @@
+package com.header_footer_demo;
+
+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/Header_Footer_Demo/app/src/main/AndroidManifest.xml b/Header_Footer_Demo/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..b5bd767
--- /dev/null
+++ b/Header_Footer_Demo/app/src/main/AndroidManifest.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Header_Footer_Demo/app/src/main/java/com/header_footer_demo/activity/MainActivity.java b/Header_Footer_Demo/app/src/main/java/com/header_footer_demo/activity/MainActivity.java
new file mode 100644
index 0000000..693cc83
--- /dev/null
+++ b/Header_Footer_Demo/app/src/main/java/com/header_footer_demo/activity/MainActivity.java
@@ -0,0 +1,41 @@
+package com.header_footer_demo.activity;
+
+import android.os.Bundle;
+import android.support.design.widget.TabLayout;
+import android.support.v4.view.ViewPager;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.Toolbar;
+
+import com.header_footer_demo.R;
+import com.header_footer_demo.adapters.ViewPagerAdapter;
+import com.header_footer_demo.tabs.ListView_Fragment;
+import com.header_footer_demo.tabs.RecyclerView_Fragment;
+
+public class MainActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+
+ Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
+ setSupportActionBar(toolbar);
+
+ ViewPager viewPager = (ViewPager) findViewById(R.id.viewPager);
+ setupViewPager(viewPager);
+
+ TabLayout tabLayout = (TabLayout) findViewById(R.id.tabLayout);
+ tabLayout.setupWithViewPager(viewPager);//setting tab over viewpager
+
+ }
+
+ //Setting View Pager
+ private void setupViewPager(ViewPager viewPager) {
+ ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager());
+ adapter.addFrag(new ListView_Fragment(), "List View");
+ adapter.addFrag(new RecyclerView_Fragment(), "Recycler View");
+ viewPager.setAdapter(adapter);
+ }
+
+
+}
diff --git a/Header_Footer_Demo/app/src/main/java/com/header_footer_demo/adapters/CustomAdapter.java b/Header_Footer_Demo/app/src/main/java/com/header_footer_demo/adapters/CustomAdapter.java
new file mode 100644
index 0000000..8a8154f
--- /dev/null
+++ b/Header_Footer_Demo/app/src/main/java/com/header_footer_demo/adapters/CustomAdapter.java
@@ -0,0 +1,60 @@
+package com.header_footer_demo.adapters;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.TextView;
+
+import com.header_footer_demo.R;
+import com.header_footer_demo.helper.GenerateRandom_Color;
+
+import java.util.ArrayList;
+
+/**
+ * Created by SONU on 22/05/16.
+ */
+public class CustomAdapter extends BaseAdapter {
+
+
+ private Context context;
+ private ArrayList arrayList;
+ private LayoutInflater inflater;
+
+ public CustomAdapter(Context context, ArrayList arrayList) {
+
+ this.context = context;
+ this.arrayList = arrayList;
+
+ this.inflater = LayoutInflater.from(context);
+ }
+
+ @Override
+ public int getCount() {
+ return arrayList.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ return arrayList.get(position);
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ convertView = inflater.inflate(R.layout.list_item_row, parent, false);
+ TextView text = (TextView) convertView.findViewById(R.id.row_item_text);
+ text.setBackgroundColor(GenerateRandom_Color.generateRandomColor());
+ text.setText(arrayList.get(position));
+
+
+ return convertView;
+ }
+
+
+}
diff --git a/Header_Footer_Demo/app/src/main/java/com/header_footer_demo/adapters/RecyclerView_Adapter.java b/Header_Footer_Demo/app/src/main/java/com/header_footer_demo/adapters/RecyclerView_Adapter.java
new file mode 100644
index 0000000..7660021
--- /dev/null
+++ b/Header_Footer_Demo/app/src/main/java/com/header_footer_demo/adapters/RecyclerView_Adapter.java
@@ -0,0 +1,106 @@
+package com.header_footer_demo.adapters;
+
+import android.content.Context;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import com.header_footer_demo.R;
+import com.header_footer_demo.helper.DemoViewHolder;
+import com.header_footer_demo.helper.GenerateRandom_Color;
+import com.header_footer_demo.helper.RecyclerView_HeaderFooter_Holder;
+
+import java.util.ArrayList;
+
+/**
+ * Created by SONU on 22/05/16.
+ */
+public class RecyclerView_Adapter extends
+ RecyclerView.Adapter {
+ private ArrayList arrayList;
+ private Context context;
+
+ //Type of data in recycler view
+ private static final int TYPE_HEADER = 0;
+ private static final int TYPE_FOOTER = 1;
+ private static final int TYPE_ITEM = 2;
+
+
+ public RecyclerView_Adapter(Context context,
+ ArrayList arrayList) {
+ this.context = context;
+ this.arrayList = arrayList;
+
+ }
+
+
+ @Override
+ public int getItemCount() {
+ return (null != arrayList ? arrayList.size() + 2 : 0);//Add 2 more size to array list for Header and Footer
+
+ }
+
+ @Override
+ public int getItemViewType(int position) {
+ //Return item type according to requirement
+ if (isPositionHeader(position))
+ return TYPE_HEADER;
+ else if (isPositionFooter(position))
+ return TYPE_FOOTER;
+ return TYPE_ITEM;
+
+ }
+
+ //if position is 0 then type is header
+ private boolean isPositionHeader(int position) {
+ return position == 0;
+ }
+
+ //If position is last then type is footer
+ private boolean isPositionFooter(int position) {
+ return position == arrayList.size() + 1;
+ }
+
+ @Override
+ public void onBindViewHolder(RecyclerView.ViewHolder holder,
+ int position) {
+
+ //If instance is DemoViewHolder the type is Item do your stuff over here
+ if (holder instanceof DemoViewHolder) {
+ ((DemoViewHolder) holder).title.setBackgroundColor(GenerateRandom_Color.generateRandomColor());
+ ((DemoViewHolder) holder).title.setText(arrayList.get(position - 1));//For getting data from array use -1 for getting correct data
+ } else if (holder instanceof RecyclerView_HeaderFooter_Holder) {
+ //Else the type is header
+ if (position == 0)
+ ((RecyclerView_HeaderFooter_Holder) holder).title.setText(context.getResources().getString(R.string.header_view));//if position is 0 set title to header view
+ if (position == getItemCount())
+ ((RecyclerView_HeaderFooter_Holder) holder).title.setText(context.getResources().getString(R.string.footer_view));//if position is equal to total item set title to footer view
+ }
+
+ }
+
+ @Override
+ public RecyclerView.ViewHolder onCreateViewHolder(
+ ViewGroup viewGroup, int viewType) {
+
+ //inflate the item according to item type
+ View itemView;
+
+
+ //Since we are using same holder for both header and footer so we can return same holder
+ if (viewType == TYPE_HEADER || viewType == TYPE_FOOTER) {
+ itemView = LayoutInflater.from(viewGroup.getContext())
+ .inflate(R.layout.header_footer_view, viewGroup, false);
+ return new RecyclerView_HeaderFooter_Holder(itemView);
+ } else if (viewType == TYPE_ITEM) {
+ //inflate your layout and pass it to view holder
+ itemView = LayoutInflater.from(viewGroup.getContext())
+ .inflate(R.layout.list_item_row, viewGroup, false);
+ return new DemoViewHolder(itemView);
+ }
+
+ throw new RuntimeException("there is no type that matches the type " + viewType + " + make sure your using types correctly");//Some error occurs then exception occurs
+
+ }
+}
diff --git a/Header_Footer_Demo/app/src/main/java/com/header_footer_demo/adapters/ViewPagerAdapter.java b/Header_Footer_Demo/app/src/main/java/com/header_footer_demo/adapters/ViewPagerAdapter.java
new file mode 100644
index 0000000..e4eca72
--- /dev/null
+++ b/Header_Footer_Demo/app/src/main/java/com/header_footer_demo/adapters/ViewPagerAdapter.java
@@ -0,0 +1,43 @@
+package com.header_footer_demo.adapters;
+
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentPagerAdapter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by SONU on 22/05/16.
+ */
+public class ViewPagerAdapter extends FragmentPagerAdapter {
+ private final List mFragmentList = new ArrayList<>();//fragment arraylist
+ private final List mFragmentTitleList = new ArrayList<>();//title arraylist
+
+ public ViewPagerAdapter(FragmentManager manager) {
+ super(manager);
+ }
+
+ @Override
+ public Fragment getItem(int position) {
+ return mFragmentList.get(position);
+ }
+
+ @Override
+ public int getCount() {
+ return mFragmentList.size();
+ }
+
+
+ //adding fragments and title method
+ public void addFrag(Fragment fragment, String title) {
+ mFragmentList.add(fragment);
+ mFragmentTitleList.add(title);
+ }
+
+ @Override
+ public CharSequence getPageTitle(int position) {
+ return mFragmentTitleList.get(position);
+ }
+}
+
diff --git a/Header_Footer_Demo/app/src/main/java/com/header_footer_demo/helper/DemoViewHolder.java b/Header_Footer_Demo/app/src/main/java/com/header_footer_demo/helper/DemoViewHolder.java
new file mode 100644
index 0000000..52f2a1a
--- /dev/null
+++ b/Header_Footer_Demo/app/src/main/java/com/header_footer_demo/helper/DemoViewHolder.java
@@ -0,0 +1,19 @@
+package com.header_footer_demo.helper;
+
+import android.support.v7.widget.RecyclerView;
+import android.view.View;
+import android.widget.TextView;
+
+import com.header_footer_demo.R;
+
+/**
+ * Created by SONU on 22/05/16.
+ */
+public class DemoViewHolder extends RecyclerView.ViewHolder {
+ public TextView title;
+
+ public DemoViewHolder(View view) {
+ super(view);
+ this.title = (TextView) view.findViewById(R.id.row_item_text);
+ }
+}
\ No newline at end of file
diff --git a/Header_Footer_Demo/app/src/main/java/com/header_footer_demo/helper/GenerateRandom_Color.java b/Header_Footer_Demo/app/src/main/java/com/header_footer_demo/helper/GenerateRandom_Color.java
new file mode 100644
index 0000000..2a149a7
--- /dev/null
+++ b/Header_Footer_Demo/app/src/main/java/com/header_footer_demo/helper/GenerateRandom_Color.java
@@ -0,0 +1,17 @@
+package com.header_footer_demo.helper;
+
+import android.graphics.Color;
+
+import java.util.Random;
+
+/**
+ * Created by SONU on 22/05/16.
+ */
+public class GenerateRandom_Color {
+
+ //this method will generate random colors
+ public static int generateRandomColor() {
+ Random rnd = new Random();
+ return Color.argb(255, rnd.nextInt(256), rnd.nextInt(256), rnd.nextInt(256));
+ }
+}
diff --git a/Header_Footer_Demo/app/src/main/java/com/header_footer_demo/helper/RecyclerView_HeaderFooter_Holder.java b/Header_Footer_Demo/app/src/main/java/com/header_footer_demo/helper/RecyclerView_HeaderFooter_Holder.java
new file mode 100644
index 0000000..cd152c3
--- /dev/null
+++ b/Header_Footer_Demo/app/src/main/java/com/header_footer_demo/helper/RecyclerView_HeaderFooter_Holder.java
@@ -0,0 +1,21 @@
+package com.header_footer_demo.helper;
+
+import android.support.v7.widget.RecyclerView;
+import android.view.View;
+import android.widget.TextView;
+
+import com.header_footer_demo.R;
+
+
+/**
+ * Created by SONU on 01/04/16.
+ */
+public class RecyclerView_HeaderFooter_Holder extends RecyclerView.ViewHolder {
+ public TextView title;
+
+ public RecyclerView_HeaderFooter_Holder(View itemView) {
+ super(itemView);
+
+ title = (TextView) itemView.findViewById(R.id.header_footer_title);
+ }
+}
\ No newline at end of file
diff --git a/Header_Footer_Demo/app/src/main/java/com/header_footer_demo/tabs/ListView_Fragment.java b/Header_Footer_Demo/app/src/main/java/com/header_footer_demo/tabs/ListView_Fragment.java
new file mode 100644
index 0000000..4a1a21d
--- /dev/null
+++ b/Header_Footer_Demo/app/src/main/java/com/header_footer_demo/tabs/ListView_Fragment.java
@@ -0,0 +1,71 @@
+package com.header_footer_demo.tabs;
+
+import android.content.Context;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ListView;
+import android.widget.TextView;
+
+import com.header_footer_demo.R;
+import com.header_footer_demo.adapters.CustomAdapter;
+
+import java.util.ArrayList;
+
+/**
+ * Created by SONU on 22/05/16.
+ */
+public class ListView_Fragment extends Fragment {
+
+ private static View view;
+ private static ListView listView;
+
+ public ListView_Fragment() {
+ }
+
+ @Nullable
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ view = inflater.inflate(R.layout.listview_layout, container, false);
+ setUpListView();
+ return view;
+ }
+
+ //Set Up list view
+ private void setUpListView() {
+
+ listView = (ListView) view
+ .findViewById(R.id.list_view);
+
+ addHeaderFooterView();//Add header and footer before adding data to list view
+
+ ArrayList arrayList = new ArrayList<>();
+ for (int i = 1; i <= 20; i++) {
+ arrayList.add("ITEM " + i);//Adding items to recycler view
+ }
+
+ CustomAdapter adapter = new CustomAdapter( getActivity(), arrayList);
+ listView.setAdapter(adapter);// set adapter on listview
+ adapter.notifyDataSetChanged();
+ }
+
+//Add header and footer view
+ private void addHeaderFooterView() {
+ LayoutInflater inflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+
+ //Header View
+ View headerView = inflater.inflate(R.layout.header_footer_view, null, false);
+ TextView headerTitle = (TextView) headerView.findViewById(R.id.header_footer_title);
+ headerTitle.setText(getActivity().getResources().getString(R.string.header_view));//set the text to Header View
+ listView.addHeaderView(headerView);//Add view to list view as header view
+
+ View footerView = inflater.inflate(R.layout.header_footer_view, null, false);
+ TextView footerTitle = (TextView) footerView.findViewById(R.id.header_footer_title);
+ footerTitle.setText(getActivity().getResources().getString(R.string.footer_view));//set the text to Footer View
+ listView.addFooterView(footerView);//Add view to list view as footer view
+
+ }
+}
diff --git a/Header_Footer_Demo/app/src/main/java/com/header_footer_demo/tabs/RecyclerView_Fragment.java b/Header_Footer_Demo/app/src/main/java/com/header_footer_demo/tabs/RecyclerView_Fragment.java
new file mode 100644
index 0000000..d48c2e1
--- /dev/null
+++ b/Header_Footer_Demo/app/src/main/java/com/header_footer_demo/tabs/RecyclerView_Fragment.java
@@ -0,0 +1,111 @@
+package com.header_footer_demo.tabs;
+
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
+import android.support.v7.widget.GridLayoutManager;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.ViewGroup;
+
+import com.header_footer_demo.R;
+import com.header_footer_demo.adapters.RecyclerView_Adapter;
+
+import java.util.ArrayList;
+
+/**
+ * Created by SONU on 22/05/16.
+ */
+public class RecyclerView_Fragment extends Fragment {
+
+ private static View view;
+ private static RecyclerView recyclerView;
+ private boolean isListType = true;
+
+ public RecyclerView_Fragment() {
+ }
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setHasOptionsMenu(true);//call this method to implement option menu over fragment
+
+ }
+
+ @Nullable
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ view = inflater.inflate(R.layout.recyclerview_layout, container, false);
+ setRecyclerView();
+ return view;
+ }
+
+ //Setting recycler view
+ private void setRecyclerView() {
+
+ recyclerView = (RecyclerView) view
+ .findViewById(R.id.recycler_view);
+ recyclerView.setHasFixedSize(true);
+ recyclerView
+ .setLayoutManager(new LinearLayoutManager(getActivity()));//Linear Items
+
+
+ ArrayList arrayList = new ArrayList<>();
+ for (int i = 1; i <= 20; i++) {
+ arrayList.add("ITEM " + i);//Adding items to recycler view
+ }
+ RecyclerView_Adapter adapter = new RecyclerView_Adapter(getActivity(), arrayList);
+ recyclerView.setAdapter(adapter);// set adapter on recycler view
+
+ }
+
+ //Toggle recycler view between List and Grid Type
+ private void toggleRecyclerView(boolean isList) {
+ isListType = isList;//set the current type is list or not
+ if (isList)
+ recyclerView
+ .setLayoutManager(new LinearLayoutManager(getActivity()));//Linear Items
+ else
+ recyclerView
+ .setLayoutManager(new GridLayoutManager(getActivity(), 2));//Grid Items
+ }
+
+ @Override
+ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+ super.onCreateOptionsMenu(menu, inflater);
+ inflater.inflate(R.menu.menu_main, menu);//Inflate menu
+ onPrepareOptionsMenu(menu);//call prepare menu so that title will change according to current type
+ }
+
+ @Override
+ public void onPrepareOptionsMenu(Menu menu) {
+ super.onPrepareOptionsMenu(menu);
+ MenuItem item = menu.findItem(R.id.action_toggle);//find menu id
+ //If current type is not list then set to list else by default is grid only
+ if (!isListType)
+ item.setTitle(getActivity().getResources().getString(R.string.list));
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+ case R.id.action_toggle:
+
+ //toggle the recycler view type and change the menu text also
+ if (isListType) {
+ item.setTitle(getActivity().getResources().getString(R.string.list));
+ toggleRecyclerView(false);
+ } else {
+ item.setTitle(getActivity().getResources().getString(R.string.grid));
+ toggleRecyclerView(true);
+ }
+ break;
+ }
+ return super.onOptionsItemSelected(item);
+ }
+}
diff --git a/Header_Footer_Demo/app/src/main/res/layout/activity_main.xml b/Header_Footer_Demo/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..614ae2d
--- /dev/null
+++ b/Header_Footer_Demo/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Header_Footer_Demo/app/src/main/res/layout/header_footer_view.xml b/Header_Footer_Demo/app/src/main/res/layout/header_footer_view.xml
new file mode 100644
index 0000000..90eb8a3
--- /dev/null
+++ b/Header_Footer_Demo/app/src/main/res/layout/header_footer_view.xml
@@ -0,0 +1,11 @@
+
+
\ No newline at end of file
diff --git a/Header_Footer_Demo/app/src/main/res/layout/list_item_row.xml b/Header_Footer_Demo/app/src/main/res/layout/list_item_row.xml
new file mode 100644
index 0000000..f77e2c5
--- /dev/null
+++ b/Header_Footer_Demo/app/src/main/res/layout/list_item_row.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
diff --git a/Header_Footer_Demo/app/src/main/res/layout/listview_layout.xml b/Header_Footer_Demo/app/src/main/res/layout/listview_layout.xml
new file mode 100644
index 0000000..6a08208
--- /dev/null
+++ b/Header_Footer_Demo/app/src/main/res/layout/listview_layout.xml
@@ -0,0 +1,8 @@
+
+
+
diff --git a/Header_Footer_Demo/app/src/main/res/layout/recyclerview_layout.xml b/Header_Footer_Demo/app/src/main/res/layout/recyclerview_layout.xml
new file mode 100644
index 0000000..fdec0a2
--- /dev/null
+++ b/Header_Footer_Demo/app/src/main/res/layout/recyclerview_layout.xml
@@ -0,0 +1,6 @@
+
+
diff --git a/Header_Footer_Demo/app/src/main/res/menu/menu_main.xml b/Header_Footer_Demo/app/src/main/res/menu/menu_main.xml
new file mode 100644
index 0000000..cb2b5fe
--- /dev/null
+++ b/Header_Footer_Demo/app/src/main/res/menu/menu_main.xml
@@ -0,0 +1,7 @@
+
diff --git a/Header_Footer_Demo/app/src/main/res/mipmap-hdpi/ic_launcher.png b/Header_Footer_Demo/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..cde69bc
Binary files /dev/null and b/Header_Footer_Demo/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/Header_Footer_Demo/app/src/main/res/mipmap-mdpi/ic_launcher.png b/Header_Footer_Demo/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..c133a0c
Binary files /dev/null and b/Header_Footer_Demo/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/Header_Footer_Demo/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/Header_Footer_Demo/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..bfa42f0
Binary files /dev/null and b/Header_Footer_Demo/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/Header_Footer_Demo/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/Header_Footer_Demo/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..324e72c
Binary files /dev/null and b/Header_Footer_Demo/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/Header_Footer_Demo/app/src/main/res/values-v21/styles.xml b/Header_Footer_Demo/app/src/main/res/values-v21/styles.xml
new file mode 100644
index 0000000..5893c74
--- /dev/null
+++ b/Header_Footer_Demo/app/src/main/res/values-v21/styles.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Header_Footer_Demo/app/src/main/res/values-w820dp/dimens.xml b/Header_Footer_Demo/app/src/main/res/values-w820dp/dimens.xml
new file mode 100644
index 0000000..63fc816
--- /dev/null
+++ b/Header_Footer_Demo/app/src/main/res/values-w820dp/dimens.xml
@@ -0,0 +1,6 @@
+
+
+ 64dp
+
diff --git a/Header_Footer_Demo/app/src/main/res/values/colors.xml b/Header_Footer_Demo/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..7b82e55
--- /dev/null
+++ b/Header_Footer_Demo/app/src/main/res/values/colors.xml
@@ -0,0 +1,10 @@
+
+
+ #D32F2F
+ #C62828
+ #FFFFFF
+ #FFFFFF
+ #000000
+ #F44336
+ #03A9F4
+
diff --git a/Header_Footer_Demo/app/src/main/res/values/dimens.xml b/Header_Footer_Demo/app/src/main/res/values/dimens.xml
new file mode 100644
index 0000000..47c8224
--- /dev/null
+++ b/Header_Footer_Demo/app/src/main/res/values/dimens.xml
@@ -0,0 +1,5 @@
+
+
+ 16dp
+ 16dp
+
diff --git a/Header_Footer_Demo/app/src/main/res/values/strings.xml b/Header_Footer_Demo/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..40de331
--- /dev/null
+++ b/Header_Footer_Demo/app/src/main/res/values/strings.xml
@@ -0,0 +1,10 @@
+
+ Header Footer Demo
+
+ Hello world!
+ Settings
+ Header View
+ Footer View
+ List
+ Grid
+
diff --git a/Header_Footer_Demo/app/src/main/res/values/styles.xml b/Header_Footer_Demo/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..276fa2a
--- /dev/null
+++ b/Header_Footer_Demo/app/src/main/res/values/styles.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
diff --git a/Header_Footer_Demo/build.gradle b/Header_Footer_Demo/build.gradle
new file mode 100644
index 0000000..9405f3f
--- /dev/null
+++ b/Header_Footer_Demo/build.gradle
@@ -0,0 +1,19 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+ repositories {
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:1.2.3'
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ jcenter()
+ }
+}
diff --git a/Header_Footer_Demo/gradle.properties b/Header_Footer_Demo/gradle.properties
new file mode 100644
index 0000000..1d3591c
--- /dev/null
+++ b/Header_Footer_Demo/gradle.properties
@@ -0,0 +1,18 @@
+# Project-wide Gradle settings.
+
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+# Default value: -Xmx10248m -XX:MaxPermSize=256m
+# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
+
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
\ No newline at end of file
diff --git a/Header_Footer_Demo/gradle/wrapper/gradle-wrapper.jar b/Header_Footer_Demo/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..f6b961f
Binary files /dev/null and b/Header_Footer_Demo/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/Header_Footer_Demo/gradle/wrapper/gradle-wrapper.properties b/Header_Footer_Demo/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..86a2c6a
--- /dev/null
+++ b/Header_Footer_Demo/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Thu Oct 04 12:21:38 IST 2018
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.2-all.zip
diff --git a/Header_Footer_Demo/gradlew b/Header_Footer_Demo/gradlew
new file mode 100755
index 0000000..cccdd3d
--- /dev/null
+++ b/Header_Footer_Demo/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/Header_Footer_Demo/gradlew.bat b/Header_Footer_Demo/gradlew.bat
new file mode 100644
index 0000000..f955316
--- /dev/null
+++ b/Header_Footer_Demo/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/Header_Footer_Demo/settings.gradle b/Header_Footer_Demo/settings.gradle
new file mode 100644
index 0000000..e7b4def
--- /dev/null
+++ b/Header_Footer_Demo/settings.gradle
@@ -0,0 +1 @@
+include ':app'
diff --git a/Henna/.gitignore b/Henna/.gitignore
new file mode 100644
index 0000000..39fb081
--- /dev/null
+++ b/Henna/.gitignore
@@ -0,0 +1,9 @@
+*.iml
+.gradle
+/local.properties
+/.idea/workspace.xml
+/.idea/libraries
+.DS_Store
+/build
+/captures
+.externalNativeBuild
diff --git a/Henna/.idea/caches/build_file_checksums.ser b/Henna/.idea/caches/build_file_checksums.ser
new file mode 100644
index 0000000..d2e1cca
Binary files /dev/null and b/Henna/.idea/caches/build_file_checksums.ser differ
diff --git a/Henna/.idea/codeStyles/Project.xml b/Henna/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..30aa626
--- /dev/null
+++ b/Henna/.idea/codeStyles/Project.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Henna/.idea/gradle.xml b/Henna/.idea/gradle.xml
new file mode 100644
index 0000000..2996d53
--- /dev/null
+++ b/Henna/.idea/gradle.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Henna/.idea/misc.xml b/Henna/.idea/misc.xml
new file mode 100644
index 0000000..af0bbdd
--- /dev/null
+++ b/Henna/.idea/misc.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Henna/.idea/modules.xml b/Henna/.idea/modules.xml
new file mode 100644
index 0000000..92f194c
--- /dev/null
+++ b/Henna/.idea/modules.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Henna/.idea/runConfigurations.xml b/Henna/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/Henna/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Henna/app/.gitignore b/Henna/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/Henna/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/Henna/app/build.gradle b/Henna/app/build.gradle
new file mode 100644
index 0000000..545edf2
--- /dev/null
+++ b/Henna/app/build.gradle
@@ -0,0 +1,42 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 27
+ defaultConfig {
+ applicationId "com.tecmax.henna"
+ minSdkVersion 21
+ targetSdkVersion 27
+ versionCode 1
+ versionName "1.0"
+ multiDexEnabled true
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+ implementation 'com.android.support:appcompat-v7:27.1.1'
+ implementation 'com.android.support.constraint:constraint-layout:1.0.2'
+ implementation 'com.android.support:design:27.1.1'
+ implementation 'com.jakewharton:butterknife:8.8.1'
+ implementation 'com.android.support:support-v4:27.1.1'
+ implementation 'com.google.android.gms:play-services-maps:11.8.0'
+ implementation 'com.google.code.gson:gson:2.7'
+ implementation 'com.squareup.retrofit2:retrofit:2.3.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
+ implementation 'com.android.support:multidex:1.0.3'
+ implementation 'com.android.support:cardview-v7:27.1.1'
+ implementation 'com.android.support:recyclerview-v7:27.1.1'
+ annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
+ implementation 'com.github.bumptech.glide:glide:4.8.0'
+ annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'com.android.support.test:runner:1.0.1'
+ androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
+}
diff --git a/Henna/app/proguard-rules.pro b/Henna/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/Henna/app/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# 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 *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/Henna/app/src/androidTest/java/com/tecmax/henna/ExampleInstrumentedTest.java b/Henna/app/src/androidTest/java/com/tecmax/henna/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..d282888
--- /dev/null
+++ b/Henna/app/src/androidTest/java/com/tecmax/henna/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.tecmax.henna;
+
+import android.content.Context;
+import android.support.test.InstrumentationRegistry;
+import android.support.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() throws Exception {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getTargetContext();
+
+ assertEquals("com.tecmax.henna", appContext.getPackageName());
+ }
+}
diff --git a/Henna/app/src/debug/res/values/google_maps_api.xml b/Henna/app/src/debug/res/values/google_maps_api.xml
new file mode 100644
index 0000000..e2877c5
--- /dev/null
+++ b/Henna/app/src/debug/res/values/google_maps_api.xml
@@ -0,0 +1,24 @@
+
+
+ AIzaSyC0OfO_ksiCm6AcDn6HrJdDNqGNBAICmZ4
+
diff --git a/Henna/app/src/main/AndroidManifest.xml b/Henna/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..0632f2d
--- /dev/null
+++ b/Henna/app/src/main/AndroidManifest.xml
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Henna/app/src/main/java/com/tecmax/henna/HomeActivity.java b/Henna/app/src/main/java/com/tecmax/henna/HomeActivity.java
new file mode 100644
index 0000000..14326cd
--- /dev/null
+++ b/Henna/app/src/main/java/com/tecmax/henna/HomeActivity.java
@@ -0,0 +1,105 @@
+package com.tecmax.henna;
+
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.v7.app.AlertDialog;
+import android.support.v7.app.AppCompatActivity;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.RatingBar;
+import android.widget.SeekBar;
+import android.widget.Spinner;
+import android.widget.Toast;
+
+public class HomeActivity extends AppCompatActivity {
+ SeekBar sb;
+ RatingBar ratingBar;
+ Button button;
+ Spinner state;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_home);
+ sb = findViewById(R.id.sbSeek);
+ button = findViewById(R.id.btAlert);
+ state = findViewById(R.id.spState);
+ sb.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
+ int count = 0;
+
+ @Override
+ public void onProgressChanged(SeekBar seekBar, int position, boolean b) {
+ count = position;
+ Toast.makeText(HomeActivity.this, "Positions on Progress " + count, Toast.LENGTH_SHORT).show();
+ }
+
+ @Override
+ public void onStartTrackingTouch(SeekBar seekBar) {
+ Toast.makeText(HomeActivity.this, "Positions on Start " + count, Toast.LENGTH_SHORT).show();
+ }
+
+ @Override
+ public void onStopTrackingTouch(SeekBar seekBar) {
+ Toast.makeText(HomeActivity.this, "Positions on Stop " + count, Toast.LENGTH_SHORT).show();
+ }
+ });
+ ratingBar = findViewById(R.id.rbstar);
+ ratingBar.setOnRatingBarChangeListener(new RatingBar.OnRatingBarChangeListener() {
+ @Override
+ public void onRatingChanged(RatingBar ratingBar, float v, boolean b) {
+ Toast.makeText(HomeActivity.this, "rated " + ratingBar.getRating(), Toast.LENGTH_SHORT).show();
+
+ }
+ });
+ button.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ showPopUp();
+ }
+ });
+
+ /**Spinner Data Inserting**/
+ String[] stateList = {"KA", "TN", "TS", "AP", "UP", "DL", "KL"};
+ final ArrayAdapter adapter = new ArrayAdapter(this, android.R.layout.simple_list_item_1, stateList);
+ state.setAdapter(adapter);
+
+ state.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+ @Override
+ public void onItemSelected(AdapterView> adapterView, View view, int position, long l) {
+ String selectedValue = adapterView.getItemAtPosition(position).toString();
+ Toast.makeText(HomeActivity.this, "Selected is " + selectedValue, Toast.LENGTH_SHORT).show();
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView> adapterView) {
+
+ }
+ });
+ }
+
+ private void showPopUp() {
+ AlertDialog.Builder builder = new AlertDialog.Builder(this);
+ builder.setTitle("Caution");
+ builder.setMessage("Hello Buddies");
+ builder.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialogInterface, int i) {
+ Intent intent = new Intent(HomeActivity.this, TempActivity.class);
+ startActivity(intent);
+ Toast.makeText(HomeActivity.this, "Clicked Yes", Toast.LENGTH_SHORT).show();
+ }
+ });
+ builder.setNegativeButton("No", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialogInterface, int i) {
+ Toast.makeText(HomeActivity.this, "Clicked No", Toast.LENGTH_SHORT).show();
+ }
+ });
+ builder.setCancelable(false);
+ AlertDialog alertDialog = builder.create();
+ alertDialog.show();
+ }
+}
diff --git a/Henna/app/src/main/java/com/tecmax/henna/InstituteActivity.java b/Henna/app/src/main/java/com/tecmax/henna/InstituteActivity.java
new file mode 100644
index 0000000..4c09ae4
--- /dev/null
+++ b/Henna/app/src/main/java/com/tecmax/henna/InstituteActivity.java
@@ -0,0 +1,65 @@
+package com.tecmax.henna;
+
+import android.os.Bundle;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.widget.Toast;
+
+import com.tecmax.henna.adapter.InstituteListAdapter;
+import com.tecmax.henna.retrofit.ApiInterface;
+import com.tecmax.henna.retrofit.BaseClientClass;
+import com.tecmax.henna.retrofit.InstituteList;
+
+import java.util.List;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+
+public class InstituteActivity extends AppCompatActivity {
+ RecyclerView recyclerView;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_institute);
+ recyclerView = findViewById(R.id.recu);
+ RecyclerView.LayoutManager inflater = new LinearLayoutManager(this);
+ recyclerView.setLayoutManager(inflater);
+ dsfsd();
+ }
+
+
+ private void dsfsd() {
+ ApiInterface apiService = BaseClientClass.getBaseClient().create(ApiInterface.class);
+ Call> call = apiService.getInstituteList();
+
+
+ call.enqueue(new Callback>() {
+ @Override
+ public void onResponse(Call> call, Response> response) {
+ if (response.isSuccessful()) {
+ List abc = response.body();
+ setAdap(abc);
+ Toast.makeText(InstituteActivity.this, "Login Successful", Toast.LENGTH_SHORT).show();
+ } else {
+ Toast.makeText(InstituteActivity.this, "Lo8gin Un Successful", Toast.LENGTH_SHORT).show();
+ }
+ }
+
+ @Override
+ public void onFailure(Call> call, Throwable t) {
+ Toast.makeText(InstituteActivity.this, "Invalid", Toast.LENGTH_SHORT).show();
+ }
+ });
+
+
+ }
+
+ public void setAdap(List adap) {
+ InstituteListAdapter listAdapter = new InstituteListAdapter(adap);
+ recyclerView.setAdapter(listAdapter);
+ }
+}
diff --git a/Henna/app/src/main/java/com/tecmax/henna/LoginActivity.java b/Henna/app/src/main/java/com/tecmax/henna/LoginActivity.java
new file mode 100644
index 0000000..6bbaf74
--- /dev/null
+++ b/Henna/app/src/main/java/com/tecmax/henna/LoginActivity.java
@@ -0,0 +1,167 @@
+package com.tecmax.henna;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.AppCompatButton;
+import android.support.v7.widget.AppCompatEditText;
+import android.support.v7.widget.AppCompatTextView;
+import android.util.Log;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.Toast;
+
+import com.google.gson.Gson;
+import com.tecmax.henna.entities.Profile;
+import com.tecmax.henna.maps.LocationActivity;
+import com.tecmax.henna.retrofit.ApiInterface;
+import com.tecmax.henna.retrofit.BaseClientClass;
+import com.tecmax.henna.retrofit.LoginRequest;
+import com.tecmax.henna.retrofit.LoginResponse;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+public class LoginActivity extends AppCompatActivity implements View.OnClickListener {
+ AppCompatEditText username, password;
+ AppCompatButton login;
+ AppCompatTextView createAccount;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_login);
+ initViews();
+ }
+
+ /**
+ * Declaration Of Views
+ **/
+ private void initViews() {
+ username = findViewById(R.id.etUsername);
+ password = findViewById(R.id.etPassword);
+ login = findViewById(R.id.btLogin);
+ createAccount = findViewById(R.id.tvCreateAccount);
+ initClickListeners();
+
+ }
+
+ /**
+ * Declaration Of Click Listners
+ **/
+ private void initClickListeners() {
+ createAccount.setOnClickListener(this);
+ login.setOnClickListener(this);
+ }
+
+ @Override
+ public void onClick(View view) {
+ switch (view.getId()) {
+ case R.id.btLogin:
+ Log.e("Login Page", "Json Handeling");
+ handelJson();
+ validation();
+ break;
+ case R.id.tvCreateAccount:
+// Intent intent = new Intent(this, SignUpActivity.class);
+ Intent intent = new Intent(this, com.tecmax.henna.dab.SignUpActivity.class);
+ startActivity(intent);
+ break;
+ }
+ }
+
+ private void handelJson() {
+ Profile profile = new Profile();
+ Profile.Address address = profile.new Address();
+
+ List phoneList = new ArrayList<>();
+ profile.setName("Harsha");
+ profile.setAge(26);
+ String[] numbers = {"1234567890", "9876543210", "8310701931"};
+ String[] type = {"Home", "Work", "Office"};
+ for (int i = 0; i < numbers.length; i++) {
+ Profile.PhoneNu phone = profile.new PhoneNu();
+ phone.setNumber(numbers[i]);
+ phone.setType(type[i]);
+ phoneList.add(phone);
+ }
+ address.setArea("BTM");
+ address.setCity("Bang");
+ address.setState("KA");
+ profile.setAddress(address);
+ profile.setPhone(phoneList);
+ Gson gson = new Gson();
+ String json = gson.toJson(profile);
+ System.out.println(json);
+ Log.e("Converted JSon", json);
+ Gson g = new Gson();
+ Profile p = g.fromJson(json, Profile.class);
+ }
+
+ /**
+ * Validating Username and Password
+ **/
+ private void validation() {
+ String mUsername = username.getText().toString();
+ String mPassword = password.getText().toString();
+ LoginRequest loginRequest = new LoginRequest();
+ loginRequest.setUserName(mUsername);
+ loginRequest.setPassword(mPassword);
+ ApiInterface apiService = BaseClientClass.getBaseClient()
+ .create(ApiInterface.class);
+ Call call = apiService.authenticateUser(loginRequest);
+ call.enqueue(new Callback() {
+ @Override
+ public void onResponse(Call call, Response response) {
+ if (response.isSuccessful()) {
+ LoginResponse abc = response.body();
+ Toast.makeText(LoginActivity.this, "Login Successful", Toast.LENGTH_SHORT).show();
+ } else {
+ Toast.makeText(LoginActivity.this, "Lo8gin Un Successful", Toast.LENGTH_SHORT).show();
+ }
+ }
+
+ @Override
+ public void onFailure(Call call, Throwable t) {
+ Toast.makeText(LoginActivity.this, "Invalid", Toast.LENGTH_SHORT).show();
+ }
+ });
+
+
+// if (mUsername.isEmpty()){
+// Toast.makeText(this, "Enter Valid Username", Toast.LENGTH_SHORT).show();
+// }else if (mPassword.isEmpty()){
+// Toast.makeText(this, "Enter Valid Password", Toast.LENGTH_SHORT).show();
+// }else if (!mUsername.equals(mPassword)){
+// Toast.makeText(this, "Invalid Username or Password", Toast.LENGTH_SHORT).show();
+// }else{
+// Intent intent = new Intent(this, HomeActivity.class);
+// startActivity(intent);
+// }
+ }
+
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ getMenuInflater().inflate(R.menu.menu_tavcsad, menu);
+ return super.onCreateOptionsMenu(menu);
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+ case R.id.action_settings:
+ startActivity(new Intent(this, WebActivity.class));
+ break;
+ case R.id.action_settings3:
+ startActivity(new Intent(this, LocationActivity.class));
+ break;
+ }
+ return super.onOptionsItemSelected(item);
+ }
+}
diff --git a/Henna/app/src/main/java/com/tecmax/henna/MainActivity.java b/Henna/app/src/main/java/com/tecmax/henna/MainActivity.java
new file mode 100644
index 0000000..b351bfd
--- /dev/null
+++ b/Henna/app/src/main/java/com/tecmax/henna/MainActivity.java
@@ -0,0 +1,112 @@
+package com.tecmax.henna;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.design.widget.FloatingActionButton;
+import android.support.design.widget.NavigationView;
+import android.support.design.widget.Snackbar;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentTransaction;
+import android.support.v4.view.GravityCompat;
+import android.support.v4.widget.DrawerLayout;
+import android.support.v7.app.ActionBarDrawerToggle;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.Toolbar;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+
+import com.tecmax.henna.Nav.ImportActivity;
+import com.tecmax.henna.fragments.GalleryFragment;
+
+public class MainActivity extends AppCompatActivity
+ implements NavigationView.OnNavigationItemSelectedListener {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
+ setSupportActionBar(toolbar);
+
+ FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
+ fab.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
+ .setAction("Action", null).show();
+ }
+ });
+
+ DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
+ ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
+ this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
+ drawer.addDrawerListener(toggle);
+ toggle.syncState();
+
+ NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
+ navigationView.setNavigationItemSelectedListener(this);
+ }
+
+ @Override
+ public void onBackPressed() {
+ DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
+ if (drawer.isDrawerOpen(GravityCompat.START)) {
+ drawer.closeDrawer(GravityCompat.START);
+ } else {
+ super.onBackPressed();
+ }
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ // Inflate the menu; this adds items to the action bar if it is present.
+ getMenuInflater().inflate(R.menu.main, menu);
+ return true;
+ }
+
+ @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);
+ }
+
+ @SuppressWarnings("StatementWithEmptyBody")
+ @Override
+ public boolean onNavigationItemSelected(MenuItem item) {
+ // Handle navigation view item clicks here.
+ int id = item.getItemId();
+
+ if (id == R.id.nav_camera) {
+ startActivity(new Intent(this, ImportActivity.class));
+ } else if (id == R.id.nav_gallery) {
+ FragmentManager fragmentManager = getSupportFragmentManager();
+ FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
+
+ fragmentTransaction.replace(R.id.container, new GalleryFragment(), "a");
+ fragmentTransaction.commit();
+
+ } else if (id == R.id.nav_slideshow) {
+
+ } else if (id == R.id.nav_manage) {
+
+ } else if (id == R.id.nav_share) {
+
+ } else if (id == R.id.nav_send) {
+
+ }
+
+ DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
+ drawer.closeDrawer(GravityCompat.START);
+ return true;
+ }
+}
diff --git a/Henna/app/src/main/java/com/tecmax/henna/MovieDescriptionActivity.java b/Henna/app/src/main/java/com/tecmax/henna/MovieDescriptionActivity.java
new file mode 100644
index 0000000..363799c
--- /dev/null
+++ b/Henna/app/src/main/java/com/tecmax/henna/MovieDescriptionActivity.java
@@ -0,0 +1,33 @@
+package com.tecmax.henna;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.design.widget.FloatingActionButton;
+import android.support.design.widget.Snackbar;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.Toolbar;
+import android.view.View;
+
+public class MovieDescriptionActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_movie_description);
+ Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
+ setSupportActionBar(toolbar);
+
+ FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
+ fab.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
+ .setAction("Action", null).show();
+ }
+ });
+ Intent i = getIntent();
+ String abc = i.getStringExtra("Title");
+ getSupportActionBar().setTitle(abc);
+ }
+
+}
diff --git a/Henna/app/src/main/java/com/tecmax/henna/Nav/ImportActivity.java b/Henna/app/src/main/java/com/tecmax/henna/Nav/ImportActivity.java
new file mode 100644
index 0000000..43b91c8
--- /dev/null
+++ b/Henna/app/src/main/java/com/tecmax/henna/Nav/ImportActivity.java
@@ -0,0 +1,39 @@
+package com.tecmax.henna.Nav;
+
+import android.os.Bundle;
+import android.support.design.widget.FloatingActionButton;
+import android.support.design.widget.Snackbar;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.Toolbar;
+import android.view.MenuItem;
+import android.view.View;
+
+import com.tecmax.henna.R;
+
+public class ImportActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_import);
+ Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
+ setSupportActionBar(toolbar);
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+ FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
+ fab.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
+ .setAction("Action", null).show();
+ }
+ });
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ if (item.getItemId() == android.R.id.home) {
+ finish();
+ }
+ return super.onOptionsItemSelected(item);
+ }
+}
diff --git a/Henna/app/src/main/java/com/tecmax/henna/SignUpActivity.java b/Henna/app/src/main/java/com/tecmax/henna/SignUpActivity.java
new file mode 100644
index 0000000..9e2ed95
--- /dev/null
+++ b/Henna/app/src/main/java/com/tecmax/henna/SignUpActivity.java
@@ -0,0 +1,107 @@
+package com.tecmax.henna;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.design.widget.FloatingActionButton;
+import android.support.design.widget.Snackbar;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.AppCompatButton;
+import android.support.v7.widget.AppCompatEditText;
+import android.support.v7.widget.AppCompatTextView;
+import android.support.v7.widget.Toolbar;
+import android.view.View;
+import android.widget.CheckBox;
+import android.widget.RadioButton;
+import android.widget.Toast;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import butterknife.OnClick;
+
+public class SignUpActivity extends AppCompatActivity {
+ @BindView(R.id.etUN)
+ AppCompatEditText mUserName;
+ @BindView(R.id.etEM)
+ AppCompatEditText mEmail;
+ @BindView(R.id.etMB)
+ AppCompatEditText mMobile;
+ @BindView(R.id.rbML)
+ RadioButton mMale;
+ @BindView(R.id.rbFL)
+ RadioButton mFemale;
+ @BindView(R.id.etPA)
+ AppCompatEditText mPassword;
+ @BindView(R.id.etCPA)
+ AppCompatEditText mConfirmPassword;
+ @BindView(R.id.cbTC)
+ CheckBox mTermsConditions;
+ @BindView(R.id.btSU)
+ AppCompatButton mSignUp;
+ @BindView(R.id.tvLG)
+ AppCompatTextView mLogin;
+
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_sign_up);
+ Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
+ setSupportActionBar(toolbar);
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+ ButterKnife.bind(this);
+ FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
+ fab.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
+ .setAction("Action", null).show();
+ }
+ });
+ }
+
+ @OnClick(R.id.btSU)
+ public void signUp() {
+ validateFields();
+ }
+
+ private void validateFields() {
+ String un = mUserName.getText().toString();
+ String em = mEmail.getText().toString();
+ String mb = mMobile.getText().toString();
+ String pa = mPassword.getText().toString();
+ String cpa = mConfirmPassword.getText().toString();
+ String mes = "";
+ if (un.isEmpty()) {
+ mes = "Enter valid Name";
+ mUserName.setError(mes);
+ } else if (em.isEmpty()) {
+ mes = "Enter valid Email";
+ } else if (mb.isEmpty()) {
+ mes = "Enter valid Mobile";
+ } else if (mb.length() < 10) {
+ mes = "Mobile Number Invalid";
+ } else if (!mMale.isChecked() && !mFemale.isChecked()) {
+ mes = "Select your Gender";
+ } else if (pa.isEmpty()) {
+ mes = "Enter valid Password";
+ } else if (pa.length() < 4) {
+ mes = "Password too short";
+ } else if (cpa.isEmpty()) {
+ mes = "Enter valid Confirm Password";
+ } else if (!pa.equals(cpa)) {
+ mes = "Password doesn't Match";
+ } else if (!mTermsConditions.isChecked()) {
+ mes = "Please Accept Terms and Conditions";
+ } else {
+ mes = "SignUp Successful";
+ Intent intent = new Intent(this, HomeActivity.class);
+ startActivity(intent);
+ }
+ Toast.makeText(this, mes, Toast.LENGTH_SHORT).show();
+ }
+
+ @OnClick(R.id.tvLG)
+ public void login() {
+ Toast.makeText(this, "rupa", Toast.LENGTH_SHORT).show();
+ }
+}
diff --git a/Henna/app/src/main/java/com/tecmax/henna/TavcsadActivity.java b/Henna/app/src/main/java/com/tecmax/henna/TavcsadActivity.java
new file mode 100644
index 0000000..ecb10db
--- /dev/null
+++ b/Henna/app/src/main/java/com/tecmax/henna/TavcsadActivity.java
@@ -0,0 +1,150 @@
+package com.tecmax.henna;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.design.widget.FloatingActionButton;
+import android.support.design.widget.Snackbar;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentPagerAdapter;
+import android.support.v4.view.ViewPager;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.Toolbar;
+import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import com.tecmax.henna.entities.Movie;
+
+public class TavcsadActivity extends AppCompatActivity {
+
+ /**
+ * The {@link android.support.v4.view.PagerAdapter} that will provide
+ * fragments for each of the sections. We use a
+ * {@link FragmentPagerAdapter} derivative, which will keep every
+ * loaded fragment in memory. If this becomes too memory intensive, it
+ * may be best to switch to a
+ * {@link android.support.v4.app.FragmentStatePagerAdapter}.
+ */
+ private SectionsPagerAdapter mSectionsPagerAdapter;
+
+ /**
+ * The {@link ViewPager} that will host the section contents.
+ */
+ private ViewPager mViewPager;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_tavcsad);
+
+ Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
+ setSupportActionBar(toolbar);
+
+ Intent i = getIntent();
+ Movie dene = (Movie) i.getSerializableExtra("Title");
+ getSupportActionBar().setTitle(dene.getName());
+ // Create the adapter that will return a fragment for each of the three
+ // primary sections of the activity.
+ mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
+
+ // Set up the ViewPager with the sections adapter.
+ mViewPager = (ViewPager) findViewById(R.id.container);
+ mViewPager.setAdapter(mSectionsPagerAdapter);
+
+ FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
+ fab.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
+ .setAction("Action", null).show();
+ }
+ });
+
+ }
+
+
+ @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_tavcsad, menu);
+ return true;
+ }
+
+ @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);
+ }
+
+ /**
+ * A placeholder fragment containing a simple view.
+ */
+ public static class PlaceholderFragment extends Fragment {
+ /**
+ * The fragment argument representing the section number for this
+ * fragment.
+ */
+ private static final String ARG_SECTION_NUMBER = "section_number";
+
+ public PlaceholderFragment() {
+ }
+
+ /**
+ * Returns a new instance of this fragment for the given section
+ * number.
+ */
+ public static PlaceholderFragment newInstance(int sectionNumber) {
+ PlaceholderFragment fragment = new PlaceholderFragment();
+ Bundle args = new Bundle();
+ args.putInt(ARG_SECTION_NUMBER, sectionNumber);
+ fragment.setArguments(args);
+ return fragment;
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ View rootView = inflater.inflate(R.layout.fragment_tavcsad, container, false);
+ TextView textView = (TextView) rootView.findViewById(R.id.section_label);
+ textView.setText(getString(R.string.section_format, getArguments().getInt(ARG_SECTION_NUMBER)));
+ return rootView;
+ }
+ }
+
+ /**
+ * A {@link FragmentPagerAdapter} that returns a fragment corresponding to
+ * one of the sections/tabs/pages.
+ */
+ public class SectionsPagerAdapter extends FragmentPagerAdapter {
+
+ public SectionsPagerAdapter(FragmentManager fm) {
+ super(fm);
+ }
+
+ @Override
+ public Fragment getItem(int position) {
+ // getItem is called to instantiate the fragment for the given page.
+ // Return a PlaceholderFragment (defined as a static inner class below).
+ return PlaceholderFragment.newInstance(position + 1);
+ }
+
+ @Override
+ public int getCount() {
+ // Show 3 total pages.
+ return 3;
+ }
+ }
+}
diff --git a/Henna/app/src/main/java/com/tecmax/henna/TempActivity.java b/Henna/app/src/main/java/com/tecmax/henna/TempActivity.java
new file mode 100644
index 0000000..4883416
--- /dev/null
+++ b/Henna/app/src/main/java/com/tecmax/henna/TempActivity.java
@@ -0,0 +1,81 @@
+package com.tecmax.henna;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.design.widget.FloatingActionButton;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.GridLayoutManager;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.support.v7.widget.Toolbar;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+
+import com.tecmax.henna.adapter.BMSAdapter;
+import com.tecmax.henna.entities.Movie;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class TempActivity extends AppCompatActivity {
+ RecyclerView bookMyShow;
+ RecyclerView.LayoutManager layoutManager;
+ GridLayoutManager gridLayoutManager;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_temp);
+ Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
+ setSupportActionBar(toolbar);
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+ bookMyShow = findViewById(R.id.bms);
+ FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
+ fab.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Intent intent = new Intent(TempActivity.this, TavcsadActivity.class);
+ startActivity(intent);
+ }
+ });
+ String[] mNameList = {"MCA", "Mufti", "Thor", "Tiger Zindha Hai", "Premam", "Sathya"};
+ String[] mLanguageList = {"Telugu", "Kannada", "English", "Hindi", "Mal", "Tamil"};
+ String[] mCertificateList = {"UA", "A", "U", "UA", "U/A", "U"};
+ String[] mStatusList = {"New", "Old", "Seen", "New", "Seen", "Old"};
+ Integer[] mBannerList = {R.drawable.mca, R.drawable.mufti, R.drawable.thor, R.drawable.tiger,
+ R.drawable.premam, R.drawable.satya};
+
+ List movieList = new ArrayList<>();
+ for (int i = 0; i < mBannerList.length; i++) {
+ Movie movie = new Movie();
+ movie.setBanner(mBannerList[i]);
+ movie.setCertificate(mCertificateList[i]);
+ movie.setLanguage(mLanguageList[i]);
+ movie.setName(mNameList[i]);
+ movie.setOlder(mStatusList[i]);
+ movieList.add(movie);
+ }
+ BMSAdapter bmsAdapter = new BMSAdapter(movieList,this);
+ layoutManager = new LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL,false);
+// gridLayoutManager = new GridLayoutManager(this,2);
+ bookMyShow.setLayoutManager(layoutManager);
+ bookMyShow.setAdapter(bmsAdapter);
+
+
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ return super.onCreateOptionsMenu(menu);
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+
+ if (item.getItemId() == android.R.id.home) {
+ finish();
+ }
+ return super.onOptionsItemSelected(item);
+ }
+}
diff --git a/Henna/app/src/main/java/com/tecmax/henna/WebActivity.java b/Henna/app/src/main/java/com/tecmax/henna/WebActivity.java
new file mode 100644
index 0000000..2c2bcb7
--- /dev/null
+++ b/Henna/app/src/main/java/com/tecmax/henna/WebActivity.java
@@ -0,0 +1,90 @@
+package com.tecmax.henna;
+
+import android.app.ProgressDialog;
+import android.os.Bundle;
+import android.support.design.widget.FloatingActionButton;
+import android.support.design.widget.Snackbar;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.Toolbar;
+import android.view.MenuItem;
+import android.view.View;
+import android.webkit.WebView;
+import android.webkit.WebViewClient;
+
+public class WebActivity extends AppCompatActivity {
+ WebView webView;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_web);
+ Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
+ setSupportActionBar(toolbar);
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+ webView = findViewById(R.id.web);
+ FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
+ fab.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
+ .setAction("Action", null).show();
+ }
+ });
+ startWebView("https://www.amazon.in/");
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ if (item.getItemId() == android.R.id.home) {
+ finish();
+ }
+ return super.onOptionsItemSelected(item);
+ }
+
+
+ private void startWebView(String url) {
+
+
+ webView.setWebViewClient(new WebViewClient() {
+ ProgressDialog progressDialog;
+
+
+ public boolean shouldOverrideUrlLoading(WebView view, String url) {
+ view.loadUrl(url);
+ return true;
+ }
+
+ public void onLoadResource (WebView view, String url) {
+ if (progressDialog == null) {
+ progressDialog = new ProgressDialog(WebActivity.this);
+ progressDialog.setMessage("Loading...");
+// progressDialog.show();
+ }
+ }
+ public void onPageFinished(WebView view, String url) {
+ try{
+ if (progressDialog.isShowing()) {
+ progressDialog.dismiss();
+ progressDialog = null;
+ }
+ }catch(Exception exception){
+ exception.printStackTrace();
+ }
+ }
+
+ });
+
+
+ webView.getSettings().setJavaScriptEnabled(true);
+ webView.getSettings().setLoadsImagesAutomatically(true);
+ webView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
+ webView.getSettings().setLoadWithOverviewMode(true);
+ webView.getSettings().setUseWideViewPort(true);
+ webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
+ webView.setScrollbarFadingEnabled(false);
+ webView.getSettings().setBuiltInZoomControls(true);
+ webView.loadUrl(url);
+
+
+ }
+}
diff --git a/Henna/app/src/main/java/com/tecmax/henna/adapter/BMSAdapter.java b/Henna/app/src/main/java/com/tecmax/henna/adapter/BMSAdapter.java
new file mode 100644
index 0000000..030f0d2
--- /dev/null
+++ b/Henna/app/src/main/java/com/tecmax/henna/adapter/BMSAdapter.java
@@ -0,0 +1,94 @@
+package com.tecmax.henna.adapter;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.support.v7.widget.AppCompatButton;
+import android.support.v7.widget.AppCompatImageView;
+import android.support.v7.widget.AppCompatTextView;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import com.tecmax.henna.R;
+import com.tecmax.henna.TavcsadActivity;
+import com.tecmax.henna.entities.Movie;
+
+import java.util.List;
+
+/**
+ * Created by DELL PC on 18-Dec-17.
+ */
+
+public class BMSAdapter extends RecyclerView.Adapter {
+ List movieList;
+ Activity mActivity;
+
+ public BMSAdapter(List movieList, Activity activity) {
+ this.movieList = movieList;
+ mActivity= activity;
+ }
+
+ @Override
+ public BMSAdapter.BMSViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.bmsadapter, parent, false);
+ return new BMSViewHolder(view);
+ }
+
+ @Override
+ public void onBindViewHolder(BMSAdapter.BMSViewHolder holder, int position) {
+ holder.mName.setText(movieList.get(position).getName());
+ holder.mLanguage.setText(movieList.get(position).getLanguage());
+ holder.mCertificate.setText(movieList.get(position).getCertificate());
+ holder.mOld.setText(movieList.get(position).getOlder());
+ holder.mBanner.setImageResource(movieList.get(position).getBanner());
+ holder.mName.setTag(movieList.get(position).getName());
+ holder.mBook.setTag(position);
+ }
+
+ @Override
+ public int getItemCount() {
+ return movieList.size();
+ }
+
+ class BMSViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
+ AppCompatImageView mBanner;
+ AppCompatTextView mName, mLanguage, mCertificate, mOld;
+ AppCompatButton mBook;
+
+ public BMSViewHolder(View itemView) {
+ super(itemView);
+ mBanner = itemView.findViewById(R.id.mBanner);
+ mName = itemView.findViewById(R.id.mName);
+ mLanguage = itemView.findViewById(R.id.mLanguage);
+ mCertificate = itemView.findViewById(R.id.mCertificate);
+ mOld = itemView.findViewById(R.id.mOld);
+ mBook = itemView.findViewById(R.id.mBook);
+ mBook.setOnClickListener(this);
+ }
+
+ @Override
+ public void onClick(View view) {
+ switch (view.getId()) {
+ case R.id.mBook:
+// Toast.makeText(view.getContext(), "Selected iS "+ mName.getTag().toString(), Toast.LENGTH_SHORT).show();
+// Intent intent = new Intent(view.getContext(), MovieDescriptionActivity.class);
+// intent.putExtra("Title",mName.getTag().toString());
+// mActivity.startActivity(intent);
+ String data = view.getTag().toString();
+ int pos = Integer.parseInt(data);
+ Movie movie = movieList.get(pos);
+ Intent intent = new Intent(view.getContext(), TavcsadActivity.class);
+ intent.putExtra("Title",movie);
+ view.getContext().startActivity(intent);
+// } else if (mName.getTag().toString().equals("Mufti")) {
+// Intent intent = new Intent(view.getContext(), TavcsadActivity.class);
+// intent.putExtra("Title",movie);
+// view.getContext().startActivity(intent);
+// }
+ break;
+ }
+ }
+ }
+
+}
diff --git a/Henna/app/src/main/java/com/tecmax/henna/adapter/InstituteListAdapter.java b/Henna/app/src/main/java/com/tecmax/henna/adapter/InstituteListAdapter.java
new file mode 100644
index 0000000..70d4f19
--- /dev/null
+++ b/Henna/app/src/main/java/com/tecmax/henna/adapter/InstituteListAdapter.java
@@ -0,0 +1,57 @@
+package com.tecmax.henna.adapter;
+
+import android.content.Context;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.bumptech.glide.Glide;
+import com.tecmax.henna.R;
+import com.tecmax.henna.retrofit.InstituteList;
+
+import java.util.List;
+
+public class InstituteListAdapter extends RecyclerView.Adapter {
+ private List instituteLists;
+ private Context context;
+
+ public InstituteListAdapter(List dfdg){
+ instituteLists = dfdg;
+ }
+
+ @Override
+ public InstituteHolder onCreateViewHolder(ViewGroup parent, int viewType) {
+ context = parent.getContext();
+ View df = LayoutInflater.from(context).inflate(R.layout.adapter_institute, parent, false);
+ return new InstituteHolder(df);
+ }
+
+ @Override
+ public void onBindViewHolder(InstituteHolder holder, int position) {
+ InstituteList list = instituteLists.get(position);
+ String imageUrl = list.getLogo().replace("/home/amvldrxq/", "http://");
+ Glide.with(context)
+ .load(imageUrl)
+ .into(holder.logo);
+ holder.title.setText(list.getTitle());
+ }
+
+ @Override
+ public int getItemCount() {
+ return instituteLists.size();
+ }
+
+ class InstituteHolder extends RecyclerView.ViewHolder {
+ ImageView logo;
+ TextView title;
+
+ public InstituteHolder(View itemView) {
+ super(itemView);
+ logo = itemView.findViewById(R.id.ivLogo);
+ title = itemView.findViewById(R.id.etTitle);
+ }
+ }
+}
diff --git a/Henna/app/src/main/java/com/tecmax/henna/dab/DbHelper.java b/Henna/app/src/main/java/com/tecmax/henna/dab/DbHelper.java
new file mode 100644
index 0000000..56d4d78
--- /dev/null
+++ b/Henna/app/src/main/java/com/tecmax/henna/dab/DbHelper.java
@@ -0,0 +1,95 @@
+package com.tecmax.henna.dab;
+
+import android.content.ContentValues;
+import android.content.Context;
+import android.database.Cursor;
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteOpenHelper;
+import android.util.Log;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+
+/**
+ * Created by DELL PC on 30-Dec-17.
+ */
+
+public class DbHelper extends SQLiteOpenHelper {
+
+
+ private static final String USERNAME = "username";
+
+ public DbHelper(Context context) {
+ super(context, "henna.db", null, 1);
+ }
+
+ @Override
+ public void onCreate(SQLiteDatabase sqLiteDatabase) {
+ sqLiteDatabase.execSQL("CREATE TABLE "
+ + "USER" + "(" + "id" + " INTEGER PRIMARY KEY," + DbHelper.USERNAME
+ + " TEXT," + "mobile"
+ + " TEXT," + "email"
+ + " TEXT," + "address"
+ + " TEXT," + "password"
+ + " TEXT," + "createdat"
+ + " DATETIME" + ")");
+ }
+
+ @Override
+ public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {
+ sqLiteDatabase.execSQL("DROP TABLE IF EXISTS " + "USER");
+ onCreate(sqLiteDatabase);
+ }
+
+ public void addUser(UserDetails userDetails) {
+ SQLiteDatabase database = this.getWritableDatabase();
+ ContentValues contentValues = new ContentValues();
+ contentValues.put(DbHelper.USERNAME, userDetails.getUsername());
+ contentValues.put("mobile", userDetails.getMobile());
+ contentValues.put("email", userDetails.getEmail());
+ contentValues.put("address", userDetails.getAddress());
+ contentValues.put("password", userDetails.getPassword());
+ contentValues.put("createdat", getDateTime());
+ database.insert("USER", null, contentValues);
+ }
+
+
+ public List getAllUsers() {
+ List userDetails = new ArrayList();
+ String selectQuery = "SELECT * FROM " + "USER";
+
+ Log.e("DB Query", selectQuery);
+
+ SQLiteDatabase db = this.getReadableDatabase();
+ Cursor c = db.rawQuery(selectQuery, null);
+
+ // looping through all rows and adding to list
+ if (c.moveToFirst()) {
+ do {
+ UserDetails t = new UserDetails();
+ t.setUsername(c.getString((c.getColumnIndex(DbHelper.USERNAME))));
+ t.setAddress(c.getString(c.getColumnIndex("address")));
+ t.setEmail(c.getString(c.getColumnIndex("email")));
+ t.setPassword(c.getString(c.getColumnIndex("password")));
+ t.setMobile(c.getString(c.getColumnIndex("mobile")));
+
+ // adding to tags list
+ userDetails.add(t);
+ } while (c.moveToNext());
+ }
+ return userDetails;
+ }
+
+ /**
+ * get datetime
+ */
+ private String getDateTime() {
+ SimpleDateFormat dateFormat = new SimpleDateFormat(
+ "yyyy-MM-dd HH:mm:ss", Locale.getDefault());
+ Date date = new Date();
+ return dateFormat.format(date);
+ }
+}
diff --git a/Henna/app/src/main/java/com/tecmax/henna/dab/SignUpActivity.java b/Henna/app/src/main/java/com/tecmax/henna/dab/SignUpActivity.java
new file mode 100644
index 0000000..5fd7afa
--- /dev/null
+++ b/Henna/app/src/main/java/com/tecmax/henna/dab/SignUpActivity.java
@@ -0,0 +1,57 @@
+package com.tecmax.henna.dab;
+
+import android.os.Bundle;
+import android.support.v7.app.AppCompatActivity;
+import android.util.Log;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+
+import com.tecmax.henna.R;
+
+import java.util.List;
+
+public class SignUpActivity extends AppCompatActivity {
+ EditText un, pa, mob, email, addre;
+ Button signUp, getDetails;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_sign_up2);
+ final DbHelper dbIn = new DbHelper(this);
+ un = findViewById(R.id.dbUn);
+ pa = findViewById(R.id.dbPA);
+ mob = findViewById(R.id.dbMobile);
+ email = findViewById(R.id.dbeM);
+ addre = findViewById(R.id.dbADD);
+ signUp = findViewById(R.id.signUp);
+ getDetails = findViewById(R.id.getAll);
+ signUp.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ UserDetails userDetails = new UserDetails();
+ userDetails.setPassword(pa.getText().toString());
+ userDetails.setMobile(mob.getText().toString());
+ userDetails.setEmail(email.getText().toString());
+ userDetails.setAddress(addre.getText().toString());
+ userDetails.setUsername(un.getText().toString());
+ dbIn.addUser(userDetails);
+ }
+ });
+
+ getDetails.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ List details = dbIn.getAllUsers();
+ for (UserDetails details1 : details) {
+ Log.e("GetDetails", details1.getUsername() + "");
+ Log.e("GetDetails1", details1.getAddress() + "");
+ Log.e("GetDetails2", details1.getEmail() + "");
+ Log.e("GetDetails3", details1.getPassword() + "");
+ }
+
+ }
+ });
+ }
+}
diff --git a/Henna/app/src/main/java/com/tecmax/henna/dab/UserDetails.java b/Henna/app/src/main/java/com/tecmax/henna/dab/UserDetails.java
new file mode 100644
index 0000000..9b82895
--- /dev/null
+++ b/Henna/app/src/main/java/com/tecmax/henna/dab/UserDetails.java
@@ -0,0 +1,53 @@
+package com.tecmax.henna.dab;
+
+/**
+ * Created by DELL PC on 30-Dec-17.
+ */
+
+public class UserDetails {
+ private String username;
+ private String password;
+ private String mobile;
+ private String address;
+ private String email;
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ public String getMobile() {
+ return mobile;
+ }
+
+ public void setMobile(String mobile) {
+ this.mobile = mobile;
+ }
+
+ public String getAddress() {
+ return address;
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+}
diff --git a/Henna/app/src/main/java/com/tecmax/henna/entities/Movie.java b/Henna/app/src/main/java/com/tecmax/henna/entities/Movie.java
new file mode 100644
index 0000000..39e9957
--- /dev/null
+++ b/Henna/app/src/main/java/com/tecmax/henna/entities/Movie.java
@@ -0,0 +1,56 @@
+package com.tecmax.henna.entities;
+
+import java.io.Serializable;
+
+/**
+ * Created by DELL PC on 18-Dec-17.
+ */
+
+public class Movie implements Serializable {
+ private String name;
+ private String language;
+ private String certificate;
+ private String movieDescription;
+ private String older;
+ private Integer banner;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getLanguage() {
+ return language;
+ }
+
+ public void setLanguage(String language) {
+ this.language = language;
+ }
+
+ public String getCertificate() {
+ return certificate;
+ }
+
+ public void setCertificate(String certificate) {
+ this.certificate = certificate;
+ }
+
+ public String getOlder() {
+ return older;
+ }
+
+ public void setOlder(String older) {
+ this.older = older;
+ }
+
+ public Integer getBanner() {
+ return banner;
+ }
+
+ public void setBanner(Integer banner) {
+ this.banner = banner;
+ }
+}
diff --git a/Henna/app/src/main/java/com/tecmax/henna/entities/Profile.java b/Henna/app/src/main/java/com/tecmax/henna/entities/Profile.java
new file mode 100644
index 0000000..17e65f6
--- /dev/null
+++ b/Henna/app/src/main/java/com/tecmax/henna/entities/Profile.java
@@ -0,0 +1,98 @@
+package com.tecmax.henna.entities;
+
+import java.util.List;
+
+/**
+ * Created by DELL PC on 05-Jan-18.
+ */
+
+public class Profile {
+ private String name;
+ private int age;
+ private List phone;
+ private Address address;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public void setAge(int age) {
+ this.age = age;
+ }
+
+
+ public Address getAddress() {
+ return address;
+ }
+
+ public void setAddress(Address address) {
+ this.address = address;
+ }
+
+ public List getPhone() {
+ return phone;
+ }
+
+ public void setPhone(List phone) {
+ this.phone = phone;
+ }
+
+ public class PhoneNu {
+ private String number;
+ private String type;
+
+ public String getNumber() {
+ return number;
+ }
+
+ public void setNumber(String number) {
+ this.number = number;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+ }
+
+ public class Address {
+ private String area;
+ private String city;
+ private String State;
+
+ public String getArea() {
+ return area;
+ }
+
+ public void setArea(String area) {
+ this.area = area;
+ }
+
+ public String getCity() {
+ return city;
+ }
+
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+ public String getState() {
+ return State;
+ }
+
+ public void setState(String state) {
+ State = state;
+ }
+ }
+}
diff --git a/Henna/app/src/main/java/com/tecmax/henna/fragments/GalleryFragment.java b/Henna/app/src/main/java/com/tecmax/henna/fragments/GalleryFragment.java
new file mode 100644
index 0000000..494df85
--- /dev/null
+++ b/Henna/app/src/main/java/com/tecmax/henna/fragments/GalleryFragment.java
@@ -0,0 +1,64 @@
+package com.tecmax.henna.fragments;
+
+
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.support.v7.widget.GridLayoutManager;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import com.tecmax.henna.R;
+import com.tecmax.henna.adapter.BMSAdapter;
+import com.tecmax.henna.entities.Movie;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * A simple {@link Fragment} subclass.
+ */
+public class GalleryFragment extends Fragment {
+ RecyclerView bookMyShow;
+ RecyclerView.LayoutManager layoutManager;
+ GridLayoutManager gridLayoutManager;
+
+ public GalleryFragment() {
+ // Required empty public constructor
+ }
+
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ View v = inflater.inflate(R.layout.fragment_gallery, container, false);
+ bookMyShow = v.findViewById(R.id.bms);
+ String[] mNameList = {"MCA", "Mufti", "Thor", "Tiger Zindha Hai", "Premam", "Sathya"};
+ String[] mLanguageList = {"Telugu", "Kannada", "English", "Hindi", "Mal", "Tamil"};
+ String[] mCertificateList = {"UA", "A", "U", "UA", "U/A", "U"};
+ String[] mStatusList = {"New", "Old", "Seen", "New", "Seen", "Old"};
+ Integer[] mBannerList = {R.drawable.mca, R.drawable.mufti, R.drawable.thor, R.drawable.tiger,
+ R.drawable.premam, R.drawable.satya};
+
+ List movieList = new ArrayList<>();
+ for (int i = 0; i < mBannerList.length; i++) {
+ Movie movie = new Movie();
+ movie.setBanner(mBannerList[i]);
+ movie.setCertificate(mCertificateList[i]);
+ movie.setLanguage(mLanguageList[i]);
+ movie.setName(mNameList[i]);
+ movie.setOlder(mStatusList[i]);
+ movieList.add(movie);
+ }
+ BMSAdapter bmsAdapter = new BMSAdapter(movieList,getActivity());
+// layoutManager = new LinearLayoutManager(getActivity(),LinearLayoutManager.HORIZONTAL,false);
+ layoutManager = new LinearLayoutManager(getActivity());
+// gridLayoutManager = new GridLayoutManager(this,2);
+ bookMyShow.setLayoutManager(layoutManager);
+ bookMyShow.setAdapter(bmsAdapter);
+ return v;
+ }
+
+}
diff --git a/Henna/app/src/main/java/com/tecmax/henna/maps/LocationActivity.java b/Henna/app/src/main/java/com/tecmax/henna/maps/LocationActivity.java
new file mode 100644
index 0000000..c22b1ff
--- /dev/null
+++ b/Henna/app/src/main/java/com/tecmax/henna/maps/LocationActivity.java
@@ -0,0 +1,47 @@
+package com.tecmax.henna.maps;
+
+import android.os.Bundle;
+import android.support.v4.app.FragmentActivity;
+
+import com.google.android.gms.maps.CameraUpdateFactory;
+import com.google.android.gms.maps.GoogleMap;
+import com.google.android.gms.maps.OnMapReadyCallback;
+import com.google.android.gms.maps.SupportMapFragment;
+import com.google.android.gms.maps.model.LatLng;
+import com.google.android.gms.maps.model.MarkerOptions;
+import com.tecmax.henna.R;
+
+public class LocationActivity extends FragmentActivity implements OnMapReadyCallback {
+
+ private GoogleMap mMap;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_location);
+ // Obtain the SupportMapFragment and get notified when the map is ready to be used.
+ SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
+ .findFragmentById(R.id.map);
+ mapFragment.getMapAsync(this);
+ }
+
+
+ /**
+ * Manipulates the map once available.
+ * This callback is triggered when the map is ready to be used.
+ * This is where we can add markers or lines, add listeners or move the camera. In this case,
+ * we just add a marker near Sydney, Australia.
+ * If Google Play services is not installed on the device, the user will be prompted to install
+ * it inside the SupportMapFragment. This method will only be triggered once the user has
+ * installed Google Play services and returned to the app.
+ */
+ @Override
+ public void onMapReady(GoogleMap googleMap) {
+ mMap = googleMap;
+
+ // Add a marker in Sydney and move the camera
+ LatLng sydney = new LatLng(-34, 151);
+ mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney"));
+ mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));
+ }
+}
diff --git a/Henna/app/src/main/java/com/tecmax/henna/retrofit/ApiInterface.java b/Henna/app/src/main/java/com/tecmax/henna/retrofit/ApiInterface.java
new file mode 100644
index 0000000..1ab79a9
--- /dev/null
+++ b/Henna/app/src/main/java/com/tecmax/henna/retrofit/ApiInterface.java
@@ -0,0 +1,23 @@
+package com.tecmax.henna.retrofit;
+
+import java.util.List;
+
+import retrofit2.Call;
+import retrofit2.http.Body;
+import retrofit2.http.GET;
+import retrofit2.http.POST;
+
+/**
+ * Created by DELL PC on 31-Dec-17.
+ */
+
+public interface ApiInterface {
+
+ @POST("kirana11_api/user/login")
+ Call authenticateUser(@Body LoginRequest loginRequest);
+
+ @GET("api/get_institute_list")
+ Call> getInstituteList();
+
+}
+
diff --git a/Henna/app/src/main/java/com/tecmax/henna/retrofit/BaseClientClass.java b/Henna/app/src/main/java/com/tecmax/henna/retrofit/BaseClientClass.java
new file mode 100644
index 0000000..39baebd
--- /dev/null
+++ b/Henna/app/src/main/java/com/tecmax/henna/retrofit/BaseClientClass.java
@@ -0,0 +1,26 @@
+package com.tecmax.henna.retrofit;
+
+import retrofit2.Retrofit;
+import retrofit2.converter.gson.GsonConverterFactory;
+
+/**
+ * Created by DELL PC on 31-Dec-17.
+ */
+
+public class BaseClientClass {
+
+// public static final String BASE_URL = "https://dev.kirana11.com/";//Dev
+ public static final String BASE_URL = "http://admin.awsrulers.com";//Dev
+ private static Retrofit retrofitEndPoint = null;
+
+ public static Retrofit getBaseClient() {
+
+ if (retrofitEndPoint == null) {
+ retrofitEndPoint = new Retrofit.Builder()
+ .baseUrl(BASE_URL)
+ .addConverterFactory(GsonConverterFactory.create())
+ .build();
+ }
+ return retrofitEndPoint;
+ }
+}
diff --git a/Henna/app/src/main/java/com/tecmax/henna/retrofit/InstituteList.java b/Henna/app/src/main/java/com/tecmax/henna/retrofit/InstituteList.java
new file mode 100644
index 0000000..7c2970b
--- /dev/null
+++ b/Henna/app/src/main/java/com/tecmax/henna/retrofit/InstituteList.java
@@ -0,0 +1,48 @@
+package com.tecmax.henna.retrofit;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.util.List;
+
+public class InstituteList {
+ @SerializedName("id")
+ private String id;
+ @SerializedName("title")
+ private String title;
+ @SerializedName("logo")
+ private String logo;
+ @SerializedName("banner")
+ private List banner = null;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getLogo() {
+ return logo;
+ }
+
+ public void setLogo(String logo) {
+ this.logo = logo;
+ }
+
+ public List getBanner() {
+ return banner;
+ }
+
+ public void setBanner(List banner) {
+ this.banner = banner;
+ }
+}
diff --git a/Henna/app/src/main/java/com/tecmax/henna/retrofit/LoginRequest.java b/Henna/app/src/main/java/com/tecmax/henna/retrofit/LoginRequest.java
new file mode 100644
index 0000000..f306ec3
--- /dev/null
+++ b/Henna/app/src/main/java/com/tecmax/henna/retrofit/LoginRequest.java
@@ -0,0 +1,30 @@
+package com.tecmax.henna.retrofit;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * Created by raheem on 28-01-2017.
+ */
+
+public class LoginRequest {
+ @SerializedName("username")
+ private String userName;
+ @SerializedName("password")
+ private String password;
+
+ public String getUserName() {
+ return userName;
+ }
+
+ public void setUserName(String userName) {
+ this.userName = userName;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+}
diff --git a/Henna/app/src/main/java/com/tecmax/henna/retrofit/LoginResponse.java b/Henna/app/src/main/java/com/tecmax/henna/retrofit/LoginResponse.java
new file mode 100644
index 0000000..dd2f58b
--- /dev/null
+++ b/Henna/app/src/main/java/com/tecmax/henna/retrofit/LoginResponse.java
@@ -0,0 +1,58 @@
+package com.tecmax.henna.retrofit;
+
+import com.google.gson.annotations.SerializedName;
+
+public class LoginResponse {
+ @SerializedName("sessid")
+ private String sessId;
+ @SerializedName("session_name")
+ private String sessionName;
+ @SerializedName("token")
+ private String accessToken;
+ @SerializedName("user")
+ private User user;
+
+ public String getSessId() {
+ return sessId;
+ }
+
+ public void setSessId(String sessId) {
+ this.sessId = sessId;
+ }
+
+ public String getSessionName() {
+ return sessionName;
+ }
+
+ public void setSessionName(String sessionName) {
+ this.sessionName = sessionName;
+ }
+
+ public String getAccessToken() {
+ return accessToken;
+ }
+
+ public void setAccessToken(String accessToken) {
+ this.accessToken = accessToken;
+ }
+
+ public User getUser() {
+ return user;
+ }
+
+ public void setUser(User user) {
+ this.user = user;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ LoginResponse user = (LoginResponse) o;
+ if (accessToken != null ? !accessToken.equals(user.accessToken) : user.accessToken != null)
+ return false;
+ return true;
+
+ }
+}
diff --git a/Henna/app/src/main/java/com/tecmax/henna/retrofit/User.java b/Henna/app/src/main/java/com/tecmax/henna/retrofit/User.java
new file mode 100644
index 0000000..03c5e44
--- /dev/null
+++ b/Henna/app/src/main/java/com/tecmax/henna/retrofit/User.java
@@ -0,0 +1,160 @@
+package com.tecmax.henna.retrofit;
+
+
+import com.google.gson.annotations.SerializedName;
+import com.google.gson.internal.LinkedTreeMap;
+
+public class User {
+ @SerializedName("uid")
+ private long userId;
+ @SerializedName("name")
+ private String mobile;
+ @SerializedName("mail")
+ private String email;
+ @SerializedName("picture")
+ private String profilePicture;
+ @SerializedName("created")
+ private String userSince;
+ @SerializedName("login")
+ private String lastLogin;
+ @SerializedName("access")
+ private String lastAccessed;
+ @SerializedName("status")
+ private String activeStatus;
+ private String cookieToken;
+ private String xcsrfToken;
+ private boolean tokenSentToServer;
+ private boolean notificationEnabled = true;
+ @SerializedName("roles")
+ private LinkedTreeMap roles;
+
+ public User() {
+ }
+
+ public String getXcsrfToken() {
+ return xcsrfToken;
+ }
+
+ public void setXcsrfToken(String xcsrfToken) {
+ this.xcsrfToken = xcsrfToken;
+ }
+
+ public long getUserId() {
+ return userId;
+ }
+
+ public void setUserId(long userId) {
+ this.userId = userId;
+ }
+
+ public String getMobile() {
+ return mobile;
+ }
+
+ public void setMobile(String mobile) {
+ this.mobile = mobile;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public String getProfilePicture() {
+ return profilePicture;
+ }
+
+ public void setProfilePicture(String profilePicture) {
+ this.profilePicture = profilePicture;
+ }
+
+ public String getUserSince() {
+ return userSince;
+ }
+
+ public void setUserSince(String userSince) {
+ this.userSince = userSince;
+ }
+
+ public String getLastLogin() {
+ return lastLogin;
+ }
+
+ public void setLastLogin(String lastLogin) {
+ this.lastLogin = lastLogin;
+ }
+
+ public String getLastAccessed() {
+ return lastAccessed;
+ }
+
+ public void setLastAccessed(String lastAccessed) {
+ this.lastAccessed = lastAccessed;
+ }
+
+ public String getActiveStatus() {
+ return activeStatus;
+ }
+
+ public void setActiveStatus(String activeStatus) {
+ this.activeStatus = activeStatus;
+ }
+
+ public String getCookieToken() {
+ return cookieToken;
+ }
+
+ public void setCookieToken(String cookieToken) {
+ this.cookieToken = cookieToken;
+ }
+
+ public boolean isTokenSentToServer() {
+ return tokenSentToServer;
+ }
+
+ public void setTokenSentToServer(boolean tokenSentToServer) {
+ this.tokenSentToServer = tokenSentToServer;
+ }
+
+ public boolean isNotificationEnabled() {
+ return notificationEnabled;
+ }
+
+ public void setNotificationEnabled(boolean notificationEnabled) {
+ this.notificationEnabled = notificationEnabled;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ User user = (User) o;
+
+ if (userId != user.userId)
+ return false;
+ if (mobile != null ? !mobile.equals(user.mobile) : user.mobile != null)
+ return false;
+ return true;
+
+ }
+
+ @Override
+ public int hashCode() {
+ int result = (int) (userId ^ (userId >>> 32));
+ result = 31 * result + (mobile != null ? mobile.hashCode() : 0);
+ result = 31 * result + (email != null ? email.hashCode() : 0);
+ return result;
+ }
+
+ public LinkedTreeMap getRoles() {
+ return roles;
+ }
+
+ public void setRoles(LinkedTreeMap roles) {
+ this.roles = roles;
+ }
+}
diff --git a/Henna/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/Henna/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 0000000..c7bd21d
--- /dev/null
+++ b/Henna/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Henna/app/src/main/res/drawable/circle_shape.xml b/Henna/app/src/main/res/drawable/circle_shape.xml
new file mode 100644
index 0000000..f112131
--- /dev/null
+++ b/Henna/app/src/main/res/drawable/circle_shape.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Henna/app/src/main/res/drawable/ic_launcher_background.xml b/Henna/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..d5fccc5
--- /dev/null
+++ b/Henna/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Henna/app/src/main/res/drawable/ic_menu_camera.xml b/Henna/app/src/main/res/drawable/ic_menu_camera.xml
new file mode 100644
index 0000000..0d9ea10
--- /dev/null
+++ b/Henna/app/src/main/res/drawable/ic_menu_camera.xml
@@ -0,0 +1,12 @@
+
+
+
+
diff --git a/Henna/app/src/main/res/drawable/ic_menu_gallery.xml b/Henna/app/src/main/res/drawable/ic_menu_gallery.xml
new file mode 100644
index 0000000..f6872c4
--- /dev/null
+++ b/Henna/app/src/main/res/drawable/ic_menu_gallery.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/Henna/app/src/main/res/drawable/ic_menu_manage.xml b/Henna/app/src/main/res/drawable/ic_menu_manage.xml
new file mode 100644
index 0000000..c1be60b
--- /dev/null
+++ b/Henna/app/src/main/res/drawable/ic_menu_manage.xml
@@ -0,0 +1,9 @@
+
+
+
\ No newline at end of file
diff --git a/Henna/app/src/main/res/drawable/ic_menu_send.xml b/Henna/app/src/main/res/drawable/ic_menu_send.xml
new file mode 100644
index 0000000..00c668c
--- /dev/null
+++ b/Henna/app/src/main/res/drawable/ic_menu_send.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/Henna/app/src/main/res/drawable/ic_menu_share.xml b/Henna/app/src/main/res/drawable/ic_menu_share.xml
new file mode 100644
index 0000000..a28fb9e
--- /dev/null
+++ b/Henna/app/src/main/res/drawable/ic_menu_share.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/Henna/app/src/main/res/drawable/ic_menu_slideshow.xml b/Henna/app/src/main/res/drawable/ic_menu_slideshow.xml
new file mode 100644
index 0000000..209aa64
--- /dev/null
+++ b/Henna/app/src/main/res/drawable/ic_menu_slideshow.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/Henna/app/src/main/res/drawable/mca.jpg b/Henna/app/src/main/res/drawable/mca.jpg
new file mode 100644
index 0000000..b7d2d08
Binary files /dev/null and b/Henna/app/src/main/res/drawable/mca.jpg differ
diff --git a/Henna/app/src/main/res/drawable/mufti.jpg b/Henna/app/src/main/res/drawable/mufti.jpg
new file mode 100644
index 0000000..0c46825
Binary files /dev/null and b/Henna/app/src/main/res/drawable/mufti.jpg differ
diff --git a/Henna/app/src/main/res/drawable/premam.jpg b/Henna/app/src/main/res/drawable/premam.jpg
new file mode 100644
index 0000000..2e6b960
Binary files /dev/null and b/Henna/app/src/main/res/drawable/premam.jpg differ
diff --git a/Henna/app/src/main/res/drawable/satya.jpg b/Henna/app/src/main/res/drawable/satya.jpg
new file mode 100644
index 0000000..94312b8
Binary files /dev/null and b/Henna/app/src/main/res/drawable/satya.jpg differ
diff --git a/Henna/app/src/main/res/drawable/side_nav_bar.xml b/Henna/app/src/main/res/drawable/side_nav_bar.xml
new file mode 100644
index 0000000..6d81870
--- /dev/null
+++ b/Henna/app/src/main/res/drawable/side_nav_bar.xml
@@ -0,0 +1,9 @@
+
+
+
\ No newline at end of file
diff --git a/Henna/app/src/main/res/drawable/tecmax_android.png b/Henna/app/src/main/res/drawable/tecmax_android.png
new file mode 100644
index 0000000..915fa62
Binary files /dev/null and b/Henna/app/src/main/res/drawable/tecmax_android.png differ
diff --git a/Henna/app/src/main/res/drawable/thor.jpg b/Henna/app/src/main/res/drawable/thor.jpg
new file mode 100644
index 0000000..e26508f
Binary files /dev/null and b/Henna/app/src/main/res/drawable/thor.jpg differ
diff --git a/Henna/app/src/main/res/drawable/tiger.jpg b/Henna/app/src/main/res/drawable/tiger.jpg
new file mode 100644
index 0000000..0b9806c
Binary files /dev/null and b/Henna/app/src/main/res/drawable/tiger.jpg differ
diff --git a/Henna/app/src/main/res/layout/activity_home.xml b/Henna/app/src/main/res/layout/activity_home.xml
new file mode 100644
index 0000000..855297e
--- /dev/null
+++ b/Henna/app/src/main/res/layout/activity_home.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Henna/app/src/main/res/layout/activity_import.xml b/Henna/app/src/main/res/layout/activity_import.xml
new file mode 100644
index 0000000..9e46632
--- /dev/null
+++ b/Henna/app/src/main/res/layout/activity_import.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Henna/app/src/main/res/layout/activity_institute.xml b/Henna/app/src/main/res/layout/activity_institute.xml
new file mode 100644
index 0000000..dd69866
--- /dev/null
+++ b/Henna/app/src/main/res/layout/activity_institute.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Henna/app/src/main/res/layout/activity_location.xml b/Henna/app/src/main/res/layout/activity_location.xml
new file mode 100644
index 0000000..6bef64f
--- /dev/null
+++ b/Henna/app/src/main/res/layout/activity_location.xml
@@ -0,0 +1,8 @@
+
diff --git a/Henna/app/src/main/res/layout/activity_login.xml b/Henna/app/src/main/res/layout/activity_login.xml
new file mode 100644
index 0000000..805faf2
--- /dev/null
+++ b/Henna/app/src/main/res/layout/activity_login.xml
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Henna/app/src/main/res/layout/activity_main.xml b/Henna/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..a61d8a6
--- /dev/null
+++ b/Henna/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
diff --git a/Henna/app/src/main/res/layout/activity_movie_description.xml b/Henna/app/src/main/res/layout/activity_movie_description.xml
new file mode 100644
index 0000000..87c9cfd
--- /dev/null
+++ b/Henna/app/src/main/res/layout/activity_movie_description.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Henna/app/src/main/res/layout/activity_sign_up.xml b/Henna/app/src/main/res/layout/activity_sign_up.xml
new file mode 100644
index 0000000..ee9b379
--- /dev/null
+++ b/Henna/app/src/main/res/layout/activity_sign_up.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Henna/app/src/main/res/layout/activity_sign_up2.xml b/Henna/app/src/main/res/layout/activity_sign_up2.xml
new file mode 100644
index 0000000..9364424
--- /dev/null
+++ b/Henna/app/src/main/res/layout/activity_sign_up2.xml
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Henna/app/src/main/res/layout/activity_tavcsad.xml b/Henna/app/src/main/res/layout/activity_tavcsad.xml
new file mode 100644
index 0000000..6884a2d
--- /dev/null
+++ b/Henna/app/src/main/res/layout/activity_tavcsad.xml
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Henna/app/src/main/res/layout/activity_temp.xml b/Henna/app/src/main/res/layout/activity_temp.xml
new file mode 100644
index 0000000..cceb6a6
--- /dev/null
+++ b/Henna/app/src/main/res/layout/activity_temp.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Henna/app/src/main/res/layout/activity_web.xml b/Henna/app/src/main/res/layout/activity_web.xml
new file mode 100644
index 0000000..4596b4d
--- /dev/null
+++ b/Henna/app/src/main/res/layout/activity_web.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Henna/app/src/main/res/layout/adapter_institute.xml b/Henna/app/src/main/res/layout/adapter_institute.xml
new file mode 100644
index 0000000..eae17dd
--- /dev/null
+++ b/Henna/app/src/main/res/layout/adapter_institute.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Henna/app/src/main/res/layout/app_bar_main.xml b/Henna/app/src/main/res/layout/app_bar_main.xml
new file mode 100644
index 0000000..07f11b1
--- /dev/null
+++ b/Henna/app/src/main/res/layout/app_bar_main.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Henna/app/src/main/res/layout/bmsadapter.xml b/Henna/app/src/main/res/layout/bmsadapter.xml
new file mode 100644
index 0000000..fe8eb16
--- /dev/null
+++ b/Henna/app/src/main/res/layout/bmsadapter.xml
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Henna/app/src/main/res/layout/content_import.xml b/Henna/app/src/main/res/layout/content_import.xml
new file mode 100644
index 0000000..90f403a
--- /dev/null
+++ b/Henna/app/src/main/res/layout/content_import.xml
@@ -0,0 +1,11 @@
+
+
+
+
diff --git a/Henna/app/src/main/res/layout/content_main.xml b/Henna/app/src/main/res/layout/content_main.xml
new file mode 100644
index 0000000..afec646
--- /dev/null
+++ b/Henna/app/src/main/res/layout/content_main.xml
@@ -0,0 +1,12 @@
+
+
+
+
diff --git a/Henna/app/src/main/res/layout/content_movie_description.xml b/Henna/app/src/main/res/layout/content_movie_description.xml
new file mode 100644
index 0000000..194f7e5
--- /dev/null
+++ b/Henna/app/src/main/res/layout/content_movie_description.xml
@@ -0,0 +1,11 @@
+
+
+
+
diff --git a/Henna/app/src/main/res/layout/content_sign_up.xml b/Henna/app/src/main/res/layout/content_sign_up.xml
new file mode 100644
index 0000000..8ec630c
--- /dev/null
+++ b/Henna/app/src/main/res/layout/content_sign_up.xml
@@ -0,0 +1,106 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Henna/app/src/main/res/layout/content_temp.xml b/Henna/app/src/main/res/layout/content_temp.xml
new file mode 100644
index 0000000..62c43fd
--- /dev/null
+++ b/Henna/app/src/main/res/layout/content_temp.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
diff --git a/Henna/app/src/main/res/layout/content_web.xml b/Henna/app/src/main/res/layout/content_web.xml
new file mode 100644
index 0000000..dd2b5cb
--- /dev/null
+++ b/Henna/app/src/main/res/layout/content_web.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
diff --git a/Henna/app/src/main/res/layout/fragment_gallery.xml b/Henna/app/src/main/res/layout/fragment_gallery.xml
new file mode 100644
index 0000000..97dc7bc
--- /dev/null
+++ b/Henna/app/src/main/res/layout/fragment_gallery.xml
@@ -0,0 +1,12 @@
+
+
+
+
diff --git a/Henna/app/src/main/res/layout/fragment_tavcsad.xml b/Henna/app/src/main/res/layout/fragment_tavcsad.xml
new file mode 100644
index 0000000..3b74a42
--- /dev/null
+++ b/Henna/app/src/main/res/layout/fragment_tavcsad.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/Henna/app/src/main/res/layout/nav_header_main.xml b/Henna/app/src/main/res/layout/nav_header_main.xml
new file mode 100644
index 0000000..2ae4e49
--- /dev/null
+++ b/Henna/app/src/main/res/layout/nav_header_main.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/Henna/app/src/main/res/layout/sugandha.xml b/Henna/app/src/main/res/layout/sugandha.xml
new file mode 100644
index 0000000..0b23a8a
--- /dev/null
+++ b/Henna/app/src/main/res/layout/sugandha.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Henna/app/src/main/res/layout/test.xml b/Henna/app/src/main/res/layout/test.xml
new file mode 100644
index 0000000..f983290
--- /dev/null
+++ b/Henna/app/src/main/res/layout/test.xml
@@ -0,0 +1,157 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Henna/app/src/main/res/menu/activity_main_drawer.xml b/Henna/app/src/main/res/menu/activity_main_drawer.xml
new file mode 100644
index 0000000..a30626e
--- /dev/null
+++ b/Henna/app/src/main/res/menu/activity_main_drawer.xml
@@ -0,0 +1,38 @@
+
+
diff --git a/Henna/app/src/main/res/menu/main.xml b/Henna/app/src/main/res/menu/main.xml
new file mode 100644
index 0000000..a2411e3
--- /dev/null
+++ b/Henna/app/src/main/res/menu/main.xml
@@ -0,0 +1,9 @@
+
+
+
+
diff --git a/Henna/app/src/main/res/menu/menu_tavcsad.xml b/Henna/app/src/main/res/menu/menu_tavcsad.xml
new file mode 100644
index 0000000..ed70cb7
--- /dev/null
+++ b/Henna/app/src/main/res/menu/menu_tavcsad.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
diff --git a/Henna/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/Henna/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/Henna/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/Henna/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/Henna/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/Henna/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/Henna/app/src/main/res/mipmap-hdpi/ic_launcher.png b/Henna/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..a2f5908
Binary files /dev/null and b/Henna/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/Henna/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/Henna/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 0000000..1b52399
Binary files /dev/null and b/Henna/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/Henna/app/src/main/res/mipmap-mdpi/ic_launcher.png b/Henna/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..ff10afd
Binary files /dev/null and b/Henna/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/Henna/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/Henna/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 0000000..115a4c7
Binary files /dev/null and b/Henna/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/Henna/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/Henna/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..dcd3cd8
Binary files /dev/null and b/Henna/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/Henna/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/Henna/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..459ca60
Binary files /dev/null and b/Henna/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/Henna/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/Henna/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..8ca12fe
Binary files /dev/null and b/Henna/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/Henna/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/Henna/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..8e19b41
Binary files /dev/null and b/Henna/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/Henna/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/Henna/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..b824ebd
Binary files /dev/null and b/Henna/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/Henna/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/Henna/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..4c19a13
Binary files /dev/null and b/Henna/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/Henna/app/src/main/res/values-v21/styles.xml b/Henna/app/src/main/res/values-v21/styles.xml
new file mode 100644
index 0000000..168b08e
--- /dev/null
+++ b/Henna/app/src/main/res/values-v21/styles.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
diff --git a/Henna/app/src/main/res/values-w820dp/dimens.xml b/Henna/app/src/main/res/values-w820dp/dimens.xml
new file mode 100644
index 0000000..63fc816
--- /dev/null
+++ b/Henna/app/src/main/res/values-w820dp/dimens.xml
@@ -0,0 +1,6 @@
+
+
+ 64dp
+
diff --git a/Henna/app/src/main/res/values/colors.xml b/Henna/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..3ab3e9c
--- /dev/null
+++ b/Henna/app/src/main/res/values/colors.xml
@@ -0,0 +1,6 @@
+
+
+ #3F51B5
+ #303F9F
+ #FF4081
+
diff --git a/Henna/app/src/main/res/values/dimens.xml b/Henna/app/src/main/res/values/dimens.xml
new file mode 100644
index 0000000..d6b5330
--- /dev/null
+++ b/Henna/app/src/main/res/values/dimens.xml
@@ -0,0 +1,9 @@
+
+ 16dp
+
+ 16dp
+ 16dp
+ 8dp
+ 8dp
+ 176dp
+
diff --git a/Henna/app/src/main/res/values/strings.xml b/Henna/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..04a6a05
--- /dev/null
+++ b/Henna/app/src/main/res/values/strings.xml
@@ -0,0 +1,25 @@
+
+ Henna
+ SignUpActivity
+ Username
+ Password
+ TestLogo
+ Login
+ Don\'t Have Account
+ Create Here
+ TempActivity
+ TavcsadActivity
+ Settings
+ Hello World from section: %1$d
+ MovieDescriptionActivity
+ MainActivity
+
+ Open navigation drawer
+ Close navigation drawer
+ ImportActivity
+
+
+ Hello blank fragment
+ Map
+ WebActivity
+
diff --git a/Henna/app/src/main/res/values/styles.xml b/Henna/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..545b9c6
--- /dev/null
+++ b/Henna/app/src/main/res/values/styles.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Henna/app/src/release/res/values/google_maps_api.xml b/Henna/app/src/release/res/values/google_maps_api.xml
new file mode 100644
index 0000000..1ef79e9
--- /dev/null
+++ b/Henna/app/src/release/res/values/google_maps_api.xml
@@ -0,0 +1,20 @@
+
+
+ YOUR_KEY_HERE
+
diff --git a/Henna/app/src/test/java/com/tecmax/henna/ExampleUnitTest.java b/Henna/app/src/test/java/com/tecmax/henna/ExampleUnitTest.java
new file mode 100644
index 0000000..49c1e84
--- /dev/null
+++ b/Henna/app/src/test/java/com/tecmax/henna/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.tecmax.henna;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() throws Exception {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/Henna/build.gradle b/Henna/build.gradle
new file mode 100644
index 0000000..6c2bb63
--- /dev/null
+++ b/Henna/build.gradle
@@ -0,0 +1,27 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+
+ repositories {
+ google()
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:3.3.0'
+
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ google()
+ jcenter()
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/Henna/gradle.properties b/Henna/gradle.properties
new file mode 100644
index 0000000..aac7c9b
--- /dev/null
+++ b/Henna/gradle.properties
@@ -0,0 +1,17 @@
+# Project-wide Gradle settings.
+
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx1536m
+
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
diff --git a/Henna/gradle/wrapper/gradle-wrapper.jar b/Henna/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..13372ae
Binary files /dev/null and b/Henna/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/Henna/gradle/wrapper/gradle-wrapper.properties b/Henna/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..28dc159
--- /dev/null
+++ b/Henna/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Thu Jan 17 22:07:18 IST 2019
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
diff --git a/Henna/gradlew b/Henna/gradlew
new file mode 100644
index 0000000..9d82f78
--- /dev/null
+++ b/Henna/gradlew
@@ -0,0 +1,160 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/Henna/gradlew.bat b/Henna/gradlew.bat
new file mode 100644
index 0000000..8a0b282
--- /dev/null
+++ b/Henna/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/Henna/settings.gradle b/Henna/settings.gradle
new file mode 100644
index 0000000..e7b4def
--- /dev/null
+++ b/Henna/settings.gradle
@@ -0,0 +1 @@
+include ':app'
diff --git a/Latest.rar b/Latest.rar
deleted file mode 100644
index e0b6c6e..0000000
Binary files a/Latest.rar and /dev/null differ
diff --git a/MyApplication/.idea/.name b/MyApplication/.idea/.name
new file mode 100644
index 0000000..1046d98
--- /dev/null
+++ b/MyApplication/.idea/.name
@@ -0,0 +1 @@
+MyApplication
\ No newline at end of file
diff --git a/ActivityExamples/.idea/compiler.xml b/MyApplication/.idea/compiler.xml
similarity index 100%
rename from ActivityExamples/.idea/compiler.xml
rename to MyApplication/.idea/compiler.xml
diff --git a/ActivityExamples/.idea/copyright/profiles_settings.xml b/MyApplication/.idea/copyright/profiles_settings.xml
similarity index 100%
rename from ActivityExamples/.idea/copyright/profiles_settings.xml
rename to MyApplication/.idea/copyright/profiles_settings.xml
diff --git a/MyApplication/app/src/androidTest/java/com/example/pratibha/myapplication/ExampleInstrumentedTest.java b/MyApplication/app/src/androidTest/java/com/example/pratibha/myapplication/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..86a6900
--- /dev/null
+++ b/MyApplication/app/src/androidTest/java/com/example/pratibha/myapplication/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.example.pratibha.myapplication;
+
+import android.content.Context;
+import android.support.test.InstrumentationRegistry;
+import android.support.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumentation test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() throws Exception {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getTargetContext();
+
+ assertEquals("com.example.pratibha.myapplication", appContext.getPackageName());
+ }
+}
diff --git a/MyApplication/app/src/main/java/com/example/pratibha/myapplication/DataBaseHelper.java b/MyApplication/app/src/main/java/com/example/pratibha/myapplication/DataBaseHelper.java
new file mode 100644
index 0000000..a2819e9
--- /dev/null
+++ b/MyApplication/app/src/main/java/com/example/pratibha/myapplication/DataBaseHelper.java
@@ -0,0 +1,261 @@
+package com.example.pratibha.myapplication;
+
+/**
+ * Created by Pratibha on 14/07/17.
+ */
+
+import android.content.ContentValues;
+import android.content.Context;
+import android.database.Cursor;
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteOpenHelper;
+
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class DataBaseHelper extends SQLiteOpenHelper {
+
+ // Database Version
+ private static final int DATABASE_VERSION = 1;
+
+ // Database Name
+ private static final String DATABASE_NAME = "Login.db";
+
+ // User table name
+ private static final String TABLE_USER = "user";
+
+ // User Table Columns names
+ private static final String COLUMN_USER_ID = "user_id";
+ private static final String COLUMN_USER_NAME = "user_name";
+ private static final String COLUMN_USER_EMAIL = "user_email";
+ private static final String COLUMN_USER_PASSWORD = "user_password";
+
+ // create table sql query
+ private String CREATE_USER_TABLE = "CREATE TABLE " + TABLE_USER + "("
+ + COLUMN_USER_ID + " INTEGER PRIMARY KEY AUTOINCREMENT," + COLUMN_USER_NAME + " TEXT,"
+ + COLUMN_USER_EMAIL + " TEXT," + COLUMN_USER_PASSWORD + " TEXT" + ")";
+
+ // drop table sql query
+ private String DROP_USER_TABLE = "DROP TABLE IF EXISTS " + TABLE_USER;
+
+ /**
+ * Constructor
+ *
+ * @param context
+ */
+ public DataBaseHelper(Context context) {
+ super(context, DATABASE_NAME, null, DATABASE_VERSION);
+ }
+
+ @Override
+ public void onCreate(SQLiteDatabase db) {
+ db.execSQL(CREATE_USER_TABLE);
+ }
+
+
+ @Override
+ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
+
+ //Drop User Table if exist
+ db.execSQL(DROP_USER_TABLE);
+
+ // Create tables again
+ onCreate(db);
+
+ }
+
+ /**
+ * This method is to create user record
+ *
+ * @param user
+ */
+ public void addUser(User user) {
+ SQLiteDatabase db = this.getWritableDatabase();
+
+ ContentValues values = new ContentValues();
+ values.put(COLUMN_USER_NAME, user.getName());
+ values.put(COLUMN_USER_EMAIL, user.getEmail());
+ values.put(COLUMN_USER_PASSWORD, user.getPassword());
+
+ // Inserting Row
+ db.insert(TABLE_USER, null, values);
+ db.close();
+ }
+
+ /**
+ * This method is to fetch all user and return the list of user records
+ *
+ * @return list
+ */
+ public List getAllUser() {
+ // array of columns to fetch
+ String[] columns = {
+ COLUMN_USER_ID,
+ COLUMN_USER_EMAIL,
+ COLUMN_USER_NAME,
+ COLUMN_USER_PASSWORD
+ };
+ // sorting orders
+ String sortOrder =
+ COLUMN_USER_NAME + " ASC";
+ List userList = new ArrayList();
+
+ SQLiteDatabase db = this.getReadableDatabase();
+
+ // query the user table
+ /**
+ * Here query function is used to fetch records from user table this function works like we use sql query.
+ * SQL query equivalent to this query function is
+ * SELECT user_id,user_name,user_email,user_password FROM user ORDER BY user_name;
+ */
+ Cursor cursor = db.query(TABLE_USER, //Table to query
+ columns, //columns to return
+ null, //columns for the WHERE clause
+ null, //The values for the WHERE clause
+ null, //group the rows
+ null, //filter by row groups
+ sortOrder); //The sort order
+
+
+ // Traversing through all rows and adding to list
+ if (cursor.moveToFirst()) {
+ do {
+ User user = new User();
+ user.setId(Integer.parseInt(cursor.getString(cursor.getColumnIndex(COLUMN_USER_ID))));
+ user.setName(cursor.getString(cursor.getColumnIndex(COLUMN_USER_NAME)));
+ user.setEmail(cursor.getString(cursor.getColumnIndex(COLUMN_USER_EMAIL)));
+ user.setPassword(cursor.getString(cursor.getColumnIndex(COLUMN_USER_PASSWORD)));
+ // Adding user record to list
+ userList.add(user);
+ } while (cursor.moveToNext());
+ }
+ cursor.close();
+ db.close();
+
+ // return user list
+ return userList;
+ }
+
+ /**
+ * This method to update user record
+ *
+ * @param user
+ */
+ public void updateUser(User user) {
+ SQLiteDatabase db = this.getWritableDatabase();
+
+ ContentValues values = new ContentValues();
+ values.put(COLUMN_USER_NAME, user.getName());
+ values.put(COLUMN_USER_EMAIL, user.getEmail());
+ values.put(COLUMN_USER_PASSWORD, user.getPassword());
+
+ // updating row
+ db.update(TABLE_USER, values, COLUMN_USER_ID + " = ?",
+ new String[]{String.valueOf(user.getId())});
+ db.close();
+ }
+
+ /**
+ * This method is to delete user record
+ *
+ * @param user
+ */
+ public void deleteUser(User user) {
+ SQLiteDatabase db = this.getWritableDatabase();
+ // delete user record by id
+ db.delete(TABLE_USER, COLUMN_USER_ID + " = ?",
+ new String[]{String.valueOf(user.getId())});
+ db.close();
+ }
+
+ /**
+ * This method to check user exist or not
+ *
+ * @param email
+ * @return true/false
+ */
+ public boolean checkUser(String email) {
+
+ // array of columns to fetch
+ String[] columns = {
+ COLUMN_USER_ID
+ };
+ SQLiteDatabase db = this.getReadableDatabase();
+
+ // selection criteria
+ String selection = COLUMN_USER_EMAIL + " = ?";
+
+ // selection argument
+ String[] selectionArgs = {email};
+
+ // query user table with condition
+ /**
+ * Here query function is used to fetch records from user table this function works like we use sql query.
+ * SQL query equivalent to this query function is
+ * SELECT user_id FROM user WHERE user_email = 'abc@gmail.com';
+ */
+ Cursor cursor = db.query(TABLE_USER, //Table to query
+ columns, //columns to return
+ selection, //columns for the WHERE clause
+ selectionArgs, //The values for the WHERE clause
+ null, //group the rows
+ null, //filter by row groups
+ null); //The sort order
+ int cursorCount = cursor.getCount();
+ cursor.close();
+ db.close();
+
+ if (cursorCount > 0) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * This method to check user exist or not
+ *
+ * @param email
+ * @param password
+ * @return true/false
+ */
+ public boolean checkUser(String email, String password) {
+
+ // array of columns to fetch
+ String[] columns = {
+ COLUMN_USER_ID
+ };
+ SQLiteDatabase db = this.getReadableDatabase();
+ // selection criteria
+ String selection = COLUMN_USER_EMAIL + " = ?" + " AND " + COLUMN_USER_PASSWORD + " = ?";
+
+ // selection arguments
+ String[] selectionArgs = {email, password};
+
+ // query user table with conditions
+ /**
+ * Here query function is used to fetch records from user table this function works like we use sql query.
+ * SQL query equivalent to this query function is
+ * SELECT user_id FROM user WHERE user_email = 'abc@gmail.com' AND user_password = 'qwerty';
+ */
+ Cursor cursor = db.query(TABLE_USER, //Table to query
+ columns, //columns to return
+ selection, //columns for the WHERE clause
+ selectionArgs, //The values for the WHERE clause
+ null, //group the rows
+ null, //filter by row groups
+ null); //The sort order
+
+ int cursorCount = cursor.getCount();
+
+ cursor.close();
+ db.close();
+ if (cursorCount > 0) {
+ return true;
+ }
+
+ return false;
+ }
+}
diff --git a/MyApplication/app/src/main/java/com/example/pratibha/myapplication/InputValidation.java b/MyApplication/app/src/main/java/com/example/pratibha/myapplication/InputValidation.java
new file mode 100644
index 0000000..3364291
--- /dev/null
+++ b/MyApplication/app/src/main/java/com/example/pratibha/myapplication/InputValidation.java
@@ -0,0 +1,92 @@
+package com.example.pratibha.myapplication;
+
+/**
+ * Created by Pratibha on 14/07/17.
+ */
+
+import android.app.Activity;
+import android.content.Context;
+import android.support.design.widget.TextInputEditText;
+import android.support.design.widget.TextInputLayout;
+import android.view.View;
+import android.view.WindowManager;
+import android.view.inputmethod.InputMethodManager;
+
+public class InputValidation {
+ private Context context;
+
+ /**
+ * constructor
+ *
+ * @param context
+ */
+ public InputValidation(Context context) {
+ this.context = context;
+ }
+
+ /**
+ * method to check InputEditText filled .
+ *
+ * @param textInputEditText
+ * @param textInputLayout
+ * @param message
+ * @return
+ */
+ public boolean isInputEditTextFilled(TextInputEditText textInputEditText, TextInputLayout textInputLayout,
+ String message) {
+ String value = textInputEditText.getText().toString().trim();
+ if (value.isEmpty()) {
+ textInputLayout.setError(message);
+ hideKeyboardFrom(textInputEditText);
+ return false;
+ } else {
+ textInputLayout.setErrorEnabled(false);
+ }
+
+ return true;
+ }
+
+
+ /**
+ * method to check InputEditText has valid email .
+ *
+ * @param textInputEditText
+ * @param textInputLayout
+ * @param message
+ * @return
+ */
+ public boolean isInputEditTextEmail(TextInputEditText textInputEditText, TextInputLayout textInputLayout, String message) {
+ String value = textInputEditText.getText().toString().trim();
+ if (value.isEmpty() || !android.util.Patterns.EMAIL_ADDRESS.matcher(value).matches()) {
+ textInputLayout.setError(message);
+ hideKeyboardFrom(textInputEditText);
+ return false;
+ } else {
+ textInputLayout.setErrorEnabled(false);
+ }
+ return true;
+ }
+
+ public boolean isInputEditTextMatches(TextInputEditText textInputEditText1, TextInputEditText textInputEditText2, TextInputLayout textInputLayout, String message) {
+ String value1 = textInputEditText1.getText().toString().trim();
+ String value2 = textInputEditText2.getText().toString().trim();
+ if (!value1.contentEquals(value2)) {
+ textInputLayout.setError(message);
+ hideKeyboardFrom(textInputEditText2);
+ return false;
+ } else {
+ textInputLayout.setErrorEnabled(false);
+ }
+ return true;
+ }
+
+ /**
+ * method to Hide keyboard
+ *
+ * @param view
+ */
+ private void hideKeyboardFrom(View view) {
+ InputMethodManager imm = (InputMethodManager) context.getSystemService(Activity.INPUT_METHOD_SERVICE);
+ imm.hideSoftInputFromWindow(view.getWindowToken(), WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
+ }
+}
diff --git a/MyApplication/app/src/main/java/com/example/pratibha/myapplication/LoginActivity.java b/MyApplication/app/src/main/java/com/example/pratibha/myapplication/LoginActivity.java
new file mode 100644
index 0000000..70a243b
--- /dev/null
+++ b/MyApplication/app/src/main/java/com/example/pratibha/myapplication/LoginActivity.java
@@ -0,0 +1,138 @@
+package com.example.pratibha.myapplication;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.design.widget.Snackbar;
+import android.support.design.widget.TextInputEditText;
+import android.support.design.widget.TextInputLayout;
+import android.support.v4.widget.NestedScrollView;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.AppCompatButton;
+import android.support.v7.widget.AppCompatTextView;
+
+import android.view.View;
+
+
+
+public class LoginActivity extends AppCompatActivity implements View.OnClickListener {
+ private final AppCompatActivity activity = LoginActivity.this;
+
+ private NestedScrollView nestedScrollView;
+
+ private TextInputLayout textInputLayoutEmail;
+ private TextInputLayout textInputLayoutPassword;
+
+ private TextInputEditText textInputEditTextEmail;
+ private TextInputEditText textInputEditTextPassword;
+
+ private AppCompatButton appCompatButtonLogin;
+
+ private AppCompatTextView textViewLinkRegister;
+
+ private InputValidation inputValidation;
+ private DataBaseHelper databaseHelper;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_login);
+ // getSupportActionBar().hide();
+
+ initViews();
+ initListeners();
+ initObjects();
+ }
+
+ /**
+ * This method is to initialize views
+ */
+ private void initViews() {
+
+ nestedScrollView = (NestedScrollView) findViewById(R.id.nestedScrollView);
+
+ textInputLayoutEmail = (TextInputLayout) findViewById(R.id.textInputLayoutEmail);
+ textInputLayoutPassword = (TextInputLayout) findViewById(R.id.textInputLayoutPassword);
+
+ textInputEditTextEmail = (TextInputEditText) findViewById(R.id.textInputEditTextEmail);
+ textInputEditTextPassword = (TextInputEditText) findViewById(R.id.textInputEditTextPassword);
+
+ appCompatButtonLogin = (AppCompatButton) findViewById(R.id.appCompatButtonLogin);
+
+ textViewLinkRegister = (AppCompatTextView) findViewById(R.id.textViewLinkRegister);
+
+ }
+
+ /**
+ * This method is to initialize listeners
+ */
+ private void initListeners() {
+ appCompatButtonLogin.setOnClickListener(this);
+ textViewLinkRegister.setOnClickListener(this);
+ }
+
+ /**
+ * This method is to initialize objects to be used
+ */
+ private void initObjects() {
+ databaseHelper = new DataBaseHelper(activity);
+ inputValidation = new InputValidation(activity);
+
+ }
+
+ /**
+ * This implemented method is to listen the click on view
+ *
+ * @param v
+ */
+ @Override
+ public void onClick(View v) {
+ switch (v.getId()) {
+ case R.id.appCompatButtonLogin:
+ verifyFromSQLite();
+ break;
+ case R.id.textViewLinkRegister:
+ // Navigate to RegisterActivity
+ Intent intentRegister = new Intent(getApplicationContext(), RegisterActivity.class);
+ startActivity(intentRegister);
+ break;
+ }
+ }
+
+ /**
+ * This method is to validate the input text fields and verify login credentials from SQLite
+ */
+ private void verifyFromSQLite() {
+ if (!inputValidation.isInputEditTextFilled(textInputEditTextEmail, textInputLayoutEmail, getString(R.string.error_message_email))) {
+ return;
+ }
+ if (!inputValidation.isInputEditTextEmail(textInputEditTextEmail, textInputLayoutEmail, getString(R.string.error_message_email))) {
+ return;
+ }
+ if (!inputValidation.isInputEditTextFilled(textInputEditTextPassword, textInputLayoutPassword, getString(R.string.error_message_email))) {
+ return;
+ }
+
+ if (databaseHelper.checkUser(textInputEditTextEmail.getText().toString().trim()
+ , textInputEditTextPassword.getText().toString().trim())) {
+
+
+ Intent accountsIntent = new Intent(activity, MainActivity.class);
+ accountsIntent.putExtra("EMAIL", textInputEditTextEmail.getText().toString().trim());
+ emptyInputEditText();
+ startActivity(accountsIntent);
+
+
+ } else {
+ // Snack Bar to show success message that record is wrong
+ Snackbar.make(nestedScrollView, getString(R.string.error_valid_email_password), Snackbar.LENGTH_LONG).show();
+ }
+ }
+
+ /**
+ * This method is to empty all input edit text
+ */
+ private void emptyInputEditText() {
+ textInputEditTextEmail.setText(null);
+ textInputEditTextPassword.setText(null);
+ }
+}
\ No newline at end of file
diff --git a/MyApplication/app/src/main/java/com/example/pratibha/myapplication/MainActivity.java b/MyApplication/app/src/main/java/com/example/pratibha/myapplication/MainActivity.java
new file mode 100644
index 0000000..0597dc3
--- /dev/null
+++ b/MyApplication/app/src/main/java/com/example/pratibha/myapplication/MainActivity.java
@@ -0,0 +1,246 @@
+package com.example.pratibha.myapplication;
+
+import android.content.Context;
+import android.graphics.Color;
+import android.os.Bundle;
+import android.support.design.widget.FloatingActionButton;
+import android.support.design.widget.Snackbar;
+import android.view.View;
+import android.support.design.widget.NavigationView;
+import android.support.v4.view.GravityCompat;
+import android.support.v4.widget.DrawerLayout;
+import android.support.v7.app.ActionBarDrawerToggle;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.Toolbar;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.ListView;
+
+import java.util.Arrays;
+import java.util.List;
+
+public class MainActivity extends AppCompatActivity {
+
+ private DrawerLayout drawer;
+ private ListView leftList;
+ private ListView rightList;
+ private String[] leftListStrings;
+ private String[] rightListStrings;
+
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+ getSupportActionBar().setHomeButtonEnabled(true);
+
+ drawer = (DrawerLayout) findViewById(R.id.drawer);
+ leftList = (ListView) findViewById(R.id.left_list);
+ rightList = (ListView) findViewById(R.id.right_list);
+
+
+ leftListStrings = getResources().getStringArray(R.array.left);
+
+ leftList.setAdapter(new ArrayAdapter(this,R.layout.nav_header_main,R.id.item_title,leftListStrings));
+
+ rightListStrings = getResources().getStringArray(R.array.left);
+
+ List stringList = Arrays.asList(rightListStrings);
+
+ rightList.setAdapter(new MyCustomAdapter(MainActivity.this, android.R.layout.simple_list_item_1, stringList));
+ rightList.setVisibility(View.VISIBLE);
+
+
+ leftList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+
+ @Override
+ public void onItemClick(AdapterView> arg0, View arg1, int arg2,
+ long arg3) {
+
+
+ arg1.setBackgroundColor(Color.WHITE);
+
+ if(arg2 == 0){
+
+ rightListStrings = getResources().getStringArray(R.array.rightOne);
+
+ List stringList = Arrays.asList(rightListStrings);
+
+ rightList.setAdapter(new MyCustomAdapter(MainActivity.this, android.R.layout.simple_list_item_1, stringList));
+ rightList.setVisibility(View.VISIBLE);
+ overridePendingTransition(R.anim.right_to_left, R.anim.left_to_right);
+
+ }
+ if(arg2 == 1){
+
+ rightListStrings = getResources().getStringArray(R.array.rightTwo);
+ List stringList = Arrays.asList(rightListStrings);
+
+ rightList.setAdapter(new MyCustomAdapter(MainActivity.this, android.R.layout.simple_list_item_1, stringList));
+ rightList.setVisibility(View.VISIBLE);
+ }
+ if(arg2 == 2){
+
+ rightListStrings = getResources().getStringArray(R.array.rightThree);
+ List stringList = Arrays.asList(rightListStrings);
+
+ rightList.setAdapter(new MyCustomAdapter(MainActivity.this, android.R.layout.simple_list_item_1, stringList));
+ rightList.setVisibility(View.VISIBLE);
+
+ }
+
+ if(arg2 == 2){
+
+ rightListStrings = getResources().getStringArray(R.array.rightFour);
+ List stringList = Arrays.asList(rightListStrings);
+
+ rightList.setAdapter(new MyCustomAdapter(MainActivity.this, android.R.layout.simple_list_item_1, stringList));
+ rightList.setVisibility(View.VISIBLE);
+
+ }
+ }
+
+ });
+
+ rightList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+
+ @Override
+ public void onItemClick(AdapterView> arg0, View arg1, int arg2,
+ long arg3) {
+
+
+ arg1.setBackgroundColor(Color.WHITE);
+
+ if(arg2 == 0){
+
+ rightListStrings = getResources().getStringArray(R.array.rightOne);
+
+ List stringList = Arrays.asList(rightListStrings);
+
+ rightList.setAdapter(new MyCustomAdapter(MainActivity.this, android.R.layout.simple_list_item_1, stringList));
+ rightList.setVisibility(View.VISIBLE);
+
+ }
+ if(arg2 == 1){
+
+ rightListStrings = getResources().getStringArray(R.array.rightTwo);
+ List stringList = Arrays.asList(rightListStrings);
+
+ rightList.setAdapter(new MyCustomAdapter(MainActivity.this, android.R.layout.simple_list_item_1, stringList));
+ rightList.setVisibility(View.VISIBLE);
+ }
+ if(arg2 == 2){
+
+ rightListStrings = getResources().getStringArray(R.array.rightThree);
+ List stringList = Arrays.asList(rightListStrings);
+
+ rightList.setAdapter(new MyCustomAdapter(MainActivity.this, android.R.layout.simple_list_item_1, stringList));
+ rightList.setVisibility(View.VISIBLE);
+
+ }
+ }
+
+ });
+
+
+
+ drawer.setDrawerListener(new DrawerLayout.DrawerListener() {
+
+ @Override
+ public void onDrawerStateChanged(int arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void onDrawerSlide(View arg0, float arg1) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void onDrawerOpened(View arg0) {
+
+ // TODO Auto-generated method stub
+
+ drawer.openDrawer(GravityCompat.START); // OPEN DRAWER
+
+
+ }
+
+ @Override
+ public void onDrawerClosed(View arg0) {
+ // TODO Auto-generated method stub
+
+ }
+ });
+
+
+
+
+ }
+
+
+ // My adapter class
+
+
+
+ class MyCustomAdapter extends ArrayAdapter{
+
+ List myList = null;
+ public MyCustomAdapter(Context context, int resource,List objects) {
+ super(context, resource, objects);
+ myList = objects;
+ }
+ public List getMyList() {
+ return myList;
+ }
+ public void setMyList(List myList) {
+ this.myList = myList;
+ }
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+
+ // Inflate the menu; this adds items to the action bar if it is present.
+ getMenuInflater().inflate(R.menu.main, menu);
+ return true;
+ }
+
+ @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();
+ switch (id)
+ {
+ case android.R.id.home:
+ drawer.openDrawer(GravityCompat.START);
+ return true;
+
+
+ case R.id.action_search: // can be used to perform search
+ return true;
+
+ }
+ return super.onOptionsItemSelected(item);
+ }
+
+
+ @Override
+ public void onBackPressed() {
+ super.onBackPressed();
+ // turn on the Navigation Drawer image;
+
+ if (drawer.isDrawerOpen(GravityCompat.START)) {
+ drawer.closeDrawers();
+ return;
+ }
+ }
+}
\ No newline at end of file
diff --git a/MyApplication/app/src/main/java/com/example/pratibha/myapplication/RegisterActivity.java b/MyApplication/app/src/main/java/com/example/pratibha/myapplication/RegisterActivity.java
new file mode 100644
index 0000000..8b26684
--- /dev/null
+++ b/MyApplication/app/src/main/java/com/example/pratibha/myapplication/RegisterActivity.java
@@ -0,0 +1,172 @@
+package com.example.pratibha.myapplication;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.design.widget.FloatingActionButton;
+import android.support.design.widget.Snackbar;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.Toolbar;
+import android.view.View;
+
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.design.widget.Snackbar;
+import android.support.design.widget.TextInputEditText;
+import android.support.design.widget.TextInputLayout;
+import android.support.v4.widget.NestedScrollView;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.AppCompatButton;
+import android.support.v7.widget.AppCompatTextView;
+import android.view.View;
+
+
+
+public class RegisterActivity extends AppCompatActivity implements View.OnClickListener {
+
+ private final AppCompatActivity activity = RegisterActivity.this;
+
+ private NestedScrollView nestedScrollView;
+
+ private TextInputLayout textInputLayoutName;
+ private TextInputLayout textInputLayoutEmail;
+ private TextInputLayout textInputLayoutPassword;
+ private TextInputLayout textInputLayoutConfirmPassword;
+
+ private TextInputEditText textInputEditTextName;
+ private TextInputEditText textInputEditTextEmail;
+ private TextInputEditText textInputEditTextPassword;
+ private TextInputEditText textInputEditTextConfirmPassword;
+
+ private AppCompatButton appCompatButtonRegister;
+ private AppCompatTextView appCompatTextViewLoginLink;
+
+ private InputValidation inputValidation;
+ private DataBaseHelper databaseHelper;
+ private User user;
+
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_register);
+ // getSupportActionBar().hide();
+
+ initViews();
+ initListeners();
+ initObjects();
+ }
+
+ /**
+ * This method is to initialize views
+ */
+ private void initViews() {
+ nestedScrollView = (NestedScrollView) findViewById(R.id.nestedScrollView);
+
+ textInputLayoutName = (TextInputLayout) findViewById(R.id.textInputLayoutName);
+ textInputLayoutEmail = (TextInputLayout) findViewById(R.id.textInputLayoutEmail);
+ textInputLayoutPassword = (TextInputLayout) findViewById(R.id.textInputLayoutPassword);
+ textInputLayoutConfirmPassword = (TextInputLayout) findViewById(R.id.textInputLayoutConfirmPassword);
+
+ textInputEditTextName = (TextInputEditText) findViewById(R.id.textInputEditTextName);
+ textInputEditTextEmail = (TextInputEditText) findViewById(R.id.textInputEditTextEmail);
+ textInputEditTextPassword = (TextInputEditText) findViewById(R.id.textInputEditTextPassword);
+ textInputEditTextConfirmPassword = (TextInputEditText) findViewById(R.id.textInputEditTextConfirmPassword);
+
+ appCompatButtonRegister = (AppCompatButton) findViewById(R.id.appCompatButtonRegister);
+
+ appCompatTextViewLoginLink = (AppCompatTextView) findViewById(R.id.appCompatTextViewLoginLink);
+
+ }
+
+ /**
+ * This method is to initialize listeners
+ */
+ private void initListeners() {
+ appCompatButtonRegister.setOnClickListener(this);
+ appCompatTextViewLoginLink.setOnClickListener(this);
+
+ }
+
+ /**
+ * This method is to initialize objects to be used
+ */
+ private void initObjects() {
+ inputValidation = new InputValidation(activity);
+ databaseHelper = new DataBaseHelper(activity);
+ user = new User();
+
+ }
+
+
+ /**
+ * This implemented method is to listen the click on view
+ *
+ * @param v
+ */
+ @Override
+ public void onClick(View v) {
+ switch (v.getId()) {
+
+ case R.id.appCompatButtonRegister:
+ postDataToSQLite();
+ break;
+
+ case R.id.appCompatTextViewLoginLink:
+ finish();
+ break;
+ }
+ }
+
+ /**
+ * This method is to validate the input text fields and post data to SQLite
+ */
+ private void postDataToSQLite() {
+ if (!inputValidation.isInputEditTextFilled(textInputEditTextName, textInputLayoutName, getString(R.string.error_message_name))) {
+ return;
+ }
+ if (!inputValidation.isInputEditTextFilled(textInputEditTextEmail, textInputLayoutEmail, getString(R.string.error_message_email))) {
+ return;
+ }
+ if (!inputValidation.isInputEditTextEmail(textInputEditTextEmail, textInputLayoutEmail, getString(R.string.error_message_email))) {
+ return;
+ }
+ if (!inputValidation.isInputEditTextFilled(textInputEditTextPassword, textInputLayoutPassword, getString(R.string.error_message_password))) {
+ return;
+ }
+ if (!inputValidation.isInputEditTextMatches(textInputEditTextPassword, textInputEditTextConfirmPassword,
+ textInputLayoutConfirmPassword, getString(R.string.error_password_match))) {
+ return;
+ }
+
+ if (!databaseHelper.checkUser(textInputEditTextEmail.getText().toString().trim())) {
+
+ user.setName(textInputEditTextName.getText().toString().trim());
+ user.setEmail(textInputEditTextEmail.getText().toString().trim());
+ user.setPassword(textInputEditTextPassword.getText().toString().trim());
+
+ databaseHelper.addUser(user);
+
+ // Snack Bar to show success message that record saved successfully
+ Snackbar.make(nestedScrollView, getString(R.string.success_message), Snackbar.LENGTH_LONG).show();
+ emptyInputEditText();
+
+ Intent intent = new Intent(this,MainActivity.class);
+ startActivity(intent);
+
+ } else {
+ // Snack Bar to show error message that record already exists
+ Snackbar.make(nestedScrollView, getString(R.string.error_email_exists), Snackbar.LENGTH_LONG).show();
+ }
+
+
+ }
+
+ /**
+ * This method is to empty all input edit text
+ */
+ private void emptyInputEditText() {
+ textInputEditTextName.setText(null);
+ textInputEditTextEmail.setText(null);
+ textInputEditTextPassword.setText(null);
+ textInputEditTextConfirmPassword.setText(null);
+ }
+}
diff --git a/MyApplication/app/src/main/java/com/example/pratibha/myapplication/User.java b/MyApplication/app/src/main/java/com/example/pratibha/myapplication/User.java
new file mode 100644
index 0000000..40c6256
--- /dev/null
+++ b/MyApplication/app/src/main/java/com/example/pratibha/myapplication/User.java
@@ -0,0 +1,45 @@
+package com.example.pratibha.myapplication;
+
+/**
+ * Created by Pratibha on 14/07/17.
+ */
+
+public class User {
+
+ private int id;
+ private String name;
+ private String email;
+ private String password;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+}
\ No newline at end of file
diff --git a/MyApplication/app/src/main/res/anim/left_to_right.xml b/MyApplication/app/src/main/res/anim/left_to_right.xml
new file mode 100644
index 0000000..1d38532
--- /dev/null
+++ b/MyApplication/app/src/main/res/anim/left_to_right.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/MyApplication/app/src/main/res/anim/right_to_left.xml b/MyApplication/app/src/main/res/anim/right_to_left.xml
new file mode 100644
index 0000000..dabee75
--- /dev/null
+++ b/MyApplication/app/src/main/res/anim/right_to_left.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/MyApplication/app/src/main/res/layout/activity_login.xml b/MyApplication/app/src/main/res/layout/activity_login.xml
new file mode 100644
index 0000000..348c6fc
--- /dev/null
+++ b/MyApplication/app/src/main/res/layout/activity_login.xml
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MyApplication/app/src/main/res/layout/activity_register.xml b/MyApplication/app/src/main/res/layout/activity_register.xml
new file mode 100644
index 0000000..88814f3
--- /dev/null
+++ b/MyApplication/app/src/main/res/layout/activity_register.xml
@@ -0,0 +1,102 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MyApplication/app/src/main/res/layout/app_bar_main.xml b/MyApplication/app/src/main/res/layout/app_bar_main.xml
new file mode 100644
index 0000000..d6de38b
--- /dev/null
+++ b/MyApplication/app/src/main/res/layout/app_bar_main.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MyApplication/app/src/main/res/layout/content_main.xml b/MyApplication/app/src/main/res/layout/content_main.xml
new file mode 100644
index 0000000..324a033
--- /dev/null
+++ b/MyApplication/app/src/main/res/layout/content_main.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
diff --git a/MyApplication/app/src/main/res/layout/content_register.xml b/MyApplication/app/src/main/res/layout/content_register.xml
new file mode 100644
index 0000000..daf179a
--- /dev/null
+++ b/MyApplication/app/src/main/res/layout/content_register.xml
@@ -0,0 +1,11 @@
+
+
+
+
diff --git a/MyApplication/app/src/main/res/layout/drawer_layout.xml b/MyApplication/app/src/main/res/layout/drawer_layout.xml
new file mode 100644
index 0000000..1139c0a
--- /dev/null
+++ b/MyApplication/app/src/main/res/layout/drawer_layout.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
diff --git a/MyApplication/app/src/main/res/layout/nav_header_main.xml b/MyApplication/app/src/main/res/layout/nav_header_main.xml
new file mode 100644
index 0000000..ff8ac7b
--- /dev/null
+++ b/MyApplication/app/src/main/res/layout/nav_header_main.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/MyApplication/app/src/main/res/menu/activity_main_drawer.xml b/MyApplication/app/src/main/res/menu/activity_main_drawer.xml
new file mode 100644
index 0000000..ac6231d
--- /dev/null
+++ b/MyApplication/app/src/main/res/menu/activity_main_drawer.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ -
+
+
+
+
+
+
+
diff --git a/MyApplication/app/src/main/res/menu/main.xml b/MyApplication/app/src/main/res/menu/main.xml
new file mode 100644
index 0000000..e6480d5
--- /dev/null
+++ b/MyApplication/app/src/main/res/menu/main.xml
@@ -0,0 +1,10 @@
+
+
+
+
diff --git a/MyApplication/app/src/test/java/com/example/pratibha/myapplication/ExampleUnitTest.java b/MyApplication/app/src/test/java/com/example/pratibha/myapplication/ExampleUnitTest.java
new file mode 100644
index 0000000..1197858
--- /dev/null
+++ b/MyApplication/app/src/test/java/com/example/pratibha/myapplication/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.example.pratibha.myapplication;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() throws Exception {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/MyApplication/projectFilesBackup/.idea/workspace.xml b/MyApplication/projectFilesBackup/.idea/workspace.xml
new file mode 100644
index 0000000..f11b82a
--- /dev/null
+++ b/MyApplication/projectFilesBackup/.idea/workspace.xml
@@ -0,0 +1,2635 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1499958011100
+
+ 1499958011100
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TabShreya/.gitignore b/TabShreya/.gitignore
new file mode 100644
index 0000000..5edb4ee
--- /dev/null
+++ b/TabShreya/.gitignore
@@ -0,0 +1,10 @@
+*.iml
+.gradle
+/local.properties
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
diff --git a/TabShreya/.idea/caches/build_file_checksums.ser b/TabShreya/.idea/caches/build_file_checksums.ser
new file mode 100644
index 0000000..84351f6
Binary files /dev/null and b/TabShreya/.idea/caches/build_file_checksums.ser differ
diff --git a/TabShreya/.idea/codeStyles/Project.xml b/TabShreya/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..30aa626
--- /dev/null
+++ b/TabShreya/.idea/codeStyles/Project.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TabShreya/.idea/gradle.xml b/TabShreya/.idea/gradle.xml
new file mode 100644
index 0000000..7ac24c7
--- /dev/null
+++ b/TabShreya/.idea/gradle.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TabShreya/.idea/misc.xml b/TabShreya/.idea/misc.xml
new file mode 100644
index 0000000..99202cc
--- /dev/null
+++ b/TabShreya/.idea/misc.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TabShreya/.idea/runConfigurations.xml b/TabShreya/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/TabShreya/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TabShreya/app/.gitignore b/TabShreya/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/TabShreya/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/TabShreya/app/build.gradle b/TabShreya/app/build.gradle
new file mode 100644
index 0000000..7b87da6
--- /dev/null
+++ b/TabShreya/app/build.gradle
@@ -0,0 +1,36 @@
+apply plugin: 'com.android.application'
+
+apply plugin: 'kotlin-android'
+
+apply plugin: 'kotlin-android-extensions'
+
+android {
+ compileSdkVersion 28
+ defaultConfig {
+ applicationId "com.glowroad.tabshreya"
+ minSdkVersion 21
+ targetSdkVersion 28
+ versionCode 1
+ versionName "1.0"
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
+ implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
+ implementation 'com.android.support:design:28.0.0-rc02'
+
+ implementation 'com.android.support.constraint:constraint-layout:1.1.3'
+ implementation 'com.android.support:support-v4:28.0.0-rc02'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'com.android.support.test:runner:1.0.2'
+ androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
+}
diff --git a/TabShreya/app/proguard-rules.pro b/TabShreya/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/TabShreya/app/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# 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 *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/TabShreya/app/src/androidTest/java/com/glowroad/tabshreya/ExampleInstrumentedTest.kt b/TabShreya/app/src/androidTest/java/com/glowroad/tabshreya/ExampleInstrumentedTest.kt
new file mode 100644
index 0000000..b7374ee
--- /dev/null
+++ b/TabShreya/app/src/androidTest/java/com/glowroad/tabshreya/ExampleInstrumentedTest.kt
@@ -0,0 +1,24 @@
+package com.glowroad.tabshreya
+
+import android.support.test.InstrumentationRegistry
+import android.support.test.runner.AndroidJUnit4
+
+import org.junit.Test
+import org.junit.runner.RunWith
+
+import org.junit.Assert.*
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * See [testing documentation](http://d.android.com/tools/testing).
+ */
+@RunWith(AndroidJUnit4::class)
+class ExampleInstrumentedTest {
+ @Test
+ fun useAppContext() {
+ // Context of the app under test.
+ val appContext = InstrumentationRegistry.getTargetContext()
+ assertEquals("com.glowroad.tabshreya", appContext.packageName)
+ }
+}
diff --git a/TabShreya/app/src/main/AndroidManifest.xml b/TabShreya/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..87bab86
--- /dev/null
+++ b/TabShreya/app/src/main/AndroidManifest.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TabShreya/app/src/main/java/com/glowroad/tabshreya/CustomPager.java b/TabShreya/app/src/main/java/com/glowroad/tabshreya/CustomPager.java
new file mode 100644
index 0000000..2f1047e
--- /dev/null
+++ b/TabShreya/app/src/main/java/com/glowroad/tabshreya/CustomPager.java
@@ -0,0 +1,49 @@
+package com.glowroad.tabshreya;
+
+import android.content.Context;
+import android.support.v4.view.ViewPager;
+import android.util.AttributeSet;
+import android.view.View;
+
+public class CustomPager extends ViewPager {
+
+ private View mCurrentView;
+
+ public CustomPager(Context context) {
+ super(context);
+ }
+
+ public CustomPager(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ @Override
+ public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+ if (mCurrentView == null) {
+ super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+ return;
+ }
+ int height = 0;
+ mCurrentView.measure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
+ int h = mCurrentView.getMeasuredHeight();
+ if (h > height) {
+ height = h;
+ }
+ heightMeasureSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY);
+
+ super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+ }
+
+ public void measureCurrentView(View currentView) {
+ mCurrentView = currentView;
+ requestLayout();
+ }
+
+ public int measureFragment(View view) {
+ if (view == null)
+ return 0;
+
+ view.measure(0, 0);
+ return view.getMeasuredHeight();
+ }
+}
diff --git a/TabShreya/app/src/main/java/com/glowroad/tabshreya/ProductDescriptionFragment.kt b/TabShreya/app/src/main/java/com/glowroad/tabshreya/ProductDescriptionFragment.kt
new file mode 100644
index 0000000..d4636c0
--- /dev/null
+++ b/TabShreya/app/src/main/java/com/glowroad/tabshreya/ProductDescriptionFragment.kt
@@ -0,0 +1,29 @@
+package com.glowroad.tabshreya
+
+
+import android.os.Bundle
+import android.support.v4.app.Fragment
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+
+
+// TODO: Rename parameter arguments, choose names that match
+// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
+private const val ARG_PARAM1 = "param1"
+private const val ARG_PARAM2 = "param2"
+
+/**
+ * A simple [Fragment] subclass.
+ *
+ */
+class ProductDescriptionFragment : Fragment() {
+
+ override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?): View? {
+ // Inflate the layout for this fragment
+ return inflater.inflate(R.layout.fragment_product_description, container, false)
+ }
+
+
+}
diff --git a/TabShreya/app/src/main/java/com/glowroad/tabshreya/ProductDetailFragment.kt b/TabShreya/app/src/main/java/com/glowroad/tabshreya/ProductDetailFragment.kt
new file mode 100644
index 0000000..7ef3dce
--- /dev/null
+++ b/TabShreya/app/src/main/java/com/glowroad/tabshreya/ProductDetailFragment.kt
@@ -0,0 +1,29 @@
+package com.glowroad.tabshreya
+
+
+import android.os.Bundle
+import android.support.v4.app.Fragment
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+
+
+// TODO: Rename parameter arguments, choose names that match
+// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
+private const val ARG_PARAM1 = "param1"
+private const val ARG_PARAM2 = "param2"
+
+/**
+ * A simple [Fragment] subclass.
+ *
+ */
+class ProductDetailFragment : Fragment() {
+
+ override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?): View? {
+ // Inflate the layout for this fragment
+ return inflater.inflate(R.layout.fragment_product_detail, container, false)
+ }
+
+
+}
diff --git a/TabShreya/app/src/main/java/com/glowroad/tabshreya/TabActivity.kt b/TabShreya/app/src/main/java/com/glowroad/tabshreya/TabActivity.kt
new file mode 100644
index 0000000..8ecccd8
--- /dev/null
+++ b/TabShreya/app/src/main/java/com/glowroad/tabshreya/TabActivity.kt
@@ -0,0 +1,57 @@
+package com.glowroad.tabshreya
+
+import android.os.Bundle
+import android.support.v4.app.Fragment
+import android.support.v4.app.FragmentManager
+import android.support.v4.app.FragmentStatePagerAdapter
+import android.support.v7.app.AppCompatActivity
+import android.view.ViewGroup
+import kotlinx.android.synthetic.main.activity_tab.*
+
+class TabActivity : AppCompatActivity() {
+ private var mCommonPagerAdapter: ViewPagerAdapter? = null
+ private var mProductDescriptionFragment: ProductDescriptionFragment? = null
+ private var mProductDetailFragment: ProductDetailFragment? = null
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ setContentView(R.layout.activity_tab)
+ mCommonPagerAdapter = ViewPagerAdapter(supportFragmentManager)
+ mProductDescriptionFragment= ProductDescriptionFragment()
+ mProductDetailFragment= ProductDetailFragment()
+ mProductDescriptionFragment?.let { mCommonPagerAdapter?.addFrag(it, "Tentang Promo") }
+ mProductDetailFragment?.let { mCommonPagerAdapter?.addFrag(it, "Syarat Promo") }
+ hotelSpeciality.setupWithViewPager(vp)
+ vp.adapter = mCommonPagerAdapter
+ }
+
+ inner class ViewPagerAdapter(fm: FragmentManager) : FragmentStatePagerAdapter(fm) {
+ private val mFragmentList by lazy { mutableListOf() }
+ private val mFragmentTitleList by lazy { mutableListOf() }
+ private var mCurrentPosition = -1
+
+ override fun getItem(position: Int): Fragment = mFragmentList[position]
+
+ override fun getCount(): Int = mFragmentList.size
+
+ fun addFrag(fragment: Fragment, title: String) {
+ mFragmentList.add(fragment)
+ mFragmentTitleList.add(title)
+ }
+
+ override fun getPageTitle(position: Int): CharSequence = mFragmentTitleList[position]
+
+ override fun setPrimaryItem(container: ViewGroup, position: Int, any: Any) {
+ super.setPrimaryItem(container, position, any)
+ if (position != mCurrentPosition) {
+ val fragment = any as? Fragment
+ val pager = container as CustomPager?
+ fragment?.view?.let {
+ mCurrentPosition = position
+ pager?.measureCurrentView(fragment.view)
+ }
+ }
+ }
+
+ }
+}
diff --git a/TabShreya/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/TabShreya/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 0000000..c7bd21d
--- /dev/null
+++ b/TabShreya/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/TabShreya/app/src/main/res/drawable/ic_launcher_background.xml b/TabShreya/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..d5fccc5
--- /dev/null
+++ b/TabShreya/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/TabShreya/app/src/main/res/drawable/teachers.webp b/TabShreya/app/src/main/res/drawable/teachers.webp
new file mode 100644
index 0000000..b33f7a0
Binary files /dev/null and b/TabShreya/app/src/main/res/drawable/teachers.webp differ
diff --git a/TabShreya/app/src/main/res/layout/activity_tab.xml b/TabShreya/app/src/main/res/layout/activity_tab.xml
new file mode 100644
index 0000000..e5c4a11
--- /dev/null
+++ b/TabShreya/app/src/main/res/layout/activity_tab.xml
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TabShreya/app/src/main/res/layout/fragment_product_description.xml b/TabShreya/app/src/main/res/layout/fragment_product_description.xml
new file mode 100644
index 0000000..fcdb85b
--- /dev/null
+++ b/TabShreya/app/src/main/res/layout/fragment_product_description.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TabShreya/app/src/main/res/layout/fragment_product_detail.xml b/TabShreya/app/src/main/res/layout/fragment_product_detail.xml
new file mode 100644
index 0000000..38b6dd4
--- /dev/null
+++ b/TabShreya/app/src/main/res/layout/fragment_product_detail.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TabShreya/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/TabShreya/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/TabShreya/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/TabShreya/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/TabShreya/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/TabShreya/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/TabShreya/app/src/main/res/mipmap-hdpi/ic_launcher.png b/TabShreya/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..a2f5908
Binary files /dev/null and b/TabShreya/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/TabShreya/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/TabShreya/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 0000000..1b52399
Binary files /dev/null and b/TabShreya/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/TabShreya/app/src/main/res/mipmap-mdpi/ic_launcher.png b/TabShreya/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..ff10afd
Binary files /dev/null and b/TabShreya/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/TabShreya/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/TabShreya/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 0000000..115a4c7
Binary files /dev/null and b/TabShreya/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/TabShreya/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/TabShreya/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..dcd3cd8
Binary files /dev/null and b/TabShreya/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/TabShreya/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/TabShreya/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..459ca60
Binary files /dev/null and b/TabShreya/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/TabShreya/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/TabShreya/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..8ca12fe
Binary files /dev/null and b/TabShreya/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/TabShreya/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/TabShreya/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..8e19b41
Binary files /dev/null and b/TabShreya/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/TabShreya/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/TabShreya/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..b824ebd
Binary files /dev/null and b/TabShreya/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/TabShreya/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/TabShreya/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..4c19a13
Binary files /dev/null and b/TabShreya/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/TabShreya/app/src/main/res/values/colors.xml b/TabShreya/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..3ab3e9c
--- /dev/null
+++ b/TabShreya/app/src/main/res/values/colors.xml
@@ -0,0 +1,6 @@
+
+
+ #3F51B5
+ #303F9F
+ #FF4081
+
diff --git a/TabShreya/app/src/main/res/values/strings.xml b/TabShreya/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..9532911
--- /dev/null
+++ b/TabShreya/app/src/main/res/values/strings.xml
@@ -0,0 +1,7 @@
+
+ TabShreya
+
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
+ It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using \'Content here, content here\', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
+
diff --git a/TabShreya/app/src/main/res/values/styles.xml b/TabShreya/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..5885930
--- /dev/null
+++ b/TabShreya/app/src/main/res/values/styles.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
diff --git a/TabShreya/app/src/test/java/com/glowroad/tabshreya/ExampleUnitTest.kt b/TabShreya/app/src/test/java/com/glowroad/tabshreya/ExampleUnitTest.kt
new file mode 100644
index 0000000..1a4186e
--- /dev/null
+++ b/TabShreya/app/src/test/java/com/glowroad/tabshreya/ExampleUnitTest.kt
@@ -0,0 +1,17 @@
+package com.glowroad.tabshreya
+
+import org.junit.Test
+
+import org.junit.Assert.*
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * See [testing documentation](http://d.android.com/tools/testing).
+ */
+class ExampleUnitTest {
+ @Test
+ fun addition_isCorrect() {
+ assertEquals(4, 2 + 2)
+ }
+}
diff --git a/TabShreya/build.gradle b/TabShreya/build.gradle
new file mode 100644
index 0000000..98e76df
--- /dev/null
+++ b/TabShreya/build.gradle
@@ -0,0 +1,27 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+ ext.kotlin_version = '1.2.61'
+ repositories {
+ google()
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:3.1.4'
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ google()
+ jcenter()
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/TabShreya/gradle.properties b/TabShreya/gradle.properties
new file mode 100644
index 0000000..743d692
--- /dev/null
+++ b/TabShreya/gradle.properties
@@ -0,0 +1,13 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx1536m
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
diff --git a/TabShreya/gradle/wrapper/gradle-wrapper.jar b/TabShreya/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..7a3265e
Binary files /dev/null and b/TabShreya/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/TabShreya/gradle/wrapper/gradle-wrapper.properties b/TabShreya/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..3f82a8b
--- /dev/null
+++ b/TabShreya/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Sat Sep 08 16:28:53 IST 2018
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
diff --git a/TabShreya/gradlew b/TabShreya/gradlew
new file mode 100755
index 0000000..cccdd3d
--- /dev/null
+++ b/TabShreya/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/TabShreya/gradlew.bat b/TabShreya/gradlew.bat
new file mode 100644
index 0000000..e95643d
--- /dev/null
+++ b/TabShreya/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/TabShreya/settings.gradle b/TabShreya/settings.gradle
new file mode 100644
index 0000000..e7b4def
--- /dev/null
+++ b/TabShreya/settings.gradle
@@ -0,0 +1 @@
+include ':app'
diff --git a/TecmaxPractise/src/com/tecmax/methodExamples/Harish.java b/TecmaxPractise/src/com/tecmax/methodExamples/Harish.java
deleted file mode 100644
index 89b4080..0000000
--- a/TecmaxPractise/src/com/tecmax/methodExamples/Harish.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.tecmax.methodExamples;
-
-public class Harish {
-
- public static void main(String[] args) {
- int customPPl = 20 + Madhuri.getAllFriendsCount() + 50;
- System.out.println(customPPl);
- }
-
- /** Information Comment -- Static Block Example **/
- static {
- System.out.println("Welcome to java and git.\nHope this is interesting");
- }
-
-}
diff --git a/TecmaxPractise/src/com/tecmax/methodExamples/Madhuri.java b/TecmaxPractise/src/com/tecmax/methodExamples/Madhuri.java
deleted file mode 100644
index 9010d20..0000000
--- a/TecmaxPractise/src/com/tecmax/methodExamples/Madhuri.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package com.tecmax.methodExamples;
-
-public class Madhuri {
- public static void main(String[] args) {
- Madhuri madhuri = new Madhuri();
- madhuri.getFriendsList("Nandini");
- int count =getAllFriendsCount();
- System.out.println(count);
- }
-
- public static int getAllFriendsCount() {
- return 10;
- }
-
- private void getFriendsList(String string) {
- System.out.println(string +" is Madhuri Friend");
- }
-}
diff --git a/TecmaxPractise/src/com/tecmax/methodExamples/arraylist.java b/TecmaxPractise/src/com/tecmax/methodExamples/arraylist.java
index 0b0acd7..561c9bc 100644
--- a/TecmaxPractise/src/com/tecmax/methodExamples/arraylist.java
+++ b/TecmaxPractise/src/com/tecmax/methodExamples/arraylist.java
@@ -1,4 +1,4 @@
-package com.tecmax.methodExamples;
+ckage com.tecmax.methodExamples;
public class arraylist {
diff --git a/TecmaxPractise/src/com/tecmax/methodExamples/arraylisttoarray.java b/TecmaxPractise/src/com/tecmax/methodExamples/arraylisttoarray.java
new file mode 100644
index 0000000..8bdb167
--- /dev/null
+++ b/TecmaxPractise/src/com/tecmax/methodExamples/arraylisttoarray.java
@@ -0,0 +1,22 @@
+package com.tecmax.methodExamples;
+
+import java.awt.List;
+import java.util.ArrayList;
+
+public class arraylisttoarray {
+
+ public static void main(String[] args) {
+ // TODO Auto-generated method stub
+ ArrayList list=new ArrayList<>();
+ list.add(1);
+ list.add(2);
+ list.add(3);
+ Integer []intArray=new Integer[list.size()];
+ list.toArray(intArray);
+ for(Integer integer:intArray) {
+ System.out.println(integer);
+ }
+
+ }
+
+}
diff --git a/TecmaxPractise/src/com/tecmax/methodExamples/map.java b/TecmaxPractise/src/com/tecmax/methodExamples/map.java
new file mode 100644
index 0000000..de105e6
--- /dev/null
+++ b/TecmaxPractise/src/com/tecmax/methodExamples/map.java
@@ -0,0 +1,22 @@
+package com.tecmax.methodExamples;
+
+import java.util.LinkedHashMap;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+public class map {
+
+ public static void main(String[] args) {
+ LinkedHashMapset= new LinkedHashMap ();
+ set.put("hello",100);
+ set.put("hi",200);
+ set.put("hello1",300);
+ set.put("are",400);
+ for (Map.Entry m: set.entrySet())
+ System.out.println(m.getValue()+""+m.getKey());
+
+ }
+
+ }
+
diff --git a/TecmaxPractise/src/com/tecmax/methodExamples/set.java b/TecmaxPractise/src/com/tecmax/methodExamples/set.java
new file mode 100644
index 0000000..6b92118
--- /dev/null
+++ b/TecmaxPractise/src/com/tecmax/methodExamples/set.java
@@ -0,0 +1,25 @@
+package com.tecmax.methodExamples;
+
+import java.util.HashSet;
+import java.util.Iterator;
+
+public class set {
+
+ public static void main(String[] args) {
+ // TODO Auto-generated method stub
+HashSet set= new HashSet();
+set.add("hello");
+set.add("hi");
+set.add("hello1");
+set.add("are");
+boolean isremoved= set.remove( "hi");
+System.out.println("value after removed is"+isremoved);
+System.out.println(set.size());
+Iterator itr= set.iterator();
+while (itr.hasNext()){
+System.out.println(itr.next());
+
+}
+ }
+
+}
diff --git a/TutorialsAndroid/.gitignore b/TutorialsAndroid/.gitignore
new file mode 100644
index 0000000..5edb4ee
--- /dev/null
+++ b/TutorialsAndroid/.gitignore
@@ -0,0 +1,10 @@
+*.iml
+.gradle
+/local.properties
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
diff --git a/TutorialsAndroid/.idea/caches/build_file_checksums.ser b/TutorialsAndroid/.idea/caches/build_file_checksums.ser
new file mode 100644
index 0000000..d760eec
Binary files /dev/null and b/TutorialsAndroid/.idea/caches/build_file_checksums.ser differ
diff --git a/TutorialsAndroid/.idea/codeStyles/Project.xml b/TutorialsAndroid/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..30aa626
--- /dev/null
+++ b/TutorialsAndroid/.idea/codeStyles/Project.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TutorialsAndroid/.idea/encodings.xml b/TutorialsAndroid/.idea/encodings.xml
new file mode 100644
index 0000000..97626ba
--- /dev/null
+++ b/TutorialsAndroid/.idea/encodings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TutorialsAndroid/.idea/gradle.xml b/TutorialsAndroid/.idea/gradle.xml
new file mode 100644
index 0000000..7ac24c7
--- /dev/null
+++ b/TutorialsAndroid/.idea/gradle.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TutorialsAndroid/.idea/misc.xml b/TutorialsAndroid/.idea/misc.xml
new file mode 100644
index 0000000..99202cc
--- /dev/null
+++ b/TutorialsAndroid/.idea/misc.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TutorialsAndroid/.idea/runConfigurations.xml b/TutorialsAndroid/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/TutorialsAndroid/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TutorialsAndroid/app/.gitignore b/TutorialsAndroid/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/TutorialsAndroid/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/TutorialsAndroid/app/build.gradle b/TutorialsAndroid/app/build.gradle
new file mode 100644
index 0000000..710a1d7
--- /dev/null
+++ b/TutorialsAndroid/app/build.gradle
@@ -0,0 +1,29 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 27
+ defaultConfig {
+ applicationId "com.amvlabs.tutorialsandroid"
+ minSdkVersion 21
+ targetSdkVersion 27
+ versionCode 1
+ versionName "1.0"
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+ implementation 'com.android.support:appcompat-v7:27.1.1'
+ implementation 'com.android.support:design:27.1.1'
+ implementation 'com.android.support.constraint:constraint-layout:1.1.2'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'com.android.support.test:runner:1.0.2'
+ androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
+}
diff --git a/TutorialsAndroid/app/proguard-rules.pro b/TutorialsAndroid/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/TutorialsAndroid/app/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# 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 *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/TutorialsAndroid/app/src/androidTest/java/com/amvlabs/tutorialsandroid/ExampleInstrumentedTest.java b/TutorialsAndroid/app/src/androidTest/java/com/amvlabs/tutorialsandroid/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..c2e0736
--- /dev/null
+++ b/TutorialsAndroid/app/src/androidTest/java/com/amvlabs/tutorialsandroid/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.amvlabs.tutorialsandroid;
+
+import android.content.Context;
+import android.support.test.InstrumentationRegistry;
+import android.support.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getTargetContext();
+
+ assertEquals("com.amvlabs.tutorialsandroid", appContext.getPackageName());
+ }
+}
diff --git a/TutorialsAndroid/app/src/main/AndroidManifest.xml b/TutorialsAndroid/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..7fbf386
--- /dev/null
+++ b/TutorialsAndroid/app/src/main/AndroidManifest.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TutorialsAndroid/app/src/main/java/com/amvlabs/tutorialsandroid/CustViewsActivity.java b/TutorialsAndroid/app/src/main/java/com/amvlabs/tutorialsandroid/CustViewsActivity.java
new file mode 100644
index 0000000..b87e9e3
--- /dev/null
+++ b/TutorialsAndroid/app/src/main/java/com/amvlabs/tutorialsandroid/CustViewsActivity.java
@@ -0,0 +1,13 @@
+package com.amvlabs.tutorialsandroid;
+
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+
+public class CustViewsActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_cust_views);
+ }
+}
diff --git a/TutorialsAndroid/app/src/main/java/com/amvlabs/tutorialsandroid/Life1Activity.java b/TutorialsAndroid/app/src/main/java/com/amvlabs/tutorialsandroid/Life1Activity.java
new file mode 100644
index 0000000..7dc9014
--- /dev/null
+++ b/TutorialsAndroid/app/src/main/java/com/amvlabs/tutorialsandroid/Life1Activity.java
@@ -0,0 +1,15 @@
+package com.amvlabs.tutorialsandroid;
+
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.util.Log;
+
+public class Life1Activity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_life1);
+ Log.e("L1", "onCreate");
+ }
+}
diff --git a/TutorialsAndroid/app/src/main/java/com/amvlabs/tutorialsandroid/MainActivity.java b/TutorialsAndroid/app/src/main/java/com/amvlabs/tutorialsandroid/MainActivity.java
new file mode 100644
index 0000000..bbbeb52
--- /dev/null
+++ b/TutorialsAndroid/app/src/main/java/com/amvlabs/tutorialsandroid/MainActivity.java
@@ -0,0 +1,45 @@
+package com.amvlabs.tutorialsandroid;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.design.widget.TextInputLayout;
+import android.support.v7.app.AppCompatActivity;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+
+public class MainActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ Button lsd = findViewById(R.id.btLogin);
+ final EditText sds = findViewById(R.id.etUserName);
+ final EditText adsd = findViewById(R.id.etPassword);
+ final TextInputLayout sdf = findViewById(R.id.tilUna);
+ final TextInputLayout ssdf = findViewById(R.id.tilPss);
+
+
+ lsd.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ String uns = sds.getText().toString();
+ String sdsuns = adsd.getText().toString();
+ if (uns.isEmpty()){
+ sdf.setError("Enter Username");
+// Toast.makeText(MainActivity.this, "Enter Username", Toast.LENGTH_SHORT).show();
+ }else if(sdsuns.isEmpty()){
+ sdf.setError(null);
+ ssdf.setError("Enter Password");
+ }else{
+ sdf.setError(null);
+ ssdf.setError(null);
+ Intent intent = new Intent(MainActivity.this, CustViewsActivity.class);
+ startActivity(intent);
+ finish();
+ }
+ }
+ });
+ }
+}
diff --git a/TutorialsAndroid/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/TutorialsAndroid/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 0000000..c7bd21d
--- /dev/null
+++ b/TutorialsAndroid/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/TutorialsAndroid/app/src/main/res/drawable/ic_launcher_background.xml b/TutorialsAndroid/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..d5fccc5
--- /dev/null
+++ b/TutorialsAndroid/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/TutorialsAndroid/app/src/main/res/layout/activity_cust_views.xml b/TutorialsAndroid/app/src/main/res/layout/activity_cust_views.xml
new file mode 100644
index 0000000..d98dd1a
--- /dev/null
+++ b/TutorialsAndroid/app/src/main/res/layout/activity_cust_views.xml
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TutorialsAndroid/app/src/main/res/layout/activity_life1.xml b/TutorialsAndroid/app/src/main/res/layout/activity_life1.xml
new file mode 100644
index 0000000..de25676
--- /dev/null
+++ b/TutorialsAndroid/app/src/main/res/layout/activity_life1.xml
@@ -0,0 +1,9 @@
+
+
+
+
\ No newline at end of file
diff --git a/TutorialsAndroid/app/src/main/res/layout/activity_main.xml b/TutorialsAndroid/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..9251a68
--- /dev/null
+++ b/TutorialsAndroid/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TutorialsAndroid/app/src/main/res/layout/example.xml b/TutorialsAndroid/app/src/main/res/layout/example.xml
new file mode 100644
index 0000000..5a8f520
--- /dev/null
+++ b/TutorialsAndroid/app/src/main/res/layout/example.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TutorialsAndroid/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/TutorialsAndroid/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/TutorialsAndroid/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/TutorialsAndroid/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/TutorialsAndroid/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/TutorialsAndroid/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/TutorialsAndroid/app/src/main/res/mipmap-hdpi/ic_launcher.png b/TutorialsAndroid/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..a2f5908
Binary files /dev/null and b/TutorialsAndroid/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/TutorialsAndroid/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/TutorialsAndroid/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 0000000..1b52399
Binary files /dev/null and b/TutorialsAndroid/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/TutorialsAndroid/app/src/main/res/mipmap-mdpi/ic_launcher.png b/TutorialsAndroid/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..ff10afd
Binary files /dev/null and b/TutorialsAndroid/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/TutorialsAndroid/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/TutorialsAndroid/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 0000000..115a4c7
Binary files /dev/null and b/TutorialsAndroid/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/TutorialsAndroid/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/TutorialsAndroid/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..dcd3cd8
Binary files /dev/null and b/TutorialsAndroid/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/TutorialsAndroid/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/TutorialsAndroid/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..459ca60
Binary files /dev/null and b/TutorialsAndroid/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/TutorialsAndroid/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/TutorialsAndroid/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..8ca12fe
Binary files /dev/null and b/TutorialsAndroid/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/TutorialsAndroid/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/TutorialsAndroid/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..8e19b41
Binary files /dev/null and b/TutorialsAndroid/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/TutorialsAndroid/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/TutorialsAndroid/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..b824ebd
Binary files /dev/null and b/TutorialsAndroid/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/TutorialsAndroid/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/TutorialsAndroid/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..4c19a13
Binary files /dev/null and b/TutorialsAndroid/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/TutorialsAndroid/app/src/main/res/values/colors.xml b/TutorialsAndroid/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..a6cf09c
--- /dev/null
+++ b/TutorialsAndroid/app/src/main/res/values/colors.xml
@@ -0,0 +1,9 @@
+
+
+ #3F51B5
+ #303F9F
+ #FF4081
+ #e62d46
+ #970536
+ #dd7a50
+
diff --git a/TutorialsAndroid/app/src/main/res/values/strings.xml b/TutorialsAndroid/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..6d1e9ee
--- /dev/null
+++ b/TutorialsAndroid/app/src/main/res/values/strings.xml
@@ -0,0 +1,15 @@
+
+ TutorialsAndroid
+ Username
+ Dont\'t Have Account
+
+
+ - India
+ - SA
+ - ENG
+ - USA
+ - AUS
+ - CAN
+ - PAK
+
+
diff --git a/TutorialsAndroid/app/src/main/res/values/styles.xml b/TutorialsAndroid/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..5ebecdd
--- /dev/null
+++ b/TutorialsAndroid/app/src/main/res/values/styles.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/TutorialsAndroid/app/src/test/java/com/amvlabs/tutorialsandroid/ExampleUnitTest.java b/TutorialsAndroid/app/src/test/java/com/amvlabs/tutorialsandroid/ExampleUnitTest.java
new file mode 100644
index 0000000..c8541a7
--- /dev/null
+++ b/TutorialsAndroid/app/src/test/java/com/amvlabs/tutorialsandroid/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.amvlabs.tutorialsandroid;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/TutorialsAndroid/build.gradle b/TutorialsAndroid/build.gradle
new file mode 100644
index 0000000..077cb2f
--- /dev/null
+++ b/TutorialsAndroid/build.gradle
@@ -0,0 +1,27 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+
+ repositories {
+ google()
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:3.1.4'
+
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ google()
+ jcenter()
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/TutorialsAndroid/gradle.properties b/TutorialsAndroid/gradle.properties
new file mode 100644
index 0000000..743d692
--- /dev/null
+++ b/TutorialsAndroid/gradle.properties
@@ -0,0 +1,13 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx1536m
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
diff --git a/TutorialsAndroid/gradle/wrapper/gradle-wrapper.jar b/TutorialsAndroid/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..7a3265e
Binary files /dev/null and b/TutorialsAndroid/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/TutorialsAndroid/gradle/wrapper/gradle-wrapper.properties b/TutorialsAndroid/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..758d153
--- /dev/null
+++ b/TutorialsAndroid/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Mon Aug 27 10:33:29 IST 2018
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
diff --git a/TutorialsAndroid/gradlew b/TutorialsAndroid/gradlew
new file mode 100644
index 0000000..cccdd3d
--- /dev/null
+++ b/TutorialsAndroid/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/TutorialsAndroid/gradlew.bat b/TutorialsAndroid/gradlew.bat
new file mode 100644
index 0000000..f955316
--- /dev/null
+++ b/TutorialsAndroid/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/TutorialsAndroid/settings.gradle b/TutorialsAndroid/settings.gradle
new file mode 100644
index 0000000..e7b4def
--- /dev/null
+++ b/TutorialsAndroid/settings.gradle
@@ -0,0 +1 @@
+include ':app'
diff --git a/VishwaCoreJava/bin/.gitignore b/VishwaCoreJava/bin/.gitignore
new file mode 100644
index 0000000..c2d9872
--- /dev/null
+++ b/VishwaCoreJava/bin/.gitignore
@@ -0,0 +1 @@
+/com/
diff --git a/WeatherReport/.gitignore b/WeatherReport/.gitignore
new file mode 100644
index 0000000..39fb081
--- /dev/null
+++ b/WeatherReport/.gitignore
@@ -0,0 +1,9 @@
+*.iml
+.gradle
+/local.properties
+/.idea/workspace.xml
+/.idea/libraries
+.DS_Store
+/build
+/captures
+.externalNativeBuild
diff --git a/FCMExample/.idea/caches/build_file_checksums.ser b/WeatherReport/.idea/caches/build_file_checksums.ser
similarity index 52%
rename from FCMExample/.idea/caches/build_file_checksums.ser
rename to WeatherReport/.idea/caches/build_file_checksums.ser
index df93467..f79d53a 100644
Binary files a/FCMExample/.idea/caches/build_file_checksums.ser and b/WeatherReport/.idea/caches/build_file_checksums.ser differ
diff --git a/WeatherReport/.idea/codeStyles/Project.xml b/WeatherReport/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..30aa626
--- /dev/null
+++ b/WeatherReport/.idea/codeStyles/Project.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/WeatherReport/.idea/encodings.xml b/WeatherReport/.idea/encodings.xml
new file mode 100644
index 0000000..97626ba
--- /dev/null
+++ b/WeatherReport/.idea/encodings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/WeatherReport/.idea/gradle.xml b/WeatherReport/.idea/gradle.xml
new file mode 100644
index 0000000..7ac24c7
--- /dev/null
+++ b/WeatherReport/.idea/gradle.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/WeatherReport/.idea/misc.xml b/WeatherReport/.idea/misc.xml
new file mode 100644
index 0000000..202c805
--- /dev/null
+++ b/WeatherReport/.idea/misc.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Android
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/WeatherReport/.idea/modules.xml b/WeatherReport/.idea/modules.xml
new file mode 100644
index 0000000..9e5b8ea
--- /dev/null
+++ b/WeatherReport/.idea/modules.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/WeatherReport/.idea/runConfigurations.xml b/WeatherReport/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/WeatherReport/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/WeatherReport/app/.gitignore b/WeatherReport/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/WeatherReport/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/WeatherReport/app/build.gradle b/WeatherReport/app/build.gradle
new file mode 100644
index 0000000..daa5cdc
--- /dev/null
+++ b/WeatherReport/app/build.gradle
@@ -0,0 +1,37 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 26
+ defaultConfig {
+ applicationId "com.walmart.weatherreport"
+ minSdkVersion 17
+ targetSdkVersion 26
+ versionCode 1
+ versionName "1.0"
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+ implementation 'com.android.support:appcompat-v7:26.1.0'
+ implementation 'com.android.support.constraint:constraint-layout:1.0.2'
+ implementation 'com.android.support:recyclerview-v7:26.1.0'
+ implementation 'com.android.support:cardview-v7:26.1.0'
+ implementation 'com.android.support:design:26.1.0'
+ implementation 'com.squareup.retrofit2:retrofit:2.3.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
+ implementation 'com.squareup.okhttp3:logging-interceptor:3.2.0'
+ implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
+ implementation 'io.reactivex.rxjava2:rxjava:2.1.9'
+ implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'com.android.support.test:runner:1.0.1'
+ androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
+}
diff --git a/WeatherReport/app/proguard-rules.pro b/WeatherReport/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/WeatherReport/app/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# 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 *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/WeatherReport/app/src/androidTest/java/com/walmart/weatherreport/ExampleInstrumentedTest.java b/WeatherReport/app/src/androidTest/java/com/walmart/weatherreport/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..5581671
--- /dev/null
+++ b/WeatherReport/app/src/androidTest/java/com/walmart/weatherreport/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.walmart.weatherreport;
+
+import android.content.Context;
+import android.support.test.InstrumentationRegistry;
+import android.support.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() throws Exception {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getTargetContext();
+
+ assertEquals("com.walmart.weatherreport", appContext.getPackageName());
+ }
+}
diff --git a/WeatherReport/app/src/main/AndroidManifest.xml b/WeatherReport/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..b98e403
--- /dev/null
+++ b/WeatherReport/app/src/main/AndroidManifest.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/WeatherReport/app/src/main/java/com/walmart/weatherreport/activities/WeatherActivity.java b/WeatherReport/app/src/main/java/com/walmart/weatherreport/activities/WeatherActivity.java
new file mode 100644
index 0000000..ec78275
--- /dev/null
+++ b/WeatherReport/app/src/main/java/com/walmart/weatherreport/activities/WeatherActivity.java
@@ -0,0 +1,105 @@
+package com.walmart.weatherreport.activities;
+
+import android.os.Bundle;
+import android.support.constraint.ConstraintLayout;
+import android.support.design.widget.Snackbar;
+import android.support.design.widget.TextInputEditText;
+import android.support.design.widget.TextInputLayout;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.view.KeyEvent;
+import android.view.inputmethod.EditorInfo;
+import android.widget.TextView;
+
+import com.walmart.weatherreport.R;
+import com.walmart.weatherreport.adapter.WeatherAdapter;
+import com.walmart.weatherreport.model.WeatherImpl;
+import com.walmart.weatherreport.model.WeatherResponse;
+import com.walmart.weatherreport.presenter.WeatherListPresenter;
+import com.walmart.weatherreport.presenter.WeatherPresenter;
+import com.walmart.weatherreport.view.WeatherView;
+
+public class WeatherActivity extends AppCompatActivity implements WeatherView {
+ private TextInputEditText mCity;
+ private TextInputLayout mCityLay;
+ private RecyclerView mWeatherList;
+ private WeatherPresenter presenter;
+ private ConstraintLayout view;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_weather);
+ view = findViewById(R.id.top);
+ mCity = findViewById(R.id.tetEnterLocation);
+ mCityLay = findViewById(R.id.tilPlace);
+ mWeatherList = findViewById(R.id.cityWeathers);
+ mWeatherList.setHasFixedSize(true);
+ LinearLayoutManager layoutManager = new LinearLayoutManager(this);
+ mWeatherList.setLayoutManager(layoutManager);
+ presenter = new WeatherImpl(this);
+ presenter.getWeatherList("Bangalore");
+ mCity.setImeOptions(EditorInfo.IME_ACTION_DONE);
+ mCity.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence s, int start, int before, int count) {
+
+ }
+
+ @Override
+ public void afterTextChanged(Editable s) {
+ if (s.length() > 3)
+ presenter.getWeatherList(mCity.getText().toString());
+ }
+ });
+ mCity.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+ @Override
+ public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+ if (actionId == EditorInfo.IME_ACTION_DONE) {
+ presenter.getWeatherList(mCity.getText().toString());
+ return true;
+ }
+ return false;
+ }
+ });
+ }
+
+ @Override
+ public void weatherResultsSuccess(WeatherResponse response) {
+ WeatherAdapter weatherAdapter = new WeatherAdapter(new WeatherListPresenter(response.getWeatherList()));
+ mWeatherList.setAdapter(weatherAdapter);
+ }
+
+ @Override
+ public void weatherResultsFailure() {
+ Snackbar.make(view, "Something Is Wrong Please Try Again", Snackbar.LENGTH_SHORT).show();
+ }
+
+ @Override
+ public void weatherValidations() {
+ mCityLay.setError("Please Enter the City");
+ }
+
+ @Override
+ public void onUnknownError(String message) {
+ Snackbar.make(view, message, Snackbar.LENGTH_SHORT).show();
+ }
+
+ @Override
+ public void onTimeout() {
+ Snackbar.make(view, "Service is Broken", Snackbar.LENGTH_SHORT).show();
+ }
+
+ @Override
+ public void onNetworkError() {
+ Snackbar.make(view, "Please Check the Network again", Snackbar.LENGTH_SHORT).show();
+ }
+}
diff --git a/WeatherReport/app/src/main/java/com/walmart/weatherreport/adapter/WeatherAdapter.java b/WeatherReport/app/src/main/java/com/walmart/weatherreport/adapter/WeatherAdapter.java
new file mode 100644
index 0000000..f7281c7
--- /dev/null
+++ b/WeatherReport/app/src/main/java/com/walmart/weatherreport/adapter/WeatherAdapter.java
@@ -0,0 +1,36 @@
+package com.walmart.weatherreport.adapter;
+
+import android.content.Context;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import com.walmart.weatherreport.R;
+import com.walmart.weatherreport.presenter.WeatherListPresenter;
+
+public class WeatherAdapter extends RecyclerView.Adapter {
+ private WeatherListPresenter mWeatherLists;
+ private Context context;
+
+ public WeatherAdapter(WeatherListPresenter weatherLists) {
+ this.mWeatherLists = weatherLists;
+ }
+
+ @Override
+ public WeatherHolder onCreateViewHolder(ViewGroup parent, int viewType) {
+ context = parent.getContext();
+ View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.adapter_weather_list, parent, false);
+ return new WeatherHolder(v);
+ }
+
+ @Override
+ public void onBindViewHolder(WeatherHolder holder, int position) {
+ mWeatherLists.onBindRepositoryRowViewAtPosition(position, holder);
+ }
+
+ @Override
+ public int getItemCount() {
+ return mWeatherLists.getWeatherCount();
+ }
+}
diff --git a/WeatherReport/app/src/main/java/com/walmart/weatherreport/adapter/WeatherHolder.java b/WeatherReport/app/src/main/java/com/walmart/weatherreport/adapter/WeatherHolder.java
new file mode 100644
index 0000000..8cd62ee
--- /dev/null
+++ b/WeatherReport/app/src/main/java/com/walmart/weatherreport/adapter/WeatherHolder.java
@@ -0,0 +1,41 @@
+package com.walmart.weatherreport.adapter;
+
+import android.content.Context;
+import android.support.v7.widget.RecyclerView;
+import android.view.View;
+import android.widget.TextView;
+
+import com.walmart.weatherreport.R;
+import com.walmart.weatherreport.view.WeatherAdapterView;
+
+public class WeatherHolder extends RecyclerView.ViewHolder implements WeatherAdapterView {
+ TextView tempArea;
+ TextView tempMin;
+ TextView tempDescription;
+ Context mContext;
+
+ public WeatherHolder(View itemView) {
+ super(itemView);
+ mContext = itemView.getContext();
+ tempArea = itemView.findViewById(R.id.tempArea);
+ tempMin = itemView.findViewById(R.id.tempMin);
+ tempDescription = itemView.findViewById(R.id.tempType);
+ }
+
+ @Override
+ public void setTempType(String main, String type) {
+ String description = mContext.getResources().getString(R.string.temp_desc, main, type);
+ tempDescription.setText(description);
+ }
+
+ @Override
+ public void setLocation(String location) {
+ tempArea.setText(location);
+ }
+
+ @Override
+ public void setTemperature(double minTemperature, double maxTemperature) {
+ String temperature = mContext.getResources().getString(R.string.temp_min, String.format("%.2f", minTemperature), String.format("%.2f", minTemperature));
+ tempMin.setText(temperature);
+ }
+}
diff --git a/WeatherReport/app/src/main/java/com/walmart/weatherreport/model/CallbackWrapper.java b/WeatherReport/app/src/main/java/com/walmart/weatherreport/model/CallbackWrapper.java
new file mode 100644
index 0000000..315d3a2
--- /dev/null
+++ b/WeatherReport/app/src/main/java/com/walmart/weatherreport/model/CallbackWrapper.java
@@ -0,0 +1,57 @@
+package com.walmart.weatherreport.model;
+
+import com.jakewharton.retrofit2.adapter.rxjava2.HttpException;
+import com.walmart.weatherreport.view.WeatherView;
+
+import org.json.JSONObject;
+
+import java.io.IOException;
+import java.lang.ref.WeakReference;
+import java.net.SocketTimeoutException;
+
+import io.reactivex.observers.DisposableObserver;
+import okhttp3.ResponseBody;
+
+public abstract class CallbackWrapper extends DisposableObserver {
+ //BaseView is just a reference of a View in MVP
+ private WeakReference weakReference;
+
+ public CallbackWrapper(WeatherView view) {
+ this.weakReference = new WeakReference<>(view);
+ }
+
+ protected abstract void onSuccess(T t);
+
+ @Override
+ public void onNext(T t) {
+ onSuccess(t);
+ }
+
+ @Override
+ public void onError(Throwable e) {
+ WeatherView view = weakReference.get();
+ if (e instanceof HttpException) {
+ ResponseBody responseBody = ((HttpException)e).response().errorBody();
+ view.onUnknownError(getErrorMessage(responseBody));
+ } else if (e instanceof SocketTimeoutException) {
+ view.onTimeout();
+ } else if (e instanceof IOException) {
+ view.onNetworkError();
+ } else {
+ view.onUnknownError(e.getMessage());
+ }
+ }
+
+ @Override
+ public void onComplete() {
+ }
+
+ private String getErrorMessage(ResponseBody responseBody) {
+ try {
+ JSONObject jsonObject = new JSONObject(responseBody.string());
+ return jsonObject.getString("message");
+ } catch (Exception e) {
+ return e.getMessage();
+ }
+ }
+}
\ No newline at end of file
diff --git a/WeatherReport/app/src/main/java/com/walmart/weatherreport/model/Clouds.java b/WeatherReport/app/src/main/java/com/walmart/weatherreport/model/Clouds.java
new file mode 100644
index 0000000..715fbeb
--- /dev/null
+++ b/WeatherReport/app/src/main/java/com/walmart/weatherreport/model/Clouds.java
@@ -0,0 +1,16 @@
+package com.walmart.weatherreport.model;
+
+import com.google.gson.annotations.SerializedName;
+
+public class Clouds {
+ @SerializedName("all")
+ private Integer all;
+
+ public Integer getAll() {
+ return all;
+ }
+
+ public void setAll(Integer all) {
+ this.all = all;
+ }
+}
diff --git a/WeatherReport/app/src/main/java/com/walmart/weatherreport/model/Country.java b/WeatherReport/app/src/main/java/com/walmart/weatherreport/model/Country.java
new file mode 100644
index 0000000..228e0e9
--- /dev/null
+++ b/WeatherReport/app/src/main/java/com/walmart/weatherreport/model/Country.java
@@ -0,0 +1,16 @@
+package com.walmart.weatherreport.model;
+
+import com.google.gson.annotations.SerializedName;
+
+public class Country {
+ @SerializedName("country")
+ private String country;
+
+ public String getCountry() {
+ return country;
+ }
+
+ public void setCountry(String country) {
+ this.country = country;
+ }
+}
diff --git a/WeatherReport/app/src/main/java/com/walmart/weatherreport/model/LatitudeLongitude.java b/WeatherReport/app/src/main/java/com/walmart/weatherreport/model/LatitudeLongitude.java
new file mode 100644
index 0000000..3420af1
--- /dev/null
+++ b/WeatherReport/app/src/main/java/com/walmart/weatherreport/model/LatitudeLongitude.java
@@ -0,0 +1,26 @@
+package com.walmart.weatherreport.model;
+
+import com.google.gson.annotations.SerializedName;
+
+public class LatitudeLongitude {
+ @SerializedName("lat")
+ private Double lat;
+ @SerializedName("lon")
+ private Double lon;
+
+ public Double getLat() {
+ return lat;
+ }
+
+ public void setLat(Double lat) {
+ this.lat = lat;
+ }
+
+ public Double getLon() {
+ return lon;
+ }
+
+ public void setLon(Double lon) {
+ this.lon = lon;
+ }
+}
diff --git a/WeatherReport/app/src/main/java/com/walmart/weatherreport/model/Temperature.java b/WeatherReport/app/src/main/java/com/walmart/weatherreport/model/Temperature.java
new file mode 100644
index 0000000..af2e45c
--- /dev/null
+++ b/WeatherReport/app/src/main/java/com/walmart/weatherreport/model/Temperature.java
@@ -0,0 +1,56 @@
+package com.walmart.weatherreport.model;
+
+import com.google.gson.annotations.SerializedName;
+
+public class Temperature {
+ @SerializedName("temp")
+ private Double temp;
+ @SerializedName("pressure")
+ private Integer pressure;
+ @SerializedName("humidity")
+ private Integer humidity;
+ @SerializedName("temp_min")
+ private Double tempMin;
+ @SerializedName("temp_max")
+ private Double tempMax;
+
+ public Double getTemp() {
+ return temp;
+ }
+
+ public void setTemp(Double temp) {
+ this.temp = temp;
+ }
+
+ public Integer getPressure() {
+ return pressure;
+ }
+
+ public void setPressure(Integer pressure) {
+ this.pressure = pressure;
+ }
+
+ public Integer getHumidity() {
+ return humidity;
+ }
+
+ public void setHumidity(Integer humidity) {
+ this.humidity = humidity;
+ }
+
+ public Double getTempMin() {
+ return tempMin;
+ }
+
+ public void setTempMin(Double tempMin) {
+ this.tempMin = tempMin;
+ }
+
+ public Double getTempMax() {
+ return tempMax;
+ }
+
+ public void setTempMax(Double tempMax) {
+ this.tempMax = tempMax;
+ }
+}
diff --git a/WeatherReport/app/src/main/java/com/walmart/weatherreport/model/Weather.java b/WeatherReport/app/src/main/java/com/walmart/weatherreport/model/Weather.java
new file mode 100644
index 0000000..f7cbf91
--- /dev/null
+++ b/WeatherReport/app/src/main/java/com/walmart/weatherreport/model/Weather.java
@@ -0,0 +1,47 @@
+package com.walmart.weatherreport.model;
+
+import com.google.gson.annotations.SerializedName;
+
+public class Weather {
+ @SerializedName("id")
+ private Integer id;
+ @SerializedName("main")
+ private String main;
+ @SerializedName("description")
+ private String description;
+ @SerializedName("icon")
+ private String icon;
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public String getMain() {
+ return main;
+ }
+
+ public void setMain(String main) {
+ this.main = main;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getIcon() {
+ return icon;
+ }
+
+ public void setIcon(String icon) {
+ this.icon = icon;
+ }
+
+}
diff --git a/WeatherReport/app/src/main/java/com/walmart/weatherreport/model/WeatherImpl.java b/WeatherReport/app/src/main/java/com/walmart/weatherreport/model/WeatherImpl.java
new file mode 100644
index 0000000..228f132
--- /dev/null
+++ b/WeatherReport/app/src/main/java/com/walmart/weatherreport/model/WeatherImpl.java
@@ -0,0 +1,59 @@
+package com.walmart.weatherreport.model;
+
+import android.text.TextUtils;
+import android.util.Log;
+
+import com.walmart.weatherreport.presenter.WeatherPresenter;
+import com.walmart.weatherreport.rest.ApiClient;
+import com.walmart.weatherreport.rest.ApiInterface;
+import com.walmart.weatherreport.view.WeatherView;
+
+import java.net.HttpURLConnection;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+import static com.walmart.weatherreport.utils.WeatherConstants.APP_ID;
+
+public class WeatherImpl implements WeatherPresenter {
+
+ private static final String TAG = WeatherImpl.class.getSimpleName();
+ WeatherView mWeatherView;
+
+ public WeatherImpl(WeatherView weatherView) {
+ this.mWeatherView = weatherView;
+ }
+
+ @Override
+ public void getWeatherList(String place) {
+ if (TextUtils.isEmpty(place)) {
+ mWeatherView.weatherValidations();
+ } else {
+ getWeatherDetails(place);
+ }
+ }
+
+ private void getWeatherDetails(String place) {
+ ApiInterface apiService = ApiClient.getBaseClient(false).create(ApiInterface.class);
+ Call call = apiService.sendRequest(place, APP_ID);
+ call.enqueue(new Callback() {
+ @Override
+ public void onResponse(Call call, Response response) {
+ if (response.code() == HttpURLConnection.HTTP_OK) {
+ mWeatherView.weatherResultsSuccess(response.body());
+ } else {
+ mWeatherView.weatherResultsFailure();
+ }
+ Log.e(TAG, "Response Code " + response.message());
+ }
+
+ @Override
+ public void onFailure(Call call, Throwable t) {
+ Log.e(TAG, "Error Due To " + t.toString());
+ mWeatherView.weatherResultsFailure();
+ }
+ });
+
+ }
+}
diff --git a/WeatherReport/app/src/main/java/com/walmart/weatherreport/model/WeatherList.java b/WeatherReport/app/src/main/java/com/walmart/weatherreport/model/WeatherList.java
new file mode 100644
index 0000000..fd3d73a
--- /dev/null
+++ b/WeatherReport/app/src/main/java/com/walmart/weatherreport/model/WeatherList.java
@@ -0,0 +1,118 @@
+package com.walmart.weatherreport.model;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.util.List;
+
+public class WeatherList {
+ @SerializedName("id")
+ private Integer id;
+ @SerializedName("name")
+ private String name;
+ @SerializedName("coord")
+ private LatitudeLongitude latitudeLongitude;
+ @SerializedName("main")
+ private Temperature temperature;
+ @SerializedName("dt")
+ private Integer dt;
+ @SerializedName("wind")
+ private Wind wind;
+ @SerializedName("sys")
+ private Country country;
+ @SerializedName("rain")
+ private Object rain;
+ @SerializedName("snow")
+ private Object snow;
+ @SerializedName("clouds")
+ private Clouds clouds;
+ @SerializedName("weather")
+ private java.util.List weather = null;
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public LatitudeLongitude getLatitudeLongitude() {
+ return latitudeLongitude;
+ }
+
+ public void setLatitudeLongitude(LatitudeLongitude latitudeLongitude) {
+ this.latitudeLongitude = latitudeLongitude;
+ }
+
+ public Temperature getTemperature() {
+ return temperature;
+ }
+
+ public void setTemperature(Temperature temperature) {
+ this.temperature = temperature;
+ }
+
+ public Integer getDt() {
+ return dt;
+ }
+
+ public void setDt(Integer dt) {
+ this.dt = dt;
+ }
+
+ public Wind getWind() {
+ return wind;
+ }
+
+ public void setWind(Wind wind) {
+ this.wind = wind;
+ }
+
+ public Country getCountry() {
+ return country;
+ }
+
+ public void setCountry(Country sys) {
+ this.country = sys;
+ }
+
+ public Object getRain() {
+ return rain;
+ }
+
+ public void setRain(Object rain) {
+ this.rain = rain;
+ }
+
+ public Object getSnow() {
+ return snow;
+ }
+
+ public void setSnow(Object snow) {
+ this.snow = snow;
+ }
+
+ public Clouds getClouds() {
+ return clouds;
+ }
+
+ public void setClouds(Clouds clouds) {
+ this.clouds = clouds;
+ }
+
+ public List getWeather() {
+ return weather;
+ }
+
+ public void setWeather(List weather) {
+ this.weather = weather;
+ }
+}
diff --git a/WeatherReport/app/src/main/java/com/walmart/weatherreport/model/WeatherResponse.java b/WeatherReport/app/src/main/java/com/walmart/weatherreport/model/WeatherResponse.java
new file mode 100644
index 0000000..c107521
--- /dev/null
+++ b/WeatherReport/app/src/main/java/com/walmart/weatherreport/model/WeatherResponse.java
@@ -0,0 +1,48 @@
+package com.walmart.weatherreport.model;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.util.List;
+
+public class WeatherResponse {
+ @SerializedName("message")
+ private String message;
+ @SerializedName("cod")
+ private String cod;
+ @SerializedName("count")
+ private Integer count;
+ @SerializedName("list")
+ private List list = null;
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public String getCod() {
+ return cod;
+ }
+
+ public void setCod(String cod) {
+ this.cod = cod;
+ }
+
+ public Integer getCount() {
+ return count;
+ }
+
+ public void setCount(Integer count) {
+ this.count = count;
+ }
+
+ public List getWeatherList() {
+ return list;
+ }
+
+ public void setWeatherList(List list) {
+ this.list = list;
+ }
+}
diff --git a/WeatherReport/app/src/main/java/com/walmart/weatherreport/model/Wind.java b/WeatherReport/app/src/main/java/com/walmart/weatherreport/model/Wind.java
new file mode 100644
index 0000000..4804af5
--- /dev/null
+++ b/WeatherReport/app/src/main/java/com/walmart/weatherreport/model/Wind.java
@@ -0,0 +1,29 @@
+package com.walmart.weatherreport.model;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+
+public class Wind {
+ @SerializedName("speed")
+ @Expose
+ private Double speed;
+ @SerializedName("deg")
+ @Expose
+ private Integer deg;
+
+ public Double getSpeed() {
+ return speed;
+ }
+
+ public void setSpeed(Double speed) {
+ this.speed = speed;
+ }
+
+ public Integer getDeg() {
+ return deg;
+ }
+
+ public void setDeg(Integer deg) {
+ this.deg = deg;
+ }
+}
diff --git a/WeatherReport/app/src/main/java/com/walmart/weatherreport/presenter/WeatherListPresenter.java b/WeatherReport/app/src/main/java/com/walmart/weatherreport/presenter/WeatherListPresenter.java
new file mode 100644
index 0000000..3a2983a
--- /dev/null
+++ b/WeatherReport/app/src/main/java/com/walmart/weatherreport/presenter/WeatherListPresenter.java
@@ -0,0 +1,33 @@
+package com.walmart.weatherreport.presenter;
+
+import com.walmart.weatherreport.model.WeatherList;
+import com.walmart.weatherreport.view.WeatherAdapterView;
+
+import java.util.List;
+
+public class WeatherListPresenter {
+
+ private List repositories;
+
+ public WeatherListPresenter(List repositories){
+ this.repositories = repositories;
+ }
+
+ public void onBindRepositoryRowViewAtPosition(int position, WeatherAdapterView rowView) {
+ WeatherList weather = repositories.get(position);
+ double tempMin, tempMax;
+ tempMin = weather.getTemperature().getTempMin() - 273.0;
+ tempMax = weather.getTemperature().getTempMax() - 273.0;
+ if (weather.getWeather().size() != 0) {
+ rowView.setTempType(weather.getWeather().get(0).getMain(),
+ weather.getWeather().get(0).getDescription());
+ }
+ rowView.setLocation(weather.getName());
+ rowView.setTemperature(tempMin, tempMax);
+
+ }
+
+ public int getWeatherCount() {
+ return repositories.size();
+ }
+}
diff --git a/WeatherReport/app/src/main/java/com/walmart/weatherreport/presenter/WeatherPresenter.java b/WeatherReport/app/src/main/java/com/walmart/weatherreport/presenter/WeatherPresenter.java
new file mode 100644
index 0000000..7385d0a
--- /dev/null
+++ b/WeatherReport/app/src/main/java/com/walmart/weatherreport/presenter/WeatherPresenter.java
@@ -0,0 +1,5 @@
+package com.walmart.weatherreport.presenter;
+
+public interface WeatherPresenter {
+ void getWeatherList(String place);
+}
diff --git a/WeatherReport/app/src/main/java/com/walmart/weatherreport/rest/ApiClient.java b/WeatherReport/app/src/main/java/com/walmart/weatherreport/rest/ApiClient.java
new file mode 100644
index 0000000..8824db1
--- /dev/null
+++ b/WeatherReport/app/src/main/java/com/walmart/weatherreport/rest/ApiClient.java
@@ -0,0 +1,95 @@
+package com.walmart.weatherreport.rest;
+
+/**
+ * Created by raheem on 28-01-2017.
+ */
+
+import android.util.Log;
+
+import java.io.IOException;
+
+import okhttp3.Dispatcher;
+import okhttp3.Interceptor;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.Response;
+import okhttp3.logging.HttpLoggingInterceptor;
+import retrofit2.Retrofit;
+import retrofit2.converter.gson.GsonConverterFactory;
+
+
+public class ApiClient {
+ public static final String BASE_URL = "http://api.openweathermap.org/";
+ private static Retrofit retrofitEndPointHeaders = null;
+ private static Retrofit retrofitEndPointNoHeaders = null;
+ private static Retrofit retrofitSms = null;
+ private static Dispatcher mDispatcher = new Dispatcher();
+ private static OkHttpClient mHttpClient;
+
+ public static Retrofit getBaseClient(boolean isHeadersRequired) {
+ if (isHeadersRequired) {
+ if (retrofitEndPointHeaders == null) {
+ retrofitEndPointHeaders = new Retrofit.Builder()
+ .baseUrl(BASE_URL)
+ .addConverterFactory(GsonConverterFactory.create())
+ .client(getHttpClient(isHeadersRequired))
+ .build();
+ }
+ return retrofitEndPointHeaders;
+ } else {
+ if (retrofitEndPointNoHeaders == null) {
+ retrofitEndPointNoHeaders = new Retrofit.Builder()
+ .baseUrl(BASE_URL)
+ .addConverterFactory(GsonConverterFactory.create())
+ .build();
+ }
+ return retrofitEndPointNoHeaders;
+ }
+
+ }
+
+
+ public static Dispatcher getDispatcher() {
+ if (mDispatcher == null)
+ mDispatcher = new Dispatcher();
+ return mDispatcher;
+ }
+
+ public static OkHttpClient getHttpClient(boolean isHeadersRequired) {
+ if (mHttpClient == null) {
+ HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor(
+ new HttpLoggingInterceptor.Logger() {
+ @Override
+ public void log(String message) {
+ Log.i("ApiClient", message);
+ }
+ }
+ );
+ loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BASIC);
+
+ OkHttpClient.Builder httpClient = new OkHttpClient.Builder();
+ httpClient.addInterceptor(loggingInterceptor);
+ httpClient.dispatcher(getDispatcher());
+ httpClient.addInterceptor(new Interceptor() {
+ @Override
+ public Response intercept(Interceptor.Chain chain) throws IOException {
+ Request original = chain.request();
+
+ Request.Builder builder = original.newBuilder();
+// if (AppPrefSettings.getActiveUser() != null)
+// builder.header("Cookie", AppPrefSettings.getActiveUser().getCookieToken())
+// .header("X-CSRF-TOKEN", AppPrefSettings.getActiveUser().getXcsrfToken());
+
+ Request request = builder
+ .method(original.method(), original.body())
+ .build();
+
+ return chain.proceed(request);
+ }
+ });
+ mHttpClient = httpClient.build();
+ }
+ return mHttpClient;
+ }
+
+}
\ No newline at end of file
diff --git a/WeatherReport/app/src/main/java/com/walmart/weatherreport/rest/ApiInterface.java b/WeatherReport/app/src/main/java/com/walmart/weatherreport/rest/ApiInterface.java
new file mode 100644
index 0000000..b6acd52
--- /dev/null
+++ b/WeatherReport/app/src/main/java/com/walmart/weatherreport/rest/ApiInterface.java
@@ -0,0 +1,24 @@
+package com.walmart.weatherreport.rest;
+
+/**
+ * Created by raheem on 28-01-2017.
+ */
+
+import com.walmart.weatherreport.model.WeatherResponse;
+
+import retrofit2.Call;
+import retrofit2.http.GET;
+import retrofit2.http.Query;
+
+
+public interface ApiInterface {
+
+
+// @GET("/data/2.5/find")
+// Observable sendRequest(@Query("q") String place, @Query("appid") String appID);
+
+
+ @GET("/data/2.5/find")
+ Call sendRequest(@Query("q") String place, @Query("appid") String appID);
+
+}
\ No newline at end of file
diff --git a/WeatherReport/app/src/main/java/com/walmart/weatherreport/utils/WeatherConstants.java b/WeatherReport/app/src/main/java/com/walmart/weatherreport/utils/WeatherConstants.java
new file mode 100644
index 0000000..7f8cc84
--- /dev/null
+++ b/WeatherReport/app/src/main/java/com/walmart/weatherreport/utils/WeatherConstants.java
@@ -0,0 +1,5 @@
+package com.walmart.weatherreport.utils;
+
+public class WeatherConstants {
+ public static final String APP_ID = "8c949a0a769924325b1cbe6d85f9afbf";
+}
diff --git a/WeatherReport/app/src/main/java/com/walmart/weatherreport/view/WeatherAdapterView.java b/WeatherReport/app/src/main/java/com/walmart/weatherreport/view/WeatherAdapterView.java
new file mode 100644
index 0000000..ca926f4
--- /dev/null
+++ b/WeatherReport/app/src/main/java/com/walmart/weatherreport/view/WeatherAdapterView.java
@@ -0,0 +1,11 @@
+package com.walmart.weatherreport.view;
+
+public interface WeatherAdapterView {
+
+ void setTempType(String main,String type);
+
+ void setLocation(String location);
+
+ void setTemperature(double minTemperature,double maxTemperature);
+
+}
diff --git a/WeatherReport/app/src/main/java/com/walmart/weatherreport/view/WeatherView.java b/WeatherReport/app/src/main/java/com/walmart/weatherreport/view/WeatherView.java
new file mode 100644
index 0000000..3287cc9
--- /dev/null
+++ b/WeatherReport/app/src/main/java/com/walmart/weatherreport/view/WeatherView.java
@@ -0,0 +1,17 @@
+package com.walmart.weatherreport.view;
+
+import com.walmart.weatherreport.model.WeatherResponse;
+
+public interface WeatherView {
+ void weatherResultsSuccess(WeatherResponse response);
+
+ void weatherResultsFailure();
+
+ void weatherValidations();
+
+ void onUnknownError(String message);
+
+ void onTimeout();
+
+ void onNetworkError();
+}
diff --git a/WeatherReport/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/WeatherReport/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 0000000..c7bd21d
--- /dev/null
+++ b/WeatherReport/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WeatherReport/app/src/main/res/drawable/ic_launcher_background.xml b/WeatherReport/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..d5fccc5
--- /dev/null
+++ b/WeatherReport/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WeatherReport/app/src/main/res/layout/activity_weather.xml b/WeatherReport/app/src/main/res/layout/activity_weather.xml
new file mode 100644
index 0000000..6b329c0
--- /dev/null
+++ b/WeatherReport/app/src/main/res/layout/activity_weather.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/WeatherReport/app/src/main/res/layout/adapter_weather_list.xml b/WeatherReport/app/src/main/res/layout/adapter_weather_list.xml
new file mode 100644
index 0000000..6fa6a2b
--- /dev/null
+++ b/WeatherReport/app/src/main/res/layout/adapter_weather_list.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/WeatherReport/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/WeatherReport/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/WeatherReport/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/WeatherReport/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/WeatherReport/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/WeatherReport/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/WeatherReport/app/src/main/res/mipmap-hdpi/ic_launcher.png b/WeatherReport/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..a2f5908
Binary files /dev/null and b/WeatherReport/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/WeatherReport/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/WeatherReport/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 0000000..1b52399
Binary files /dev/null and b/WeatherReport/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/WeatherReport/app/src/main/res/mipmap-mdpi/ic_launcher.png b/WeatherReport/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..ff10afd
Binary files /dev/null and b/WeatherReport/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/WeatherReport/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/WeatherReport/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 0000000..115a4c7
Binary files /dev/null and b/WeatherReport/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/WeatherReport/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/WeatherReport/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..dcd3cd8
Binary files /dev/null and b/WeatherReport/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/WeatherReport/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/WeatherReport/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..459ca60
Binary files /dev/null and b/WeatherReport/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/WeatherReport/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/WeatherReport/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..8ca12fe
Binary files /dev/null and b/WeatherReport/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/WeatherReport/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/WeatherReport/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..8e19b41
Binary files /dev/null and b/WeatherReport/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/WeatherReport/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/WeatherReport/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..b824ebd
Binary files /dev/null and b/WeatherReport/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/WeatherReport/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/WeatherReport/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..4c19a13
Binary files /dev/null and b/WeatherReport/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/WeatherReport/app/src/main/res/values/colors.xml b/WeatherReport/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..3ab3e9c
--- /dev/null
+++ b/WeatherReport/app/src/main/res/values/colors.xml
@@ -0,0 +1,6 @@
+
+
+ #3F51B5
+ #303F9F
+ #FF4081
+
diff --git a/WeatherReport/app/src/main/res/values/strings.xml b/WeatherReport/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..4209b40
--- /dev/null
+++ b/WeatherReport/app/src/main/res/values/strings.xml
@@ -0,0 +1,7 @@
+
+ WeatherReport
+ Enter Location
+ %1$s C \ %2$s C
+ %1$s
+ %1$s / %2$s
+
diff --git a/WeatherReport/app/src/main/res/values/styles.xml b/WeatherReport/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..5885930
--- /dev/null
+++ b/WeatherReport/app/src/main/res/values/styles.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
diff --git a/WeatherReport/app/src/test/java/com/walmart/weatherreport/ExampleUnitTest.java b/WeatherReport/app/src/test/java/com/walmart/weatherreport/ExampleUnitTest.java
new file mode 100644
index 0000000..267bd4b
--- /dev/null
+++ b/WeatherReport/app/src/test/java/com/walmart/weatherreport/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.walmart.weatherreport;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() throws Exception {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/WeatherReport/build.gradle b/WeatherReport/build.gradle
new file mode 100644
index 0000000..e6b32bc
--- /dev/null
+++ b/WeatherReport/build.gradle
@@ -0,0 +1,27 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+
+ repositories {
+ google()
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:3.0.1'
+
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ google()
+ jcenter()
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/WeatherReport/gradle.properties b/WeatherReport/gradle.properties
new file mode 100644
index 0000000..aac7c9b
--- /dev/null
+++ b/WeatherReport/gradle.properties
@@ -0,0 +1,17 @@
+# Project-wide Gradle settings.
+
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx1536m
+
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
diff --git a/WeatherReport/gradle/wrapper/gradle-wrapper.jar b/WeatherReport/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..13372ae
Binary files /dev/null and b/WeatherReport/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/WeatherReport/gradle/wrapper/gradle-wrapper.properties b/WeatherReport/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..934b1fa
--- /dev/null
+++ b/WeatherReport/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Mon Mar 26 19:04:46 IST 2018
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
diff --git a/WeatherReport/gradlew b/WeatherReport/gradlew
new file mode 100644
index 0000000..9d82f78
--- /dev/null
+++ b/WeatherReport/gradlew
@@ -0,0 +1,160 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/WeatherReport/gradlew.bat b/WeatherReport/gradlew.bat
new file mode 100644
index 0000000..8a0b282
--- /dev/null
+++ b/WeatherReport/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/WeatherReport/settings.gradle b/WeatherReport/settings.gradle
new file mode 100644
index 0000000..e7b4def
--- /dev/null
+++ b/WeatherReport/settings.gradle
@@ -0,0 +1 @@
+include ':app'