Skip to content

Latest commit

 

History

History
352 lines (207 loc) · 8.56 KB

developingApp.md

File metadata and controls

352 lines (207 loc) · 8.56 KB


Developing-Android-Apps

Topics :


1. Scroll-View Example App:

App with ScrollView and HorizontalScrollView having a set of buttons inside it.

  • ScrollView
  • HorizontalScrollView
  • Button
  • LinearLayout
  • TextView

XML Code

Kotlin Code

Output Screenshot


2. Tool-Bar Example App:

App with Toolbar having a set of buttons inside it.

  • Toolbar
  • Button
  • RelativeLayout
  • TextView

Firstly, Go to res > values > themes.xml(both files) and change the theme from DarkActionBar to NoActionBar otherwise the app may crash.

Menu file

XML Code

Kotlin Code

Output Screenshot


3. Rating Bar Example App:

App with RatingBar and a submit button which display a toast clicked on it

  • RatingBar
  • Button
  • RelativeLayout
  • TextView

XML Code

Kotlin Code

Output Screenshot


4. Splash Screen Example App:

App with Splash Screen. Splash Screen is a screen which is displayed when the app is launched. It is used to display the logo of the app or some other information for a short period of time.

  • Handler
  • Runnable
  • Intent
  • RelativeLayout

XML Code

Kotlin Code

Output Screenshot


5. Custom-Toast Example App:

App with a button that shows a Custom Toast when click on it. Custom Toast is a toast which is displayed with a custom layout.

  • Toast
  • Button
  • ConstraintLayout

Custom Toast Layout file

XML Code

Kotlin Code

Output Screenshot


6. Progress Bar Example App:

App with a button that shows a Progress Bar when click on it. Progress Bar is a bar which is displayed to show the progress of some task.

  • ProgressBar
  • Button
  • ConstraintLayout

XML Code

Kotlin Code

Output Screenshot


7. Footer Example App:

Footer is also known as Bottom Navigation Bar. It is a bar which is displayed at the bottom of the screen. It is used to navigate between different activities or fragments. In this app, we have a footer with 4 items. When we click on any item, the textView is changed to the name of the item.

  • BottomNavigationView
  • TextView
  • ConstrainLayout
  • Menu

Menu file

XML Code

Kotlin Code

Output Screenshot


8. Alarm Manager Example App:

App with an edit text and a button. When we enter the time in the edit text and click on the button, the alarm is set for that time. When the alarm is triggered, a toast is displayed and the alarm is played. We can cancel the alarm by clicking on the cancel button. We can create a repeating alarm by clicking on the repeating button.

  • AlarmManager
  • PendingIntent
  • BroadcastReceiver
  • Intent
  • EditText
  • Button

Add a ringtone in the raw folder.

Add a permission in the manifest file under the application tag.

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

Add a receiver with the name same as class name of the BroadcastReceiver in the manifest file under the application tag.

<receiver android:name=".AlarmManagerBroadcast" />

XML Code

Kotlin Code

Output Screenshot


9. Job Scheduler Example App:

App with a button that shows a Job Scheduler when click on it. Job Scheduler is a service which is used to perform some task at a specific time. In this app, we have a button which starts the job scheduler. When the job scheduler is triggered, a toast is displayed and the alarm is played. We can cancel the job scheduler by clicking on the stop job button.

  • JobScheduler
  • JobService
  • AlarmManager
  • PendingIntent
  • BroadcastReceiver

Add AlarmManagerBroadcast and all permissions in manifest file from the above example.

Add a service with the name same as class name of the JobService in the manifest file under the application tag.

<service
            android:name=".MyJobService"
            android:exported="true"
            android:permission="android.permission.BIND_JOB_SERVICE" />
            

XML Code

Kotlin Code

Output Screenshot


10. Notification Example App:

App with a button that shows a Notification when click on it. Notification is a message which is displayed outside the app. When the user clicks on the notification, the app is opened and the user is taken to the activity which is specified in the intent and shown the message.

  • Notification
  • NotificationManager
  • NotificationChannel
  • PendingIntent
  • Intent
  • Builder
XML Codes Kotlin Codes Output
1'st activity 1'st activity
2'nd activity 2'nd activity Output Screenshot

11. Static Fragment Example App:

App with two fragments in a single activity. The first fragment is having a set of buttons for sending text, clear text and changing background colour of the second fragment.

  • Fragment
  • FragmentManager
  • FragmentTransaction
  • Button
  • TextView
XML Codes Kotlin Codes Output
Main activity Main activity
1'st fragment 1'st fragment
2'nd fragment 2'nd fragment Output Screenshot
Text Interface
Color Interface

12. Fragment with ListView:

App with two fragments in a single activity. The first fragment is having a list of items. When we click on any item, the second fragment is displayed with the name of the item. It also shows how to pass data from one fragment to another fragment.

  • Fragment
  • FragmentManager
  • ListView
  • Button
  • TextView
XML Codes Kotlin Codes Output
Main activity Main activity
1'st fragment 1'st fragment Output Screenshot
2'nd fragment 2'nd fragment

13. Dynamic Fragment Example App:

App with two fragments. The fragments are displayed depending on the orientation of the device. When the device is in portrait mode, the first fragment is displayed. When the device is in landscape mode, the second fragment is displayed.

  • Fragment
  • FragmentManager
  • FragmentTransaction
  • Orientation
  • Button
  • TextView
XML Codes Kotlin Codes Output
Main activity Main activity
1'st fragment 1'st fragment Output Screenshot
2'nd fragment 2'nd fragment

14. Custom View Example App:

App with a custom view. The activity is having a custom views as a rectange and three arc which is making a fan shape. When user tap on it, then the fan translates which seems like a fan is rotating.

  • CustomView
  • Canvas
  • Paint
  • Path

XML Code

Kotlin Code

CustomView Code

Output Screenshot


15. Simple Drawing App:

App that allows the user to draw on the screen. It has a button to clear the canvas.

  • Canvas
  • Paint
  • Path
  • Button

XML Code

Kotlin Code

CustomView Code

Output Screenshot


16. Date Picker Example App:

App with a date picker. When user selects a date, the date is displayed as a toast message.

  • DatePicker
  • Button
  • Toast

XML Code

Kotlin Code

Output Screenshot


17. Time Picker Example App:

App with a time picker. When user selects a time, the time is displayed as a toast message.

  • TimePicker
  • Button
  • Toast

XML Code

Kotlin Code

Output Screenshot