Simple Network Library


Source link: https://github.com/ahmed-adel-said/SimpleNetworkLibrary

Simple Network Library

Android Simple Network Library for HTTP and Image Requests with cool features implemented with Simple Demo using some Material Design UI Elements.


Most Common Library Features:

  1. Making HTTP Requests with different Request Types like GET, POST, PUT, DELETE and PATCH.
  2. Making HTTP Requests with different Content Types like JSON and XML.
  3. Caching HTTP Request on Memory.
  4. Handling Multiple Requests in a Thread Safe Mechanism.
  5. Making Image Requests Synchronous and Asynchronous with helpful observers to handle most cases.
  6. Caching Image Bitmaps on Memory.
  7. Creating a Test Case for NetworkRequest class using JUnit testing framework.

Most Common Simple Demo Application Features:

  1. Using some Material Design UI Elements like CoordinatorLayout, CardView, AppBarLayout, SwipeRefreshLayout, RecyclerView and Transition.
  2. Handling Pull To Refresh and Load More mechanism.

User Documentation :

  1. For simple integration all you have to do is to add the following command in your root build.gradle at the end of repositories:
 allprojects {

repositories {

 ...
 maven {
 url 'https://jitpack.io' 
}

}
  
}

and after this, add the Simple Library Network dependency:

 dependencies {

 compile 'com.github.ahmed-adel-said:SimpleNetworkLibrary:-SNAPSHOT'  
}
  1. To initialize HTTP request:
networkRequest = NetworkRequest.getInstance(context)
// base url

  .baseUrl(String baseUrl)

  // endpoint

  .endpoint(String endpoint)

  // request types: GET, POST, PUT, DELETE and PATCH.

  .requestType(RequestType requestType)

  // content types: JSON and XML

  .contentType(ContentType contentType)

  // decode url if the url has spaces like %20%

  .decodedUrl(boolean decodedUrl)

  // add params to your request

  .params(Map<String, String> params)

  // add headers to your request

  .headers(Map<String, String> headers)

  // add json body as a body to your POST, PUT, DELETE and PATCH requests

  .bodyJsonObject(JSONObject bodyJsonObject)

  // OnNetworkRequestResponseListener is a listener that used to observe the success and error response

  .onNetworkRequestResponseListener(OnNetworkRequestResponseListener onNetworkRequestResponseListener);
  1. To fire the request after initializing it:
networkRequest.fireRequest();
  1. To initialize image HTTP request and load the required image:
userImageView.setImageUrl(
// image url
String url,

  // fall back image resource if the image url is not correct and there is an error occurred while downloading the image

  Integer fallbackResource,

  // loading image resource that is appeared during the download of the image 

  Integer loadingResource,

  // OnCompleteImageListener is a listener that used to observe the success downloaded bitmap

  OnCompleteImageListener onCompleteImageListener);
  1. OnNetworkRequestResponseListener is a observer that used to handle the response of network request calls:
OnNetworkRequestResponseListener() {

@Override

public void onSuccessResponse(String response, ContentType contentType, boolean isCached) {

 
}

 @Override

public void onErrorResponse(String error, String message, int code) {

 
}

  
}
);
  1. OnCompleteImageListener is a listener that helps the developer to get the image bitmap if he/she makes an only image single request not a multiple image requests as in the recycler view adapter as an example.:
OnCompleteImageListener() {

 @Override

 public void onComplete(Bitmap bitmap) {

}

}
)

Resources

This is fully-fledged the native BOINC client for Android and BOINC Manager (based on AndroBOINC) especially designed for working with this version of BOINC client.

Official Website

RapidJSON is a JSON parser and generator for C++. It was inspired by RapidXml.

Features:

  • Small but complete. It supports both SAX and DOM style API.
  • Fast. Its performance can be comparable to strlen().
  • Self-contained. It does not depend on external libraries.
  • Memory friendly. Each JSON value occupies exactly 16/20 bytes.
  • Unicode friendly.

EdgeEffectOverride is library designed to help override the blue overscroll_edge and overscroll_glow effects used by the the EdgeEffect class.

Simply import the project into your library, replace existing references to ScrollView, ListView, ExpandableListView, GridView & ViewPager with references to the the classes found in this library.

No need to edit any graphics, simply colorize the edge effect dynamically or via the layout xml, easy!

A Reactive wrapper around Google's YouTube Data API.

material-dialogs library allows you to use a consistently Material themed dialog on all versions of Android, along with specific customizations that make it easier to brand the dialog.

Navigation Drawer Activity with material design style and simplified methods.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes