├── .idea
├── .name
├── vcs.xml
├── render.experimental.xml
├── misc.xml
├── runConfigurations.xml
├── gradle.xml
├── jarRepositories.xml
└── codeStyles
│ └── Project.xml
├── app
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── values
│ │ │ │ ├── strings.xml
│ │ │ │ ├── colors.xml
│ │ │ │ ├── preloaded_fonts.xml
│ │ │ │ ├── styles.xml
│ │ │ │ └── font_certs.xml
│ │ │ ├── drawable
│ │ │ │ ├── active.jpg
│ │ │ │ ├── death.jpeg
│ │ │ │ ├── farrow.jpg
│ │ │ │ ├── india.jpg
│ │ │ │ ├── world.jpg
│ │ │ │ ├── confirmed.png
│ │ │ │ ├── recovered.png
│ │ │ │ ├── recovery.jpg
│ │ │ │ ├── ic_baseline_arrow_forward_24.xml
│ │ │ │ ├── ic_activecases1.xml
│ │ │ │ ├── ic_launcher_background.xml
│ │ │ │ ├── ic_virus.xml
│ │ │ │ └── ic_death.xml
│ │ │ ├── font
│ │ │ │ ├── abril_fatface.ttf
│ │ │ │ ├── archivo_black.ttf
│ │ │ │ ├── asset.xml
│ │ │ │ ├── amaranth.xml
│ │ │ │ └── fugaz_one.xml
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ ├── drawable-v24
│ │ │ │ └── ic_launcher_foreground.xml
│ │ │ └── layout
│ │ │ │ ├── activity_main2.xml
│ │ │ │ ├── custom_list_layout.xml
│ │ │ │ └── activity_main.xml
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── covidtracer
│ │ │ ├── AlarmReciever.java
│ │ │ ├── NotificationHelper.java
│ │ │ ├── StateData.java
│ │ │ ├── JsonRetriver.java
│ │ │ ├── CustomAdapter.java
│ │ │ ├── MainActivity2.java
│ │ │ └── MainActivity.java
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── covidtracer
│ │ │ └── ExampleUnitTest.java
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── example
│ │ └── covidtracer
│ │ └── ExampleInstrumentedTest.java
├── proguard-rules.pro
└── build.gradle
├── settings.gradle
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── Requirement
├── About the app
├── README.md
├── .gitignore
├── gradle.properties
├── gradlew.bat
└── gradlew
/.idea/.name:
--------------------------------------------------------------------------------
1 | COVID TRACER
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 | rootProject.name = "COVID TRACER"
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | COVID TRACER
3 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rishikeshrane18/COVID_TRACER/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/app/src/main/res/drawable/active.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rishikeshrane18/COVID_TRACER/HEAD/app/src/main/res/drawable/active.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/death.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rishikeshrane18/COVID_TRACER/HEAD/app/src/main/res/drawable/death.jpeg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/farrow.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rishikeshrane18/COVID_TRACER/HEAD/app/src/main/res/drawable/farrow.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/india.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rishikeshrane18/COVID_TRACER/HEAD/app/src/main/res/drawable/india.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/world.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rishikeshrane18/COVID_TRACER/HEAD/app/src/main/res/drawable/world.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/confirmed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rishikeshrane18/COVID_TRACER/HEAD/app/src/main/res/drawable/confirmed.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/recovered.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rishikeshrane18/COVID_TRACER/HEAD/app/src/main/res/drawable/recovered.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/recovery.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rishikeshrane18/COVID_TRACER/HEAD/app/src/main/res/drawable/recovery.jpg
--------------------------------------------------------------------------------
/app/src/main/res/font/abril_fatface.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rishikeshrane18/COVID_TRACER/HEAD/app/src/main/res/font/abril_fatface.ttf
--------------------------------------------------------------------------------
/app/src/main/res/font/archivo_black.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rishikeshrane18/COVID_TRACER/HEAD/app/src/main/res/font/archivo_black.ttf
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rishikeshrane18/COVID_TRACER/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rishikeshrane18/COVID_TRACER/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rishikeshrane18/COVID_TRACER/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rishikeshrane18/COVID_TRACER/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rishikeshrane18/COVID_TRACER/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Requirement:
--------------------------------------------------------------------------------
1 | ANDROID STUDIO,WHICH YOU CAN DOWNLOAD FROM https://developer.android.com/studio
2 | YOU WILL NEED API "https://api.covid19india.org/data.json"
3 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rishikeshrane18/COVID_TRACER/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rishikeshrane18/COVID_TRACER/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rishikeshrane18/COVID_TRACER/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rishikeshrane18/COVID_TRACER/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rishikeshrane18/COVID_TRACER/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/About the app:
--------------------------------------------------------------------------------
1 | This app will be showing you live count of the covid cases around the world.
2 | It will show you the World Count,India's Count and Indian state cvid count too.
3 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | IT'S COVID COUNT TRACKER.
2 | This app will be showing you live count of the covid cases around the world.
3 | It will show you the World Count,India's Count and Indian state cvid count too.
4 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/render.experimental.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #6200EE
4 | #3700B3
5 | #03DAC5
6 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .cxx
15 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 26 19:41:07 IST 2020
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/preloaded_fonts.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - @font/amaranth
5 | - @font/asset
6 | - @font/fugaz_one
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/font/asset.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/font/amaranth.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/font/fugaz_one.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_arrow_forward_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/test/java/com/example/covidtracer/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.example.covidtracer;
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() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/example/covidtracer/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.example.covidtracer;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 | assertEquals("com.example.covidtracer", appContext.getPackageName());
25 | }
26 | }
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app"s APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
--------------------------------------------------------------------------------
/.idea/jarRepositories.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 30
5 | buildToolsVersion "30.0.0"
6 |
7 | defaultConfig {
8 | applicationId "com.example.covidtracer"
9 | minSdkVersion 16
10 | targetSdkVersion 30
11 | versionCode 1
12 | versionName "1.0"
13 | vectorDrawables.useSupportLibrary = true
14 |
15 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
16 | }
17 |
18 | buildTypes {
19 | release {
20 | minifyEnabled false
21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
22 | }
23 | }
24 | }
25 |
26 | dependencies {
27 | implementation fileTree(dir: "libs", include: ["*.jar"])
28 | implementation 'androidx.appcompat:appcompat:1.1.0'
29 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
30 | implementation 'androidx.cardview:cardview:1.0.0'
31 | implementation 'androidx.gridlayout:gridlayout:1.0.0'
32 | implementation 'androidx.recyclerview:recyclerview:1.1.0'
33 | implementation 'com.android.volley:volley:1.1.1'
34 | testImplementation 'junit:junit:4.12'
35 | androidTestImplementation 'androidx.test.ext:junit:1.1.1'
36 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
37 |
38 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/example/covidtracer/AlarmReciever.java:
--------------------------------------------------------------------------------
1 | package com.example.covidtracer;
2 |
3 | import android.app.NotificationManager;
4 | import android.app.PendingIntent;
5 | import android.content.BroadcastReceiver;
6 | import android.content.Context;
7 | import android.content.Intent;
8 |
9 | import androidx.core.app.NotificationCompat;
10 |
11 | public class AlarmReciever extends BroadcastReceiver {
12 |
13 | @Override
14 | public void onReceive(Context context, Intent intent) {
15 |
16 | /* long when = System.currentTimeMillis();
17 | NotificationManager notificationManager = (NotificationManager) context
18 | .getSystemService(Context.NOTIFICATION_SERVICE);
19 |
20 | Intent notificationIntent = new Intent(context, MainActivity.class);
21 | notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
22 |
23 | PendingIntent pendingIntent = PendingIntent.getActivity(context,0,notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
24 |
25 | NotificationCompat.Builder mNotifyBuilder = new NotificationCompat.Builder(context).setSmallIcon(R.drawable.ic_virus)
26 | .setContentTitle("COVID STATS")
27 | .setContentText("CHECK COVID TRACER APP FOR UPDATE IN COVID CASES")
28 | .setAutoCancel(true)
29 | .setWhen(when)
30 | .setContentIntent(pendingIntent);
31 | notificationManager.notify(250,mNotifyBuilder.build());*/
32 |
33 | NotificationHelper notificationHelper = new NotificationHelper(context);
34 | NotificationCompat.Builder nb = notificationHelper.getChannelNotification();
35 | notificationHelper.getManager().notify(1, nb.build());
36 |
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/covidtracer/NotificationHelper.java:
--------------------------------------------------------------------------------
1 | package com.example.covidtracer;
2 |
3 | import android.annotation.TargetApi;
4 | import android.app.NotificationChannel;
5 | import android.app.NotificationManager;
6 | import android.content.Context;
7 | import android.content.ContextWrapper;
8 | import android.os.Build;
9 |
10 | import androidx.core.app.NotificationCompat;
11 |
12 | public class NotificationHelper extends ContextWrapper {
13 | public static final String channelID = "channelID";
14 | public static final String channelName = "Channel Name";
15 | private NotificationManager mManager;
16 |
17 | public NotificationHelper(Context base) {
18 | super(base);
19 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
20 | createChannel();
21 | }
22 | }
23 |
24 | @TargetApi(Build.VERSION_CODES.O)
25 | private void createChannel() {
26 | NotificationChannel channel = new NotificationChannel(channelID, channelName, NotificationManager.IMPORTANCE_HIGH);
27 | getManager().createNotificationChannel(channel);
28 | }
29 |
30 | public NotificationManager getManager() {
31 | if (mManager == null) {
32 | mManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
33 | }
34 | return mManager;
35 | }
36 |
37 | public NotificationCompat.Builder getChannelNotification() {
38 |
39 | return new NotificationCompat.Builder(getApplicationContext(), channelID)
40 | .setContentTitle("Cases Update")
41 | .setContentText("CASES COUNT UPDATED CHECK IT")
42 | .setSmallIcon(R.drawable.ic_virus)
43 | .setAutoCancel(true);
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/covidtracer/StateData.java:
--------------------------------------------------------------------------------
1 | package com.example.covidtracer;
2 |
3 | public class StateData {
4 | private String stateName;
5 | private String activeCases;
6 | private String confirmedCases;
7 | private String recoveredCases;
8 | private String deathCases;
9 |
10 | public StateData() {
11 | }
12 |
13 | public StateData(String stateName, String confirmedCases, String activeCases, String recoveredCases, String deathCases){
14 | this.stateName = stateName;
15 | this.confirmedCases = confirmedCases;
16 | this.activeCases = activeCases;
17 | this.recoveredCases = recoveredCases;
18 | this.deathCases = deathCases;
19 | }
20 |
21 | public String getStateName() {
22 | return stateName;
23 | }
24 |
25 | public void setStateName(String stateName) {
26 | this.stateName = stateName;
27 | }
28 |
29 | public String getActiveCases() {
30 | return activeCases;
31 | }
32 |
33 | public void setActiveCases(String activeCases) {
34 | this.activeCases = activeCases;
35 | }
36 |
37 | public String getConfirmedCases() {
38 | return confirmedCases;
39 | }
40 |
41 | public void setConfirmedCases(String confirmedCases) {
42 | this.confirmedCases = confirmedCases;
43 | }
44 |
45 | public String getRecoveredCases() {
46 | return recoveredCases;
47 | }
48 |
49 | public void setRecoveredCases(String recoveredCases) {
50 | this.recoveredCases = recoveredCases;
51 | }
52 |
53 | public String getDeathCases() {
54 | return deathCases;
55 | }
56 |
57 | public void setDeathCases(String deathCases) {
58 | this.deathCases = deathCases;
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/covidtracer/JsonRetriver.java:
--------------------------------------------------------------------------------
1 | package com.example.covidtracer;
2 |
3 | import android.os.AsyncTask;
4 | import android.util.Log;
5 |
6 | import java.io.IOException;
7 | import java.io.InputStream;
8 | import java.io.InputStreamReader;
9 | import java.net.HttpURLConnection;
10 | import java.net.MalformedURLException;
11 | import java.net.URL;
12 |
13 |
14 | import static com.example.covidtracer.MainActivity.INDIA_OPT;
15 | import static com.example.covidtracer.MainActivity.WORLD_OPT;
16 | import static com.example.covidtracer.MainActivity.populate_india;
17 | import static com.example.covidtracer.MainActivity.populate_world;
18 |
19 | public class JsonRetriver extends AsyncTask {
20 |
21 | private int option;
22 | public JsonRetriver(int option) {
23 | this.option = option;
24 | }
25 |
26 | @Override
27 | protected String doInBackground(String... urls) {
28 |
29 | String result = "";
30 | URL url;
31 | HttpURLConnection urlConnection;
32 | urlConnection = null;
33 | try {
34 | url = new URL( urls[0]);
35 | urlConnection = (HttpURLConnection) url.openConnection();
36 | InputStream in = urlConnection.getInputStream();
37 | InputStreamReader reader = new InputStreamReader(in);
38 |
39 | int data = reader.read();
40 | while (data!= -1){
41 | char current = (char) data;
42 | result += current;
43 | data = reader.read();
44 | }
45 | return result;
46 | } catch (MalformedURLException e) {
47 | e.printStackTrace();
48 | } catch (IOException e) {
49 | e.printStackTrace();
50 | }
51 |
52 | return null;
53 | }
54 |
55 | @Override
56 | protected void onPostExecute(String result) {
57 | super.onPostExecute(result);
58 | if(option == WORLD_OPT)
59 | populate_world(result);
60 | //else if(option == INDIA_OPT)
61 | else
62 | populate_india(result);
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/covidtracer/CustomAdapter.java:
--------------------------------------------------------------------------------
1 | package com.example.covidtracer;
2 |
3 | import android.content.Context;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.widget.TextView;
8 |
9 | import androidx.annotation.NonNull;
10 | import androidx.recyclerview.widget.RecyclerView;
11 |
12 | import java.util.ArrayList;
13 | import java.util.List;
14 |
15 | public class CustomAdapter extends RecyclerView.Adapter {
16 |
17 | LayoutInflater inflater;
18 | List stateData = new ArrayList<>();
19 | public CustomAdapter (Context ctx,ListstateData){
20 | this.inflater = LayoutInflater.from(ctx);
21 | this.stateData = stateData;
22 | }
23 |
24 | @NonNull
25 | @Override
26 | public CustomAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
27 | View view = inflater.inflate(R.layout.custom_list_layout,parent,false);
28 | return new ViewHolder(view);
29 | }
30 |
31 | @Override
32 | public void onBindViewHolder(@NonNull CustomAdapter.ViewHolder holder, int position) {
33 |
34 | holder.stateName.setText(stateData.get(position).getStateName());
35 | holder.sccases.setText(stateData.get(position).getConfirmedCases());
36 | holder.sacases.setText(stateData.get(position).getActiveCases());
37 | holder.srcases.setText(stateData.get(position).getRecoveredCases());
38 | holder.sdcases.setText(stateData.get(position).getDeathCases());
39 |
40 | }
41 |
42 | @Override
43 | public int getItemCount() {
44 | return stateData != null?stateData.size(): 0;
45 | }
46 |
47 | public class ViewHolder extends RecyclerView.ViewHolder{
48 | TextView stateName,sccases,sacases,srcases,sdcases;
49 |
50 |
51 | public ViewHolder(@NonNull View itemView) {
52 | super(itemView);
53 |
54 | stateName = itemView.findViewById(R.id.stateName);
55 | sccases = itemView.findViewById(R.id.sccases);
56 | sacases = itemView.findViewById(R.id.sacases);
57 | srcases = itemView.findViewById(R.id.srcases);
58 | sdcases = itemView.findViewById(R.id.sdcases);
59 | }
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main2.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
22 |
23 |
37 |
38 |
42 |
43 |
49 |
50 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/app/src/main/res/values/font_certs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - @array/com_google_android_gms_fonts_certs_dev
5 | - @array/com_google_android_gms_fonts_certs_prod
6 |
7 |
8 | -
9 | MIIEqDCCA5CgAwIBAgIJANWFuGx90071MA0GCSqGSIb3DQEBBAUAMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTAeFw0wODA0MTUyMzM2NTZaFw0zNTA5MDEyMzM2NTZaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBANbOLggKv+IxTdGNs8/TGFy0PTP6DHThvbbR24kT9ixcOd9W+EaBPWW+wPPKQmsHxajtWjmQwWfna8mZuSeJS48LIgAZlKkpFeVyxW0qMBujb8X8ETrWy550NaFtI6t9+u7hZeTfHwqNvacKhp1RbE6dBRGWynwMVX8XW8N1+UjFaq6GCJukT4qmpN2afb8sCjUigq0GuMwYXrFVee74bQgLHWGJwPmvmLHC69EH6kWr22ijx4OKXlSIx2xT1AsSHee70w5iDBiK4aph27yH3TxkXy9V89TDdexAcKk/cVHYNnDBapcavl7y0RiQ4biu8ymM8Ga/nmzhRKya6G0cGw8CAQOjgfwwgfkwHQYDVR0OBBYEFI0cxb6VTEM8YYY6FbBMvAPyT+CyMIHJBgNVHSMEgcEwgb6AFI0cxb6VTEM8YYY6FbBMvAPyT+CyoYGapIGXMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbYIJANWFuGx90071MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADggEBABnTDPEF+3iSP0wNfdIjIz1AlnrPzgAIHVvXxunW7SBrDhEglQZBbKJEk5kT0mtKoOD1JMrSu1xuTKEBahWRbqHsXclaXjoBADb0kkjVEJu/Lh5hgYZnOjvlba8Ld7HCKePCVePoTJBdI4fvugnL8TsgK05aIskyY0hKI9L8KfqfGTl1lzOv2KoWD0KWwtAWPoGChZxmQ+nBli+gwYMzM1vAkP+aayLe0a1EQimlOalO762r0GXO0ks+UeXde2Z4e+8S/pf7pITEI/tP+MxJTALw9QUWEv9lKTk+jkbqxbsh8nfBUapfKqYn0eidpwq2AzVp3juYl7//fKnaPhJD9gs=
10 |
11 |
12 |
13 | -
14 | MIIEQzCCAyugAwIBAgIJAMLgh0ZkSjCNMA0GCSqGSIb3DQEBBAUAMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDAeFw0wODA4MjEyMzEzMzRaFw0zNjAxMDcyMzEzMzRaMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBAKtWLgDYO6IIrgqWbxJOKdoR8qtW0I9Y4sypEwPpt1TTcvZApxsdyxMJZ2JORland2qSGT2y5b+3JKkedxiLDmpHpDsz2WCbdxgxRczfey5YZnTJ4VZbH0xqWVW/8lGmPav5xVwnIiJS6HXk+BVKZF+JcWjAsb/GEuq/eFdpuzSqeYTcfi6idkyugwfYwXFU1+5fZKUaRKYCwkkFQVfcAs1fXA5V+++FGfvjJ/CxURaSxaBvGdGDhfXE28LWuT9ozCl5xw4Yq5OGazvV24mZVSoOO0yZ31j7kYvtwYK6NeADwbSxDdJEqO4k//0zOHKrUiGYXtqw/A0LFFtqoZKFjnkCAQOjgdkwgdYwHQYDVR0OBBYEFMd9jMIhF1Ylmn/Tgt9r45jk14alMIGmBgNVHSMEgZ4wgZuAFMd9jMIhF1Ylmn/Tgt9r45jk14aloXikdjB0MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLR29vZ2xlIEluYy4xEDAOBgNVBAsTB0FuZHJvaWQxEDAOBgNVBAMTB0FuZHJvaWSCCQDC4IdGZEowjTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4IBAQBt0lLO74UwLDYKqs6Tm8/yzKkEu116FmH4rkaymUIE0P9KaMftGlMexFlaYjzmB2OxZyl6euNXEsQH8gjwyxCUKRJNexBiGcCEyj6z+a1fuHHvkiaai+KL8W1EyNmgjmyy8AW7P+LLlkR+ho5zEHatRbM/YAnqGcFh5iZBqpknHf1SKMXFh4dd239FJ1jWYfbMDMy3NS5CTMQ2XFI1MvcyUTdZPErjQfTbQe3aDQsQcafEQPD+nqActifKZ0Np0IS9L9kR/wbNvyz6ENwPiTrjV2KRkEjH78ZMcUQXg0L3BYHJ3lc69Vs5Ddf9uUGGMYldX3WfMBEmh/9iFBDAaTCK
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/covidtracer/MainActivity2.java:
--------------------------------------------------------------------------------
1 | package com.example.covidtracer;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 | import androidx.recyclerview.widget.LinearLayoutManager;
5 | import androidx.recyclerview.widget.RecyclerView;
6 |
7 | import android.content.Intent;
8 | import android.os.Bundle;
9 | import android.util.Log;
10 | import android.view.View;
11 | import android.widget.Adapter;
12 | import android.widget.TextView;
13 |
14 | import com.android.volley.Request;
15 | import com.android.volley.RequestQueue;
16 | import com.android.volley.Response;
17 | import com.android.volley.VolleyError;
18 | import com.android.volley.toolbox.JsonObjectRequest;
19 | import com.android.volley.toolbox.Volley;
20 |
21 | import org.json.JSONArray;
22 | import org.json.JSONException;
23 | import org.json.JSONObject;
24 |
25 | import java.util.ArrayList;
26 | import java.util.List;
27 |
28 | public class MainActivity2 extends AppCompatActivity {
29 |
30 | private RecyclerView recyclerView;
31 | private List newdata;
32 | private RequestQueue mQueue;
33 | private CustomAdapter adapter;
34 |
35 |
36 | public void activityShifter(View view){
37 | Intent intent = new Intent(this,MainActivity.class);
38 | startActivity(intent);
39 | }
40 |
41 | @Override
42 | protected void onCreate(Bundle savedInstanceState) {
43 | super.onCreate(savedInstanceState);
44 | setContentView(R.layout.activity_main2);
45 |
46 |
47 |
48 |
49 | Intent intent = getIntent();
50 | recyclerView = findViewById(R.id.recycleView);
51 |
52 | mQueue = new Volley().newRequestQueue(this);
53 |
54 | newdata = new ArrayList<>();
55 |
56 | jsonParse();
57 |
58 | recyclerView.setLayoutManager(new LinearLayoutManager(this));
59 | }
60 | private void jsonParse(){
61 | String url = "https://api.covid19india.org/data.json";
62 | JsonObjectRequest request = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener() {
63 | @Override
64 | public void onResponse(JSONObject response) {
65 | try {
66 | JSONArray jsonArray = response.getJSONArray("statewise");
67 |
68 | for (int i = 0;i < jsonArray.length();i++){
69 | JSONObject statewise = jsonArray.getJSONObject(i);
70 | StateData data = new StateData();
71 | data.setStateName(statewise.getString("state").toString());
72 | data.setConfirmedCases(statewise.getString("confirmed").toString());
73 | data.setActiveCases(statewise.getString("active").toString());
74 | data.setRecoveredCases(statewise.getString("recovered").toString());
75 | data.setDeathCases(statewise.getString("deaths").toString());
76 | newdata.add(data);
77 | Log.i("info", String.valueOf(i));
78 |
79 |
80 | }
81 | adapter = new CustomAdapter(MainActivity2.this,newdata);
82 | recyclerView.setAdapter(adapter);
83 | } catch (JSONException e) {
84 | e.printStackTrace();
85 |
86 | }
87 |
88 | }
89 | }, new Response.ErrorListener() {
90 | @Override
91 | public void onErrorResponse(VolleyError error) {
92 | error.printStackTrace();
93 | Log.i("info123","sww");
94 |
95 | }
96 | });
97 | mQueue.add(request);
98 | }
99 |
100 |
101 | }
--------------------------------------------------------------------------------
/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | xmlns:android
14 |
15 | ^$
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | xmlns:.*
25 |
26 | ^$
27 |
28 |
29 | BY_NAME
30 |
31 |
32 |
33 |
34 |
35 |
36 | .*:id
37 |
38 | http://schemas.android.com/apk/res/android
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | .*:name
48 |
49 | http://schemas.android.com/apk/res/android
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | name
59 |
60 | ^$
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | style
70 |
71 | ^$
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 | .*
81 |
82 | ^$
83 |
84 |
85 | BY_NAME
86 |
87 |
88 |
89 |
90 |
91 |
92 | .*
93 |
94 | http://schemas.android.com/apk/res/android
95 |
96 |
97 | ANDROID_ATTRIBUTE_ORDER
98 |
99 |
100 |
101 |
102 |
103 |
104 | .*
105 |
106 | .*
107 |
108 |
109 | BY_NAME
110 |
111 |
112 |
113 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_activecases1.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
15 |
18 |
21 |
24 |
27 |
30 |
33 |
36 |
39 |
42 |
45 |
48 |
51 |
54 |
57 |
60 |
61 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_virus.xml:
--------------------------------------------------------------------------------
1 |
6 |
10 |
14 |
18 |
22 |
26 |
30 |
34 |
38 |
42 |
46 |
50 |
51 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/covidtracer/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.covidtracer;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 | import androidx.core.app.NotificationCompat;
5 |
6 | import android.app.AlarmManager;
7 | import android.app.NotificationManager;
8 | import android.app.PendingIntent;
9 | import android.content.BroadcastReceiver;
10 | import android.content.Context;
11 | import android.content.Intent;
12 | import android.os.Bundle;
13 | import android.view.View;
14 | import android.widget.TextView;
15 |
16 | import org.json.JSONArray;
17 | import org.json.JSONException;
18 | import org.json.JSONObject;
19 |
20 | import java.util.Calendar;
21 |
22 |
23 | public class MainActivity extends AppCompatActivity {
24 | public static TextView wccases,wacases,wrcases,wdcases,iccases,iacases,ircases,idcases;
25 |
26 | public static int WORLD_OPT = 1;
27 | public static int INDIA_OPT = 2;
28 |
29 | public void activityShifter(View view){
30 | Intent intent = new Intent(this,MainActivity2.class);
31 | startActivity(intent);
32 |
33 |
34 | }
35 |
36 | @Override
37 | protected void onCreate(Bundle savedInstanceState) {
38 | super.onCreate(savedInstanceState);
39 | setContentView(R.layout.activity_main);
40 |
41 | Intent intent = getIntent();
42 |
43 | wccases = findViewById(R.id.textView2);
44 | wacases = findViewById(R.id.textView4);
45 | wrcases = findViewById(R.id.textView6);
46 | wdcases = findViewById(R.id.textView8);
47 | iccases = findViewById(R.id.textView10);
48 | iacases = findViewById(R.id.textView12);
49 | ircases = findViewById(R.id.textView14);
50 | idcases = findViewById(R.id.textView16);
51 |
52 |
53 | JsonRetriver task = new JsonRetriver(WORLD_OPT);
54 | task.execute("https://api.thevirustracker.com/free-api?global=stats");
55 | JsonRetriver task_india = new JsonRetriver(INDIA_OPT);
56 | task_india.execute("https://api.thevirustracker.com/free-api?countryTotal=IN");
57 |
58 | /* Calendar calendar = Calendar.getInstance();
59 | Intent intent1 = new Intent(MainActivity.this,AlarmReciever.class);
60 | PendingIntent pendingIntent = PendingIntent.getBroadcast(this,0,intent1,PendingIntent.FLAG_UPDATE_CURRENT);
61 | AlarmManager am =(AlarmManager)this.getSystemService(ALARM_SERVICE);
62 | am.setRepeating(AlarmManager.RTC_WAKEUP,calendar.getTimeInMillis(),60000,pendingIntent);*/
63 | setNotification();
64 |
65 | }
66 |
67 | private void setNotification() {
68 | AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
69 | Intent intent = new Intent(this,AlarmReciever.class);
70 | PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 1, intent, 0);
71 |
72 | alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis(), 360000, pendingIntent);
73 | }
74 |
75 | public static void populate_world(String jsonData){
76 | try {
77 | JSONObject jsonObject = new JSONObject(jsonData);
78 | JSONArray jsonArray = jsonObject.getJSONArray("results");
79 | JSONObject data = jsonArray.getJSONObject(0);
80 | wccases.setText(data.getString("total_cases"));
81 | wacases.setText(data.getString("total_unresolved"));
82 | wrcases.setText(data.getString("total_recovered"));
83 | wdcases.setText(data.getString("total_deaths"));
84 | } catch (JSONException e) {
85 | e.printStackTrace();
86 | }
87 |
88 | }
89 | public static void populate_india(String jsonData){
90 | try {
91 | JSONObject jsonObject = new JSONObject(jsonData);
92 | JSONArray jsonArray = jsonObject.getJSONArray("countrydata");
93 | JSONObject data = jsonArray.getJSONObject(0);
94 | iccases.setText(data.getString("total_cases"));
95 | iacases.setText(data.getString("total_serious_cases"));
96 | ircases.setText(data.getString("total_recovered"));
97 | idcases.setText(data.getString("total_deaths"));
98 | } catch (JSONException e) {
99 | e.printStackTrace();
100 | }
101 |
102 | }
103 | /* public static class AlarmReciever extends BroadcastReceiver{
104 |
105 | @Override
106 | public void onReceive(Context context, Intent intent) {
107 | long when = System.currentTimeMillis();
108 | NotificationManager notificationManager = (NotificationManager) context
109 | .getSystemService(Context.NOTIFICATION_SERVICE);
110 |
111 | Intent notificationIntent = new Intent(context, MainActivity.class);
112 | notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
113 |
114 | PendingIntent pendingIntent = PendingIntent.getActivity(context,0,notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
115 |
116 | NotificationCompat.Builder mNotifyBuilder = new NotificationCompat.Builder(context).setSmallIcon(R.drawable.ic_virus)
117 | .setContentTitle("COVID STATS")
118 | .setContentText("CHECK COVID TRACER APP FOR UPDATE IN COVID CASES")
119 | .setAutoCancel(true)
120 | .setWhen(when)
121 | .setContentIntent(pendingIntent);
122 | notificationManager.notify(250,mNotifyBuilder.build());
123 |
124 | }
125 | }*/
126 | }
127 | /* Calendar calendar = Calendar.getInstance();
128 | Intent intent1 = new Intent(MainActivity.this,AlarmReceiver.class);
129 | PendingIntent pendingIntent = PendingIntent.getBroadcast(this,0,intent1,PendingIntent.FLAG_UPDATE_CURRENT);
130 | AlarmManager am =(AlarmManager)this.getSystemService(this.ALARM_SERVICE);
131 | am.setRepeating(AlarmManager.RTC_WAKEUP,calendar.getTimeInMillis(),2*60*60,pendingIntent);
132 | }
133 | public class AlarmReceiver extends BroadcastReceiver {
134 | @Override
135 | public void onReceive(Context context, Intent intent) {
136 | long when = System.currentTimeMillis();
137 | NotificationManager notificationManager = (NotificationManager) context
138 | .g Calendar calendar = Calendar.getInstance();
139 | Intent intent1 = new Intent(MainActivity.this,AlarmReceiver.class);
140 | PendingIntent pendingIntent = PendingIntent.getBroadcast(this,0,intent1,PendingIntent.FLAG_UPDATE_CURRENT);
141 | AlarmManager am =(AlarmManager)this.getSystemService(this.ALARM_SERVICE);
142 | am.setRepeating(AlarmManager.RTC_WAKEUP,calendar.getTimeInMillis(),2*60*60,pendingIntent);
143 | }
144 | public class AlarmReceiver extends BroadcastReceiver{
145 | @Override
146 | public void onReceive(Context context, Intent intent) {
147 | long when = System.currentTimeMillis();
148 | NotificationManager notificationManager = (NotificationManager) context
149 | .getSystemservice(Context.NOTIFICATION_SERVICE);
150 | Intent notificationIntent = new Intent(context,MainActivity.class);
151 | notificationIntent,setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
152 | PendingIntent pendingIntent = PendingIntent.getActivity(context,0,notificationIntent,PendingIntent.FLAG_UPDATE_CURRENT);
153 | NotificationCompat.Builder mnNotifyBuilder = new NotificationCompat.Builder(context).setSmallIcon(R.drawable.ic_launcher_background).setContentTitle("TEXT").setContentText("TEXT")
154 | .setWhen(when).setContentIntent(pendingIntent)
155 | notificationManager.notify(25,mnNotifyBuilder.build());
156 | }
157 | }etSystemservice(Context.NOTIFICATION_SERVICE);
158 | Intent notificationIntent = new Intent(context,MainActivity.class);
159 | notificationIntent,setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
160 | PendingIntent pendingIntent = PendingIntent.getActivity(context,0,notificationIntent,PendingIntent.FLAG_UPDATE_CURRENT);
161 | NotificationCompat.Builder mnNotifyBuilder = new NotificationCompat.Builder(context).setSmallIcon(R.drawable.ic_launcher_background).setContentTitle("TEXT").setContentText("TEXT")
162 | .setWhen(when).setContentIntent(pendingIntent)
163 | notificationManager.notify(25,mnNotifyBuilder.build());
164 | }
165 | }*/
--------------------------------------------------------------------------------
/app/src/main/res/layout/custom_list_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
21 |
22 |
26 |
27 |
39 |
40 |
46 |
47 |
54 |
55 |
64 |
65 |
76 |
77 |
88 |
89 |
90 |
91 |
98 |
99 |
108 |
109 |
120 |
121 |
132 |
133 |
134 |
135 |
142 |
143 |
152 |
153 |
164 |
165 |
176 |
177 |
178 |
179 |
186 |
187 |
196 |
197 |
208 |
209 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_death.xml:
--------------------------------------------------------------------------------
1 |
6 |
10 |
14 |
18 |
22 |
26 |
30 |
34 |
38 |
42 |
46 |
50 |
54 |
58 |
62 |
65 |
68 |
71 |
74 |
75 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
26 |
27 |
28 |
35 |
36 |
42 |
43 |
44 |
50 |
51 |
63 |
64 |
65 |
66 |
67 |
87 |
88 |
98 |
99 |
106 |
107 |
116 |
117 |
129 |
130 |
141 |
142 |
143 |
144 |
145 |
155 |
156 |
163 |
164 |
173 |
174 |
186 |
187 |
198 |
199 |
200 |
201 |
202 |
215 |
216 |
223 |
224 |
233 |
234 |
246 |
247 |
258 |
259 |
260 |
261 |
262 |
274 |
275 |
282 |
283 |
292 |
293 |
305 |
306 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
334 |
335 |
339 |
340 |
344 |
345 |
353 |
354 |
363 |
364 |
365 |
366 |
367 |
384 |
385 |
395 |
396 |
403 |
404 |
413 |
414 |
426 |
427 |
438 |
439 |
440 |
441 |
442 |
452 |
453 |
460 |
461 |
470 |
471 |
483 |
484 |
495 |
496 |
497 |
498 |
499 |
512 |
513 |
520 |
521 |
530 |
531 |
543 |
544 |
555 |
556 |
557 |
558 |
559 |
571 |
572 |
579 |
580 |
589 |
590 |
602 |
603 |
614 |
615 |
616 |
617 |
618 |
619 |
620 |
621 |
637 |
638 |
643 |
644 |
656 |
657 |
663 |
664 |
665 |
666 |
667 |
668 |
--------------------------------------------------------------------------------