Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anton46/IceNet
https://github.com/anton46/IceNet
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/anton46/IceNet
- Owner: anton46
- License: apache-2.0
- Created: 2014-10-24T04:24:47.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-11-18T05:18:22.000Z (almost 10 years ago)
- Last Synced: 2024-08-02T16:15:22.292Z (3 months ago)
- Language: Java
- Size: 843 KB
- Stars: 62
- Watchers: 5
- Forks: 13
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-android - IceNet - Fast, Simple and Easy Networking for Android (Libraries / Networking)
- awesome-android - IceNet - Fast, Simple and Easy Networking for Android (Libraries / Networking)
- awesome-android-cn - 官网
README
IceNet
======
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-IceNet-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/1054)[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.anton46/IceNet/badge.svg?style=flat)](https://maven-badges.herokuapp.com/maven-central/com.anton46/IceNet/)
**FAST, SIMPLE, EASY**
This library is an Android networking wrapper consisting of a combination of [Volley](https://github.com/mcxiaoke/android-volley), [OkHttp](https://github.com/square/okhttp) and [Gson](https://code.google.com/p/google-gson/). For more information see the [website](http://anton46.com/icenet-fast-simple-and-easy-networking-for-android/).Usage
=====**Gradle**
```gradle
compile 'com.anton46:IceNet:1.0.2'
````
**Maven**
```xmlcom.anton46
IceNet
1.0.2````
**Initialization**
```java
public class YourApplications extends Application {
...
@Override
public void onCreate() {
super.onCreate();
initIceNet();
}public void initIceNet() {
IceNetConfig config = new IceNetConfig.Builder()
.setBaseUrl(BuildConfig.SERVER_URL)
.setContext(getApplicationContext())
.build();
IceNet.init(config);
}
...
}
```**GET REQUEST**
```java
IceNet.connect()
.createRequest()
.get()
.pathUrl("/v1/feeds")
.fromJsonArray()
.mappingInto(Feeds.class)
.execute(REQUEST_TAG, callback);
```**POST REQUEST**
```java
IceNet.connect()
.createRequest()
.post(bodyRequest)
.pathUrl("/v1/feed")
.fromJsonObject()
.mappingInto(PostResponse.class)
.execute(REQUEST_TAG, callback);
```**STRING REQUEST (NEW)**
```java
IceNet.connect()
.createRequest()
.get()
.pathUrl("/string")
.fromString()
.execute("REQUEST_TAG", callback);
```**Put this script for Android 4.4.4 (Kitkat) and older `uses-sdk`**
```xml```
License
=======Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.