A sample for learning blockchain technology implementation with Android
Instruction of the installing API service: https://github.com/blockchain/service-my-wallet-v3#installation
In class Constants
type your API key:
Constants file
const val BASE_URL = "http://192.168.88.100:3000/" //Your server
const val API_KEY = "5rtyughjbtyughbjnbtyuhbj" //Your API KEY
App using java library from Blockchain.
In build.gradle
:
dependencies {
implementation 'info.blockchain:api:1.1.4'
}
Example use methods from it library .All methods in main thread. For background thread used Rx:
Observable<CreateWalletResponse> createWallet(String email, String password) {
return Observable.fromCallable(() -> CreateWallet.create(
Constants.BASE_URL,
password,
Constants.API_KEY,
null, null,
email))
.observeOn(AndroidSchedulers.mainThread())
.subscribeOn(Schedulers.newThread());
}
Observable<Map<String, Currency>> getExchangeRates() {
return Observable.fromCallable(() -> ExchangeRates.getTicker(Constants.API_KEY))
.observeOn(AndroidSchedulers.mainThread())
.subscribeOn(Schedulers.newThread());
}
##For get access need API key.
- Receive Payments API V2: https://api.blockchain.info/v2/apikey/request
- Global key (available Create Wallet,... etc): https://blockchain.info/ru/api/api_create_code
I'd appreciate even your little contribution to my work, it helps me keep this Open Source updated. If this project helped you or your business and if you feel like donating some bucks, you can Paypal me - ankitdroiddeveloper@gmail.com
Copyright 2018 Ankit Kumar
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.