Want to become an Android developer or start your journey with Android development but have not started yet?
Let me help you create your first Android app to kick off your Android journey.
Work with me to the end of the thread 🧵🧵
First, download Android Studio on your PC through this link and complete the setup and wait for all indexing and initial build to finish (might take time so keep patience) developer.android.com/studio
🔸Click on create new Project
🔸Select Empty Activity
🔸Click on next
🔸Give a name to your app. We are going to create a simple converter app so naming it MyConverter
🔸Select the package name, project location, and minimum SDK
🔸Click on Finish
🔸Wait for Gradle build and indexing to finish
Ok, we will test our app on our own mobile phone.
For that, you need to enable USB debugging on your phone.
🔸Open settings
🔸Select the About Phone/System
🔸Go to the build number/build version and tap on it 7 times.
🔸You are now a developer
🔸Return to the previous screen and tap on developer options
🔸In the Developer options window, scroll down to find and enable USB debugging.
🔸Connect your PC with your mobile phone through USB (select file transfer mode)
You could now see your device listed at top of your Android studio screen as this -
Click on the Run app (green one at the top near your device name) to install your app on your device.
Your app gets downloaded and hello world screen appears on your screen now. Your app is successfully visible on your device now.
This is how it looks-
Now we will start the process of creating your first Android app
Go to activity_main.xml and you could see three things -
-Code tab
-Split tab
-Design tab
🔸In the design tab, right-click on hello world and click delete to clear the layout
🔸 You can see the palette on the left. Search for "Plain Text" and drag it to the screen
🔸Also search for "Text View" and drag it to the screen
🔸Also search for "Button" and drag it to the screen
You might have created up to this
🔸Constraint these views horizontally and vertically in the screen as you want
🔸Now we will add attributes to these views
🔸Click on any view on the Component Tree visible in the left and click on "Attributes" in the right
Like this -
Now give the following attributes for the first view (EditText) -
🔸id - inputField
🔸layout_width - 275dp
🔸layout_height - wrap_content
🔸text - none (remove name from it)
🔸hint - Enter kg value
🔸inputType - number
The XML (from the design tab) for this looks like this -
Now give the following attributes for the second view (TextView) -
🔸id - gramValue
🔸layout_width - wrap_content
🔸layout_height - wrap_content
🔸text - none (remove TextView from it)
🔸textSize - 16sp
The XML (from the design tab) for this looks like this -
Now give the following attributes for the third view (Button) -
🔸id - submit
🔸text - Submit
The XML (from the design tab) for this looks like this -
Now the frontend for our app i.e design has been done. Now we will write some java code for the app to function.
First, we need to bring all our views in our Java file.
For this, we create variables of view and use findViewById
Look at the following code -
Now we set action on click on submit button. We also check whether the input field is empty or not.
To convert kg into grams multiply that by 1000
Set this grams value as text to the second view (TextView)
The code looks like this -
Now you can run the application and check this.
This is what you have made -
Hurray
You have successfully made your first app. Now you can edit this app according to your needs and start making many other apps.
📌Blockchain
Blockchain is a distributed decentralized network that provides immutability, privacy, security, and transparency. There is no central authority present to validate and verify the transactions.
Hence we require some consensus protocol.
📌What does consensus means?
A general agreement that is accepted by all people in a group.
In Blockchain, consensus refers to that all nodes in the network reach a particular agreement about the blocks in the blockchain
🎵Music
Your unique musical artwork can be sold in the form of NFT to anyone. The owner has the right to determine how the composition is used.
🎮Gaming
NFTs have the best use case in the gaming world. Unique characters or avatars or items in the game can be bought and sold using NFTs. Example - purchasing weapons for the game via an NFT marketplace to play in the game.
Most of the apps today run on centralized networks i.e they are controlled by a single authority. For example, social media networks, banks, and streaming services hold all of our data on centralized servers.
When you access any of these apps, a request is sent to the server and you gets a response back. Suppose you entered your credentials details to login into that system as a request and the response comes in form of access to the website or not(in case of invalid credentials).
Defi stands for 'Decentralized finance'. It refers to financial applications built on blockchain technology that enable digital transactions between multiple parties.
Before diving into it further, let us first understand centralized or traditional finance.
📌Example scenario
Suppose a person named Luv has some money and he wants to earn interest on that money. What will he do?
You are right!
He will deposit it in any bank and earn interest on that.
Imagine that you and your friend physically far apart attending a 'Justin Bieber' concert 'virtually' with thousands of fans from across the globe together.
No, I don’t mean being part of an online concert of the like we have all attended in the pandemic times.
I am talking of virtual concerts in the Metaverse, which will be much more immersive than listening to a live video.
How do these events take place?
The event organizers can imagine how the concert would look…they will transport you to a beach, the moon, or some fantasy world.