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

15 Sep
Writing your first Java program??

🔸How to compile and run it
🔸What does "Public Static Void Main" mean

A thread🧵
(1/11)
A simple Java program
(2/11)
How to save a Java program?

The program name must be saved as the class name in which the main function is declared.
Extension -> .java
Example here: First.java
Read 14 tweets
13 Sep
Some real-world examples of the Data structure "Stack"👇

A thread🧵
Stack is a LIFO (Last In First Out) data structure.
🔸A pile of books is an example of a stack. The last book kept on the pile will be removed first i.e LAST IN FIRST OUT (LIFO) data structure Image
Read 16 tweets
12 Sep
The output of this code is:
Finalise
Main1
Main2

One fact about garbage collector is that it will call finalize() method on a particular object exactly one time.
After making m1 = null m1 becomes eligible for garbage collection. So when we call garbage collector the first time, Garbage Collector will call finalize() method on m1 before destroying it.
The finalize method will print "Finalise" here but in finalize method we are again referencing the same object by m which makes it no longer eligible for garbage collection. Hence the garbage collector will not destroy the object.
Read 4 tweets
11 Sep
Some real-world examples of the Data structure "Linked List" 👇

A thread 🧵
🔸Train is an example of a linked list as it is made up of a collection of railroad cars where each car is connected to the car in front of it.
🔸A chain is an example of a linked list as it is connected in a linked list fashion. Each link is connected with the next one.
Read 16 tweets
9 Sep
Confused about implementing data structures in real problems?

See some real-world examples of the Data structure "Array" today 👇

A thread 🧵 Image
🔸A parking lot is an example of an array with each index of the array storing whether a car is present or not. Or it may be used for some other functionality. Image
🔸Phone contacts stored in a sorted array Image
Read 19 tweets
5 Sep
8 Google extensions every developer must use

A thread 🧵🧵
🔹Eye Dropper - Allows us to pick a color from any point in your browser and also contains our color history
chrome.google.com/webstore/detai…
🔹Json Formatter - To make JSON files and text on the web easy to read
chrome.google.com/webstore/detai…
Read 12 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

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

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(