Skip to content

Commit

Permalink
Update branding
Browse files Browse the repository at this point in the history
  • Loading branch information
SandroMachado committed Oct 14, 2015
1 parent a4f62ad commit 561aa8e
Show file tree
Hide file tree
Showing 152 changed files with 1,064 additions and 1,000 deletions.
3 changes: 1 addition & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015 Bitreserve
Copyright (c) 2015 Uphold

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

72 changes: 36 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Bitreserve SDK for Android
# Uphold SDK for Android

Bitreserve is a next generation platform that allows anyone to transfer and exchange value for free, instantly and securely.
Uphold is a next generation platform that allows anyone to transfer and exchange value for free, instantly and securely.

The Bitreserve SDK for Android provides an easy way for developers to integrate Android applications with the [Bitreserve API](https://developers.bitreserve.org).
The Uphold SDK for Android provides an easy way for developers to integrate Android applications with the [Uphold API](https://uphold.com/en/developer).

## Requirements

Expand All @@ -22,9 +22,9 @@ repositories {
}
dependencies {
compile 'com.github.bitreserve:bitreserve-sdk-android:0.0.1'
compile 'com.github.uphold:uphold-sdk-android:0.0.2'
// Change to:
// compile ('com.github.bitreserve:bitreserve-sdk-android:0.0.1:sandboxRelease@aar') {
// compile ('com.github.uphold:uphold-sdk-android:0.0.2:sandboxRelease@aar') {
// transitive = true
// }
// to use the sandbox environment.
Expand All @@ -33,25 +33,25 @@ dependencies {

## Basic usage

In order to learn more about the Bitreserve API, please visit the [developer website](https://developer.bitreserve.org).
In order to learn more about the Uphold API, please visit the [developer website](https://uphold.com/en/developer).

To use the SDK you must first register an Application and obtain a unique `client_id` and `client_secret` combination. We recommend your first app be [registered in the Sandbox environment](https://sandbox.bitreserve.org/dashboard/profile/applications/developer/new), so you can safely play around during development.
To use the SDK you must first register an Application and obtain a unique `client_id` and `client_secret` combination. We recommend your first app be [registered in the Sandbox environment](https://sandbox.uphold.com/dashboard/profile/applications/developer/new), so you can safely play around during development.

From the application page in your account you can get the Client ID, Client Secret and configure the redirect URI and the desired Scopes.

### Authenticate User

Before instantiating the Bitreserve client to start the OAuth authentication flow, you must first initialize it:
Before instantiating the Uphold client to start the OAuth authentication flow, you must first initialize it:

```java
BitreserveClient.initialize(MainActivity.this);
UpholdClient.initialize(MainActivity.this);
```

Now we can start the authentication process by calling the `beginAuthorization` method:

```java
BitreserveClient bitreserveClient = new BitreserveClient();
bitreserveClient.beginAuthorization(MainActivity.this, CLIENT_ID, scopes, state);
UpholdClient upholdClient = new UpholdClient();
upholdClient.beginAuthorization(MainActivity.this, CLIENT_ID, scopes, state);
```

To receive an intent for the callback URL it is necessary to register an intent filter for one of your Android activities in order for users to be redirected to your app after the authorization process:
Expand All @@ -62,8 +62,8 @@ To receive an intent for the callback URL it is necessary to register an intent
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:pathPrefix="/connect/bitreserve"
android:scheme="bitreserve-demo" />
android:pathPrefix="/connect/uphold"
android:scheme="uphold-demo" />
</intent-filter>
```

Expand All @@ -76,7 +76,7 @@ protected void onNewIntent(final Intent intent) {
return;
}

bitreserveClient.completeAuthorization(intent.getData(), CLIENT_ID, CLIENT_SECRET, "authorization_code", state).then(new PromiseAction<AuthenticationResponse>() {
upholdClient.completeAuthorization(intent.getData(), CLIENT_ID, CLIENT_SECRET, "authorization_code", state).then(new PromiseAction<AuthenticationResponse>() {
@Override
public void call(AuthenticationResponse authenticationResponse) {
// Get the user bearer token from the authenticationResponse.
Expand All @@ -90,11 +90,11 @@ protected void onNewIntent(final Intent intent) {
}
```

To get the current user information, just instantiate the Bitreserve client with the user bearer token:
To get the current user information, just instantiate the Uphold client with the user bearer token:

```java
BitreserveClient bitreserveClient = new BitreserveClient(bearerToken);
bitreserveClient.getUser().then(new PromiseAction<User>() {
UpholdClient upholdClient = new UpholdClient(bearerToken);
upholdClient.getUser().then(new PromiseAction<User>() {
@Override
public void call(User user) {
// The user information is available at the user object.
Expand All @@ -105,8 +105,8 @@ bitreserveClient.getUser().then(new PromiseAction<User>() {
### Get user cards with chaining

```java
BitreserveClient bitreserveClient = new BitreserveClient(bearerToken);
bitreserveClient.getUser().then(new RepromiseFunction<User, List<Card>>() {
UpholdClient upholdClient = new UpholdClient(bearerToken);
upholdClient.getUser().then(new RepromiseFunction<User, List<Card>>() {
@Override
public Promise<List<Card>> call(User user) {
// Do something with the user.
Expand Down Expand Up @@ -165,10 +165,10 @@ user.createCard(cardRequest).then(new PromiseAction<Card>() {
```java
// Instantiate the client. In this case, we don't need an
// AUTHORIZATION_TOKEN because the Ticker endpoint is public.
BitreserveClient bitreserveClient = new BitreserveClient();
UpholdClient upholdClient = new UpholdClient();

// Get tickers.
bitreserveClient.getTicker().then(new PromiseAction<List<Rate>>() {
upholdClient.getTicker().then(new PromiseAction<List<Rate>>() {
@Override
public void call(List<Rate> rates) {
// Do something with the rates list.
Expand All @@ -180,7 +180,7 @@ Or you could get a ticker for a specific currency:

```java
// Get tickers for BTC.
bitreserveClient.getTickersByCurrency("BTC").then(new PromiseAction<List<Rate>>() {
upholdClient.getTickersByCurrency("BTC").then(new PromiseAction<List<Rate>>() {
@Override
public void call(List<Rate> rates) {
// Do something with the rates list.
Expand Down Expand Up @@ -213,9 +213,9 @@ card.createTransaction(transactionRequest, true);
```java
// Instantiate the client. In this case, we don't need an
// AUTHORIZATION_TOKEN because the Ticker endpoint is public.
BitreserveClient bitreserveClient = new BitreserveClient();
UpholdClient upholdClient = new UpholdClient();

Paginator<Transaction> paginator = bitreserveClient.getReserve().getTransactions();
Paginator<Transaction> paginator = upholdClient.getReserve().getTransactions();

// Get the list of transactions.
paginator.getElements().then(new PromiseAction<List<Transaction>>() {
Expand All @@ -238,7 +238,7 @@ Or you could get a specific public transaction:

```java
// Get one public transaction.
bitreserveClient.getReserve().getTransactionById("a97bb994-6e24-4a89-b653-e0a6d0bcf634").then(new PromiseAction<Transaction>() {
upholdClient.getReserve().getTransactionById("a97bb994-6e24-4a89-b653-e0a6d0bcf634").then(new PromiseAction<Transaction>() {
@Override
public void call(Transaction transaction) {
// Do something with the transaction.
Expand All @@ -251,10 +251,10 @@ bitreserveClient.getReserve().getTransactionById("a97bb994-6e24-4a89-b653-e0a6d0
```java
// Instantiate the client. In this case, we don't need an
// AUTHORIZATION_TOKEN because the Ticker endpoint is public.
BitreserveClient bitreserveClient = new BitreserveClient();
UpholdClient upholdClient = new UpholdClient();

// Get the reserve summary of all the obligations and assets within it.
bitreserveClient.getReserve().getStatistics().then(new PromiseAction<List<ReserveStatistics>>() {
upholdClient.getReserve().getStatistics().then(new PromiseAction<List<ReserveStatistics>>() {
@Override
public void call(List<ReserveStatistics> reserveStatisticses) {
// Do something with the reserve statistics.
Expand All @@ -268,7 +268,7 @@ Some endpoints will return a paginator. Here are some examples on how to handle

```java
// Get public transactions paginator.
Paginator<Transaction> paginator = bitreserveClient.getReserve().getTransactions();
Paginator<Transaction> paginator = upholdClient.getReserve().getTransactions();

// Get the first page of transactions.
paginator.getElements().then(new PromiseAction<List<Transaction>>() {
Expand Down Expand Up @@ -304,9 +304,9 @@ paginator.getNext().then(new PromiseAction<List<Transaction>>() {

```

## Bitreserve SDK sample
## Uphold SDK sample

Check the sample application to explore a application using the Bitreserve Android SDK.
Check the sample application to explore a application using the Uphold Android SDK.

#### Building

Expand All @@ -315,22 +315,22 @@ To build the sample application you need the [Android Studio](http://developer.a
1. Clone the repository.
2. Open Android Studio.
3. Click 'Import project...'.
4. Open the `sample/Bitreserve-android-sdk-demo` directory in the cloned repository.
4. Open the `sample/Uphold-android-sdk-demo` directory in the cloned repository.
5. Build and run the app from inside Android Studio.

The sample application is configured to use the [sandbox environment](https://sandbox.bitreserve.org), make sure you use a sandbox account to perform the login.
The sample application is configured to use the [sandbox environment](https://sandbox.uphold.com), make sure you use a sandbox account to perform the login.

## Contributing & Development

#### Contributing

Have you found a bug or want to suggest something? Please search the [issues](https://github.com/bitreserve/bitreserve-sdk-android/issues) first and, if it is new, go ahead and [submit it](https://github.com/bitreserve/bitreserve-sdk-android/issues/new).
Have you found a bug or want to suggest something? Please search the [issues](https://github.com/uphold/uphold-sdk-android/issues) first and, if it is new, go ahead and [submit it](https://github.com/uphold/uphold-sdk-android/issues/new).

#### Develop

It will be awesome if you can help us evolve `bitreserve-sdk-android`. Want to help?
It will be awesome if you can help us evolve `uphold-sdk-android`. Want to help?

1. [Fork it](https://github.com/bitreserve/bitreserve-sdk-android).
1. [Fork it](https://github.com/uphold/uphold-sdk-android).
2. Hack away.
3. Run the tests.
5. Create a [Pull Request](https://github.com/bitreserve/bitreserve-sdk-android/compare).
5. Create a [Pull Request](https://github.com/uphold/uphold-sdk-android/compare).
1 change: 0 additions & 1 deletion sample/Bitreserve-android-sdk-demo/.idea/.name

This file was deleted.

10 changes: 0 additions & 10 deletions sample/Bitreserve-android-sdk-demo/.idea/modules.xml

This file was deleted.

This file was deleted.

4 changes: 0 additions & 4 deletions sample/Bitreserve-android-sdk-demo/settings.gradle

This file was deleted.

1 change: 1 addition & 0 deletions sample/Uphold-android-sdk-demo/.idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions sample/Uphold-android-sdk-demo/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="Bitreserve-android-sdk-demo" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<module external.linked.project.id="Uphold-android-sdk-demo" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="java-gradle" name="Java-Gradle">
<configuration>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="Bitreserve-android-sdk-demo" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="Uphold-android-sdk-demo" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
Expand Down Expand Up @@ -86,20 +86,21 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="appcompat-v7-22.1.1" level="project" />
<orderEntry type="library" exported="" name="gson-2.3.1" level="project" />
<orderEntry type="library" exported="" name="okhttp-urlconnection-2.0.0" level="project" />
<orderEntry type="library" exported="" name="rxjava-promises-java-1.2.0" level="project" />
<orderEntry type="library" exported="" name="okio-1.0.0" level="project" />
<orderEntry type="library" exported="" name="rxjava-promises-core-1.2.0" level="project" />
<orderEntry type="library" exported="" name="okhttp-2.0.0" level="project" />
<orderEntry type="library" exported="" name="rxjava-promises-java-1.2.1" level="project" />
<orderEntry type="library" exported="" name="okhttp-2.5.0" level="project" />
<orderEntry type="library" exported="" name="okio-1.6.0" level="project" />
<orderEntry type="library" exported="" name="rxjava-promises-core-1.2.1" level="project" />
<orderEntry type="library" exported="" name="okhttp-urlconnection-2.5.0" level="project" />
<orderEntry type="library" exported="" name="retrofit-1.9.0" level="project" />
<orderEntry type="library" exported="" name="rxjava-core-0.19.6" level="project" />
<orderEntry type="library" exported="" name="support-v4-22.1.1" level="project" />
<orderEntry type="library" exported="" name="support-annotations-22.1.1" level="project" />
<orderEntry type="module" module-name="Bitreserve-android-sdk" exported="" />
<orderEntry type="module" module-name="Uphold-android-sdk" exported="" />
</component>
</module>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ android {
}

defaultConfig {
applicationId "org.bitreserve.androidsdkdemo"
applicationId "com.uphold.androidsdkdemo"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
Expand All @@ -23,5 +23,5 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.1.1'
compile project (path: ':Bitreserve-android-sdk', configuration: 'sandboxRelease')
compile project (path: ':Uphold-android-sdk', configuration: 'sandboxRelease')
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.bitreserve.androidsdkdemo">
package="com.uphold.androidsdkdemo">

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

Expand All @@ -10,7 +10,7 @@
android:label="@string/app_name"
android:theme="@style/AppTheme">
<activity
android:name="org.bitreserve.androidsdkdemo.MainActivity"
android:name="com.uphold.androidsdkdemo.MainActivity"
android:alwaysRetainTaskState="true"
android:label="@string/app_name"
android:launchMode="singleTask">
Expand All @@ -23,12 +23,12 @@
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:pathPrefix="/connect/bitreserve"
android:scheme="bitreserve-demo" />
android:pathPrefix="/connect/uphold"
android:scheme="uphold-demo" />
</intent-filter>
</activity>
<activity
android:name="org.bitreserve.androidsdkdemo.UserActivity"
android:name="com.uphold.androidsdkdemo.UserActivity"
android:label="@string/app_name" />
</application>

Expand Down
Loading

0 comments on commit 561aa8e

Please sign in to comment.