Skip to content

Kotlin and XML codes from basic for Android app development

License

Notifications You must be signed in to change notification settings

iamvikramkumar/Fundamentals-of-Android

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fundamentals-of-Android

Kotlin and XML codes from basic for Android app development

Topics :


1. Hello World App:

App to display Hello World on screen.

  • TextView
  • TextColor
  • Background Color
  • TextStyle
  • TextSize

XML Code

Kotlin Code

Output Screenshot


2. TextViews and Submit Button App:

App to display Text and a button to show Toast message on screen.

  • TextView
  • TextColor
  • Background Color
  • Button

XML Code

Kotlin Code

Output Screenshot


3. Simple Addition Calculator App:

App to add two numbers and show the result on screen.

  • EditText
  • TextView
  • Button

XML Code

Kotlin Code

Output Screenshot


4. Simple Addition, Subtraction, Multiplication & Division Calculator App:

App that can add, subtract, multipy & divide two numbers and show the result on screen.

  • EditText
  • TextView
  • Button
  • Toast Message

XML Code

Kotlin Code

Output Screenshot


5. Simple Form App:

App that takes different inputs from user and show it on the screen.

  • EditText
  • TextView
  • Button

XML Code

Kotlin Code

Output Screenshot


6. Android Activity Lifecycle:

shows Logs in Logcat section about start, stop, pause, resume etc.

  • Override Methods

XML Code

Kotlin Code

Output Screenshot


7. Radio-Button Implementation:

App having radioButtons that shows the text of selected option when submit button clicked.

  • RadioGroup
  • RadioButton
  • OnClickListener

XML Code

Kotlin Code

Output Screenshot


8. Grid-Layout Implementation:

App having Image-Button in the form of grid shows Toast message on clicking.

  • GridLayout
  • ImageButton
  • Toast Message

XML Code

Kotlin Code

Output Screenshot


9. Simple Calculator App:

App that can do basic mathematics operations like add, Sub, Multiplication, division, Percentage, etc. having phone calculator like UI.

  • EditText
  • TextView
  • Button
  • epx4j library to solve expressions
  • append() function

XML Code

Kotlin Code

Output Screenshot


10. CheckBox Example App:

App with multiple checkBox items which shows text of selected Box in toast message when pressed submit button.

  • CheckBox
  • Button
  • append() function
  • Toast

XML Code

Kotlin Code

Output Screenshot


11. ListView Example App:

App with multiple items in ListView which changes background Color when clicked on listView item.

  • ListView
  • arrayAdapter

XML Code

Kotlin Code

Output Screenshot


12. Drop-Down Example App:

Form app with a drop-down (Spinner) options.

  • EditText
  • Spinner
  • Adapter

XML Code

Kotlin Code

Output Screenshot


13. Explicit Intent Example App:

Form app with two activity which take user input in one activity and display on another using Intent.

  • Intent
  • EditText
  • Spinner
  • Adapter

XML Code for 1'st activity

XML Code for 2'nd activity

Kotlin Code for 1'st activity

Kotlin Code for 2'nd activity

Output Screenshot


14. Image Button Example App:

App having 3 imageButton which shows Toast message when clicked on them.

  • ImageButton
  • Toast

XML Code

Kotlin Code

Output Screenshot


15. Food order Example App:

Dummy Food order app with three activity in which user have to choose an item from the list in 1'st activity, fill details in 2'nd activity and it will display values on last activity.

  • Views
    • Custom ListView
    • ScrollView
    • CardView
  • Layouts
    • Relative Layout
    • Constraint Layout
    • Linear Layout
    • Grid Layout
  • Intent
  • Spinner
  • Adapter

XML Codes Kotlin Codes Output
1'st activity 1'st activity
2'nd activity 2'nd activity Output Screenshot
3'rd activity 3'rd activity
Custom List item design

16. Dynamic View Example App:

App with a Dynamic button which create new View-Group when clicked on it.

  • Linear Layout
  • LayoutParams
  • Button

XML Code

Kotlin Code

Output Screenshot


17. SnackBar Example App:

App with a button which generate a snackBar(with action) when clicked on it, And when clicked on Snackbar button it shows some text on screen.

  • SnackBar
  • Button

XML Code

Kotlin Code

Output Screenshot


18. Implicit Example App:

App with a set of buttons for: navigating any url and opening camera, call logs, contacts, gallery & dialler using Intent.

  • Intent
  • Button
  • EditText

XML Code

Kotlin Code

Output Screenshot


19. Intent Data Transfer:

App with a couple of editText, having some operations(+,-,*,/) in form of radioButton. After giving inputs and clicking on Compute Button it transfer data & shows result on another activity using intent.

  • Intent
  • Button
  • EditText
  • RadioButton
  • RadioGroup
XML Codes Kotlin Codes Output
1'st activity 1'st activity
2'nd activity 2'nd activity Output Screenshot

20. App-Choser :

App with a couple of buttons to open map with a default location and open provided link in default browser using implicit intent.

  • Implicit Intent
  • Button

XML Code

Kotlin Code

Output Screenshot


21. Alert-Dialog box Example App:

App with a button which shows alert dialog box when clicked on it.

  • AlertDialog
  • Button
  • Toast

XML Code

Kotlin Code

Output Screenshot


22. Custom Alert-Dialog box Example App:

App with a set of button which shows different type of alert dialog box when clicked on it.

  • AlertDialog
  • Button
  • Toast
  • EditText
  • CheckBox

XML Code

Kotlin Code

Output Screenshot


23. Camera-Picture App:

App which is used to take picture on own app using camera and display it in ImageView.

  • Implicit Intent
  • Button
  • Toast

For permission, in manifest file add this line:

<uses-permission android:name="android.permission.CAMERA" />

XML Code

Kotlin Code

Output Screenshot


24. Action-Bar Example App:

App with a action bar having menu items and a button which shows Toast message when clicked on it.

  • Action Bar
  • menu(res folder)
  • Toast
  • menu item

To make menu file, right click on res folder and select New -> Android Resource Directory. Then select menu folder and click on OK. Then right click on menu folder and select New -> Menu Resource File. Then give name to menu file and click on OK.

Menu file

XML Code

Kotlin Code

Output Screenshot


25. Contact-list Example App:

App with a floating action button which shows an alert dialog box when clicked on it. In alert dialog box user can add contact details and it will be displayed in list view. User can also update and delete contact details.

  • Floating Action Button
  • AlertDialog
  • ListView
  • menu(res folder)
  • Toast
  • menu item

To make contact_menu file, right click on res folder and select New -> Android Resource Directory. Then select menu folder and click on OK. Then right click on menu folder and select New -> Menu Resource File. Then give name to menu file and click on OK.

Menu file

XML Code

Kotlin Code

Output Screenshot


26. Option-Menu Example App:

App with a option menu having menu items and shows toast message when clicked on it.

  • Option Menu
  • menu(res folder)
  • Toast
  • menu item

To make option_menu file, right click on res folder and select New -> Android Resource Directory. Then select menu folder and click on OK. Then right click on menu folder and select New -> Menu Resource File. Then give name to menu file and click on OK.

Menu file

XML Code

Kotlin Code

Output Screenshot


27. Popup-Menu Example App:

App with a button which shows popup menu when clicked on it. It shows toast message when clicked on any menu item.

  • Popup Menu
  • menu(res folder)
  • Toast
  • menu item

To make popup_menu file, right click on res folder and select New -> Android Resource Directory. Then select menu folder and click on OK. Then right click on menu folder and select New -> Menu Resource File. Then give name to menu file and click on OK.

Menu file

XML Code

Kotlin Code

Output Screenshot

About

Kotlin and XML codes from basic for Android app development

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 100.0%