I will keep the code simple and let's jump into the coding part.

Setting up build.gradle(Module: app) file

Add the following code in your file.

repositories {
maven { url "https://jitpack.io" }
}
dependencies {
//...
//...
implementation 'com.github.PhilJay:MPAndroidChart:v2.2.4'
}

Building activity_main.xml file

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="16dp"
android:paddingTop="16dp"
android:paddingRight="16dp"
android:paddingBottom="16dp"
tools:context="Android.in.barchart.MainActivity"
>

<com.github.mikephil.charting.charts.BarChart
android:id="@+id/barchart"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>

</RelativeLayout>

Coding MainActivity.java file

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.github.mikephil.charting.charts.BarChart;
import com.github.mikephil.charting.data.BarData;
import com.github.mikephil.charting.data.BarDataSet;
import com.github.mikephil.charting.data.BarEntry;
import com.github.mikephil.charting.utils.ColorTemplate;

import java.util.ArrayList;

public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState)…


In this post, we will discuss more on Mining and Consensus protocol.

Let's get started with Mining.

4. Mining

Here we will discuss what mining is. What is the competition that everybody is participating in mining? why there are so many resources allocated to mining.

Let’s consider this block.


Blockchain concept initially came from these two people Stuart Haber and W.Scott Stornetta. They didn’t introduce the term blockchain which came much later after the original paper by Satoshi Nakamoto but these two gentlemen wanted to implement a system where document timestamps could not be tampered with. In 1991 they published a paper called How to Time-Stamp a Digital Document and the paper includes the concepts what we now call the Blockchain and all or most of the features and ideas behind the notion actually were presented in that paper.

The Blockchain is a type of distributed ledger for maintaining…


Anyone finding difficulty in using constructor on version above 0.5.0+

This is the code:

//The version I have used is 0.5.2

pragma solidity ^0.5.2;

contract Inbox{
string public message;

//Constructor must be defined using “constructor” keyword

//In version 0.5.0 or above it is mandatory to use “memory” keyword so as //to explicitly mention the data location

//you are free to remove the keyword and try for yourself
constructor (string memory initialMessage) public{
message=initialMessage;
}

function setMessage(string memory newMessage)public{
message=newMessage;

}

function getMessage()public view returns(string memory){
return message;
}
}

//For reference you can refer the official solidity website here

Kartik ganiga

Professionally I am a Software Engineer. I Love programming, reading and writing about Technical articles.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store