项目作者: rohitpuriji

项目描述 :
UniversalAsyncHandler to provide http post requests efficiently...
高级语言: Java
项目地址: git://github.com/rohitpuriji/Universal-Async-Handler.git
创建时间: 2017-07-27T06:33:53Z
项目社区:https://github.com/rohitpuriji/Universal-Async-Handler

开源协议:

下载


UniversalAsyncHandler

UniversalAsyncHandler to provide http post requests efficiently…

This library is very efficient for users who are still using AsyncTasks to post data.

Only you have to add jitpack in your root build.gradle :

  1. allprojects {
  2. repositories
  3. {
  4. ...
  5. maven { url 'https://jitpack.io' }
  6. }
  7. }

and add the dependency in app.gradle :

  1. dependencies {
  2. compile 'com.github.rohitpuriji:UniversalAsyncHandler:-SNAPSHOT'
  3. }

This library made with java8 so add the jack option inside defaultCondig in your app gradle file :

  1. minSdkVersion 16
  2. targetSdkVersion 25
  3. versionCode 1
  4. versionName "1.0"
  5. jackOptions {
  6. enabled true
  7. }

and add compile ad dex options :

  1. dexOptions {
  2. incremental true
  3. }
  4. compileOptions {
  5. sourceCompatibility JavaVersion.VERSION_1_8
  6. targetCompatibility JavaVersion.VERSION_1_8
  7. }

now you can simply create a post request by using “HttpPostCaller” class and its method getReponse() this will return object type like this :

  1. Object object = HttpPostCaller.getResponse(MainActivity.this,"Your post url", Your jsonobject,"Your loading message...");
  2. if (object instanceof String){
  3. AppLogs.printLogs("response :",object.toString());
  4. }

Developed By

Rohit Puri

License

Copyright Rohit Puri
Copyright (C) 2011 The Android Open Source Project

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.