├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── MAINTAINERS.md ├── Privacy.md ├── README.md ├── android ├── .gitignore ├── .idea │ ├── assetWizardSettings.xml │ ├── caches │ │ └── build_file_checksums.ser │ ├── codeStyles │ │ └── Project.xml │ ├── gradle.xml │ ├── misc.xml │ └── runConfigurations.xml ├── app │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ ├── release │ │ └── output.json │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── anthony │ │ │ └── fitcoinandroid │ │ │ └── ExampleInstrumentedTest.java │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── amanse │ │ │ │ └── anthony │ │ │ │ └── fitcoinandroid │ │ │ │ ├── ArticleModel.java │ │ │ │ ├── ArticlePagerAdapter.java │ │ │ │ ├── ContractDetails.java │ │ │ │ ├── ContractList.java │ │ │ │ ├── ContractListAdapter.java │ │ │ │ ├── ContractModel.java │ │ │ │ ├── LeaderboardAdapater.java │ │ │ │ ├── LeaderboardsFragment.java │ │ │ │ ├── MainActivity.java │ │ │ │ ├── Objects.java │ │ │ │ ├── QuantitySelection.java │ │ │ │ ├── ShopFragment.java │ │ │ │ ├── ShopItemModel.java │ │ │ │ ├── ShopItemsAdapter.java │ │ │ │ ├── TechFragment.java │ │ │ │ ├── UserFragment.java │ │ │ │ └── UserInfoModel.java │ │ ├── kube_icon-web.png │ │ └── res │ │ │ ├── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── drawable │ │ │ ├── bee_sticker.png │ │ │ ├── coin.png │ │ │ ├── distance.png │ │ │ ├── em_sticker.png │ │ │ ├── eye_sticker.png │ │ │ ├── footprint.png │ │ │ ├── ic_bar_chart.xml │ │ │ ├── ic_catalog.xml │ │ │ ├── ic_checkout_cart.xml │ │ │ ├── ic_contract.xml │ │ │ ├── ic_dashboard_black_24dp.xml │ │ │ ├── ic_fitcoin.xml │ │ │ ├── ic_footprint.xml │ │ │ ├── ic_home_black_24dp.xml │ │ │ ├── ic_launcher_background.xml │ │ │ ├── ic_menu_overflow.xml │ │ │ ├── ic_notifications_black_24dp.xml │ │ │ ├── kubecoin_shirt.png │ │ │ ├── minus_stepper.xml │ │ │ ├── plus_stepper.xml │ │ │ ├── popsocket.png │ │ │ └── think_bandana.png │ │ │ ├── layout │ │ │ ├── activity_main.xml │ │ │ ├── article_item.xml │ │ │ ├── contract_details.xml │ │ │ ├── contract_item.xml │ │ │ ├── contracts_list.xml │ │ │ ├── fragment_leaderboards.xml │ │ │ ├── fragment_shop.xml │ │ │ ├── fragment_tech.xml │ │ │ ├── fragment_user.xml │ │ │ ├── leaderboard_item.xml │ │ │ ├── quantity_selection.xml │ │ │ ├── shop_item.xml │ │ │ └── tech_article.xml │ │ │ ├── menu │ │ │ ├── navigation.xml │ │ │ └── privacy.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ ├── ic_launcher_round.xml │ │ │ ├── kube_icon.xml │ │ │ └── kube_icon_round.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_round.png │ │ │ ├── kube_icon.png │ │ │ ├── kube_icon_foreground.png │ │ │ └── kube_icon_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_round.png │ │ │ ├── kube_icon.png │ │ │ ├── kube_icon_foreground.png │ │ │ └── kube_icon_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_round.png │ │ │ ├── kube_icon.png │ │ │ ├── kube_icon_foreground.png │ │ │ └── kube_icon_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_round.png │ │ │ ├── kube_icon.png │ │ │ ├── kube_icon_foreground.png │ │ │ └── kube_icon_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_round.png │ │ │ ├── kube_icon.png │ │ │ ├── kube_icon_foreground.png │ │ │ └── kube_icon_round.png │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── dimens.xml │ │ │ ├── kube_icon_background.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── example │ │ └── anthony │ │ └── fitcoinandroid │ │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle ├── booklet.json ├── bookletImages ├── Application.png ├── Cloud.png ├── Microservices.png ├── Run.png ├── Secure.png ├── kubecoin logo.png ├── newcloud.png ├── newextend.png ├── newmicroservice.png ├── newops.png └── newsecure.png ├── buildAndPushImages.sh ├── containers ├── blockchain │ ├── .dockerignore │ ├── .eslintrc.js │ ├── .gitignore │ ├── backend │ │ ├── .babelrc │ │ ├── .dockerignore │ │ ├── .gitignore │ │ ├── Dockerfile │ │ ├── app.js │ │ ├── index.js │ │ ├── package-lock.json │ │ ├── package.json │ │ └── utils │ │ │ ├── peer.js │ │ │ └── util.js │ ├── blockchainNetwork │ │ ├── .babelrc │ │ ├── .dockerignore │ │ ├── Dockerfile │ │ ├── chaincode │ │ │ └── src │ │ │ │ └── bcfit │ │ │ │ ├── contract.go │ │ │ │ ├── member.go │ │ │ │ ├── product.go │ │ │ │ └── secret_map.go │ │ ├── index.js │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── set-up │ │ │ ├── CouchDBKeyValueStore.js │ │ │ ├── client.js │ │ │ ├── config.js │ │ │ ├── enroll.js │ │ │ ├── invoke.js │ │ │ ├── query.js │ │ │ ├── setup.js │ │ │ └── utils.js │ │ └── test │ │ │ ├── testInvoke.js │ │ │ └── testQuery.js │ ├── build.sh │ ├── ca-base.yaml │ ├── ccfunctions.md │ ├── clean.sh │ ├── cliLoadTester │ │ ├── .gitignore │ │ ├── pom.xml │ │ ├── src │ │ │ ├── main │ │ │ │ └── java │ │ │ │ │ └── secretApp │ │ │ │ │ └── testApp │ │ │ │ │ ├── ExecutionApp.java │ │ │ │ │ ├── ResultGenerator.java │ │ │ │ │ └── Task.java │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── secretApp │ │ │ │ └── testApp │ │ │ │ └── ExecutionAppTest.java │ │ └── start.md │ ├── configtx.yaml │ ├── configtxgen │ ├── configuration │ │ ├── .dockerignore │ │ ├── .gitignore │ │ ├── config.js │ │ ├── package-lock.json │ │ └── package.json │ ├── crypto-config.yaml │ ├── cryptogen │ ├── docker-compose.yaml │ ├── docker-images.sh │ ├── fitcoinCertificateAuthority │ │ ├── Dockerfile │ │ └── fabric-ca-server-config.yaml │ ├── fitcoinPeer │ │ └── Dockerfile │ ├── generate-certs.sh │ ├── generate-cfgtx.sh │ ├── instructions.md │ ├── kube-configs │ │ ├── blockchain-setup.yaml │ │ ├── ca-datastore.yaml │ │ ├── docker-deployment.yaml │ │ ├── fitcoin-backend.yaml │ │ ├── fitcoin-ca.yaml │ │ ├── fitcoin-peer.yaml │ │ ├── fitcoin-statedb.yaml │ │ ├── orderer0.yaml │ │ ├── persistent-volume │ │ │ ├── persistent-volume-claims.yaml │ │ │ └── static-pv-pvc │ │ │ │ ├── couhdb-pair.yaml │ │ │ │ ├── org-ca-pair.yaml │ │ │ │ └── peer-pair.yaml │ │ ├── rabbitclient-api.yaml │ │ ├── readme.md │ │ ├── secrets.yaml │ │ ├── shop-backend.yaml │ │ ├── shop-ca.yaml │ │ ├── shop-peer.yaml │ │ ├── shop-statedb.yaml │ │ ├── test-docker.yaml │ │ ├── test-instantiate │ │ │ └── test-pod.yaml │ │ └── test.yaml │ ├── orderer │ │ └── Dockerfile │ ├── peer-base.yaml │ ├── rabbitClient │ │ ├── .babelrc │ │ ├── .dockerignore │ │ ├── Dockerfile │ │ ├── app.js │ │ ├── index.js │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── routes │ │ │ └── api.js │ │ └── utils │ │ │ ├── channel.js │ │ │ ├── config.js │ │ │ └── util.js │ ├── rabbitClientHAProxy.cfg │ ├── rabbitCluster │ │ └── cluster-entrypoint.sh │ ├── rabbitServerClusterHAProxy.cfg │ ├── redisCluster │ │ ├── Dockerfile │ │ └── docker-data │ │ │ ├── docker-entrypoint.sh │ │ │ ├── redis-cluster.tmpl │ │ │ ├── redis.tmpl │ │ │ └── supervisord.conf │ ├── shopCertificateAuthority │ │ ├── Dockerfile │ │ └── fabric-ca-server-config.yaml │ ├── shopPeer │ │ └── Dockerfile │ ├── testApplication │ │ ├── .gitignore │ │ ├── client.js │ │ ├── index.js │ │ ├── package-lock.json │ │ ├── package.json │ │ └── public │ │ │ ├── history.html │ │ │ ├── scripts │ │ │ ├── events.js │ │ │ └── message.js │ │ │ └── test.html │ └── ubuntu │ │ ├── configtxgen │ │ └── cryptogen ├── gravatar.yaml ├── gravatar │ ├── Dockerfile │ ├── app.js │ ├── package-lock.json │ └── package.json ├── ingress-prod.yaml ├── leaderboard-api.yaml ├── leaderboard │ ├── Dockerfile │ ├── app.js │ ├── models │ │ └── registeree.js │ ├── package-lock.json │ ├── package.json │ └── routes │ │ └── leaderboard.js ├── mobile-assets.yaml ├── mobile-assets │ ├── Dockerfile │ ├── app.js │ ├── models │ │ └── page.js │ ├── package-lock.json │ ├── package.json │ ├── public │ │ ├── bee_sticker.png │ │ ├── em_sticker.png │ │ └── eye_sticker.png │ └── routes │ │ └── pages.js ├── mongo-cert-secret.yaml ├── registeree-api.yaml └── registeree-api │ ├── .npmrc │ ├── Dockerfile │ ├── app.js │ ├── models │ └── registeree.js │ ├── package.json │ ├── public │ ├── css │ │ └── style.css │ └── index.html │ ├── routes │ └── registerees.js │ └── test │ └── registereeTest.js ├── deployNetwork.sh └── docs ├── android-screen.png ├── architecture.png ├── java-files.png ├── mongo-certificate.png ├── mongo-credentials.png ├── rabbit-credentials.png └── redis-credentials.png /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24 | .grunt 25 | 26 | # Bower dependency directory (https://bower.io/) 27 | bower_components 28 | 29 | # node-waf configuration 30 | .lock-wscript 31 | 32 | # Compiled binary addons (https://nodejs.org/api/addons.html) 33 | build/Release 34 | 35 | # Dependency directories 36 | node_modules/ 37 | jspm_packages/ 38 | 39 | # TypeScript v1 declaration files 40 | typings/ 41 | 42 | # Optional npm cache directory 43 | .npm 44 | 45 | # Optional eslint cache 46 | .eslintcache 47 | 48 | # Optional REPL history 49 | .node_repl_history 50 | 51 | # Output of 'npm pack' 52 | *.tgz 53 | 54 | # Yarn Integrity file 55 | .yarn-integrity 56 | 57 | # dotenv environment variables file 58 | .env 59 | 60 | # next.js build output 61 | .next 62 | 63 | # Built application files 64 | *.apk 65 | *.ap_ 66 | 67 | # Files for the ART/Dalvik VM 68 | *.dex 69 | 70 | # Java class files 71 | *.class 72 | 73 | # Generated files 74 | bin/ 75 | gen/ 76 | out/ 77 | 78 | # Gradle files 79 | .gradle/ 80 | build/ 81 | 82 | # Local configuration file (sdk path, etc) 83 | local.properties 84 | 85 | # Proguard folder generated by Eclipse 86 | proguard/ 87 | 88 | # Log Files 89 | *.log 90 | 91 | # Android Studio Navigation editor temp files 92 | .navigation/ 93 | 94 | # Android Studio captures folder 95 | captures/ 96 | 97 | # Intellij 98 | *.iml 99 | .idea/workspace.xml 100 | .idea/tasks.xml 101 | .idea/gradle.xml 102 | .idea/dictionaries 103 | .idea/libraries 104 | 105 | # Keystore files 106 | *.jks 107 | 108 | # External native build folder generated in Android Studio 2.2 and later 109 | .externalNativeBuild 110 | 111 | # Google Services (e.g. APIs or Firebase) 112 | google-services.json 113 | 114 | # Freeline 115 | freeline.py 116 | freeline/ 117 | freeline_project_description.json 118 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | This is an open source project, and we appreciate your help! 4 | 5 | We use the GitHub issue tracker to discuss new features and non-trivial bugs. 6 | 7 | In addition to the issue tracker, [#journeys on 8 | Slack](https://dwopen.slack.com) is the best way to get into contact with the 9 | project's maintainers. 10 | 11 | To contribute code, documentation, or tests, please submit a pull request to 12 | the GitHub repository. Generally, we expect two maintainers to review your pull 13 | request before it is approved for merging. For more details, see the 14 | [MAINTAINERS](MAINTAINERS.md) page. 15 | -------------------------------------------------------------------------------- /MAINTAINERS.md: -------------------------------------------------------------------------------- 1 | # Maintainers Guide 2 | 3 | This guide is intended for maintainers - anybody with commit access to one or 4 | more Code Pattern repositories. 5 | 6 | ## Methodology 7 | 8 | This repository does not have a traditional release management cycle, but 9 | should instead be maintained as a useful, working, and polished reference at 10 | all times. While all work can therefore be focused on the master branch, the 11 | quality of this branch should never be compromised. 12 | 13 | The remainder of this document details how to merge pull requests to the 14 | repositories. 15 | 16 | ## Merge approval 17 | 18 | The project maintainers use LGTM (Looks Good To Me) in comments on the pull 19 | request to indicate acceptance prior to merging. A change requires LGTMs from 20 | two project maintainers. If the code is written by a maintainer, the change 21 | only requires one additional LGTM. 22 | 23 | ## Reviewing Pull Requests 24 | 25 | We recommend reviewing pull requests directly within GitHub. This allows a 26 | public commentary on changes, providing transparency for all users. When 27 | providing feedback be civil, courteous, and kind. Disagreement is fine, so long 28 | as the discourse is carried out politely. If we see a record of uncivil or 29 | abusive comments, we will revoke your commit privileges and invite you to leave 30 | the project. 31 | 32 | During your review, consider the following points: 33 | 34 | ### Does the change have positive impact? 35 | 36 | Some proposed changes may not represent a positive impact to the project. Ask 37 | whether or not the change will make understanding the code easier, or if it 38 | could simply be a personal preference on the part of the author (see 39 | [bikeshedding](https://en.wiktionary.org/wiki/bikeshedding)). 40 | 41 | Pull requests that do not have a clear positive impact should be closed without 42 | merging. 43 | 44 | ### Do the changes make sense? 45 | 46 | If you do not understand what the changes are or what they accomplish, ask the 47 | author for clarification. Ask the author to add comments and/or clarify test 48 | case names to make the intentions clear. 49 | 50 | At times, such clarification will reveal that the author may not be using the 51 | code correctly, or is unaware of features that accommodate their needs. If you 52 | feel this is the case, work up a code sample that would address the pull 53 | request for them, and feel free to close the pull request once they confirm. 54 | 55 | ### Does the change introduce a new feature? 56 | 57 | For any given pull request, ask yourself "is this a new feature?" If so, does 58 | the pull request (or associated issue) contain narrative indicating the need 59 | for the feature? If not, ask them to provide that information. 60 | 61 | Are new unit tests in place that test all new behaviors introduced? If not, do 62 | not merge the feature until they are! Is documentation in place for the new 63 | feature? (See the documentation guidelines). If not do not merge the feature 64 | until it is! Is the feature necessary for general use cases? Try and keep the 65 | scope of any given component narrow. If a proposed feature does not fit that 66 | scope, recommend to the user that they maintain the feature on their own, and 67 | close the request. You may also recommend that they see if the feature gains 68 | traction among other users, and suggest they re-submit when they can show such 69 | support. 70 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/libraries 5 | /.idea/modules.xml 6 | /.idea/workspace.xml 7 | .DS_Store 8 | /build 9 | /captures 10 | .externalNativeBuild 11 | -------------------------------------------------------------------------------- /android/.idea/caches/build_file_checksums.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/android-kubernetes-blockchain/5d6caeccd1888992f98fdd80eb27f993cd3945a1/android/.idea/caches/build_file_checksums.ser -------------------------------------------------------------------------------- /android/.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /android/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /android/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 27 | 28 | 29 | 30 | 31 | 32 | 34 | -------------------------------------------------------------------------------- /android/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /android/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | signingConfigs { 5 | config { 6 | storeFile file('/Users/anthony/Library/Mobile Documents/com~apple~CloudDocs/kubecoin-release') 7 | keyAlias 'KubecoinRelease' 8 | keyPassword 'qwerty' 9 | storePassword 'qwerty' 10 | } 11 | } 12 | compileSdkVersion 27 13 | defaultConfig { 14 | applicationId "com.amanse.anthony.fitcoinandroid" 15 | minSdkVersion 21 16 | targetSdkVersion 27 17 | versionCode 5 18 | versionName "1.4" 19 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 20 | } 21 | buildTypes { 22 | release { 23 | minifyEnabled true 24 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 25 | signingConfig signingConfigs.config 26 | } 27 | } 28 | productFlavors { 29 | } 30 | } 31 | 32 | dependencies { 33 | implementation fileTree(include: ['*.jar'], dir: 'libs') 34 | implementation 'com.android.support:appcompat-v7:27.1.1' 35 | implementation 'com.android.support:design:27.1.1' 36 | implementation 'com.android.support.constraint:constraint-layout:1.1.0' 37 | implementation 'com.android.support:support-vector-drawable:27.1.1' 38 | implementation 'com.android.support:support-v4:27.1.1' 39 | testImplementation 'junit:junit:4.12' 40 | androidTestImplementation 'com.android.support.test:runner:1.0.1' 41 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' 42 | implementation 'com.google.android.gms:play-services-fitness:12.0.1' 43 | implementation 'com.google.android.gms:play-services-auth:12.0.1' 44 | implementation 'com.android.volley:volley:1.1.0' 45 | implementation 'com.google.code.gson:gson:2.8.2' 46 | implementation 'com.android.support:cardview-v7:27.1.1' 47 | implementation 'com.pixplicity.sharp:library:1.1.0' 48 | } 49 | -------------------------------------------------------------------------------- /android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | 23 | -dontoptimize 24 | -dontpreverify 25 | -dontskipnonpubliclibraryclasses 26 | -dontobfuscate 27 | -forceprocessing 28 | -optimizationpasses 5 29 | 30 | -assumenosideeffects class android.util.Log { 31 | public static *** v(...); 32 | public static *** d(...); 33 | public static *** e(...); 34 | } -------------------------------------------------------------------------------- /android/app/release/output.json: -------------------------------------------------------------------------------- 1 | [{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":5,"versionName":"1.4","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] -------------------------------------------------------------------------------- /android/app/src/androidTest/java/com/example/anthony/fitcoinandroid/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.example.anthony.fitcoinandroid; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.example.anthony.fitcoinandroid", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 15 | 18 | 19 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 30 | 32 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/amanse/anthony/fitcoinandroid/ArticleModel.java: -------------------------------------------------------------------------------- 1 | package com.amanse.anthony.fitcoinandroid; 2 | 3 | import android.graphics.Bitmap; 4 | import android.graphics.BitmapFactory; 5 | import android.util.Base64; 6 | 7 | public class ArticleModel { 8 | int page; 9 | String title; 10 | String subtitle; 11 | String imageEncoded; 12 | String subtext; 13 | String description; 14 | String link; 15 | 16 | public ArticleModel(int page, String title, String subtitle, String imageEncoded, String subtext, String description, String link) { 17 | this.page = page; 18 | this.title = title; 19 | this.subtitle = subtitle; 20 | this.imageEncoded = imageEncoded; 21 | this.subtext = subtext; 22 | this.description = description; 23 | this.link = link; 24 | } 25 | 26 | public Bitmap getBitmap() { 27 | if (imageEncoded == null || imageEncoded.equals("")) { 28 | return null; 29 | } 30 | byte[] decodedString = Base64.decode(imageEncoded, Base64.DEFAULT); 31 | return BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length); 32 | } 33 | 34 | public int getPage() { 35 | return page; 36 | } 37 | 38 | public String getTitle() { 39 | return title; 40 | } 41 | 42 | public String getSubtitle() { 43 | return subtitle; 44 | } 45 | 46 | public String getImageEncoded() { 47 | return imageEncoded; 48 | } 49 | 50 | public String getSubtext() { 51 | return subtext; 52 | } 53 | 54 | public String getDescription() { 55 | return description; 56 | } 57 | 58 | public String getLink() { 59 | return link; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/amanse/anthony/fitcoinandroid/ArticlePagerAdapter.java: -------------------------------------------------------------------------------- 1 | package com.amanse.anthony.fitcoinandroid; 2 | 3 | 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.net.Uri; 7 | import android.support.v4.view.PagerAdapter; 8 | import android.view.LayoutInflater; 9 | import android.view.View; 10 | import android.view.ViewGroup; 11 | import android.widget.Button; 12 | import android.widget.ImageView; 13 | import android.widget.TextView; 14 | 15 | 16 | import java.util.ArrayList; 17 | 18 | public class ArticlePagerAdapter extends PagerAdapter { 19 | 20 | private Context context; 21 | private ArrayList articleModels; 22 | 23 | public ArticlePagerAdapter(Context context, ArrayList articleModels) { 24 | this.context = context; 25 | this.articleModels = articleModels; 26 | } 27 | 28 | @Override 29 | public Object instantiateItem(ViewGroup container, int position) { 30 | View view = LayoutInflater.from(context).inflate(R.layout.article_item, container, false); 31 | 32 | final ArticleModel articleModel = articleModels.get(position); 33 | 34 | TextView articleTitle = view.findViewById(R.id.articleTitle); 35 | TextView articleSubTitle = view.findViewById(R.id.articleSubtitle); 36 | TextView articleSubtext = view.findViewById(R.id.articleSubtext); 37 | TextView articleDescription = view.findViewById(R.id.articleStatement); 38 | ImageView articleImage = view.findViewById(R.id.articleImage); 39 | Button articleLink = view.findViewById(R.id.articleLink); 40 | 41 | articleTitle.setText(articleModel.getTitle()); 42 | articleSubTitle.setText(articleModel.getSubtitle()); 43 | articleSubtext.setText(articleModel.getSubtext()); 44 | articleDescription.setText(articleModel.getDescription()); 45 | if (articleModel.getBitmap() != null) { 46 | articleImage.setImageBitmap(articleModel.getBitmap()); 47 | } 48 | 49 | articleLink.setOnClickListener(new View.OnClickListener() { 50 | @Override 51 | public void onClick(View view) { 52 | Uri uri = Uri.parse(articleModel.getLink()); 53 | Intent intent = new Intent(Intent.ACTION_VIEW, uri); 54 | context.startActivity(intent); 55 | } 56 | }); 57 | 58 | container.addView(view); 59 | 60 | return view; 61 | } 62 | 63 | @Override 64 | public void destroyItem(ViewGroup container, int position, Object object) { 65 | container.removeView((View) object); 66 | } 67 | 68 | @Override 69 | public int getCount() { 70 | return articleModels.size(); 71 | } 72 | 73 | @Override 74 | public boolean isViewFromObject(View view, Object object) { 75 | return view == object; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/amanse/anthony/fitcoinandroid/ContractList.java: -------------------------------------------------------------------------------- 1 | package com.amanse.anthony.fitcoinandroid; 2 | 3 | import android.support.v7.app.AppCompatActivity; 4 | import android.os.Bundle; 5 | import android.support.v7.widget.LinearLayoutManager; 6 | import android.support.v7.widget.RecyclerView; 7 | import android.view.View; 8 | import android.widget.TextView; 9 | 10 | import com.google.gson.Gson; 11 | 12 | import java.util.ArrayList; 13 | import java.util.Arrays; 14 | import java.util.Collections; 15 | import java.util.List; 16 | 17 | public class ContractList extends AppCompatActivity { 18 | 19 | Gson gson = new Gson(); 20 | ArrayList contractModels; 21 | RecyclerView recyclerView; 22 | ContractListAdapter adapter; 23 | 24 | TextView contractTextNotification; 25 | 26 | @Override 27 | protected void onCreate(Bundle savedInstanceState) { 28 | super.onCreate(savedInstanceState); 29 | setContentView(R.layout.contracts_list); 30 | 31 | String contractModelsJson = getIntent().getStringExtra("CONTRACT_MODELS_JSON"); 32 | 33 | recyclerView = findViewById(R.id.contractsList); 34 | recyclerView.setHasFixedSize(true); 35 | recyclerView.setLayoutManager(new LinearLayoutManager(this)); 36 | 37 | contractTextNotification = findViewById(R.id.contractTextNotification); 38 | 39 | contractModels = new ArrayList<>(); 40 | 41 | ContractModel[] contractModelsReceived = gson.fromJson(contractModelsJson, ContractModel[].class); 42 | 43 | if (contractModelsReceived.length != 0) { 44 | // reverse the contracts so that newest show at the top 45 | List temp = Arrays.asList(contractModelsReceived); 46 | Collections.reverse(temp); 47 | contractModels.addAll(temp); 48 | } else { 49 | contractTextNotification.setVisibility(View.VISIBLE); 50 | contractTextNotification.setText("You have not made any contracts yet. Claim an item to get one and come to our booth."); 51 | } 52 | 53 | // attach adapter to view 54 | adapter = new ContractListAdapter(this, contractModels); 55 | recyclerView.setAdapter(adapter); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/amanse/anthony/fitcoinandroid/ContractModel.java: -------------------------------------------------------------------------------- 1 | package com.amanse.anthony.fitcoinandroid; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | public class ContractModel { 6 | 7 | @SerializedName("id") 8 | String contractId; 9 | String sellerId; 10 | String userId; 11 | String productId; 12 | String productName; 13 | int quantity; 14 | int cost; 15 | String state; 16 | 17 | public ContractModel(String contractId, String sellerId, String userId, String productId, String productName, int quantity, int cost, String state) { 18 | this.contractId = contractId; 19 | this.sellerId = sellerId; 20 | this.userId = userId; 21 | this.productId = productId; 22 | this.productName = productName; 23 | this.quantity = quantity; 24 | this.cost = cost; 25 | this.state = state; 26 | } 27 | 28 | public String getContractId() { 29 | return contractId; 30 | } 31 | 32 | public String getSellerId() { 33 | return sellerId; 34 | } 35 | 36 | public String getUserId() { 37 | return userId; 38 | } 39 | 40 | public String getProductId() { 41 | return productId; 42 | } 43 | 44 | public String getProductName() { 45 | return productName; 46 | } 47 | 48 | public int getQuantity() { 49 | return quantity; 50 | } 51 | 52 | public int getCost() { 53 | return cost; 54 | } 55 | 56 | public String getState() { 57 | return state; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/amanse/anthony/fitcoinandroid/LeaderboardAdapater.java: -------------------------------------------------------------------------------- 1 | package com.amanse.anthony.fitcoinandroid; 2 | 3 | import android.content.Context; 4 | import android.support.v7.widget.RecyclerView; 5 | import android.util.SparseIntArray; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | import android.view.animation.AlphaAnimation; 10 | import android.widget.ImageView; 11 | import android.widget.TextView; 12 | 13 | 14 | import java.util.ArrayList; 15 | 16 | public class LeaderboardAdapater extends RecyclerView.Adapter { 17 | 18 | private Context context; 19 | private ArrayList userInfoModels; 20 | SparseIntArray stepsAndPlace = new SparseIntArray(); 21 | 22 | public LeaderboardAdapater(Context context, ArrayList userInfoModels) { 23 | this.context = context; 24 | this.userInfoModels = userInfoModels; 25 | } 26 | 27 | @Override 28 | public LeaderboardViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 29 | 30 | LayoutInflater inflater = LayoutInflater.from(context); 31 | View view = inflater.inflate(R.layout.leaderboard_item, null); 32 | return new LeaderboardViewHolder(view); 33 | } 34 | 35 | @Override 36 | public void onBindViewHolder(LeaderboardViewHolder holder, int position) { 37 | UserInfoModel userInfoModel = userInfoModels.get(position); 38 | int userSteps = userInfoModel.getSteps(); 39 | 40 | // set views 41 | holder.userImage.setImageBitmap(userInfoModel.getBitmap()); 42 | 43 | holder.userName.setText(userInfoModel.getName()); 44 | holder.userStats.setText(String.format("%d steps", userSteps)); 45 | 46 | if(stepsAndPlace.get(userSteps) != 0) { 47 | holder.userPosition.setText(String.valueOf(stepsAndPlace.get(userSteps))); 48 | } else { 49 | holder.userPosition.setText(String.valueOf(position+1)); 50 | stepsAndPlace.put(userSteps,position+1); 51 | } 52 | 53 | setAnimation(holder); 54 | } 55 | 56 | public void setAnimation(LeaderboardViewHolder holder) { 57 | AlphaAnimation animation = new AlphaAnimation(0.0f, 1.0f); 58 | animation.setDuration(500); 59 | holder.itemView.startAnimation(animation); 60 | } 61 | 62 | @Override 63 | public int getItemCount() { 64 | return userInfoModels.size(); 65 | } 66 | 67 | public class LeaderboardViewHolder extends RecyclerView.ViewHolder { 68 | TextView userName, userStats, userPosition; 69 | ImageView userImage; 70 | 71 | public LeaderboardViewHolder(View view) { 72 | super(view); 73 | 74 | userName = view.findViewById(R.id.userName); 75 | userStats = view.findViewById(R.id.userStats); 76 | userPosition = view.findViewById(R.id.userPosition); 77 | 78 | userImage = view.findViewById(R.id.userImage); 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/amanse/anthony/fitcoinandroid/Objects.java: -------------------------------------------------------------------------------- 1 | package com.amanse.anthony.fitcoinandroid; 2 | 3 | public class Objects {} 4 | 5 | class GetStateFinalResult { 6 | String[] contractIds; 7 | int fitcoinsBalance; 8 | String id; 9 | String memberType; 10 | int stepsUsedForConversion; 11 | int totalSteps; 12 | } 13 | 14 | class InitialResultFromRabbit { 15 | String status; 16 | String resultId; 17 | } 18 | 19 | class BackendResult { 20 | String status; 21 | String result; 22 | } 23 | 24 | class ResultOfEnroll { 25 | String message; 26 | EnrollFinalResult result; 27 | } 28 | 29 | class EnrollFinalResult { 30 | String user; 31 | String txId; 32 | String error; 33 | } 34 | 35 | class ResultOfBackendResult { 36 | String message; 37 | String result; 38 | String error; 39 | } 40 | 41 | class ResultOfTransactionResult { 42 | int status; 43 | String message; 44 | String payload; 45 | } 46 | 47 | class TransactionResult { 48 | String txId; 49 | ResultOfTransactionResult results; 50 | } 51 | 52 | class ResultOfMakePurchase { 53 | String message; 54 | TransactionResult result; 55 | String error; 56 | } -------------------------------------------------------------------------------- /android/app/src/main/java/com/amanse/anthony/fitcoinandroid/ShopItemModel.java: -------------------------------------------------------------------------------- 1 | package com.amanse.anthony.fitcoinandroid; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | public class ShopItemModel { 6 | 7 | @SerializedName("sellerid") 8 | String sellerId; 9 | @SerializedName("productid") 10 | String productId; 11 | @SerializedName("name") 12 | String productName; 13 | @SerializedName("count") 14 | int quantityLeft; 15 | int price; 16 | 17 | public ShopItemModel(String sellerId, String productId, String productName, int quantityLeft, int price) { 18 | this.sellerId = sellerId; 19 | this.productId = productId; 20 | this.productName = productName; 21 | this.quantityLeft = quantityLeft; 22 | this.price = price; 23 | } 24 | 25 | public String getProductId() { 26 | return productId; 27 | } 28 | 29 | public String getSellerId() { 30 | return sellerId; 31 | } 32 | 33 | public String getProductName() { 34 | return productName; 35 | } 36 | 37 | public int getQuantityLeft() { 38 | return quantityLeft; 39 | } 40 | 41 | public int getPrice() { 42 | return price; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/amanse/anthony/fitcoinandroid/UserInfoModel.java: -------------------------------------------------------------------------------- 1 | package com.amanse.anthony.fitcoinandroid; 2 | 3 | import android.graphics.Bitmap; 4 | import android.graphics.BitmapFactory; 5 | import android.graphics.drawable.Drawable; 6 | import android.util.Base64; 7 | 8 | public class UserInfoModel { 9 | int steps; 10 | String name; 11 | String png; 12 | 13 | public UserInfoModel(int steps, String name, String image) { 14 | this.steps = steps; 15 | this.name = name; 16 | this.png = image; 17 | } 18 | 19 | public String getName() { 20 | return name; 21 | } 22 | 23 | public int getSteps() { 24 | return steps; 25 | } 26 | 27 | public String getPng() { 28 | return png; 29 | } 30 | 31 | public Bitmap getBitmap() { 32 | if (png == null || png.equals("")) { 33 | return null; 34 | } 35 | byte[] decodedString = Base64.decode(png, Base64.DEFAULT); 36 | return BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /android/app/src/main/kube_icon-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/android-kubernetes-blockchain/5d6caeccd1888992f98fdd80eb27f993cd3945a1/android/app/src/main/kube_icon-web.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/bee_sticker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/android-kubernetes-blockchain/5d6caeccd1888992f98fdd80eb27f993cd3945a1/android/app/src/main/res/drawable/bee_sticker.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/coin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/android-kubernetes-blockchain/5d6caeccd1888992f98fdd80eb27f993cd3945a1/android/app/src/main/res/drawable/coin.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/distance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/android-kubernetes-blockchain/5d6caeccd1888992f98fdd80eb27f993cd3945a1/android/app/src/main/res/drawable/distance.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/em_sticker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/android-kubernetes-blockchain/5d6caeccd1888992f98fdd80eb27f993cd3945a1/android/app/src/main/res/drawable/em_sticker.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/eye_sticker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/android-kubernetes-blockchain/5d6caeccd1888992f98fdd80eb27f993cd3945a1/android/app/src/main/res/drawable/eye_sticker.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/footprint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/android-kubernetes-blockchain/5d6caeccd1888992f98fdd80eb27f993cd3945a1/android/app/src/main/res/drawable/footprint.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/ic_bar_chart.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/ic_catalog.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/ic_checkout_cart.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/ic_contract.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/ic_dashboard_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/ic_fitcoin.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/ic_footprint.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/ic_home_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/ic_menu_overflow.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/ic_notifications_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/kubecoin_shirt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/android-kubernetes-blockchain/5d6caeccd1888992f98fdd80eb27f993cd3945a1/android/app/src/main/res/drawable/kubecoin_shirt.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/minus_stepper.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/plus_stepper.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/popsocket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/android-kubernetes-blockchain/5d6caeccd1888992f98fdd80eb27f993cd3945a1/android/app/src/main/res/drawable/popsocket.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/think_bandana.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/android-kubernetes-blockchain/5d6caeccd1888992f98fdd80eb27f993cd3945a1/android/app/src/main/res/drawable/think_bandana.png -------------------------------------------------------------------------------- /android/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 21 | 22 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /android/app/src/main/res/layout/article_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 18 | 19 | 29 | 30 | 39 | 40 | 45 | 46 | 56 | 57 | 65 | 66 |