Mobile Application Development Micro project
Mobile Application Development Micro project
(Year: 2024-2025)
Micro Project
Semester: Sixth
1
Mahavir Polytechnic
Vision
We strive to educate students to become industry ready engineers having professional attitude and
groomed personality.
Mission
M1. To provides well defined system to ensure quality education by strengthening teaching learning
processes through innovative practices.
M2. To provides a platform where students are exposed to the industry, up bridged with the industry
standards and requirements.
IT Department
VISION
IT Department strives to educate students to become Industry ready Engineers having Professional
attitude and groomed personality.
MISSION
M1. To provides well defined system to ensure quality education by strengthening teaching learning
processes through innovative practices.
M2. To provides a platform where students are exposed to the industry, up bridged with the industry
standards and requirements.
2
PART A
1.0 Brief Introduction:
A News Application is a mobile platform that provides users with access to the latest news and updates
from various sources. The app aggregates news articles, headlines, and breaking stories on topics such
as politics, sports, technology, entertainment, and more. This project focuses on developing a
functional prototype of a News App that allows users to customize their feed, search for articles, and
stay informed.
The application will be designed to be user-friendly, fast, and efficient, ensuring users receive real-
time updates in an organized and visually appealing format.
To design and develop a News Application that delivers real-time news updates, categorizes news by
topics, and offers a personalized user experience.
Benefits:
1. Real-Time Information:
2. Personalization:
3. Skill Development:
4. Career Readiness:
3
MICRO PROJECT
Progress Report / Weekly Report
Week Duration Sign of the
Date Work / Activity Performed
No in Hrs. Faculty
5 1 Presentation
6 1 Correction on project
7 4 Report of micro-project
8 1 Submission of report
5.0ResourcesRequired
NameOf
Sr. No Specifications Quantity Remarks
Resource/Material
Computer processor(i3-i5)
3 Computer system 1 -
RAM 8 GB
4
REPORT
1.0 Rationale
In the digital era, staying updated with the latest news is crucial. Traditional methods like newspapers
and TV broadcasts are increasingly being replaced by digital platforms. This project aims to provide an
accessible, personalized, and fast way for users to consume news through a mobile application.
The rationale for developing a News App is to combine real-time updates with a customizable user
experience, helping users stay informed about topics of interest in a convenient format.
Aims:
To develop a functional prototype of a News Application that provides real-time updates, topic
categorization, and search functionality to enhance user engagement and accessibility.
Benefits:
1. Convenience: Offers users easy access to news updates on their mobile devices.
2. Customizability: Enables users to personalize their feed by selecting categories of interest.
3. Efficiency: Saves time by aggregating news from multiple sources in one platform.
4. Learning Opportunity: Equips students with practical experience in mobile app development.
• Planning
• Research
• Study
• Design
• Development
• Testing
5
Uses of the News Application:
• Serves as a platform for users to explore news across various categories (e.g., politics, sports,
entertainment).
• Acts as an educational tool for students to stay informed about global events.
Advantages: -
Disadvantages: -
6
6.0Actual Resources Used: -
NameOf
Sr. No Specifications Quantity Remarks
Resource/Material
Computer processor(i3-i5)
3 Computer system 1 -
RAM 8GB
7.0 PROGRAM:
Main Activity.kt
package com.example.news24
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.view.View
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.RecyclerView
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import com.example.news24.adapter.NewsAdapter
import com.example.news24.model.News
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import org.json.JSONObject
import java.net.HttpURLConnection
import java.net.URL
import java.text.SimpleDateFormat
import java.util.*
class MainActivity : AppCompatActivity() {
private lateinit var newsAdapter: NewsAdapter
private lateinit var swipeRefresh: SwipeRefreshLayout
private val newsApiKey = "8ffd2d3c56ab4bb1aba395072c385350"
private val CONNECTION_TIMEOUT = 15000 // 15 seconds timeout
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
swipeRefresh = findViewById(R.id.swipeRefresh)
val recyclerView = findViewById<RecyclerView>(R.id.newsRecyclerView)
newsAdapter = NewsAdapter { news ->
// Open news article in browser
7
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(news.url))
startActivity(intent)
}
recyclerView.adapter = newsAdapter
swipeRefresh.setOnRefreshListener {
fetchNews()
}
fetchNews()
}
private fun fetchNews() {
swipeRefresh.isRefreshing = true
CoroutineScope(Dispatchers.IO).launch {
try {
// Using everything endpoint with proper query parameters
val url =
URL("https://newsapi.org/v2/everything?q=maharashtra&language=en&sortBy=publishedAt&apiKey
=$newsApiKey")
val connection = url.openConnection() as HttpURLConnection
if (jsonObject.getString("status") == "ok") {
val articles = jsonObject.getJSONArray("articles")
val newsList = mutableListOf<News>()
8
imageUrl = article.getString("urlToImage") ?: "",
source = article.getJSONObject("source").getString("name"),
publishedAt = formatDate(article.getString("publishedAt")),
url = article.getString("url")
)
newsList.add(news)
}
withContext(Dispatchers.Main) {
if (newsList.isEmpty()) {
Toast.makeText(this@MainActivity, "No Maharashtra news found at the moment",
Toast.LENGTH_LONG).show()
} else {
newsAdapter.updateNews(newsList)
}
swipeRefresh.isRefreshing = false
}
} else {
withContext(Dispatchers.Main) {
val errorMessage = jsonObject.optString("message", "Unknown error occurred")
Toast.makeText(this@MainActivity, "Error: $errorMessage", Toast.LENGTH_LONG).show()
swipeRefresh.isRefreshing = false
}
}
} catch (e: Exception) {
withContext(Dispatchers.Main) {
val errorMessage = when (e) {
is java.net.UnknownHostException -> "No internet connection. Please check your network."
is java.net.SocketTimeoutException -> "Server is not responding. Please try again later."
is java.net.ConnectException -> "Could not connect to server. Please check your internet connection."
else -> "Error: ${e.message}"
}
Toast.makeText(this@MainActivity, errorMessage, Toast.LENGTH_LONG).show()
swipeRefresh.isRefreshing = false
}
}}}
private fun formatDate(dateString: String): String {
return try {
val inputFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.getDefault())
val outputFormat = SimpleDateFormat("MMM dd, yyyy HH:mm", Locale.getDefault())
val date = inputFormat.parse(dateString)
outputFormat.format(date!!)
} catch (e: Exception) {
dateString
}
}
}
9
New Adapter.kt
package com.example.news24.adapter
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import com.example.news24.R
import com.example.news24.model.News
class NewsAdapter(private val onItemClick: (News) -> Unit) :
RecyclerView.Adapter<NewsAdapter.NewsViewHolder>() {
private var newsList = listOf<News>()
fun updateNews(news: List<News>) {
newsList = news
notifyDataSetChanged()
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): NewsViewHolder {
val view = LayoutInflater.from(parent.context)
.inflate(R.layout.item_news, parent, false)
return NewsViewHolder(view)
}
Glide.with(itemView.context)
.load(news.imageUrl)
.placeholder(R.drawable.placeholder_image)
.into(imageView)
itemView.setOnClickListener { onItemClick(news) }
}
}
10
Gradle Properties
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. For more details, visit
# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
libs.version
[versions]
agp = "8.9.1"
kotlin = "2.0.21"
coreKtx = "1.15.0"
junit = "4.13.2"
junitVersion = "1.2.1"
espressoCore = "3.6.1"
appcompat = "1.7.0"
material = "1.12.0"
activity = "1.10.1"
constraintlayout = "2.2.1"
[libraries]
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
junit = { group = "junit", name = "junit", version.ref = "junit" }
androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref =
"espressoCore" }
androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref =
"appcompat" }
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
androidx-activity = { group = "androidx.activity", name = "activity", version.ref = "activity" }
androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout",
version.ref = "constraintlayout" }
[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
11
AnroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET"/>
<application android:allowBackup="true" android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules" android:icon="@drawable/ic_launcher"
android:label="@string/app_name" android:roundIcon="@drawable/ic_launcher"
android:supportsRtl="true" android:theme="@style/Theme.News24" tools:targetApi="31">
<activity android:name=".MainActivity" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
Acitivity_main XMl
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/swipeRefresh"
android:layout_width="match_parent" android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView android:id="@+id/newsRecyclerView"
android:layout_width="match_parent" android:layout_height="match_parent"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"/>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
Item_news..xml
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_margin="8dp" app:cardCornerRadius="8dp"
app:cardElevation="4dp">
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"
android:orientation="vertical" android:padding="8dp">
<ImageView android:id="@+id/newsImage" android:layout_width="match_parent"
android:layout_height="200dp" android:scaleType="centerCrop"/>
<TextView android:id="@+id/newsTitle" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_marginTop="8dp" android:textSize="18sp"
android:textStyle="bold"/>
<TextView android:id="@+id/newsDescription" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_marginTop="4dp" android:maxLines="3"
android:ellipsize="end"/>
<TextView android:id="@+id/newsSource" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_marginTop="4dp" android:textStyle="italic"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
12
OUTPUT:
13
14
8.0 Skill Developed / Learning outcome:-
1. Technical Expertise: Learned to use APIs and frameworks for mobile app development.
2. UI/UX Design: Gained knowledge in creating intuitive and user-friendly interfaces.
3. Problem-Solving: Developed debugging and error-solving skills during app testing.
4. Collaboration: Worked as part of a team, improving communication and teamwork skills.
5. Industry Relevance: Acquired practical skills that align with current industry demands
9.0 Applications:
15
Teacher Evaluation Sheet for Micro Project
RubricsforAssessmentofMicro-Project
1. Relevance to course
2. Literature survey
3. Project proposal
4. Completion of target
Analysis &
5.
representation of data
Quality of
6.
Prototype/Model
7. Report preparation
8. Presentation
9. Defense
Marks:-
16
Maharashtra State Board of Technical Education, Mumbai
CERTIFICATE
This is to certify that Mr /Ms Leena Dinesh Patil Roll No. 33 of 6th Semester of Diploma in
Information Technology of Mahavir Polytechnic has completed the Micro Project satisfactorily
in course MAD (22617)for the academic year 2024 -2025 as prescribed in the curriculum.
Institute Seal
17