1. 程式人生 > >Create an Android app with Blockchain integration

Create an Android app with Blockchain integration

Description

People who aware of their health and fitness often use mobile applications to track their data. Some of those apps reward them for reaching certain goals or tasks. With more people becoming more conscious about what data they give to the application developers, we use Hyperledger Fabric (a blockchain framework implementation) to provide anonymity and security on people’s data and transactions. The Android app tracks the users’ steps and rewards them with “Kubecoins” which they can exchange for swag.

Overview

Modern development requires scalability, resiliency, and good management, and that’s why we chose to use Kubernetes for our Android app’s backend. We chose to use Hyperledger Fabric to enable the app with Blockchain capabilities. We used MongoDB for our data storage and RabbitMQ and Redis to optimize Blockchain requests.

This code pattern is for developers who want to provide data anonymity and security to their users. Their users will be more confident to use their app if it gives them more control over their privacy. The developers can also extend the pattern to use the backend from different platforms.

The Android application was used in KubeCon Europe 2018.

When you have completed this code pattern, you will understand how to:

  • Build a native Android app and use Google Fit for its steps data
  • Deploy a Blockchain network in Kubernetes
  • Integrate the Android app with the Blockchain network

Flow

flow

  1. The REST API is how the mobile app will interact with the blockchain network. The API will acknowledge the request, and the mobile app will receive a unique key (random numbers and letters) which will be used to get the blockchain’s response later.
  2. The API just stores the request in a queue in RabbitMQ. The queue has 2 channels, which are for the user (Fitcoin org) and the seller (Shop org). The requests can either be: enroll a user, query data from the blockchain network, or invoke or perform a transaction.
  3. The execution workers use the Hyperledger Fabric Node.js SDK to perform the requests. They are listening to the requests from RabbitMQ.
  4. The execution workers send the requests to the Blockchain network, which are then processed. The blockchain network uses NFS to persist the ledger and state database.
  5. The execution workers receive the response and then persists it in the Redis database with the unique key from #1.
  6. The mobile app will continue to wait for the blockchain’s response results that should be in the Redis database. The mobile app will query the Redis database with the unique key.
  7. The Registration microservice is used to create a user or update the user’s steps. When the blockchain network enrolls a user, this service uses the user ID assigned by the blockchain network.
  8. When a user is registered, it calls an IBM Cloud Function to generate a random name and avatar for the user.
  9. The data from the microservices (the user’s data (steps, name, and avatar) and mobile assets (booklet/articles in the first view of mobile app)) are persisted in MongoDB.
  10. The mobile assets microservice is used to query the MongoDB to get dynamic data for the mobile app. The booklet in the first view uses the database for its content.
  11. The leaderboard microservice is used to get the standings of the users.

Instructions

Find the detailed steps for this pattern in the README. The steps show you how to:

  1. Clone the repo for the pattern
  2. Create IBM Cloud services
  3. Configure the Blockchain Network
  4. Deploy the Blockchain Network in Kubernetes
  5. Deploy and configure the microservices in Kubernetes
  6. Expose the back-end with Kubernetes Ingress
  7. Configure the Android app
  8. Test the Android app

相關推薦

Create an Android app with Blockchain integration

Description People who aware of their health and fitness often use mobile applications to track their data. Some of those apps reward

Create an Android calorie-counter app

Summary Built for those familiar with JavaScript and Node.js that are interested in creating a mobile app that interacts with the cam

Learn Kotlin while developing an Android App (Introduction)

ContentIntroductionWelcome to this series of Stories where we are going to learn Kotlin, a new JVM language, while developing an Android App. I hope it wil

Create an online IDE with Angular 6 + NodeJS ~ Part #2

Configure Environment VariablesNode apps, like most, work with multiple environments, that can be accessed through proccess.env.NODE_ENV value.The common e

Create an Android Platform Application for Push Messaging in SNS

Amazon Web Services is Hiring. Amazon Web Services (AWS) is a dynamic, growing business unit within Amazon.com. We are currently hiring So

Develop an IoT app with Node-RED and Watson

Summary Build an IoT project. Expand it into a fully functional business application. Use PaaS services and leverage the Watson IoT p

[iOS] Application Loader stuck at “Authenticating with the iTunes store” when uploading an iOS app

You have to agree to a new sign up in Application Loader. Select “Application Loader” under the “Xcode -> Open Developer Tool” menu (the first menu to

Creating an Ember and Rails app with a POST request for a side project

Creating an Ember and Rails app with a POST request for a side projectThis post is a tutorial that will go through creating a simple app with ember js on t

Create a web app to visually interact with objects detected using machine learning

Summary The IBM Model Asset eXchange (MAX) has given application developers without data science experience easy access to prebuilt m

Build an end-to-end blockchain app in 28 minutes

In the third Webinar we will create an end-to-end application in Hyperledger Composer and deploy it in Hyperledger Fabric. The applic

Building an Ionic OCR App with Tesseract

轉自 If you need some sort of text recognition inside images for your app you’ll come across the two most popular libraries called Ocrad and Tesse

Getting Started with Android App Development

As an open platform, Android developers have a few choices for distributing apps to users, customers, developers, and business associates. For pu

[Free Guide] Create your first Android App using Kotlin in 15 minutes

The personal data that you provide through this form will be recorded in a file of Antonio Leiva Gordillo, in order to meet your request. The legitimation

Create an isolated Python 3.4 environment with Boto 3 on EC2 using virtualenv

Amazon Web Services is Hiring. Amazon Web Services (AWS) is a dynamic, growing business unit within Amazon.com. We are currently hiring So

Deploy an asset-transfer app using blockchain

Create a decentralized energy network with Hyperledger Composer

Cannot create an NSPersistentStoreCoordinator with a nil model 問題解決

專案中使用到coredata,由於建立時沒有選擇coredata,只好自己手動新增, 手動新增的方式就是,加個.xcdatamodel檔案之後從模板中拷貝程式碼。 拷貝程式碼後遇到了 “Cannot create an NSPersistentStoreCoordinato

android app 架構設計01

clas -h tab size data 資源 top post 樣式 1:本文有摘抄, 1 2 3 4 5 - 開發過程中。需求、設計、編碼的一致性 - 整個程序具有統一的風格,比方對話框樣式,button風格,色調等UI元素 - 整個程序詳細統一的結

開源整理:Android App新手指引開源控件

暫時 博客 target 引導 技術 方式 關於 iam ice 開源整理:Android App新手指引開源控件 一個App第一次與用戶接觸或者發生大版本更新時,常常會用戶進行新手引導,而一個好的新手指引,往往能夠方便新用戶快速了解操作你的應用功能。新手指引的重要性,不

Android App的設計架構:MVC,MVP,MVVM與架構經驗談

用戶 自己的 req html pla 觀察 持久化 重構 his 來源: Android App的設計架構:MVC,MVP,MVVM與架構經驗談 和MVC框架模式一樣,Model模型處理數據代碼不變在Android的App開發中,很多人經常會頭疼於App的架構如何設計:

Android基礎新手教程——1.2.1 使用Eclipse + ADT + SDK開發Android APP

devtools 進行 string append tle 編寫 android項目 找不到 系統版本號 Android基礎新手教程——1.2.1 使用Eclipse + ADT + SDK開發Android APP