Mad Micro123
Mad Micro123
ON
Develop a Android Application by using Intent
SUMITTED IN PARTIAL FULFILLMENT OF THE
REQUIREM5ENT FOR THE AWARD OF
DIPLOMA IN COMPUTER ENGINEERING
SUBMITTED TO
MAHARASHTRA STATE BOARD OF TECHNICAL
EDUCATION, MUMBAI
SUBMITTED BY
CertifiCate
This is to certify that the project report entitled “ Develop an android application by using Intent
” was successfully completed by student of Six semester Diploma in Computer Engineering.
In partial fulfillment of the requirement for the award of the Diploma in Computer Engineering
and submitted to the Department of JD College of Engineering and Management (DIPLOMA),
Nagpur work carried out during a period for the academic year 2023-2024 as per curriculum.
Marks:-
Mark Marks
for obtained by the Total
Roll Name of student group individual marks
no. Remarks
work based on viva (10)
(06) (04)
09
PRIYANSHU JAMBHULKAR
10
ANKIT DAMODHAR BODKHE
11
ANIRUDDHA BABAN SHENDRE
12
NEHA LAHU TIBUDE
03
KRUTIKA YOGIRAJ SHENDE
1. Introduction 1
2. Problem Statement 2
3. Modules 3
4. Proposed Methodology 4
4.1 Method Used 6
4.2 Hardware Requirement 7
4.3
Software Requirement 7
5. Program Code 8
6. Result Analysis 13
7. Application 17
8. Conclusion 18
9. References 19
INTRODUCTION
An intent is a messaging object used to request any action from another app component.
Intents facilitate communication between different components in several ways. The intent is used
to launch an activity, start the services, broadcast receivers, display a web page, dial a phone call,
send messages from one activity to another activity.
Type of intent
1. Explicit Intent:
When you explicitly define which Android component should be opened
on some user action, then you use explicit intents. You generally use an explicit intent to start a
new component in your own app, because you know which exact activity or service you want to
start.
For example, you can start a new activity in response to a user action or start a service to download
a file in the background.
2. Implicit Intent:
When you just have to tell what action you want to perform without
worrying which component will perform it, then you can use implicit intent. Implicit intents do
not name a specific component to perform a particular action, but instead it declares a general
action to be performed, which allows any component, even from another app to handle it.
For example, if you want to show a specific location of the user on a map, you can use an implicit
intent to pass the coordinates through the intent and then any other app, which is capable of
showing the coordinates on a map will accept that intent.
1
PROBLEM STATEMENT
If you choose not to use implicit and explicit intents in your mobile application, it would
significantly impact the user experience and the functionality of the app navigating between app
components becomes challenging, hindering user exploration. Lack of implicit intents restricts
interaction with external apps and services, reducing user engagement.
1. Limited Interaction: Without explicit intents, you lose the ability to navigate between
different components of your app, such as activities or fragments. This restricts the user's
ability to explore various features and functionalities within the app.
2. Isolated Functionality: Without implicit intents, your app cannot interact with external
applications or system functionalities. Users won't be able to share content from your app
to social media platforms, open links in a web browser, or utilize other apps' features within
your app.
3. Reduced User Engagement: Implicit and explicit intents play a crucial role in enhancing
user engagement by providing seamless navigation and integration with external services.
Without these intents, users may find it cumbersome to perform basic actions like sharing
content or accessing external resources.
4. Less Flexibility for Developers: Developers would have to rely on alternative, often more
complex methods to achieve the same functionality that implicit and explicit intents
provide. This could lead to longer development times, increased complexity in code, and
higher maintenance costs.
2
MODULES
1. Set Up Your Development Environment: Install Android Studio, which is the official
IDE for Android development. Ensure you have the necessary SDKs and tools installed.
2. Create a New Project: Start a new Android Studio project and choose a template that suits
your application's requirements.
3. Design Your User Interface (UI): Use XML layout files to design the UI of your
application. You can use tools like Android Studio's layout editor to visually design your
app's UI.
4. Define Activities: Activities represent the different screens in your application. Define the
activities you'll need for your app and specify their layout and behavior.
6. Handle Intents: Implement intent filters and handle incoming intents in your activities or
services. This allows your app to respond to intents sent by other components or apps.
7. Test Your Application: Test your application thoroughly to ensure that it works as
expected and handles intents correctly. Use Android emulators and physical devices for
testing.
8. Optimize and Debug: Optimize your application for performance and debug any issues
that you encounter during testing.
9. Deploy Your Application: Once your application is ready, you can deploy it to the Google
Play Store or distribute it through other channels.
3
PROPOSED METHODOLOGY
1. Requirement Analysis:
Define the purpose and goals of your mobile application.
Identify the target audience and their needs.
Gather requirements through user interviews, surveys, and market research.
3. Design:
Design the user interface (UI) based on the wireframes.
Follow Material Design guidelines (for Android) or Human Interface Guidelines (for iOS)
for a consistent and intuitive UI.
Design the architecture of your app, including activities, services, and intent filters.
Define the data model and decide how data will be stored and accessed.
4. Development:
Implement the UI using XML layout files and Java/Kotlin code.
Implement the various components of your app such as activities, services, and broadcast
receivers.
Use intents to enable communication between different components of your app.
Handle incoming intents and data passed through intents appropriately.
5. Testing:
Perform unit testing to ensure individual components of your app work as expected.
Conduct integration testing to verify that components interact correctly via intents.
Test the app on different devices and screen sizes to ensure compatibility.
Perform usability testing to gather feedback from real users and refine the user experience.
Test edge cases and handle exceptions gracefully.
6. Deployment:
Prepare your app for deployment by optimizing performance and fixing any bugs or issues.
Sign your app with a digital certificate for security.
4
Publish your app to the Google Play Store (for Android) or Apple App Store (for iOS).
Promote your app through various channels to reach your target audience.
5
METHOD USED
1. Explicit Intent: This type of Intent is used to start a specific component within your
application, such as starting a new activity. You specify the component's class name
explicitly.
2. Implicit Intent: An implicit Intent is used to request functionality from other components
on the device, such as opening a web page, sending an email, or making a phone call. You
specify the action to be performed, and the system determines the appropriate component
to handle it.
3. Passing Data with Intents: You can also use Intents to pass data between components. For
example, passing data from one activity to another activity.
4. Starting Activities for Result: You can start an activity and receive a result back from it,
which can be useful for scenarios like getting user input or selecting an item from a list.
5. Broadcast Intents: Intents can also be used to send broadcasts within your application or
to other apps, allowing communication between different parts of the system.
These are just some of the methods commonly used when working with Intents in Android
development. Each method serves different purposes and adds versatility to your application's
functionality.
6
HARDWARE REQUIREMENTS
SOFTWARE REQUIREMENTS
Language : Java
7
PROGRAM CODE
Activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Implicit intent"
android:id="@+id/implicit"
android:layout_above="@+id/explicit"
android:layout_centerInParent="true"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Explicit intent"
android:id="@+id/explicit"
android:layout_centerInParent="true"/>
</RelativeLayout>
8
secondActivity_layout.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Implicit intent"
android:id="@+id/implicit"
android:layout_above="@+id/explicit"
android:layout_centerInParent="true"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Explicit intent"
android:id="@+id/explicit"
android:layout_centerInParent="true"/>
</RelativeLayout>
9
SecondActivity.java
package com.example.explicit_intent;
import android.app.ActionBar;
import android.os.Bundle;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
@Override
super.onCreate(savedInstanceState);
setContentView(R.layout.secondactivity_layout);
MainActivity.java
package com.example.explicit_intent;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
@Override
10
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
implicit.setOnClickListener(new View.OnClickListener() {
@Override
implicit.setData(Uri.parse("https://www.geeksforgeeks.org/"));
startActivity(implicit);
});
explicit.setOnClickListener(new View.OnClickListener() {
@Override
startActivity(explicit);
});
11
AndroidMenifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Explicit_Intent"
tools:targetApi="31">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
</intent-filter>
</activity>
<activity android:name=".SecondActivity">
</activity>
</application> </manifest>
12
RESULT ANALYSIS
Implicit:
This interface represents how an intent is used when starting an activity. When the Intent object
names a specific activity component implicitly, the system immediately starts that component.
13
Fig 2 :- Implicit Second Action
When you use an implicit intent, the Android system finds the appropriate component to start by
comparing the contents of the intent to the intent filters declared in the manifest file of other apps
on the device. If the intent matches an intent filter, the system starts that component and delivers
it the Intent object.
14
Explicit:
This interface shows Android Explicit intent specifies the component to be invoked from activity.
In other words, we can call another activity in android by explicit intent. We can also pass the
information from one activity to another using explicit intent.
15
Fig 4 :- Explicit’s Second Activity
In the above example, there are two activities (FirstActivity, and SecondActivity). When you click
on the ‘GO TO OTHER ACTIVITY’ button in the first activity, then you move to the second
activity. When you click on the ‘GO TO HOME ACTIVITY’ button in the second activity, then
you move to the first activity. This is getting done through Explicit Intent.
16
APPLICATIONS
Tracks user activities such as steps taken, calories burned, and workout sessions.
Utilizes explicit Intents to start different activities like a timer for workouts or a map for
tracking running routes.
Includes features for setting fitness goals, viewing progress charts, and sharing achievements
with friends.
These applications demonstrate the versatility of Intents in Android development, from sharing
content to integrating location-based services and enhancing user interaction across different
activities within the app.
17
CONCLUSION
In conclusion, developing an Android application utilizing intents offers a versatile and powerful
approach to enhance user experience and interactivity within the app. Intents serve as the bridge
between different components of an application, facilitating seamless communication and data
exchange between activities, services, and even between different applications.
By leveraging intents effectively, developers can enable various functionalities such as launching
activities, passing data between screens, invoking system services, and interacting with external
applications. This flexibility not only enhances the overall functionality of the application but also
contributes to a more intuitive and engaging user interface.
18
REFRENCES
[1] Email client application with rabbit algorithm for Android smart phone Muhammad
Anwari Leksono; Rinaldi Munir2012 7th International Conference on Telecommunication
Systems, Services, and Applications (TSSA)
[3] Tiltle of book:- Android Programming for Biginners, author:- Hortan,John, Publication:-
Packet Publication,2015,IBSN:-978-1-78588-326-2
[4] Title of Book:- Android , author:-Dixit, Prasanna Kumar, Publication:- Vikas Publications,
New Delhi 2014, IBSN: 9789325977884
19