Skip to content

Commit

Permalink
Merge pull request #8 from islem19/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
islem19 authored Mar 21, 2020
2 parents c9f2c71 + dd6935c commit 2b9d79c
Show file tree
Hide file tree
Showing 97 changed files with 2,572 additions and 641 deletions.
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions README-ar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Covid-19 Android App


تطبيق محمول يوفر إحصائيات وبيانات محدثة حول فيروس كورونا المنتشر حول العالم.

بفضل التقارير والبيانات المقدمة من worldmeters.info/coronavirus و NovalCOVID API ، يبسط التطبيق ويوفر بيانات حول انتشار فيروس كورونا في المنطقة المحلية للمستخدمين ، تقارير مثل: عدد الحالات النشطة ، حالات يومية جديدة مؤكدة ,الوفيات الجديدة وعدد الحالات الذين تعافوا .

يوضح تطبيق الهاتف المحمول أيضًا ، إجمالي الحالات في العالم ، وتقريرًا مفصلاً حول كل بلد - يتم فرزه حسب عدد الحالات المؤكدة.

6 changes: 6 additions & 0 deletions README-fr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Covid-19 Android App

Covid-19 est une application mobile qui fournit des mises à jour des statistiques et des données sur la propagation du virus corona sur le monde.

Grâce aux rapports et données fournis par worldmeters.info/coronavirus et NovalCOVID API, l'application simplifie et fournit des données sur la propagation du virus corona dans la région locale des utilisateurs, des rapports tels que: combien de cas actifs, nouveaux cas confirmés, nouveaux décès et combien ont récupéré.
L'application mobile affiche également le nombre total de cas dans le monde et un rapport détaillé sur chaque pays -trié par le nombre de cas confirmés.
61 changes: 61 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Covid-19 Android App

Covid-19 is a mobile application that provides updated stats and data about the spreaded corona virus around the world.

Thanks to the reports and data provided by worldmeters.info/coronavirus and NovalCOVID API, the application simplifies and provide data about the spreading of the corona virus in the local region of the users, reports such as : how many active cases, new daily confirmed cases, new deaths and how many recovered one.
The mobile application shows also, the total cases in the globe, and a detailed report about every country -sorted by the number of confirmed cases.

## Download The App from here [first release](https://github.com/islem19/CoronaCovid19/releases/download/v1.0.1/covid19.apk)

## Screenshots

[<img src="screenshots/screenshot1.png" align="left"
width="250"
hspace="10" vspace="10">](screenshots/screenshot1.png)
[<img src="screenshots/screenshot2.png" align="center"
width="250"
hspace="10" vspace="10">](screenshots/screenshot2.png)
[<img src="screenshots/screenshot3.png" align="center"
width="250"
hspace="10" vspace="10">](screenshots/screenshot3.png)
[<img src="screenshots/screenshot4.png" align="center"
width="250"
hspace="10" vspace="10">](screenshots/screenshot4.png)


## Setup
Clone this repository and import into **Android Studio**
```bash
git clone https://github.com/islem19/CoronaCovid19.git
```

## Permissions
The App requires the following permissions:
- Internet access.

## Libraries and Dependencies
- [Retrofit](https://square.github.io/retrofit/)
- [CardView]()
- [Gson](https://github.com/google/gson)
- [Butterknife](https://jakewharton.github.io/butterknife/)
- [RecyclerView](https://developer.android.com/jetpack/androidx/releases/recyclerview)
- [Material Design](https://material.io/develop/android/components/)


## Maintainers
This project is mantained by:
* [Abdelkader SELLAMI](https://github.com/islem19)
* [Billel BOUMESSAIDIA](https://github.com/BillelBmsd)


## Contributing

1. Fork it
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -m 'Add some feature')
4. Push your branch (git push origin my-new-feature)
5. Create a new Pull Request


## License
This application is released under GNU GPLv3 (see [LICENSE]()). Some of the used libraries are released under different licenses.
6 changes: 4 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ android {
buildToolsVersion "29.0.3"

defaultConfig {
applicationId "dz.islem.covid19"
applicationId "com.covidvirus.app"
minSdkVersion 23
targetSdkVersion 29
versionCode 1
versionName "1.0"
versionName "1.0.1"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand All @@ -31,6 +31,8 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'com.google.android.gms:play-services-ads:19.0.1'

implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.appcompat:appcompat:1.1.0'
// cardview
Expand Down
25 changes: 20 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,26 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="dz.islem.covid19">
package="com.covidvirus.app"
>

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />


<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:name=".App"
android:name="com.covidvirus.app.App"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:networkSecurityConfig="@xml/network_security_config"
android:theme="@style/AppTheme">
<activity android:name=".ui.home.MainActivity"

<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-4756765024373725~9622341322"/>

<activity
android:screenOrientation="portrait"
android:name="com.covidvirus.app.ui.splash.SplashActivity"
android:theme="@style/AppTheme.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

</activity>
<activity
android:screenOrientation="portrait"
android:name="com.covidvirus.app.ui.home.MainActivity"
android:theme="@style/AppTheme.MainActivity">

</activity>
</application>

Expand Down
Binary file added app/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dz.islem.covid19;
package com.covidvirus.app;

import android.app.Application;

Expand Down
59 changes: 59 additions & 0 deletions app/src/main/java/com/covidvirus/app/data/DataManager.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package com.covidvirus.app.data;

import android.content.SharedPreferences;

import com.covidvirus.app.App;
import com.covidvirus.app.data.network.services.DataService;
import com.covidvirus.app.data.network.services.location.LocationService;

import static android.content.Context.MODE_PRIVATE;

public class DataManager {

private static DataManager mInstance;
private SharedPreferences sharedPreferences;
public static final String MY_PREFS_NAME = "covid_pref";
public static final String COUNTRY_KEY = "county";
public static final String RUN_COUNT_KEY = "run_count";
public static final int MAX_COUNT = 5;

private DataManager(){
sharedPreferences = App.getInstance().getSharedPreferences(MY_PREFS_NAME,MODE_PRIVATE);
}

public static synchronized DataManager getInstance(){
return mInstance == null ? new DataManager() : mInstance;
}

public void setDefaultCountry(String country){
sharedPreferences.edit()
.putString(COUNTRY_KEY, country)
.apply();
}

public String getDefaultCountry(){
return sharedPreferences.getString(COUNTRY_KEY, null);
}

public void setRunCount(){
int count = getRunCount();
if (count == MAX_COUNT || count > MAX_COUNT) count = 0;
else count++;
sharedPreferences.edit()
.putInt(RUN_COUNT_KEY, count)
.apply();
}

public int getRunCount(){
return sharedPreferences.getInt(RUN_COUNT_KEY, 0);
}

public DataService getDataService(){
return DataService.getInstance();
}

public LocationService getLocationService(){
return LocationService.getInstance();
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dz.islem.covid19.data.network.model;
package com.covidvirus.app.data.network.model;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dz.islem.covid19.data.network.model;
package com.covidvirus.app.data.network.model;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.covidvirus.app.data.network.model;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

import java.io.Serializable;

public class Location implements Serializable {
@Expose
@SerializedName("country")
private String country;

public Location(String country) {
this.country = country;
}

public String getCountry() {
return country;
}

public void setCountry(String country) {
this.country = country;
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package dz.islem.covid19.data.network.services;
package com.covidvirus.app.data.network.services;

import com.covidvirus.app.data.network.model.CountryDataModel;
import com.covidvirus.app.data.network.model.GlobalDataModel;

import java.util.List;

import dz.islem.covid19.data.network.model.CountryDataModel;
import dz.islem.covid19.data.network.model.GlobalDataModel;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Path;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dz.islem.covid19.data.network.services;
package com.covidvirus.app.data.network.services;

import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.covidvirus.app.data.network.services.location;

import com.covidvirus.app.data.network.model.Location;
import retrofit2.Call;
import retrofit2.http.GET;

public interface LocationApi {

@GET("/json")
Call<Location> getLocationData();


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.covidvirus.app.data.network.services.location;

import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

public class LocationService {
private static final String BASE_URL = "http://ip-api.com";
private LocationApi mLocationApi;

private static LocationService mInstance;

public static LocationService getInstance(){
return mInstance == null ? new LocationService() : mInstance;
}

private LocationService(){
Retrofit mRetrofit = new Retrofit.Builder()
.addConverterFactory(GsonConverterFactory.create())
.baseUrl(BASE_URL)
.build();
mLocationApi = mRetrofit.create(LocationApi.class);
}

public LocationApi getLocationApi(){
return mLocationApi;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dz.islem.covid19.ui.base;
package com.covidvirus.app.ui.base;

import android.os.Bundle;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dz.islem.covid19.ui.base;
package com.covidvirus.app.ui.base;

import android.content.Context;
import android.util.Log;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dz.islem.covid19.ui.base;
package com.covidvirus.app.ui.base;

import androidx.lifecycle.ViewModel;

Expand Down
Loading

0 comments on commit 2b9d79c

Please sign in to comment.