All Projects → lordtao → android-tao-rest-data-processor

lordtao / android-tao-rest-data-processor

Licence: GPL-3.0 license
Android REST Data Processor library. Easy to build a REST request, to receive and processing data (XML, JSON, CSV and etc.) from REST requests, file system, assets.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to android-tao-rest-data-processor

rpgdice
A generic RPG dice roller syntax and library.
Stars: ✭ 24 (+0%)
Mutual labels:  parse
parse-csv
CSV parser for node.js
Stars: ✭ 15 (-37.5%)
Mutual labels:  parse
parse
Parse with an Eloquent-like interface for Laravel
Stars: ✭ 15 (-37.5%)
Mutual labels:  parse
logstash-laravel-logs
Process Laravel Log files on Logstash and forward to ElasticSearch
Stars: ✭ 35 (+45.83%)
Mutual labels:  parse
AtomicWatch
Intel Atom C2000 series discovery tool that parses log files and returns results if a positive match is found. #nsacyber
Stars: ✭ 25 (+4.17%)
Mutual labels:  processor
php-simple-request
php-simple-request is a request parser library designed to simplify requests validation and filtering using annotations, generating at the same time an object representation from the request data.
Stars: ✭ 15 (-37.5%)
Mutual labels:  parse
Brightside
Command Dispatcher, Processor, and Distributed Task Queue
Stars: ✭ 20 (-16.67%)
Mutual labels:  processor
limelight
A php Japanese language text analyzer and parser.
Stars: ✭ 76 (+216.67%)
Mutual labels:  parse
asmdot
[Unstable] Fast, zero-copy and lightweight (Arm | Mips | x86) assembler in (C | C++ | C# | Go | Haskell | Javascript | Nim | OCaml | Python | Rust).
Stars: ✭ 23 (-4.17%)
Mutual labels:  parse
jgeXml
The Just-Good-Enough XML Toolkit
Stars: ✭ 20 (-16.67%)
Mutual labels:  parse
ujson drf
JSON Renderer and Parser for Django Rest Framework using the ultra fast json (in C).
Stars: ✭ 14 (-41.67%)
Mutual labels:  parse
color-math
Expressions to manipulate colors.
Stars: ✭ 18 (-25%)
Mutual labels:  parse
svg-quick-editor
SVG Quick Editor is a free and open-source SVG editing tool. It offers features such as editing SVG colors, viewing or deleting their paths.
Stars: ✭ 88 (+266.67%)
Mutual labels:  parse
BaaSDelphiSamples
💾 Code samples for BaaS and PaaS using Delphi
Stars: ✭ 30 (+25%)
Mutual labels:  parse
ParseCareKit
Securely synchronize any CareKit 2.1+ based app to a Parse Server Cloud. Compatible with parse-hipaa.
Stars: ✭ 28 (+16.67%)
Mutual labels:  parse
MarknoteParser
A high performance markdown parser in Swift.
Stars: ✭ 29 (+20.83%)
Mutual labels:  parse
xml-spac
Handle streaming XML data with declarative, composable parsers
Stars: ✭ 39 (+62.5%)
Mutual labels:  parse
abstract-syntax-tree
A library for working with abstract syntax trees.
Stars: ✭ 77 (+220.83%)
Mutual labels:  parse
elm-html-parser
Parse HTML in Elm!
Stars: ✭ 44 (+83.33%)
Mutual labels:  parse
postcss-gtk
Processes GTK+ CSS into browser CSS
Stars: ✭ 23 (-4.17%)
Mutual labels:  processor

#Android Data Processor. Easy to build a REST request, to receive and processing data (XML, JSON, CSV and etc.)

The Data Processor is designed to perform simple RESTservice requests or to files locally. Requests can run synchronously or asynchronously. Used LruCache for store results and ThreadPool for async requests.

Download from Bintray: Download

###Easy possibility of building requests and processing results.

Initialize the Data Processor

To use the processor needs to initialize it using the configurator. Configurator allows you to set the basic parameters of a request under http://developer.android.com/reference/java/net/URL.html, encoding, timeout, etc. These data are basic and can be modified without problems in the construction of concrete request. You can initialization in the class to inherit from Application:

private void initDataProcessor () {
DataProcessorConfiguration configuration = DataProcessorConfiguration
                                            .getBuilder ()
                                            .setHost ("google.com")
                                            .setLogEnabled (true)
                                            .setShowProcessingTime (true)
                                            .setTimeout (4000)
                                            .build ();
DataProcessor.getInstance (). Init (configuration);
}

Currently is possible to build GET, POST, PUT, DELETE, MultipartRequest and processing locale files using FileRequest.

Request request = GetRequest.newInstance ()
                  .setLogTag ("FB Login to server")
                  .addGetParam ("signature", "DHFHJDDBHJV3393n")
                  .setPath ("login.php")
                  .build ();
Request request = PostRequest.newInstance ()
                  .addPostParam ("email", "[email protected]")
                  .addPostParam ("password", "any_password")
                  .setLogTag ("Login to server")
                  .addGetParam (VAR_SIG, SIGNATURE)
                  .setPath ("auth2.php")
                  .build ();

The obtained data request can be processed by any of your favorite parser. The processed data is stored in the objects implementing interfaces InputStreamDataInterface, StringDataInterface.

public class LoginResult implements StringDataInterface {

public static String token = "";
public static String email = "";
public static String password = "";

@ Override
public void fillFromString (String src) throws Exception {
  JSONObject jsonObject = new JSONObject(src);
  token = jsonObject.getString ("token");
  email = jsonObject.getString ("email");
  password = jsonObject.getString ("password");
}

Running a request can be synchronous or asynchronous. Request will returns filled object through DataProcessor.Callback or Exception object. Status code will be return also. The result Object will be created in the case of a successful call request.

For HTTP request will return HttpStatus code or ERROR.

For local file request (using FileRequest) process will be return FILE_SUCCESS or ERROR.

Request execution example:

DataProcessor.getInstance ().ExecuteAsync (request, LoginResult.class, callback);

Sample of processing callback:

private DataProcessor.Callback<LoginResult> getLoginCallback () {
return new DataProcessor.Callback<LoginResult>() {

      @Override
      public void onFinish(LoginResult item, int what) {
          acMainProgressLayout.setVisibility(View.GONE);
          if (what == HttpURLConnection.HTTP_OK) {
              // you code with items
          } else {
              Log.e("Error, What=" + what);
          }
     }
}

Example project you can find at https://github.com/lordtao/android-tao-data-processor-example

Add android-tao-core to your project

Android Data Processor is available on Bintray. Please ensure that you are using the latest versions by Download

Gradle dependency for your Android app:

add to general build.gradle

buildscript {
    repositories {
        jcenter()
        maven {
            url  "http://dl.bintray.com/lordtao/maven"
        }
    }
    ...
}

allprojects {
    repositories {
        jcenter()
        maven {
            url  "http://dl.bintray.com/lordtao/maven"
        }
    }
}

add to your module build.gradle

    compile 'ua.at.tsvetkov:taodataprocessor:1.2.10@aar'
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].