Meet Jain🦅(🛠️,⛓️) Profile picture
Sep 6, 2021 24 tweets 7 min read Read on X
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.

Good luck with your Android journey.
If you liked this, make sure to:

1. Follow me @meetjain74

2. Retweet the first tweet

Thanks so much for getting to the end of the thread! Let me know your thoughts below
As many of you asked for the pdf version of this thread
Here it is
drive.google.com/file/d/1eR_b0G…

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Meet Jain🦅(🛠️,⛓️)

Meet Jain🦅(🛠️,⛓️) Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @meetjain74

Aug 2, 2022
Consensus Mechanism in Blockchain

A thread🧵
📌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
Read 18 tweets
Mar 24, 2022
NFT Use cases

A thread🧵 Image
🎵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.
Read 20 tweets
Feb 25, 2022
What are DApps?

A mega thread🧵
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).
Read 31 tweets
Feb 24, 2022
What is Defi?

A mega thread🧵 Image
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.
Read 92 tweets
Feb 22, 2022
What is the metaverse?

A mega thread🧵
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.
Read 29 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(