Novate Android Networking Framework

repository·master·Indexed 23 days ago

https://github.com/tamicer/novate

An Android networking framework that combines OkHttp, Retrofit, and RxJava into an extensible, chained API. Novate simplifies error handling, file transfers with progress tracking, and offline caching, while supporting both direct OkHttp-style calls and Retrofit-style annotation-based service definitions.

Tokens
846
Snippets
3
Records
4
Agent score
31%

What's inside Novate

  1. Overview of Novate features

    master

    Novate is a chained networking framework for Android built on top of OkHttp, Retrofit, and RxJava. It is designed to reduce API redundancy and simplify error handling through an exception-driven mechanism.

    Key Capabilities:

    • Hybrid API Style: Supports both OkHttp-style direct calls and Retrofit-style annotation-based service definitions.
    • RxJava Integration: Provides seamless RxJava chaining with intelligent thread control (handling UI thread callbacks automatically).
    • Advanced Caching: Supports offline caching and intelligent loading when no network is available.
    • File Operations: Built-in support for file uploads and downloads with progress tracking.
    • Unified Processing: Provides unified request header/parameter injection and unified result handling (automatic serialization of complex data).
    • Extensibility: Allows developers to define custom Retrofit services when default APIs are insufficient.
  2. Configure Android Permissions for Novate

    master

    Novate requires several permissions in your AndroidManifest.xml to handle networking, state detection, and file operations (upload/download). Add the following permissions:

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  3. Install Novate via Gradle

    master

    To use Novate in an Android project using Gradle, add the JitPack repository to your root build.gradle file and then add the dependency to your app-level build.gradle file based on your Gradle version.

    1. Root build.gradle

    Add the following to your repositories block:

    repositories {
        maven { url "https://jitpack.io" }
        jcenter()
    }

    2. App build.gradle

    Depending on your Gradle version, use one of the following:

    For Gradle < 2.1:

    dependencies {
        compile 'com.tamic.novate:novate:1.5.5'
    }

    For Gradle > 2.1:

    plugins {
        id "com.tamic.novate:novate" version "1.5.5"
    }
    repositories {
        maven { url "https://jitpack.io" }
        jcenter()
    }
    
    // For Gradle < 2.1
    dependencies {
        compile 'com.tamic.novate:novate:1.5.5'
    }
    
    // For Gradle > 2.1
    plugins {
        id "com.tamic.novate:novate" version "1.5.5"
    }
  4. Configure ProGuard/R8 rules for Novate

    master

    To prevent Novate from being stripped or renamed during code obfuscation, add the following rule to your ProGuard configuration file:

    -keep class com.tamic.novate.** {*;}
    -keep class com.tamic.novate.** {*;}