No description, website, or topics provided.
Java Groovy IDL Prolog
Latest commit 8d3de5f Nov 18, 2014 @anton46 Update README.md
Permalink
Failed to load latest commit information.
gradle/wrapper Initial commit Oct 24, 2014
icenet Merge branch 'develop' Oct 31, 2014
jar Add jar file and cleaning up Oct 28, 2014
sample update gitignore Oct 31, 2014
.gitignore Initial commit Oct 24, 2014
IceNet.iml Initial commit Oct 24, 2014
LICENSE Initial commit Oct 24, 2014
README.md Update README.md Nov 18, 2014
build.gradle Initial commit Oct 24, 2014
proguard-rules.pro Initial commit Oct 24, 2014
settings.gradle added sample app Oct 31, 2014

README.md

IceNet

Android Arsenal

Maven Central

FAST, SIMPLE, EASY
This library is an Android networking wrapper consisting of a combination of Volley, OkHttp and Gson. For more information see the website.

Usage

Gradle

compile 'com.anton46:IceNet:1.0.2'

Maven

<dependency>
    <groupId>com.anton46</groupId>
    <artifactId>IceNet</artifactId>
    <version>1.0.2</version>
</dependency>

Initialization

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

    IceNet.connect()
                .createRequest()
                .get()
                .pathUrl("/v1/feeds")
                .fromJsonArray()
                .mappingInto(Feeds.class)
                .execute(REQUEST_TAG, callback);

POST REQUEST

IceNet.connect()
                .createRequest()
                .post(bodyRequest)
                .pathUrl("/v1/feed")
                .fromJsonObject()
                .mappingInto(PostResponse.class)
                .execute(REQUEST_TAG, callback);

STRING REQUEST (NEW)

IceNet.connect()
                .createRequest()
                .get()
                .pathUrl("/string")
                .fromString()
                .execute("REQUEST_TAG", callback);

Put this script for Android 4.4.4 (Kitkat) and older uses-sdk

<uses-sdk tools:node="replace"/>

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 at

http://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.