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

https://github.com/angpysha/diploma_bridge

A bridge library which will be used at raspberry pi project and Android application
https://github.com/angpysha/diploma_bridge

crud iot java raspberry-pi restful

Last synced: 6 months ago
JSON representation

A bridge library which will be used at raspberry pi project and Android application

Awesome Lists containing this project

README

          

# Diploma bridge library

[![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg)](https://opensource.org/licenses/Apache-2.0)
[![Build Status](https://travis-ci.org/angpysha/diploma_bridge.svg?branch=master)](https://travis-ci.org/angpysha/diploma_bridge)
[![Stage](https://img.shields.io/badge/stage-beta-orange.svg)](https://github.com/angpysha/diploma_bridge)
[![Maven](https://maven-badges.herokuapp.com/maven-central/io.github.angpysha/diploma_bridge/badge.svg?style=green)](https://github.com/angpysha/diploma_bridge)
[![Tag](https://img.shields.io/github/tag/angpysha/diploma_bridge.svg)](https://github.com/angpysha/diploma_bridge/tags)
[![Coverage Status](https://coveralls.io/repos/github/angpysha/diploma_bridge/badge.svg?branch=master)](https://coveralls.io/github/angpysha/diploma_bridge?branch=master)

The library, which contains API and models for interaction Raspberry Pi app
and Android app with server.

## Requirements

- JDK 8
- IntelliJ IDEA (or other IDE with gradle support)
- Git

## Installation

### With Maven

```$xslt

io.github.angpysha
diploma_bridge
0.5

```

### With Gradle

```$xslt
compile 'io.github.angpysha:diploma_bridge:0.5'
```

## Getting started

1. Create data model, which extends from **Entity** class, model for entity searching, which extends from EntitySearch and provide data send from your Raspberry Pi to web server.

Data model:

```$xslt
public class DHT11 extends Entity {
//declare your propeties here
}
```
Data search:

```$xslt
public class DhtSearch extends SearchEntity {
//declare your propeties here
}
```

2. You must implement these apis on your web server:

```$xslt
search; get; add; update; delete; last; datecount;
```

3. Create controller class:

Example:

```$xslt
public class DhtController extends BaseController{

public DhtController() {
SEARCH_URL = "/dhts/search";
GET_URL = "/dhts/get";
ADD_URL = "/dhts/add";
UPDATE_URL="/dhts/update";
DELETE_URL="/dhts/delete";
GET_LAST_URL = "/dhts/last";
GET_SIZE_URL = "/dhts/datecount";
}
}


```
4. You should also implement GetCount method for every controller
Now you can use methods from controller to get info.
## License

This project is licensing by Apache 2 license. See [LICENSE](https://github.com/angpysha/diploma_bridge/blob/master/LICENSE)