├── .gitattributes
├── GridLayout
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── lenovo
│ │ └── gridlayout
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── lenovo
│ │ │ └── gridlayout
│ │ │ └── MainActivity.java
│ └── res
│ │ ├── layout
│ │ └── activity_main.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxxhdpi
│ │ └── ic_launcher.png
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ └── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── lenovo
│ └── gridlayout
│ └── ExampleUnitTest.java
├── GuessTheCelebrity
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── lenovo
│ │ └── guessthecelebrity
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── lenovo
│ │ │ └── guessthecelebrity
│ │ │ └── MainActivity.java
│ └── res
│ │ ├── layout
│ │ └── activity_main.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxxhdpi
│ │ └── ic_launcher.png
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ └── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── lenovo
│ └── guessthecelebrity
│ └── ExampleUnitTest.java
├── HIkers-Watch
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── lenovo
│ │ └── hikerswatch
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── lenovo
│ │ │ └── hikerswatch
│ │ │ └── MainActivity.java
│ └── res
│ │ ├── drawable
│ │ └── background.jpeg
│ │ ├── layout
│ │ └── activity_main.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxxhdpi
│ │ └── ic_launcher.png
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ └── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── lenovo
│ └── hikerswatch
│ └── ExampleUnitTest.java
├── HideAndShow
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── lenovo
│ │ └── hideandshow
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── lenovo
│ │ │ └── hideandshow
│ │ │ └── MainActivity.java
│ └── res
│ │ ├── layout
│ │ └── activity_main.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxxhdpi
│ │ └── ic_launcher.png
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ └── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── lenovo
│ └── hideandshow
│ └── ExampleUnitTest.java
├── Higher-OR-Lower
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── lenovo
│ │ └── higherorlower
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── lenovo
│ │ │ └── higherorlower
│ │ │ └── MainActivity.java
│ └── res
│ │ ├── layout
│ │ └── activity_main.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxxhdpi
│ │ └── ic_launcher.png
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ └── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── lenovo
│ └── higherorlower
│ └── ExampleUnitTest.java
├── Instagram-Clone
├── MainActivity.java
├── StarterApplication.java
├── UserFeedActivity.java
└── UserListActivity.java
├── LICENSE
├── README.md
├── Resources
├── TwitterKey.ppk
├── airhorn.mp3
├── cat.jpg
├── cat2.jpg
├── currency.jpg
├── egg.png
├── instapic.jpeg
├── snitch.gif
├── snitch.png
├── snitch2.png
└── twitterkeypair.pem
├── adding-New-Activity
├── MainActivity.java
└── secondActivity.java
├── alert-demo
└── MainActivity.java
├── android-wear-demo
└── MainActivity.java
├── animations
└── MainActivity.java
├── basicphrases
└── MainActivity.java
├── bluetooth
└── MainActivity.java
├── braintrainerapp
└── MainActivity.java
├── connect3
└── MainActivity.java
├── currencyconverter
└── MainActivity.java
├── databasedemo
└── MainActivity.java
├── demoapp
└── MainActivity.java
├── downloadingimages
└── MainActivity.java
├── downloadingwebcontent
└── MainActivity.java
├── eggtimer
└── MainActivity.java
├── firebasedemoapp
└── MainActivity.java
├── googlemaps
└── MapsActivity.java
├── jsondemo
└── MainActivity.java
├── languagepreferences
└── MainActivity.java
├── layouts
└── MainActivity.java
├── listview
└── MainActivity.java
├── locationdemo
└── MainActivity.java
├── memorableplaces
├── MainActivity.java
└── MapsActivity.java
├── menudemo
└── MainActivity.java
├── mygdx
└── game
│ └── AndroidLauncher.java
├── new
└── connect3
│ └── MainActivity.java
├── newsreader
├── ArticleActivity.java
└── MainActivity.java
├── notetakingapp
├── MainActivity.java
└── NoteEditorActivity.java
├── notification
└── MainActivity.java
├── numbershape
└── MainActivity.java
├── parseserverstarterproject
├── MainActivity.java
└── StarterApplication.java
├── photoimport
└── MainActivity.java
├── radiobutton
└── radiobutton.java
├── sharedperferences
├── MainActivity.java
└── ObjectSerializer.java
├── sound
└── MainActivity.java
├── timer
└── MainActivity.java
├── timetables
└── MainActivity.java
├── toastdemo
└── MainActivity.java
├── twitter
├── Feed.java
├── Main2Activity.java
├── MainActivity.java
└── StarterApplication.java
├── uber
├── DriverLocationActivity.java
├── MainActivity.java
├── RiderActivity.java
├── StarterApplication.java
└── ViewRequestActivity.java
├── userlocationdemo
└── MapsActivity.java
├── video
└── MainActivity.java
├── weatherapp
└── MainActivity.java
├── webviews
└── MainActivity.java
└── whatsapp
├── ChatActivity.java
├── MainActivity.java
├── StarterApplication.java
└── UserListActivity.java
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/GridLayout/src/androidTest/java/com/lenovo/gridlayout/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.lenovo.gridlayout;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.lenovo.gridlayout", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/GridLayout/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/GridLayout/src/main/java/com/lenovo/gridlayout/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.lenovo.gridlayout;
2 |
3 | import android.support.v7.app.AppCompatActivity;
4 | import android.os.Bundle;
5 |
6 | public class MainActivity extends AppCompatActivity {
7 |
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | setContentView(R.layout.activity_main);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/GridLayout/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
19 |
20 |
30 |
31 |
41 |
42 |
52 |
53 |
63 |
73 |
83 |
93 |
103 |
104 |
105 |
--------------------------------------------------------------------------------
/GridLayout/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ashleshk/Android-N-developer-Course/734aecfcc012d7ee474ca1e146a4ce78a03bd425/GridLayout/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/GridLayout/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ashleshk/Android-N-developer-Course/734aecfcc012d7ee474ca1e146a4ce78a03bd425/GridLayout/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/GridLayout/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ashleshk/Android-N-developer-Course/734aecfcc012d7ee474ca1e146a4ce78a03bd425/GridLayout/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/GridLayout/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ashleshk/Android-N-developer-Course/734aecfcc012d7ee474ca1e146a4ce78a03bd425/GridLayout/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/GridLayout/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ashleshk/Android-N-developer-Course/734aecfcc012d7ee474ca1e146a4ce78a03bd425/GridLayout/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/GridLayout/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/GridLayout/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/GridLayout/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/GridLayout/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | GridLayout
3 |
4 |
--------------------------------------------------------------------------------
/GridLayout/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/GridLayout/src/test/java/com/lenovo/gridlayout/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.lenovo.gridlayout;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/GuessTheCelebrity/src/androidTest/java/com/lenovo/guessthecelebrity/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.lenovo.guessthecelebrity;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.lenovo.guessthecelebrity", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/GuessTheCelebrity/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/GuessTheCelebrity/src/main/java/com/lenovo/guessthecelebrity/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.lenovo.guessthecelebrity;
2 |
3 | import android.graphics.Bitmap;
4 | import android.graphics.BitmapFactory;
5 | import android.os.AsyncTask;
6 | import android.support.v7.app.AppCompatActivity;
7 | import android.os.Bundle;
8 | import android.view.View;
9 | import android.widget.Button;
10 | import android.widget.ImageView;
11 | import android.widget.Toast;
12 |
13 | import java.io.IOException;
14 | import java.io.InputStream;
15 | import java.io.InputStreamReader;
16 | import java.net.HttpURLConnection;
17 | import java.net.MalformedURLException;
18 | import java.net.URL;
19 | import java.util.ArrayList;
20 | import java.util.Random;
21 | import java.util.concurrent.ExecutionException;
22 | import java.util.regex.Matcher;
23 | import java.util.regex.Pattern;
24 |
25 | public class MainActivity extends AppCompatActivity {
26 |
27 | ArrayList celebURLs = new ArrayList();
28 | ArrayList celebNames = new ArrayList();
29 | int chosenCeleb = 0;
30 | int locationOfCorrectAnswer = 0;
31 | String[] answers = new String[4];
32 |
33 | ImageView imageView;
34 | Button button0;
35 | Button button1;
36 | Button button2;
37 | Button button3;
38 |
39 | public void celebChosen(View view) {
40 |
41 | if (view.getTag().toString().equals(Integer.toString(locationOfCorrectAnswer))) {
42 |
43 | Toast.makeText(getApplicationContext(), "Correct!", Toast.LENGTH_LONG).show();
44 |
45 | } else {
46 |
47 | Toast.makeText(getApplicationContext(), "Wrong! It was " + celebNames.get(chosenCeleb), Toast.LENGTH_LONG).show();
48 |
49 | }
50 |
51 | createNewQuestion();
52 |
53 | }
54 |
55 | public class ImageDownloader extends AsyncTask {
56 |
57 |
58 | @Override
59 | protected Bitmap doInBackground(String... urls) {
60 |
61 | try {
62 |
63 | URL url = new URL(urls[0]);
64 |
65 | HttpURLConnection connection = (HttpURLConnection) url.openConnection();
66 |
67 | connection.connect();
68 |
69 | InputStream inputStream = connection.getInputStream();
70 |
71 | Bitmap myBitmap = BitmapFactory.decodeStream(inputStream);
72 |
73 | return myBitmap;
74 |
75 |
76 | } catch (MalformedURLException e) {
77 |
78 | e.printStackTrace();
79 |
80 | } catch (IOException e) {
81 |
82 | e.printStackTrace();
83 |
84 | }
85 |
86 | return null;
87 | }
88 | }
89 |
90 |
91 | public class DownloadTask extends AsyncTask {
92 |
93 |
94 | @Override
95 | protected String doInBackground(String... urls) {
96 |
97 | String result = "";
98 | URL url;
99 | HttpURLConnection urlConnection = null;
100 |
101 | try {
102 |
103 | url = new URL(urls[0]);
104 |
105 | urlConnection = (HttpURLConnection)url.openConnection();
106 |
107 | InputStream in = urlConnection.getInputStream();
108 |
109 | InputStreamReader reader = new InputStreamReader(in);
110 |
111 | int data = reader.read();
112 |
113 | while (data != -1) {
114 |
115 | char current = (char) data;
116 |
117 | result += current;
118 |
119 | data = reader.read();
120 | }
121 |
122 | return result;
123 |
124 | }
125 | catch (Exception e) {
126 |
127 | e.printStackTrace();
128 |
129 | }
130 |
131 | return null;
132 | }
133 | }
134 |
135 | @Override
136 | protected void onCreate(Bundle savedInstanceState) {
137 | super.onCreate(savedInstanceState);
138 | setContentView(R.layout.activity_main);
139 |
140 | imageView = (ImageView) findViewById(R.id.imageView);
141 | button0 = (Button) findViewById(R.id.button);
142 | button1 = (Button) findViewById(R.id.button2);
143 | button2 = (Button) findViewById(R.id.button3);
144 | button3 = (Button) findViewById(R.id.button4);
145 |
146 | DownloadTask task = new DownloadTask();
147 | String result = null;
148 |
149 | try {
150 |
151 | result = task.execute("http://www.posh24.com/celebrities").get();
152 |
153 | String[] splitResult = result.split("