An open API service indexing awesome lists of open source software.

https://github.com/istornz/airchecker

An Android application to fetch air quality
https://github.com/istornz/airchecker

air android aqi checker javascript pollution

Last synced: 4 days ago
JSON representation

An Android application to fetch air quality

Awesome Lists containing this project

README

          



An Android application to fetch air quality from [**Aqicn**](http://aqicn.org/).

## Screenshots

## Functionnality

- Show all saved cities with air quality level fetched from [**Aqicn**](http://aqicn.org/).
- Add/delete any city.
- French & English support.
- Special display on tablet/smartphone (fragmented layout).
- Share air quality level by email.
- Playing sound according to air quality level.
- Content provider allowing to add/remove a city from other app (see [**content provider**](#content-provider)).
- Air quality chart (powered by [**Hello Chart Android**](https://github.com/lecho/hellocharts-android)).
- 3 themes available (dark, light, sunset).
- Automatic night mode (apply dark theme automatically).
- Display nearest city from user's location.
- Refresh in background all saved cities (see [**background service**](#background-service)).
- Send push notifications when air quality is higher than 100.
- Display informations about city.
- Widget of favorite city (see [**widget**](#widget)).

## Compatibility

Min. version
Targeted version
Compiled version
Android Studio v. used

Android 4.4
Android 5.1
Android 5.1
2.3

Working on :
- Smartphone
- Tablet

## Installation

- Clone this repository.
```sh
git clone git@github.com:istornz/AirChecker.git
```
- Open the project with [**Android Studio**](https://developer.android.com/studio/index.html)
- Build & run the project.
- Profit :tada:

## Usage

#### Basic usage
- Add a new city by touching the "magnifying glass" icon at top right.
- Type your city on the search field and click on "OK".
- Select on the list your city.
- To delete a city, swipe right/left on it and choose "Yes".
- On the top of list, this is the nearest city (gray background).

#### Widget
- Add a new city (see [**basic usage**](#basic-usage)).
- Select the city cell in list and touch "Favorite" button at the bottom of details page.
- Add the widget on your homescreen/launchscreen.
- Enjoy :tada:

#### Content provider
- You can add a new city by using the **insert()** method. Pass the city identifier as **identifier** key.
```java
ContentValues aqi = new ContentValues();
aqi.put("identifier", "IDENTIFIER_HERE");
getContentResolver().insert(AirCheckerProvider.CONTENT_URI, aqi);
```
- You can delete a city by using the **delete()** method. Pass the city identifier as **selection** argument.
```java
getContentResolver().delete(AirCheckerProvider.CONTENT_URI, "IDENTIFIER_HERE", null);
```

#### Background service
You can easily change the refresh rate of the background task service.

You can find all params in the **BackgroundRefresher** class.
```java
// Delay value between two request .
private static final int delay = 1800000;
// Air quality level (Greater than or equal fire a notification).
private static final int limit = 100;
```

## APIs used

- [Aqicn](http://aqicn.org/)
- [Wikipedia](https://www.mediawiki.org/wiki/API:Main_page/fr)

## Others

To get your keys, please go on the [**Air Quality Open Data Platform register page**](http://aqicn.org/data-platform/token/#/).

## Licenses

- [Google GSON](https://github.com/google/gson)
- [Google Volley](https://github.com/google/volley)
- [Sugar ORM](https://github.com/satyan/sugar)
- [Picasso](https://github.com/square/picasso)
- [HelloCharts](https://github.com/lecho/hellocharts-android)

© Dessus Dimitri - 3/04/2017