Giter Club home page Giter Club logo

reyna's Introduction

reyna : Icelandic for "try"

An android store and forward library for http post requests. Reyna will store your requests and post them when there is a valid connection.

Installation

Reyna is a standard android library and can be referenced as a jar in your project.

If you don't want to build your own, you can download the latest version from the artifacts directory.

Android Manifest

You will need to add the following entries into your AndroidManifest.xml in order for reyna to have the correct permissions, services and receivers.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.package.my"
    android:versionCode="1"
    android:versionName="1.0.0.0">

    <uses-sdk android:minSdkVersion="8" />

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />

		<application>
        <service android:name="com.b2msolutions.reyna.services.StoreService" />
        <service android:name="com.b2msolutions.reyna.services.ForwardService" />
        <receiver android:name="com.b2msolutions.reyna.receivers.ForwardServiceReceiver">
            <intent-filter>
                <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
            </intent-filter>
        </receiver>
    </application>
 </manifest>

Usage

	import com.b2msolutions.reyna.services.StoreService;

	// Add any headers if required
	Header[] headers = new Header[] {
		new Header("Content-Type", "application/json"),
		new Header("myheader", "header content"),

		// gzip content when posting
		new Header("Content-Encoding", "gzip")
	};


	// Create the message to send
	Message message = new Message(
		new URI("http://server.tosendmessageto.com"),
		"body of post, probably JSON",
		headers);

	// Send the message to Reyna
	StoreService.start(context, message);


	// set Reyna logging level, same constant values as android.util.log (ERROR, WARN, INFO, DEBUG, VERBOSE)
	StoreService.setLogLevel(level);

Latest version is 2.7.3

Contributors

Pair programmed by Roy Lines and James Bloomer.

reyna's People

Contributors

b2mdevelopment avatar fabei avatar jamesbloomer avatar lazywithclass avatar roylines avatar sjwood avatar youhana-hana avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.