Code Monkey home page Code Monkey logo

pocket-android's Introduction

PocketAndroid

Official Android client to use with the Pocket Network

Overview

PocketAndroid wraps all of the tools a developer will need to begin interacting with a network. PocketAndroid contains 3 packages:

  • network.pocket:eth: A library that allows your DApp to communicate to the Ethereum network.
  • network.pocket:aion: A library that allows your DApp to communicate to the AION network.
  • network.pocket:core: An implementation of the Pocket protocol that you can use to create your own plugin to interact with a blockchain of your choosing.

Before you can start using the library, you have to get a Developer ID by registering for MVP. To learn how to register please click here.

Requirements

You should have at least have a basic knowledge of blockchain technology and know your way around Java/Kotlin.

Installation

First you need to add the following Maven URL to your project, so the your root build.gradle file add the following:

allprojects {
    repositories {
        google()
        jcenter()
        maven {
          url 'https://dl.bintray.com/pokt-network/pocket-android'
        }
    }
}

Now, you will need to add either of the 3 packages within PocketAndroid to your module's build.gradle file, like this:

// Eth
implementation 'network.pocket:eth:0.0.2'

// Aion
implementation 'network.pocket:aion:0.0.3'

// Core
implementation 'network.pocket:core:0.0.4'

Usage

If you would like to know how to integrate PocketAndroid into your DApp, visit our developer portal that has a lot of useful tutorials and material about the Pocket Network.

Contact Us

We have created a Discord server where you can meet with the Pocket team, as well as fellow App Developers, and Service Nodes. Click here to join!

pocket-android's People

Contributors

eugenio35 avatar jeremybeal11 avatar luyzdeleon avatar pabelnl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pocket-android's Issues

Define and implement Data layer

Data layer's job is to send and receive data requests with and EndPoint.

Every request is a POST type.

  • sendRelay
  • retrieveServiceNodes

Separate environments

Currently the SDK is hardcoded to use the staging environment URL with no option to switching out to production.

Core - Add retry feature for failing Service Nodes

If a Node returns a network error, pocket core should be able to remove the node from the list and retry the request with another node, a retry count should be configurable and also a default value.

Plugins should not need to install core separately

One of the requirements if you install a plugin, let's say Aion, the core functionalities and classes from Core are not available, the developer needs to add Core besides adding Aion in the dependencies.

The objective is to only install the plugin.

implementation 'network.pocket.android:aion:0.0.2'
implementation 'network.pocket.android:core:0.0.2'

Create Core Module

Pocket Core Android module is a sub-package of the main project.

Create a folder inside "packages" with the name "core".
Create a new project with the name "PocketAndroid-Core"

Wallet save fails - SecretKeyFactory not available

Wallet save functionality fails with error:
W/System.err: java.security.NoSuchAlgorithmException: PBEwithHmacSHA512AndAES_256 SecretKeyFactory not available

The issue is happening with the Ethereum plugin.

// Wallet this.wallet = pocketEth.getRinkeby().createWallet();

this.wallet.save("123", appContext, new Function1<WalletPersistenceError, Unit>() { @Override public Unit invoke(WalletPersistenceError walletPersistenceError) { return null; } });

Create Eth Module

Pocket Eth Android module is a sub-package of the main project.

Create a folder inside "packages" with the name "eth".
Create a new project with the name "PocketAndroid-Eth"

Fix Wallet management tests

Currently there's a concurrency issue with the design of the wallet management making the tests fail intermitently.

Create project structure

Create the project structure:

1- Jitpack capable
2- Jitpack name "PocketAndroid"
3- Create a folder called "Packages" for the other plugins

Sign transaction creates bad data

If the param field "value" is null, the sign transaction function returns bad data.

When the value param is passed to sign the transaction, it reads the literal value = "null", causing the signed tx to be invalid.

Note: verify if the issue exists in both Aion and Eth

Pocket Core Rest API support

Pocket Core module should suppport REST API requests.

A view of how the Relay payload should be:
{"Blockchain":"POKT","NetID":"1","METHOD":"GET", "DATA":"foo", "PATH":"/v1/","DevID":"DEVID1"}

New fields:
METHOD - HTTP Methods
PATH - URL path with params support

Plugins should not need to install core separately

One of the requirements if you install a plugin, let's say Aion, the core functionalities and classes from Core are not available, the developer needs to add Core besides adding Aion in the dependencies.

The objective is to only install the plugin.

implementation 'network.pocket.android:aion:0.0.2'
implementation 'network.pocket.android:core:0.0.2'

Create Aion Module

Pocket Aion Android module is a sub-package of the main project.

Create a folder inside "packages" with the name "aion".
Create a new project with the name "PocketAndroid-Aion"

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.