Before we begin, here is the project structure when opening the project in Android Studio:
Source Code Directories Description
app/src/main/java/org/zus/bolt/helloworld/
├── models
│ ├── blobber (blobber models for data exchange in json)
│ │ ├── BlobberDetail.kt
│ │ ├── BlobberNodeModelItem.kt
│ │ ├── BlobberNodeModel.kt
│ │ ├── BlobbersUrlIdModel.kt
│ │ ├── ReadPriceRange.kt
│ │ ├── StakePoolSettings.kt
│ │ ├── StatsModel.kt
│ │ ├── Terms.kt
│ │ ├── TermsX.kt
│ │ └── WritePriceRange.kt
│ ├── selectapp
│ │ ├── DetailsModel.kt (Provide Key Value pair data class for storing the details represented in wallet details list.)
│ ├── bolt
│ │ ├── BalanceModel.kt (Provides check wallet balance functions and more)
│ │ ├── KeyModel.kt (Provides structure for key deserialization from wallet.)
│ │ ├── TransactionModel.kt (Model to represent and convert transactions(json)
│ │ └── WalletModel.kt (Represents the wallet model while creating wallet)
│ ├── Config.kt (chain config model)
│ ├── NetworkModel.kt (network model to display network data in the SelectAppFragment)
│ └── vult
│ ├── AllocationModelItem.kt (Allocation Item Model.)
│ ├── AllocationModel.kt (Allocations List Model.)
│ ├── CliAllocationsModelItem.kt (Allocation item model when allocation is created from cli and hardcoded as text)
│ ├── CliAllocationsModel.kt (Allocation list model when allocation is created from cli and hardcoded as text)
│ ├── FileModel.kt (Files model to repesent the uploaded files in the allocation)
│ └── FileResponseModel.kt (File json response model from the gosdk. )
├── ui
│ ├── bolt
│ │ ├── BoltFragment.kt(Handles UI logic,click and views.)
│ │ ├── BoltViewModel.kt(Handles data sources and core api methods.)
│ │ ├── SortEnum.kt(Wrapper to efficiently use sort while getting transactions)
│ │ └── TransactionsAdapter.kt(Adapter for recycler view in BoltFragment)
| │ └── TransactionBottomSheetFragment.kt(Transaction Bottom Sheet for dispaying transaction value in BoltFragment)
│ ├── CreateWalletFragment.kt (Creates wallet for a user at first time)
│ ├── mainactivity
│ │ ├── MainActivity.kt (Launched at startup and sets up action bar and saved wallet.)
│ │ └── MainViewModel.kt (Core wallet saving classes using files in android)
│ ├── selectapp
│ │ ├── AllocationDetailsBottomScreenFragment.kt (Bottom sheet fragment for displaying allocation details)
│ │ ├── DetailsListAdapter.kt (Adapter for generalised list view)
│ │ ├── CustomDialog.kt (a custom dialog class for displaying dialogs.)
│ │ ├── DetailsBottomSheetFragment.kt (Details Bottom Sheet for dispaying the value of the key value pair in DetailsModel in Wallet Details)
│ │ ├── NetworkDetailsBottomScreenFragment.kt (Bottom Sheet fragment for displaying network details)
│ │ ├── SelectAppFragment.kt (Navigates to bolt or vult app.)
│ │ └── WalletDetailsBottomScreenFragment.kt (wallet details bottom sheet fragment in SelectAppFragment.)
│ ├── vult
│ │ ├── FilesAdapter.kt (Recycler view adapter for displaying uploaded files in VultFragment. )
│ │ ├── VultFragment.kt (Vult Fragment for creating, managing allocations and uploading, downloading files )
│ │ └── VultViewModel.kt (Handles data sources and core api methods for file upload, download and allocation creation.)
│ └── ZusExampleApplication.kt (Application class for initializing static libraries. )
└── utils
├── Utils.kt (Utility methods and members.)
└── ZcnSDK.kt (Core sdk wrapped methods for read pool lock, write pool lock and faucet txns. )ko
manifests Folder
The manifest folder contains .xml file related to your android application. .xml file contains your application metadata, packages for Kotlin file, and other application components.
java folder
The java folder contains all the source code (libraries,test files). If we create any new project by default the class file MainActivity.kt file with empty implementations will create automatically under the package name. For example see the “org.zus.bolt.helloworld” Main Activity in the screenshot below.
assets Folder
assets folder contain config.json which provides storage network configuration.
Resource (res) folder
The resource folder contains images, XML layouts, and UI strings for the android application.
Gradle Scripts folder
Gradle means automated build system and it contains a number of files that are used to define a build configuration that can be applied to all modules in our application. In build.gradle (Project) there are buildscripts and in build.gradle (Module) plugins and implementations are used to build configurations that can be applied to all our application modules.