diff --git a/.gitignore b/.gitignore
index 649affc..47333d9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,50 +1,50 @@
-### Android ###
-# Built application files
-*.apk
-*.ap_
-
-# Files for the ART/Dalvik VM
-*.dex
-
-# Java class files
-*.class
-
-# Generated files
-bin/
-gen/
-out/
-
-# Gradle files
-.gradle/
-build/
-
-# Local configuration file (sdk path, etc)
-local.properties
-
-# Proguard folder generated by Eclipse
-proguard/
-
-# Log Files
-*.log
-
-# Android Studio Navigation editor temp files
-.navigation/
-
-# Android Studio captures folder
-captures/
-
-# Intellij
-*.iml
-.idea/
-
-# Keystore files
-*.jks
-
-# External native build folder generated in Android Studio 2.2 and later
-.externalNativeBuild
-
-# Google Services (e.g. APIs or Firebase)
-google-services.json
-
-### Android Patch ###
-gen-external-apklibs
+### Android ###
+# Built application files
+*.apk
+*.ap_
+
+# Files for the ART/Dalvik VM
+*.dex
+
+# Java class files
+*.class
+
+# Generated files
+bin/
+gen/
+out/
+
+# Gradle files
+.gradle/
+build/
+
+# Local configuration file (sdk path, etc)
+local.properties
+
+# Proguard folder generated by Eclipse
+proguard/
+
+# Log Files
+*.log
+
+# Android Studio Navigation editor temp files
+.navigation/
+
+# Android Studio captures folder
+captures/
+
+# Intellij
+*.iml
+.idea/
+
+# Keystore files
+*.jks
+
+# External native build folder generated in Android Studio 2.2 and later
+.externalNativeBuild
+
+# Google Services (e.g. APIs or Firebase)
+google-services.json
+
+### Android Patch ###
+gen-external-apklibs
diff --git a/CoolDudesAssignment/.gitignore b/CoolDudesAssignment/.gitignore
new file mode 100644
index 0000000..47333d9
--- /dev/null
+++ b/CoolDudesAssignment/.gitignore
@@ -0,0 +1,50 @@
+### Android ###
+# Built application files
+*.apk
+*.ap_
+
+# Files for the ART/Dalvik VM
+*.dex
+
+# Java class files
+*.class
+
+# Generated files
+bin/
+gen/
+out/
+
+# Gradle files
+.gradle/
+build/
+
+# Local configuration file (sdk path, etc)
+local.properties
+
+# Proguard folder generated by Eclipse
+proguard/
+
+# Log Files
+*.log
+
+# Android Studio Navigation editor temp files
+.navigation/
+
+# Android Studio captures folder
+captures/
+
+# Intellij
+*.iml
+.idea/
+
+# Keystore files
+*.jks
+
+# External native build folder generated in Android Studio 2.2 and later
+.externalNativeBuild
+
+# Google Services (e.g. APIs or Firebase)
+google-services.json
+
+### Android Patch ###
+gen-external-apklibs
diff --git a/CoolDudesAssignment/app/.gitignore b/CoolDudesAssignment/app/.gitignore
new file mode 100644
index 0000000..3543521
--- /dev/null
+++ b/CoolDudesAssignment/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/CoolDudesAssignment/app/build.gradle
similarity index 78%
rename from app/build.gradle
rename to CoolDudesAssignment/app/build.gradle
index fe0a5c9..0566196 100644
--- a/app/build.gradle
+++ b/CoolDudesAssignment/app/build.gradle
@@ -1,29 +1,30 @@
-apply plugin: 'com.android.application'
-
-android {
- compileSdkVersion 25
- buildToolsVersion "25.0.2"
- defaultConfig {
- applicationId "com.sdsmdg.hareshkh.lectureassignment"
- minSdkVersion 19
- targetSdkVersion 25
- versionCode 1
- versionName "1.0"
- testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
-}
-
-dependencies {
- compile fileTree(dir: 'libs', include: ['*.jar'])
- androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
- exclude group: 'com.android.support', module: 'support-annotations'
- })
- compile 'com.android.support:appcompat-v7:25.1.0'
- testCompile 'junit:junit:4.12'
-}
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 25
+ buildToolsVersion "25.0.2"
+ defaultConfig {
+ applicationId "com.rohan.musicplayer"
+ minSdkVersion 21
+ targetSdkVersion 25
+ versionCode 1
+ versionName "1.0"
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ compile fileTree(dir: 'libs', include: ['*.jar'])
+ androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
+ exclude group: 'com.android.support', module: 'support-annotations'
+ })
+ compile 'com.android.support:appcompat-v7:25.2.0'
+ compile 'com.github.d-max:spots-dialog:0.7@aar'
+ testCompile 'junit:junit:4.12'
+}
diff --git a/CoolDudesAssignment/app/proguard-rules.pro b/CoolDudesAssignment/app/proguard-rules.pro
new file mode 100644
index 0000000..8a75ce1
--- /dev/null
+++ b/CoolDudesAssignment/app/proguard-rules.pro
@@ -0,0 +1,25 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in C:\Users\Rohan\AppData\Local\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 *;
+#}
+
+# 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/CoolDudesAssignment/app/src/androidTest/java/com/rohan/musicplayer/ExampleInstrumentedTest.java b/CoolDudesAssignment/app/src/androidTest/java/com/rohan/musicplayer/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..a5973e6
--- /dev/null
+++ b/CoolDudesAssignment/app/src/androidTest/java/com/rohan/musicplayer/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.rohan.musicplayer;
+
+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.rohan.musicplayer", appContext.getPackageName());
+ }
+}
diff --git a/CoolDudesAssignment/app/src/main/AndroidManifest.xml b/CoolDudesAssignment/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..5df532e
--- /dev/null
+++ b/CoolDudesAssignment/app/src/main/AndroidManifest.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CoolDudesAssignment/app/src/main/java/com/rohan/musicplayer/MainActivity.java b/CoolDudesAssignment/app/src/main/java/com/rohan/musicplayer/MainActivity.java
new file mode 100644
index 0000000..7f75021
--- /dev/null
+++ b/CoolDudesAssignment/app/src/main/java/com/rohan/musicplayer/MainActivity.java
@@ -0,0 +1,108 @@
+package com.rohan.musicplayer;
+
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.ServiceConnection;
+import android.os.Bundle;
+import android.os.IBinder;
+import android.support.v7.app.AppCompatActivity;
+import android.view.View;
+import android.widget.Button;
+
+import dmax.dialog.SpotsDialog;
+
+public class MainActivity extends AppCompatActivity {
+
+ MyService mService;
+ boolean mBound = false;
+ Button playButton;
+ Button pauseButton;
+ Button stopButton;
+ public SpotsDialog dialog;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+
+ playButton = (Button) findViewById(R.id.play);
+ pauseButton = (Button) findViewById(R.id.pause);
+ stopButton = (Button) findViewById(R.id.stop);
+
+ dialog = new SpotsDialog(this);
+ dialog.show();
+
+ Intent intent = new Intent(this, MyService.class);
+ bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
+
+ playButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (mBound)
+ mService.startPlayer();
+ }
+ });
+ pauseButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (mBound)
+ mService.pausePlayer();
+ }
+ });
+ stopButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (mBound)
+ mService.stopPlayer();
+ }
+ });
+
+ }
+
+ @Override
+ protected void onPause() {
+ super.onPause();
+ if (mBound)
+ mService.showNotification();
+ }
+
+ @Override
+ protected void onPostResume() {
+ super.onPostResume();
+ if (mBound)
+ mService.removeNotification();
+ }
+
+ @Override
+ protected void onDestroy() {
+ super.onDestroy();
+ if (mBound) {
+ unbindService(mConnection);
+ mBound = false;
+ }
+ }
+
+ private ServiceConnection mConnection = new ServiceConnection() {
+
+ @Override
+ public void onServiceConnected(ComponentName className, IBinder service) {
+ MyService.MyBinder binder = (MyService.MyBinder) service;
+ mService = binder.getService();
+ binder.setListener(new MyService.BoundServiceListener() {
+
+ @Override
+ public void finishedDownloading() {
+ dialog.dismiss();
+ }
+ });
+ mBound = true;
+ }
+
+ @Override
+ public void onServiceDisconnected(ComponentName arg0) {
+ mBound = false;
+ }
+ };
+
+}
diff --git a/CoolDudesAssignment/app/src/main/java/com/rohan/musicplayer/MessageReceiver.java b/CoolDudesAssignment/app/src/main/java/com/rohan/musicplayer/MessageReceiver.java
new file mode 100644
index 0000000..8168b47
--- /dev/null
+++ b/CoolDudesAssignment/app/src/main/java/com/rohan/musicplayer/MessageReceiver.java
@@ -0,0 +1,36 @@
+package com.rohan.musicplayer;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.os.Build;
+import android.os.Bundle;
+import android.telephony.SmsMessage;
+
+public class MessageReceiver extends BroadcastReceiver {
+ public void onReceive(Context context, Intent intent) {
+ Bundle myBundle = intent.getExtras();
+ SmsMessage[] messages = null;
+
+ if (myBundle != null) {
+ Object[] pdus = (Object[]) myBundle.get("pdus");
+
+ //String strMessage[] = new String[pdus.length];
+ messages = new SmsMessage[pdus.length];
+
+ for (int i = 0; i < messages.length; i++) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+ String format = myBundle.getString("format");
+ messages[i] = SmsMessage.createFromPdu((byte[]) pdus[i], format);
+ } else {
+ messages[i] = SmsMessage.createFromPdu((byte[]) pdus[i]);
+ }
+ Intent x = new Intent(context, MyService.class);
+ if (messages[i].getMessageBody().toLowerCase().trim().equals("play media")) {
+ context.startService(x);
+ }
+
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/CoolDudesAssignment/app/src/main/java/com/rohan/musicplayer/MyService.java b/CoolDudesAssignment/app/src/main/java/com/rohan/musicplayer/MyService.java
new file mode 100644
index 0000000..75e8af5
--- /dev/null
+++ b/CoolDudesAssignment/app/src/main/java/com/rohan/musicplayer/MyService.java
@@ -0,0 +1,146 @@
+package com.rohan.musicplayer;
+
+import android.app.Notification;
+import android.app.PendingIntent;
+import android.app.Service;
+import android.content.Intent;
+import android.media.AudioManager;
+import android.media.MediaPlayer;
+import android.os.AsyncTask;
+import android.os.Binder;
+import android.os.IBinder;
+import android.support.annotation.Nullable;
+import android.widget.Toast;
+
+import java.io.IOException;
+
+
+public class MyService extends Service {
+
+ private MediaPlayer mPlayer = new MediaPlayer();
+ private boolean playerIsSet = false;
+
+ public interface BoundServiceListener {
+
+ public void finishedDownloading();
+ }
+
+ public class MyBinder extends Binder {
+ MyService getService() {
+ return MyService.this;
+ }
+
+ public void setListener(BoundServiceListener listener) {
+ mListener = listener;
+ }
+ }
+
+ private final IBinder mBinder = new MyBinder();
+ private BoundServiceListener mListener;
+
+ @Nullable
+ @Override
+ public IBinder onBind(Intent intent) {
+ if (!playerIsSet) {
+ new LoadDataInBackground().execute();
+ }
+ return mBinder;
+ }
+
+ @Override
+ public boolean onUnbind(Intent intent) {
+ mPlayer.stop();
+ mPlayer.release();
+ playerIsSet = false;
+ stopSelf();
+ return super.onUnbind(intent);
+ }
+
+ @Override
+ public int onStartCommand(Intent intent, int flags, int startId) {
+ if (!playerIsSet) {
+ setUpPlayer();
+ playerIsSet = true;
+ }
+ if (!mPlayer.isPlaying())
+ mPlayer.start();
+ return super.onStartCommand(intent, flags, startId);
+ }
+
+ private class LoadDataInBackground extends AsyncTask {
+
+ @Override
+ protected Void doInBackground(Void... params) {
+ setUpPlayer();
+ return null;
+ }
+
+ @Override
+ protected void onPostExecute(Void aVoid) {
+ super.onPostExecute(aVoid);
+ playerIsSet = true;
+ if (mListener != null)
+ mListener.finishedDownloading();
+ }
+ }
+
+ public void setUpPlayer() {
+ mPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
+ try {
+ String URL = "http://dot.890m.com/shapeofyou.mp3";
+ mPlayer.setDataSource(URL);
+ } catch (IllegalArgumentException e) {
+ Toast.makeText(getApplicationContext(), "You might not set the URI correctly!", Toast.LENGTH_LONG).show();
+ } catch (SecurityException e) {
+ Toast.makeText(getApplicationContext(), "You might not set the URI correctly!", Toast.LENGTH_LONG).show();
+ } catch (IllegalStateException e) {
+ Toast.makeText(getApplicationContext(), "You might not set the URI correctly!", Toast.LENGTH_LONG).show();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ try {
+ mPlayer.prepare();
+ } catch (IllegalStateException e) {
+ Toast.makeText(getApplicationContext(), "You might not set the URI correctly!", Toast.LENGTH_LONG).show();
+ } catch (IOException e) {
+ Toast.makeText(getApplicationContext(), "You might not set the URI correctly!", Toast.LENGTH_LONG).show();
+ }
+ }
+
+ public void startPlayer() {
+ mPlayer.start();
+ }
+
+ public void pausePlayer() {
+ mPlayer.pause();
+ }
+
+ public void stopPlayer() {
+ mPlayer.stop();
+ try {
+ mPlayer.prepare();
+ } catch (IllegalStateException e) {
+ Toast.makeText(getApplicationContext(), "You might not set the URI correctly!", Toast.LENGTH_LONG).show();
+ } catch (IOException e) {
+ Toast.makeText(getApplicationContext(), "You might not set the URI correctly!", Toast.LENGTH_LONG).show();
+ }
+ }
+
+ public void showNotification() {
+ Intent notificationIntent = new Intent(this, MainActivity.class);
+ PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
+
+ Notification notification = new Notification.Builder(this)
+ .setContentTitle("Shape of You")
+ .setContentText("Tap to open app")
+ .setSmallIcon(R.mipmap.ic_launcher)
+ .setContentIntent(pendingIntent)
+ .setTicker("Music Player is running")
+ .build();
+ startForeground(101, notification);
+ }
+
+ public void removeNotification() {
+ stopForeground(true);
+ }
+}
diff --git a/CoolDudesAssignment/app/src/main/res/layout/activity_main.xml b/CoolDudesAssignment/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..0fc7e4c
--- /dev/null
+++ b/CoolDudesAssignment/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/CoolDudesAssignment/app/src/main/res/mipmap-hdpi/ic_launcher.png
similarity index 100%
rename from app/src/main/res/mipmap-hdpi/ic_launcher.png
rename to CoolDudesAssignment/app/src/main/res/mipmap-hdpi/ic_launcher.png
diff --git a/CoolDudesAssignment/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/CoolDudesAssignment/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 0000000..9a078e3
Binary files /dev/null and b/CoolDudesAssignment/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/CoolDudesAssignment/app/src/main/res/mipmap-mdpi/ic_launcher.png
similarity index 100%
rename from app/src/main/res/mipmap-mdpi/ic_launcher.png
rename to CoolDudesAssignment/app/src/main/res/mipmap-mdpi/ic_launcher.png
diff --git a/CoolDudesAssignment/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/CoolDudesAssignment/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 0000000..efc028a
Binary files /dev/null and b/CoolDudesAssignment/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/CoolDudesAssignment/app/src/main/res/mipmap-xhdpi/ic_launcher.png
similarity index 100%
rename from app/src/main/res/mipmap-xhdpi/ic_launcher.png
rename to CoolDudesAssignment/app/src/main/res/mipmap-xhdpi/ic_launcher.png
diff --git a/CoolDudesAssignment/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/CoolDudesAssignment/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..3af2608
Binary files /dev/null and b/CoolDudesAssignment/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/CoolDudesAssignment/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
similarity index 100%
rename from app/src/main/res/mipmap-xxhdpi/ic_launcher.png
rename to CoolDudesAssignment/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
diff --git a/CoolDudesAssignment/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/CoolDudesAssignment/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..9bec2e6
Binary files /dev/null and b/CoolDudesAssignment/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/CoolDudesAssignment/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
similarity index 100%
rename from app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
rename to CoolDudesAssignment/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
diff --git a/CoolDudesAssignment/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/CoolDudesAssignment/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..34947cd
Binary files /dev/null and b/CoolDudesAssignment/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/CoolDudesAssignment/app/src/main/res/values/colors.xml b/CoolDudesAssignment/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..2a12c47
--- /dev/null
+++ b/CoolDudesAssignment/app/src/main/res/values/colors.xml
@@ -0,0 +1,6 @@
+
+
+ #3F51B5
+ #303F9F
+ #FF4081
+
diff --git a/CoolDudesAssignment/app/src/main/res/values/strings.xml b/CoolDudesAssignment/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..9e448ea
--- /dev/null
+++ b/CoolDudesAssignment/app/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ Music Player
+
diff --git a/CoolDudesAssignment/app/src/main/res/values/styles.xml b/CoolDudesAssignment/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..6f19b47
--- /dev/null
+++ b/CoolDudesAssignment/app/src/main/res/values/styles.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
diff --git a/CoolDudesAssignment/app/src/test/java/com/rohan/musicplayer/ExampleUnitTest.java b/CoolDudesAssignment/app/src/test/java/com/rohan/musicplayer/ExampleUnitTest.java
new file mode 100644
index 0000000..414b451
--- /dev/null
+++ b/CoolDudesAssignment/app/src/test/java/com/rohan/musicplayer/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.rohan.musicplayer;
+
+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/CoolDudesAssignment/build.gradle b/CoolDudesAssignment/build.gradle
new file mode 100644
index 0000000..3a56163
--- /dev/null
+++ b/CoolDudesAssignment/build.gradle
@@ -0,0 +1,23 @@
+// 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:2.3.1'
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ jcenter()
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/CoolDudesAssignment/gradle.properties b/CoolDudesAssignment/gradle.properties
new file mode 100644
index 0000000..3530b01
--- /dev/null
+++ b/CoolDudesAssignment/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/gradle/wrapper/gradle-wrapper.jar b/CoolDudesAssignment/gradle/wrapper/gradle-wrapper.jar
similarity index 100%
rename from gradle/wrapper/gradle-wrapper.jar
rename to CoolDudesAssignment/gradle/wrapper/gradle-wrapper.jar
diff --git a/CoolDudesAssignment/gradle/wrapper/gradle-wrapper.properties b/CoolDudesAssignment/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..882da76
--- /dev/null
+++ b/CoolDudesAssignment/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Sun Mar 05 13:04:08 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
diff --git a/gradlew b/CoolDudesAssignment/gradlew
old mode 100755
new mode 100644
similarity index 100%
rename from gradlew
rename to CoolDudesAssignment/gradlew
diff --git a/gradlew.bat b/CoolDudesAssignment/gradlew.bat
similarity index 100%
rename from gradlew.bat
rename to CoolDudesAssignment/gradlew.bat
diff --git a/CoolDudesAssignment/settings.gradle b/CoolDudesAssignment/settings.gradle
new file mode 100644
index 0000000..d3db109
--- /dev/null
+++ b/CoolDudesAssignment/settings.gradle
@@ -0,0 +1 @@
+include ':app'
diff --git a/HarjotsAssignments/.gitignore b/HarjotsAssignments/.gitignore
new file mode 100644
index 0000000..47333d9
--- /dev/null
+++ b/HarjotsAssignments/.gitignore
@@ -0,0 +1,50 @@
+### Android ###
+# Built application files
+*.apk
+*.ap_
+
+# Files for the ART/Dalvik VM
+*.dex
+
+# Java class files
+*.class
+
+# Generated files
+bin/
+gen/
+out/
+
+# Gradle files
+.gradle/
+build/
+
+# Local configuration file (sdk path, etc)
+local.properties
+
+# Proguard folder generated by Eclipse
+proguard/
+
+# Log Files
+*.log
+
+# Android Studio Navigation editor temp files
+.navigation/
+
+# Android Studio captures folder
+captures/
+
+# Intellij
+*.iml
+.idea/
+
+# Keystore files
+*.jks
+
+# External native build folder generated in Android Studio 2.2 and later
+.externalNativeBuild
+
+# Google Services (e.g. APIs or Firebase)
+google-services.json
+
+### Android Patch ###
+gen-external-apklibs
diff --git a/README.md b/HarjotsAssignments/README.md
similarity index 98%
rename from README.md
rename to HarjotsAssignments/README.md
index 7b1838b..5c49450 100644
--- a/README.md
+++ b/HarjotsAssignments/README.md
@@ -1,15 +1,15 @@
-# Lecture Assignments
-
-This respository will function as a one stop assignment portal for all the MDG lectures for 2016-2020 batch. Each lecture will be followed by an assignment which will be done and pushed in this repository.
-
-### Before the first assignment
- - Install `git`.
- - Clone the repository using `git clone .git`.
- - Make sure you have `Android Studio` installed along with `Android SDK`.
- - Build the first project and install it on your mobile phone, thereby setting up adb.
- - Try wireless adb if you want.
-
-### How to submit an assignment?
- - For the first assignment you need to make a branch with your `slack username` as the `branch name`.
- - For all subsequent assignemnts the same branch will be used and you will be adding commits to the branch.
- - Details for all the assignments will be provided in the lectures and a list will also be maintained here.
+# Lecture Assignments
+
+This respository will function as a one stop assignment portal for all the MDG lectures for 2016-2020 batch. Each lecture will be followed by an assignment which will be done and pushed in this repository.
+
+### Before the first assignment
+ - Install `git`.
+ - Clone the repository using `git clone .git`.
+ - Make sure you have `Android Studio` installed along with `Android SDK`.
+ - Build the first project and install it on your mobile phone, thereby setting up adb.
+ - Try wireless adb if you want.
+
+### How to submit an assignment?
+ - For the first assignment you need to make a branch with your `slack username` as the `branch name`.
+ - For all subsequent assignemnts the same branch will be used and you will be adding commits to the branch.
+ - Details for all the assignments will be provided in the lectures and a list will also be maintained here.
diff --git a/HarjotsAssignments/app/.gitignore b/HarjotsAssignments/app/.gitignore
new file mode 100644
index 0000000..3543521
--- /dev/null
+++ b/HarjotsAssignments/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/HarjotsAssignments/app/build.gradle b/HarjotsAssignments/app/build.gradle
new file mode 100644
index 0000000..e3461ca
--- /dev/null
+++ b/HarjotsAssignments/app/build.gradle
@@ -0,0 +1,42 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 25
+ buildToolsVersion "25.0.2"
+ defaultConfig {
+ applicationId "com.sdsmdg.hareshkh.lectureassignment"
+ minSdkVersion 19
+ targetSdkVersion 25
+ versionCode 1
+ versionName "1.0"
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ }
+ sourceSets {
+ main {
+ manifest.srcFile 'src/main/mymanifest/AndroidManifest.xml'
+ res.srcDirs = [
+ 'src/main/res/rohan',
+ 'src/main/res'
+ ]
+ }
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ compile fileTree(dir: 'libs', include: ['*.jar'])
+ androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
+ exclude group: 'com.android.support', module: 'support-annotations'
+ })
+ compile 'com.android.support:appcompat-v7:25.1.1'
+ compile 'com.android.support:support-v4:25.1.1'
+ compile 'com.android.support:recyclerview-v7:25.1.1'
+ testCompile 'junit:junit:4.12'
+ compile 'com.android.support:cardview-v7:25.1.1'
+ compile 'com.android.support:design:25.1.1'
+}
diff --git a/app/proguard-rules.pro b/HarjotsAssignments/app/proguard-rules.pro
similarity index 97%
rename from app/proguard-rules.pro
rename to HarjotsAssignments/app/proguard-rules.pro
index 0be0b70..75a1aba 100644
--- a/app/proguard-rules.pro
+++ b/HarjotsAssignments/app/proguard-rules.pro
@@ -1,17 +1,17 @@
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in /home/haresh/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 *;
-#}
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in /home/haresh/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/app/src/androidTest/java/com/sdsmdg/hareshkh/lectureassignment/ExampleInstrumentedTest.java b/HarjotsAssignments/app/src/androidTest/java/com/sdsmdg/hareshkh/lectureassignment/ExampleInstrumentedTest.java
similarity index 96%
rename from app/src/androidTest/java/com/sdsmdg/hareshkh/lectureassignment/ExampleInstrumentedTest.java
rename to HarjotsAssignments/app/src/androidTest/java/com/sdsmdg/hareshkh/lectureassignment/ExampleInstrumentedTest.java
index 456cdfe..43a28c5 100644
--- a/app/src/androidTest/java/com/sdsmdg/hareshkh/lectureassignment/ExampleInstrumentedTest.java
+++ b/HarjotsAssignments/app/src/androidTest/java/com/sdsmdg/hareshkh/lectureassignment/ExampleInstrumentedTest.java
@@ -1,26 +1,26 @@
-package com.sdsmdg.hareshkh.lectureassignment;
-
-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.sdsmdg.hareshkh.lectureassignment", appContext.getPackageName());
- }
-}
+package com.sdsmdg.hareshkh.lectureassignment;
+
+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.sdsmdg.hareshkh.lectureassignment", appContext.getPackageName());
+ }
+}
diff --git a/HarjotsAssignments/app/src/main/java/com/sdsmdg/hareshkh/lectureassignment/rohanbh/CustomProgressBar.java b/HarjotsAssignments/app/src/main/java/com/sdsmdg/hareshkh/lectureassignment/rohanbh/CustomProgressBar.java
new file mode 100644
index 0000000..e3164b7
--- /dev/null
+++ b/HarjotsAssignments/app/src/main/java/com/sdsmdg/hareshkh/lectureassignment/rohanbh/CustomProgressBar.java
@@ -0,0 +1,80 @@
+package com.sdsmdg.hareshkh.lectureassignment.rohanbh;
+
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.Paint;
+import android.util.AttributeSet;
+import android.view.View;
+
+import com.sdsmdg.hareshkh.lectureassignment.R;
+
+public class CustomProgressBar extends View {
+
+ private int barColor;
+ private int barHeight=8;
+ private Paint paint;
+ int progress;
+
+ public int getProgress() {
+ return progress;
+ }
+
+ public void setProgress(int progress) {
+ this.progress = progress;
+ invalidate();
+ }
+
+ public CustomProgressBar(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ setupAttributes(attrs);
+ progress=0;
+ setPaint();
+ }
+
+ private void setPaint() {
+ paint=new Paint();
+ paint.setStyle(Paint.Style.FILL);
+ paint.setColor(barColor);
+ }
+
+ private void setupAttributes(AttributeSet attrs) {
+ // Obtain a typed array of attributes
+ TypedArray a = getContext().getTheme().obtainStyledAttributes(attrs, R.styleable.CustomProgressBarView, 0, 0);
+ // Extract custom attributes into member variables
+ try {
+ barColor = a.getColor(R.styleable.CustomProgressBarView_ProgressBarColor, Color.BLACK);
+ } finally {
+ // TypedArray objects are shared and must be recycled.
+ a.recycle();
+ }
+ }
+
+ @Override
+ protected void onDraw(Canvas canvas) {
+ super.onDraw(canvas);
+ int progressWidth=canvas.getWidth()*progress/100;
+ canvas.drawRect(0,0,progressWidth,barHeight,paint);
+ }
+
+ @Override
+ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+ int w=MeasureSpec.getSize(widthMeasureSpec);
+ int height=barHeight+getPaddingTop()+getPaddingBottom();
+ int h=resolveSizeAndState(height,heightMeasureSpec,0);
+ setMeasuredDimension(w,h);
+
+ }
+
+ public int getBarColor() {
+ return barColor;
+ }
+
+ public void setBarColor(int barColor) {
+ this.barColor = barColor;
+ invalidate();
+ requestLayout();
+ }
+}
diff --git a/HarjotsAssignments/app/src/main/java/com/sdsmdg/hareshkh/lectureassignment/rohanbh/CustomProgressBehavior.java b/HarjotsAssignments/app/src/main/java/com/sdsmdg/hareshkh/lectureassignment/rohanbh/CustomProgressBehavior.java
new file mode 100644
index 0000000..db02e04
--- /dev/null
+++ b/HarjotsAssignments/app/src/main/java/com/sdsmdg/hareshkh/lectureassignment/rohanbh/CustomProgressBehavior.java
@@ -0,0 +1,30 @@
+package com.sdsmdg.hareshkh.lectureassignment.rohanbh;
+
+import android.content.Context;
+import android.support.design.widget.CoordinatorLayout;
+import android.support.design.widget.Snackbar;
+import android.util.AttributeSet;
+import android.view.View;
+
+
+public class CustomProgressBehavior extends CoordinatorLayout.Behavior {
+
+ public CustomProgressBehavior() {
+ }
+
+ public CustomProgressBehavior(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ @Override
+ public boolean layoutDependsOn(CoordinatorLayout parent, View child, View dependency) {
+ return dependency instanceof Snackbar.SnackbarLayout;
+ }
+
+ @Override
+ public boolean onDependentViewChanged(CoordinatorLayout parent, View child, View dependency) {
+ float translationY = Math.min(0, dependency.getTranslationY() - dependency.getHeight());
+ child.setTranslationY(translationY);
+ return true;
+ }
+}
diff --git a/HarjotsAssignments/app/src/main/java/com/sdsmdg/hareshkh/lectureassignment/rohanbh/activities/MainActivity.java b/HarjotsAssignments/app/src/main/java/com/sdsmdg/hareshkh/lectureassignment/rohanbh/activities/MainActivity.java
new file mode 100644
index 0000000..08ae4dd
--- /dev/null
+++ b/HarjotsAssignments/app/src/main/java/com/sdsmdg/hareshkh/lectureassignment/rohanbh/activities/MainActivity.java
@@ -0,0 +1,45 @@
+package com.sdsmdg.hareshkh.lectureassignment.rohanbh.activities;
+
+import android.os.Bundle;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+
+import com.sdsmdg.hareshkh.lectureassignment.R;
+import com.sdsmdg.hareshkh.lectureassignment.rohanbh.adapters.MoviesAdapter;
+import com.sdsmdg.hareshkh.lectureassignment.rohanbh.modelclasses.MovieClass;
+
+import java.util.ArrayList;
+
+public class MainActivity extends AppCompatActivity {
+
+ ArrayList myMovies = new ArrayList<>();
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+
+ myMovies.add(new MovieClass("The Dark Knight Rises", "2012", "@drawable/batman"));
+ myMovies.add((new MovieClass("Dragon Ball Z: Battle of Gods", "2013", "@drawable/battleofgods")));
+ myMovies.add(new MovieClass("Captain America: Civil War", "2016", "@drawable/civilwar"));
+ myMovies.add(new MovieClass("Furious 7", "2015", "@drawable/furious"));
+ myMovies.add(new MovieClass("Harry Potter and the Deathly Hallows â Part 2", "2011", "@drawable/harrypotter"));
+ myMovies.add(new MovieClass("Kung Fu Panda 3", "2016", "@drawable/panda"));
+ myMovies.add(new MovieClass("Dragon Ball Z: Resurrection âFâ", "2015", "@drawable/revivalf"));
+ myMovies.add(new MovieClass("The Amazing Spider-Man 2", "2014", "@drawable/amazing"));
+ myMovies.add(new MovieClass("Avatar", "2009", "@drawable/avatar"));
+ myMovies.add(new MovieClass("The Dark Knight", "2008", "@drawable/dark"));
+ myMovies.add(new MovieClass("Deadpool", "2016", "@drawable/deadpool"));
+ myMovies.add(new MovieClass("Star Wars: The Force Awakens", "2015", "@drawable/star"));
+ myMovies.add(new MovieClass("Titanic", "1997", "@drawable/titanic"));
+ myMovies.add(new MovieClass("Avengers: Age of Ultron", "2015", "@drawable/ultron"));
+
+
+ RecyclerView movieList = (RecyclerView) findViewById(R.id.my_recycler_view);
+ MoviesAdapter adapter = new MoviesAdapter(myMovies, this);
+ movieList.setAdapter(adapter);
+ movieList.setLayoutManager(new LinearLayoutManager(this));
+ movieList.setHasFixedSize(true);
+ }
+}
diff --git a/HarjotsAssignments/app/src/main/java/com/sdsmdg/hareshkh/lectureassignment/rohanbh/activities/ProgressBarActivity.java b/HarjotsAssignments/app/src/main/java/com/sdsmdg/hareshkh/lectureassignment/rohanbh/activities/ProgressBarActivity.java
new file mode 100644
index 0000000..45cc4bc
--- /dev/null
+++ b/HarjotsAssignments/app/src/main/java/com/sdsmdg/hareshkh/lectureassignment/rohanbh/activities/ProgressBarActivity.java
@@ -0,0 +1,37 @@
+package com.sdsmdg.hareshkh.lectureassignment.rohanbh.activities;
+
+import android.os.Bundle;
+import android.support.design.widget.Snackbar;
+import android.support.v7.app.AppCompatActivity;
+import android.widget.SeekBar;
+
+import com.sdsmdg.hareshkh.lectureassignment.R;
+import com.sdsmdg.hareshkh.lectureassignment.rohanbh.CustomProgressBar;
+
+public class ProgressBarActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_progress_bar);
+ SeekBar seekBar = (SeekBar) findViewById(R.id.my_seekbar);
+ final CustomProgressBar progressBar = (CustomProgressBar) findViewById(R.id.my_progress_bar);
+
+ seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
+ @Override
+ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
+ progressBar.setProgress(progress);
+ }
+
+ @Override
+ public void onStartTrackingTouch(SeekBar seekBar) {
+
+ }
+
+ @Override
+ public void onStopTrackingTouch(SeekBar seekBar) {
+ Snackbar.make(findViewById(R.id.my_c_layout), "Rohan", Snackbar.LENGTH_SHORT).show();
+ }
+ });
+ }
+}
diff --git a/HarjotsAssignments/app/src/main/java/com/sdsmdg/hareshkh/lectureassignment/rohanbh/adapters/MoviesAdapter.java b/HarjotsAssignments/app/src/main/java/com/sdsmdg/hareshkh/lectureassignment/rohanbh/adapters/MoviesAdapter.java
new file mode 100644
index 0000000..4323eb0
--- /dev/null
+++ b/HarjotsAssignments/app/src/main/java/com/sdsmdg/hareshkh/lectureassignment/rohanbh/adapters/MoviesAdapter.java
@@ -0,0 +1,89 @@
+package com.sdsmdg.hareshkh.lectureassignment.rohanbh.adapters;
+
+import android.content.Context;
+import android.content.Intent;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+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 android.widget.Toast;
+
+import com.sdsmdg.hareshkh.lectureassignment.R;
+import com.sdsmdg.hareshkh.lectureassignment.rohanbh.activities.ProgressBarActivity;
+import com.sdsmdg.hareshkh.lectureassignment.rohanbh.modelclasses.MovieClass;
+import com.sdsmdg.hareshkh.lectureassignment.rohanbh.utilities.Utils;
+
+import java.util.List;
+
+public class MoviesAdapter extends RecyclerView.Adapter {
+
+ private List movies;
+ private Context ctx;
+
+ public MoviesAdapter(List movies, Context ctx) {
+ this.movies = movies;
+ this.ctx = ctx;
+ }
+
+ public Context getCtx() {
+ return ctx;
+ }
+
+ public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
+
+ public TextView movieName;
+ public TextView movieYear;
+ public ImageView movieImage;
+
+ public ViewHolder(View itemView) {
+ super(itemView);
+ movieName = (TextView) itemView.findViewById(R.id.movie_name);
+ movieYear = (TextView) itemView.findViewById(R.id.movie_year);
+ movieImage = (ImageView) itemView.findViewById(R.id.movie_image);
+ itemView.setOnClickListener(this);
+ }
+
+ @Override
+ public void onClick(View v) {
+ int position = getAdapterPosition();
+ MovieClass movie = movies.get(position);
+ Toast.makeText(getCtx(), movie.getTitle() + " clicked!", Toast.LENGTH_SHORT).show();
+ Intent i=new Intent(getCtx(), ProgressBarActivity.class);
+ getCtx().startActivity(i);
+ }
+ }
+
+ @Override
+ public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
+ LayoutInflater inflater = LayoutInflater.from(getCtx());
+
+ View movieView = inflater.inflate(R.layout.row_layout, parent, false);
+
+ ViewHolder mHolder = new ViewHolder(movieView);
+ return mHolder;
+ }
+
+ @Override
+ public void onBindViewHolder(ViewHolder holder, int position) {
+
+ MovieClass movie = movies.get(position);
+ holder.movieName.setText(movie.getTitle());
+ holder.movieYear.setText(movie.getYear());
+
+ Bitmap bitmap = BitmapFactory.decodeResource(getCtx().getResources(),
+ Utils.getImageResourceFromString(movie.getImageResId(), getCtx()));
+ Bitmap bMapScaled = Utils.scaleToFitWidth(bitmap, (int) Utils.convertToPixel(500, getCtx()));
+
+ holder.movieImage.setImageBitmap(bMapScaled);
+
+ }
+
+ @Override
+ public int getItemCount() {
+ return movies.size();
+ }
+}
diff --git a/HarjotsAssignments/app/src/main/java/com/sdsmdg/hareshkh/lectureassignment/rohanbh/modelclasses/MovieClass.java b/HarjotsAssignments/app/src/main/java/com/sdsmdg/hareshkh/lectureassignment/rohanbh/modelclasses/MovieClass.java
new file mode 100644
index 0000000..dcb870a
--- /dev/null
+++ b/HarjotsAssignments/app/src/main/java/com/sdsmdg/hareshkh/lectureassignment/rohanbh/modelclasses/MovieClass.java
@@ -0,0 +1,38 @@
+package com.sdsmdg.hareshkh.lectureassignment.rohanbh.modelclasses;
+
+public class MovieClass {
+
+ private String title;
+ private String year;
+ private String imageResId;
+
+ public MovieClass(String title, String year, String imageResId) {
+ this.title = title;
+ this.year = year;
+ this.imageResId = imageResId;
+ }
+
+ public String getYear() {
+ return year;
+ }
+
+ public void setYear(String year) {
+ this.year = year;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getImageResId() {
+ return imageResId;
+ }
+
+ public void setImageResId(String imageResId) {
+ this.imageResId = imageResId;
+ }
+}
diff --git a/HarjotsAssignments/app/src/main/java/com/sdsmdg/hareshkh/lectureassignment/rohanbh/utilities/Utils.java b/HarjotsAssignments/app/src/main/java/com/sdsmdg/hareshkh/lectureassignment/rohanbh/utilities/Utils.java
new file mode 100644
index 0000000..a1b15ea
--- /dev/null
+++ b/HarjotsAssignments/app/src/main/java/com/sdsmdg/hareshkh/lectureassignment/rohanbh/utilities/Utils.java
@@ -0,0 +1,25 @@
+package com.sdsmdg.hareshkh.lectureassignment.rohanbh.utilities;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.graphics.Bitmap;
+import android.util.TypedValue;
+
+public class Utils {
+
+ public static Bitmap scaleToFitWidth(Bitmap b, int width) {
+ float factor = width / (float) b.getWidth();
+ return Bitmap.createScaledBitmap(b, width, (int) (b.getHeight() * factor), true);
+ }
+
+ public static int getImageResourceFromString(String img_path, Context context) {
+ int imageResource = context.getResources().getIdentifier(img_path, null, context.getPackageName());
+ return imageResource;
+ }
+
+ public static float convertToPixel(float myDPs, Context ctx) {
+ Resources r = ctx.getResources();
+ float px = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, myDPs, r.getDisplayMetrics());
+ return px;
+ }
+}
diff --git a/HarjotsAssignments/app/src/main/mymanifest/AndroidManifest.xml b/HarjotsAssignments/app/src/main/mymanifest/AndroidManifest.xml
new file mode 100644
index 0000000..a79a10d
--- /dev/null
+++ b/HarjotsAssignments/app/src/main/mymanifest/AndroidManifest.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarjotsAssignments/app/src/main/res/rohan/drawable/amazing.jpeg b/HarjotsAssignments/app/src/main/res/rohan/drawable/amazing.jpeg
new file mode 100644
index 0000000..89533bc
Binary files /dev/null and b/HarjotsAssignments/app/src/main/res/rohan/drawable/amazing.jpeg differ
diff --git a/HarjotsAssignments/app/src/main/res/rohan/drawable/avatar.jpg b/HarjotsAssignments/app/src/main/res/rohan/drawable/avatar.jpg
new file mode 100644
index 0000000..f8a639c
Binary files /dev/null and b/HarjotsAssignments/app/src/main/res/rohan/drawable/avatar.jpg differ
diff --git a/HarjotsAssignments/app/src/main/res/rohan/drawable/batman.jpeg b/HarjotsAssignments/app/src/main/res/rohan/drawable/batman.jpeg
new file mode 100644
index 0000000..1fba9fb
Binary files /dev/null and b/HarjotsAssignments/app/src/main/res/rohan/drawable/batman.jpeg differ
diff --git a/HarjotsAssignments/app/src/main/res/rohan/drawable/battleofgods.png b/HarjotsAssignments/app/src/main/res/rohan/drawable/battleofgods.png
new file mode 100644
index 0000000..747f53f
Binary files /dev/null and b/HarjotsAssignments/app/src/main/res/rohan/drawable/battleofgods.png differ
diff --git a/HarjotsAssignments/app/src/main/res/rohan/drawable/civilwar.jpg b/HarjotsAssignments/app/src/main/res/rohan/drawable/civilwar.jpg
new file mode 100644
index 0000000..233b59b
Binary files /dev/null and b/HarjotsAssignments/app/src/main/res/rohan/drawable/civilwar.jpg differ
diff --git a/HarjotsAssignments/app/src/main/res/rohan/drawable/dark.jpg b/HarjotsAssignments/app/src/main/res/rohan/drawable/dark.jpg
new file mode 100644
index 0000000..d619137
Binary files /dev/null and b/HarjotsAssignments/app/src/main/res/rohan/drawable/dark.jpg differ
diff --git a/HarjotsAssignments/app/src/main/res/rohan/drawable/deadpool.jpg b/HarjotsAssignments/app/src/main/res/rohan/drawable/deadpool.jpg
new file mode 100644
index 0000000..bc9fefa
Binary files /dev/null and b/HarjotsAssignments/app/src/main/res/rohan/drawable/deadpool.jpg differ
diff --git a/HarjotsAssignments/app/src/main/res/rohan/drawable/furious.jpg b/HarjotsAssignments/app/src/main/res/rohan/drawable/furious.jpg
new file mode 100644
index 0000000..968dbaa
Binary files /dev/null and b/HarjotsAssignments/app/src/main/res/rohan/drawable/furious.jpg differ
diff --git a/HarjotsAssignments/app/src/main/res/rohan/drawable/harrypotter.jpg b/HarjotsAssignments/app/src/main/res/rohan/drawable/harrypotter.jpg
new file mode 100644
index 0000000..fcfe963
Binary files /dev/null and b/HarjotsAssignments/app/src/main/res/rohan/drawable/harrypotter.jpg differ
diff --git a/HarjotsAssignments/app/src/main/res/rohan/drawable/panda.jpg b/HarjotsAssignments/app/src/main/res/rohan/drawable/panda.jpg
new file mode 100644
index 0000000..65c2a55
Binary files /dev/null and b/HarjotsAssignments/app/src/main/res/rohan/drawable/panda.jpg differ
diff --git a/HarjotsAssignments/app/src/main/res/rohan/drawable/revivalf.jpg b/HarjotsAssignments/app/src/main/res/rohan/drawable/revivalf.jpg
new file mode 100644
index 0000000..5535a9b
Binary files /dev/null and b/HarjotsAssignments/app/src/main/res/rohan/drawable/revivalf.jpg differ
diff --git a/HarjotsAssignments/app/src/main/res/rohan/drawable/star.jpg b/HarjotsAssignments/app/src/main/res/rohan/drawable/star.jpg
new file mode 100644
index 0000000..b82ffe4
Binary files /dev/null and b/HarjotsAssignments/app/src/main/res/rohan/drawable/star.jpg differ
diff --git a/HarjotsAssignments/app/src/main/res/rohan/drawable/titanic.jpg b/HarjotsAssignments/app/src/main/res/rohan/drawable/titanic.jpg
new file mode 100644
index 0000000..7f490bf
Binary files /dev/null and b/HarjotsAssignments/app/src/main/res/rohan/drawable/titanic.jpg differ
diff --git a/HarjotsAssignments/app/src/main/res/rohan/drawable/ultron.jpg b/HarjotsAssignments/app/src/main/res/rohan/drawable/ultron.jpg
new file mode 100644
index 0000000..d208a97
Binary files /dev/null and b/HarjotsAssignments/app/src/main/res/rohan/drawable/ultron.jpg differ
diff --git a/HarjotsAssignments/app/src/main/res/rohan/layout/activity_main.xml b/HarjotsAssignments/app/src/main/res/rohan/layout/activity_main.xml
new file mode 100644
index 0000000..ce4b556
--- /dev/null
+++ b/HarjotsAssignments/app/src/main/res/rohan/layout/activity_main.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
diff --git a/HarjotsAssignments/app/src/main/res/rohan/layout/activity_progress_bar.xml b/HarjotsAssignments/app/src/main/res/rohan/layout/activity_progress_bar.xml
new file mode 100644
index 0000000..9c843f8
--- /dev/null
+++ b/HarjotsAssignments/app/src/main/res/rohan/layout/activity_progress_bar.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
diff --git a/HarjotsAssignments/app/src/main/res/rohan/layout/row_layout.xml b/HarjotsAssignments/app/src/main/res/rohan/layout/row_layout.xml
new file mode 100644
index 0000000..031b041
--- /dev/null
+++ b/HarjotsAssignments/app/src/main/res/rohan/layout/row_layout.xml
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/HarjotsAssignments/app/src/main/res/rohan/mipmap-hdpi/ic_launcher.png b/HarjotsAssignments/app/src/main/res/rohan/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..cde69bc
Binary files /dev/null and b/HarjotsAssignments/app/src/main/res/rohan/mipmap-hdpi/ic_launcher.png differ
diff --git a/HarjotsAssignments/app/src/main/res/rohan/mipmap-mdpi/ic_launcher.png b/HarjotsAssignments/app/src/main/res/rohan/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..c133a0c
Binary files /dev/null and b/HarjotsAssignments/app/src/main/res/rohan/mipmap-mdpi/ic_launcher.png differ
diff --git a/HarjotsAssignments/app/src/main/res/rohan/mipmap-xhdpi/ic_launcher.png b/HarjotsAssignments/app/src/main/res/rohan/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..bfa42f0
Binary files /dev/null and b/HarjotsAssignments/app/src/main/res/rohan/mipmap-xhdpi/ic_launcher.png differ
diff --git a/HarjotsAssignments/app/src/main/res/rohan/mipmap-xxhdpi/ic_launcher.png b/HarjotsAssignments/app/src/main/res/rohan/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..324e72c
Binary files /dev/null and b/HarjotsAssignments/app/src/main/res/rohan/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/HarjotsAssignments/app/src/main/res/rohan/mipmap-xxxhdpi/ic_launcher.png b/HarjotsAssignments/app/src/main/res/rohan/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..aee44e1
Binary files /dev/null and b/HarjotsAssignments/app/src/main/res/rohan/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/values-w820dp/dimens.xml b/HarjotsAssignments/app/src/main/res/rohan/values-w820dp/dimens.xml
similarity index 98%
rename from app/src/main/res/values-w820dp/dimens.xml
rename to HarjotsAssignments/app/src/main/res/rohan/values-w820dp/dimens.xml
index 63fc816..62df187 100644
--- a/app/src/main/res/values-w820dp/dimens.xml
+++ b/HarjotsAssignments/app/src/main/res/rohan/values-w820dp/dimens.xml
@@ -1,6 +1,6 @@
-
-
- 64dp
-
+
+
+ 64dp
+
diff --git a/HarjotsAssignments/app/src/main/res/rohan/values/attrs.xml b/HarjotsAssignments/app/src/main/res/rohan/values/attrs.xml
new file mode 100644
index 0000000..43c617e
--- /dev/null
+++ b/HarjotsAssignments/app/src/main/res/rohan/values/attrs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HarjotsAssignments/app/src/main/res/rohan/values/colors.xml b/HarjotsAssignments/app/src/main/res/rohan/values/colors.xml
new file mode 100644
index 0000000..5b8b362
--- /dev/null
+++ b/HarjotsAssignments/app/src/main/res/rohan/values/colors.xml
@@ -0,0 +1,7 @@
+
+
+ #3F51B5
+ #303F9F
+ #FF4081
+ #1E88E5
+
diff --git a/app/src/main/res/values/dimens.xml b/HarjotsAssignments/app/src/main/res/rohan/values/dimens.xml
similarity index 97%
rename from app/src/main/res/values/dimens.xml
rename to HarjotsAssignments/app/src/main/res/rohan/values/dimens.xml
index 47c8224..295b5a9 100644
--- a/app/src/main/res/values/dimens.xml
+++ b/HarjotsAssignments/app/src/main/res/rohan/values/dimens.xml
@@ -1,5 +1,5 @@
-
-
- 16dp
- 16dp
-
+
+
+ 16dp
+ 16dp
+
diff --git a/app/src/main/res/values/strings.xml b/HarjotsAssignments/app/src/main/res/rohan/values/strings.xml
similarity index 96%
rename from app/src/main/res/values/strings.xml
rename to HarjotsAssignments/app/src/main/res/rohan/values/strings.xml
index 223979f..7ee687d 100644
--- a/app/src/main/res/values/strings.xml
+++ b/HarjotsAssignments/app/src/main/res/rohan/values/strings.xml
@@ -1,3 +1,3 @@
-
- LectureAssignment
-
+
+ LectureAssignment
+
diff --git a/HarjotsAssignments/app/src/main/res/rohan/values/styles.xml b/HarjotsAssignments/app/src/main/res/rohan/values/styles.xml
new file mode 100644
index 0000000..6f19b47
--- /dev/null
+++ b/HarjotsAssignments/app/src/main/res/rohan/values/styles.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
diff --git a/app/src/test/java/com/sdsmdg/hareshkh/lectureassignment/ExampleUnitTest.java b/HarjotsAssignments/app/src/test/java/com/sdsmdg/hareshkh/lectureassignment/ExampleUnitTest.java
similarity index 96%
rename from app/src/test/java/com/sdsmdg/hareshkh/lectureassignment/ExampleUnitTest.java
rename to HarjotsAssignments/app/src/test/java/com/sdsmdg/hareshkh/lectureassignment/ExampleUnitTest.java
index bd676b5..5a00a45 100644
--- a/app/src/test/java/com/sdsmdg/hareshkh/lectureassignment/ExampleUnitTest.java
+++ b/HarjotsAssignments/app/src/test/java/com/sdsmdg/hareshkh/lectureassignment/ExampleUnitTest.java
@@ -1,17 +1,17 @@
-package com.sdsmdg.hareshkh.lectureassignment;
-
-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);
- }
+package com.sdsmdg.hareshkh.lectureassignment;
+
+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/HarjotsAssignments/build.gradle b/HarjotsAssignments/build.gradle
new file mode 100644
index 0000000..8998434
--- /dev/null
+++ b/HarjotsAssignments/build.gradle
@@ -0,0 +1,23 @@
+// 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:2.3.0'
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ jcenter()
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/HarjotsAssignments/gradle.properties b/HarjotsAssignments/gradle.properties
new file mode 100644
index 0000000..3530b01
--- /dev/null
+++ b/HarjotsAssignments/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/HarjotsAssignments/gradle/wrapper/gradle-wrapper.jar b/HarjotsAssignments/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..13372ae
Binary files /dev/null and b/HarjotsAssignments/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/HarjotsAssignments/gradle/wrapper/gradle-wrapper.properties b/HarjotsAssignments/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..6ed78df
--- /dev/null
+++ b/HarjotsAssignments/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Sun Mar 05 12:46:50 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
diff --git a/HarjotsAssignments/gradlew b/HarjotsAssignments/gradlew
new file mode 100644
index 0000000..e834973
--- /dev/null
+++ b/HarjotsAssignments/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/HarjotsAssignments/gradlew.bat b/HarjotsAssignments/gradlew.bat
new file mode 100644
index 0000000..aec9973
--- /dev/null
+++ b/HarjotsAssignments/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/HarjotsAssignments/settings.gradle b/HarjotsAssignments/settings.gradle
new file mode 100644
index 0000000..d3db109
--- /dev/null
+++ b/HarjotsAssignments/settings.gradle
@@ -0,0 +1 @@
+include ':app'
diff --git a/NDK Assignment/.gitignore b/NDK Assignment/.gitignore
new file mode 100644
index 0000000..39fb081
--- /dev/null
+++ b/NDK Assignment/.gitignore
@@ -0,0 +1,9 @@
+*.iml
+.gradle
+/local.properties
+/.idea/workspace.xml
+/.idea/libraries
+.DS_Store
+/build
+/captures
+.externalNativeBuild
diff --git a/app/.gitignore b/NDK Assignment/app/.gitignore
similarity index 100%
rename from app/.gitignore
rename to NDK Assignment/app/.gitignore
diff --git a/NDK Assignment/app/CMakeLists.txt b/NDK Assignment/app/CMakeLists.txt
new file mode 100644
index 0000000..a64699d
--- /dev/null
+++ b/NDK Assignment/app/CMakeLists.txt
@@ -0,0 +1,20 @@
+# For more information about using CMake with Android Studio, read the
+# documentation: https://d.android.com/studio/projects/add-native-code.html
+
+# Sets the minimum version of CMake required to build the native library.
+
+cmake_minimum_required(VERSION 3.4.1)
+
+# Creates and names a library, sets it as either STATIC
+# or SHARED, and provides the relative paths to its source code.
+# You can define multiple libraries, and CMake builds them for you.
+# Gradle automatically packages shared libraries with your APK.
+
+add_library( MidPoint
+
+ SHARED
+
+ src/main/cpp/MidPoint.cpp )
+
+# Specifies a path to native header files.
+include_directories(src/main/cpp/)
\ No newline at end of file
diff --git a/NDK Assignment/app/build.gradle b/NDK Assignment/app/build.gradle
new file mode 100644
index 0000000..f753e48
--- /dev/null
+++ b/NDK Assignment/app/build.gradle
@@ -0,0 +1,40 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 26
+ buildToolsVersion "26.0.0"
+ defaultConfig {
+ applicationId "com.sdsmdg.ndkassignment"
+ minSdkVersion 19
+ targetSdkVersion 26
+ versionCode 1
+ versionName "1.0"
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ externalNativeBuild {
+ cmake {
+ cppFlags ""
+ }
+ }
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+ externalNativeBuild {
+ cmake {
+ path "CMakeLists.txt"
+ }
+ }
+}
+
+dependencies {
+ compile fileTree(dir: 'libs', include: ['*.jar'])
+ androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
+ exclude group: 'com.android.support', module: 'support-annotations'
+ })
+ compile 'com.android.support:appcompat-v7:26.+'
+ compile 'com.android.support.constraint:constraint-layout:1.0.2'
+ testCompile 'junit:junit:4.12'
+}
diff --git a/NDK Assignment/app/proguard-rules.pro b/NDK Assignment/app/proguard-rules.pro
new file mode 100644
index 0000000..85e0e01
--- /dev/null
+++ b/NDK Assignment/app/proguard-rules.pro
@@ -0,0 +1,25 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in /home/rohan/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 *;
+#}
+
+# 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/NDK Assignment/app/src/androidTest/java/com/sdsmdg/ndkassignment/ExampleInstrumentedTest.java b/NDK Assignment/app/src/androidTest/java/com/sdsmdg/ndkassignment/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..0b9461d
--- /dev/null
+++ b/NDK Assignment/app/src/androidTest/java/com/sdsmdg/ndkassignment/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.sdsmdg.ndkassignment;
+
+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.sdsmdg.ndkassignment", appContext.getPackageName());
+ }
+}
diff --git a/app/src/main/AndroidManifest.xml b/NDK Assignment/app/src/main/AndroidManifest.xml
similarity index 86%
rename from app/src/main/AndroidManifest.xml
rename to NDK Assignment/app/src/main/AndroidManifest.xml
index 4bb1fd6..974cb25 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/NDK Assignment/app/src/main/AndroidManifest.xml
@@ -1,11 +1,12 @@
+ package="com.sdsmdg.ndkassignment">
diff --git a/NDK Assignment/app/src/main/cpp/MidPoint.cpp b/NDK Assignment/app/src/main/cpp/MidPoint.cpp
new file mode 100644
index 0000000..6d2c345
--- /dev/null
+++ b/NDK Assignment/app/src/main/cpp/MidPoint.cpp
@@ -0,0 +1,34 @@
+//
+// Created by rohan on 24/9/17.
+//
+
+#include "MidPoint.h"
+
+extern "C" JNIEXPORT jobject JNICALL
+Java_com_sdsmdg_ndkassignment_Point_getMidPoint(
+ JNIEnv *env, jobject callingObject, jobject p1, jobject p2) {
+
+ jclass pointClass = env->GetObjectClass(p1);
+
+ jfieldID yFieldID = env->GetFieldID(pointClass, "y", "I");
+ jmethodID getXMethodID = env->GetMethodID(pointClass, "getX", "()I");
+ jmethodID setXMethodID = env->GetMethodID(pointClass, "setX", "(I)V");
+ jmethodID constrMethodID = env->GetMethodID(pointClass, "", "(II)V");
+
+ int x1 = env->CallIntMethod(p1, getXMethodID);
+ int y1 = env->GetIntField(p1, yFieldID);
+
+ int x2 = env->CallIntMethod(p2, getXMethodID);
+ int y2 = env->GetIntField(p2, yFieldID);
+
+ return env->NewObject(
+ pointClass,
+ constrMethodID,
+ midPoint(x1, x2),
+ midPoint(y1, y2)
+ );
+}
+
+int midPoint(int a, int b) {
+ return (a + b) / 2;
+}
\ No newline at end of file
diff --git a/NDK Assignment/app/src/main/cpp/MidPoint.h b/NDK Assignment/app/src/main/cpp/MidPoint.h
new file mode 100644
index 0000000..7cafa8a
--- /dev/null
+++ b/NDK Assignment/app/src/main/cpp/MidPoint.h
@@ -0,0 +1,16 @@
+//
+// Created by rohan on 24/9/17.
+//
+
+#ifndef NDK_ASSIGNMENT_MIDPOINT_H
+#define NDK_ASSIGNMENT_MIDPOINT_H
+
+#include
+
+extern "C" JNIEXPORT jobject JNICALL
+Java_com_sdsmdg_ndkassignment_Point_getMidPoint(
+ JNIEnv *env, jobject callingObject, jobject p1, jobject p2);
+
+int midPoint(int, int);
+
+#endif //NDK_ASSIGNMENT_MIDPOINT_H
diff --git a/NDK Assignment/app/src/main/java/com/sdsmdg/ndkassignment/MainActivity.java b/NDK Assignment/app/src/main/java/com/sdsmdg/ndkassignment/MainActivity.java
new file mode 100644
index 0000000..28aad8c
--- /dev/null
+++ b/NDK Assignment/app/src/main/java/com/sdsmdg/ndkassignment/MainActivity.java
@@ -0,0 +1,33 @@
+package com.sdsmdg.ndkassignment;
+
+import android.os.Bundle;
+import android.support.v7.app.AppCompatActivity;
+import android.util.Log;
+
+public class MainActivity extends AppCompatActivity {
+
+ // Used to load the 'MidPoint' library on application startup.
+ static {
+ System.loadLibrary("MidPoint");
+ }
+
+ private static final String LOG_TAG = "MainActivity/";
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+
+ // Call to native method declared in Point
+ Point p1 = new Point(5, 10);
+ Point p2 = new Point(0, 2);
+
+ Point midPoint = p1.getMidPoint(p1, p2);
+
+ Log.v(LOG_TAG+"p1", p1.toString());
+ Log.v(LOG_TAG+"p2", p2.toString());
+ Log.v(LOG_TAG+"midP", midPoint.toString());
+
+ }
+
+}
diff --git a/NDK Assignment/app/src/main/java/com/sdsmdg/ndkassignment/Point.java b/NDK Assignment/app/src/main/java/com/sdsmdg/ndkassignment/Point.java
new file mode 100644
index 0000000..653b5c3
--- /dev/null
+++ b/NDK Assignment/app/src/main/java/com/sdsmdg/ndkassignment/Point.java
@@ -0,0 +1,31 @@
+package com.sdsmdg.ndkassignment;
+
+public class Point {
+
+ private int x;
+ public int y;
+
+ public Point(int x, int y) {
+ this.x = x;
+ this.y = y;
+ }
+
+ public int getX() {
+ return x;
+ }
+
+ public void setX(int x) {
+ this.x = x;
+ }
+
+ public native Point getMidPoint(Point p1, Point p2);
+
+ @Override
+ public String toString() {
+ return "Point{" +
+ "x=" + x +
+ ", y=" + y +
+ "}";
+ }
+
+}
diff --git a/NDK Assignment/app/src/main/res/layout/activity_main.xml b/NDK Assignment/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..f3ddd60
--- /dev/null
+++ b/NDK Assignment/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
diff --git a/NDK Assignment/app/src/main/res/mipmap-hdpi/ic_launcher.png b/NDK Assignment/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..cde69bc
Binary files /dev/null and b/NDK Assignment/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/NDK Assignment/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/NDK Assignment/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 0000000..9a078e3
Binary files /dev/null and b/NDK Assignment/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/NDK Assignment/app/src/main/res/mipmap-mdpi/ic_launcher.png b/NDK Assignment/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..c133a0c
Binary files /dev/null and b/NDK Assignment/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/NDK Assignment/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/NDK Assignment/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 0000000..efc028a
Binary files /dev/null and b/NDK Assignment/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/NDK Assignment/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/NDK Assignment/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..bfa42f0
Binary files /dev/null and b/NDK Assignment/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/NDK Assignment/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/NDK Assignment/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..3af2608
Binary files /dev/null and b/NDK Assignment/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/NDK Assignment/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/NDK Assignment/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..324e72c
Binary files /dev/null and b/NDK Assignment/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/NDK Assignment/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/NDK Assignment/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..9bec2e6
Binary files /dev/null and b/NDK Assignment/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/NDK Assignment/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/NDK Assignment/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..aee44e1
Binary files /dev/null and b/NDK Assignment/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/NDK Assignment/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/NDK Assignment/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..34947cd
Binary files /dev/null and b/NDK Assignment/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/values/colors.xml b/NDK Assignment/app/src/main/res/values/colors.xml
similarity index 100%
rename from app/src/main/res/values/colors.xml
rename to NDK Assignment/app/src/main/res/values/colors.xml
diff --git a/NDK Assignment/app/src/main/res/values/strings.xml b/NDK Assignment/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..38ae11e
--- /dev/null
+++ b/NDK Assignment/app/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ NDK Assignment
+
diff --git a/app/src/main/res/values/styles.xml b/NDK Assignment/app/src/main/res/values/styles.xml
similarity index 100%
rename from app/src/main/res/values/styles.xml
rename to NDK Assignment/app/src/main/res/values/styles.xml
diff --git a/NDK Assignment/app/src/test/java/com/sdsmdg/ndkassignment/ExampleUnitTest.java b/NDK Assignment/app/src/test/java/com/sdsmdg/ndkassignment/ExampleUnitTest.java
new file mode 100644
index 0000000..5048027
--- /dev/null
+++ b/NDK Assignment/app/src/test/java/com/sdsmdg/ndkassignment/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.sdsmdg.ndkassignment;
+
+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/build.gradle b/NDK Assignment/build.gradle
similarity index 88%
rename from build.gradle
rename to NDK Assignment/build.gradle
index 74b2ab0..c2eea8e 100644
--- a/build.gradle
+++ b/NDK Assignment/build.gradle
@@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:2.2.3'
+ classpath 'com.android.tools.build:gradle:2.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
diff --git a/gradle.properties b/NDK Assignment/gradle.properties
similarity index 100%
rename from gradle.properties
rename to NDK Assignment/gradle.properties
diff --git a/NDK Assignment/gradle/wrapper/gradle-wrapper.jar b/NDK Assignment/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..13372ae
Binary files /dev/null and b/NDK Assignment/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/NDK Assignment/gradle/wrapper/gradle-wrapper.properties
similarity index 79%
rename from gradle/wrapper/gradle-wrapper.properties
rename to NDK Assignment/gradle/wrapper/gradle-wrapper.properties
index 04e285f..2353262 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/NDK Assignment/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Mon Dec 28 10:00:20 PST 2015
+#Sun Sep 24 16:38:04 AZOST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
diff --git a/NDK Assignment/gradlew b/NDK Assignment/gradlew
new file mode 100644
index 0000000..9d82f78
--- /dev/null
+++ b/NDK Assignment/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/NDK Assignment/gradlew.bat b/NDK Assignment/gradlew.bat
new file mode 100644
index 0000000..aec9973
--- /dev/null
+++ b/NDK Assignment/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/settings.gradle b/NDK Assignment/settings.gradle
similarity index 100%
rename from settings.gradle
rename to NDK Assignment/settings.gradle
diff --git a/app/src/main/java/com/sdsmdg/hareshkh/lectureassignment/MainActivity.java b/app/src/main/java/com/sdsmdg/hareshkh/lectureassignment/MainActivity.java
deleted file mode 100644
index a42b22d..0000000
--- a/app/src/main/java/com/sdsmdg/hareshkh/lectureassignment/MainActivity.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.sdsmdg.hareshkh.lectureassignment;
-
-import android.support.v7.app.AppCompatActivity;
-import android.os.Bundle;
-
-public class MainActivity extends AppCompatActivity {
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- }
-}
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
deleted file mode 100644
index 809dd02..0000000
--- a/app/src/main/res/layout/activity_main.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-