Public News App for Real-Time Updates – Public News Droid
Introduction
In today’s fast-paced world, staying updated with real-time news is essential, and Public News Droid is here to serve that very purpose. Designed for your Android device, this application focuses on delivering local news to keep you aware of what’s happening in your community. Built using Android Studio and backed by SQL Server, this app offers both user and admin functionalities for an enhanced news reading experience.
Features
- Localized Coverage: With Public News Droid, you get news that’s relevant to your city.
- User Participation: Not just a passive experience, the app allows users to contribute by adding news updates, complete with a title and a supporting image.
- Admin Moderation: Our backend ensures that only verified and relevant news gets displayed, maintaining the quality and reliability of the content.
- Exclusive Access: Only registered users can view or add news, ensuring a dedicated community of active users.
- Interactive UI: The app supports swipe gestures with smooth transition effects for an engaging news browsing experience.
Advantages
- Real-time Updates: Stay updated minute-to-minute with events that matter to you and your community.
- User Engagement: The app’s interactive design encourages users to participate by contributing news items.
- Ease of Use: The intuitive interface makes it simple for anyone to navigate and stay updated.
Disadvantages
- Internet Dependency: A constant internet connection is required.
- Limited Geographic Scope: The app focuses on local news, thereby restricting access to news from other cities.
- Image Restrictions: Users can upload only one image per news story, which might limit the visual context.
Technical Specifications
- Frontend: Android Studio
- Backend: SQL Server
- Word Limit: News items are restricted to 450 words to keep the content concise.
Conclusion
Public News Droid is more than just another news app; it’s a community-driven platform aimed at keeping you aware and updated. Whether you’re interested in what’s happening in your locality or looking to contribute to the public news sphere, this app is your go-to solution.
Sample Code
MainActivity.java (User Login)
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
public class MainActivity extends Activity {
EditText username, password;
Button login;
DatabaseHelper db;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
db = new DatabaseHelper(this);
username = findViewById(R.id.username);
password = findViewById(R.id.password);
login = findViewById(R.id.loginBtn);
login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String user = username.getText().toString();
String pwd = password.getText().toString();
if (db.checkUser(user, pwd)) {
Intent intent = new Intent(MainActivity.this, NewsActivity.class);
startActivity(intent);
}
}
});
}
}
RegisterActivity.java (User Registration)
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
public class RegisterActivity extends Activity {
EditText username, password;
Button register;
DatabaseHelper db;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register);
db = new DatabaseHelper(this);
username = findViewById(R.id.username);
password = findViewById(R.id.password);
register = findViewById(R.id.registerBtn);
register.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String user = username.getText().toString();
String pwd = password.getText().toString();
db.addUser(user, pwd);
}
});
}
}
NewsActivity.java (News Posting)
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
public class NewsActivity extends Activity {
EditText title, content;
Button postNews;
DatabaseHelper db;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_news);
db = new DatabaseHelper(this);
title = findViewById(R.id.newsTitle);
content = findViewById(R.id.newsContent);
postNews = findViewById(R.id.postBtn);
postNews.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String newsTitle = title.getText().toString();
String newsContent = content.getText().toString();
db.addNews(newsTitle, newsContent);
}
});
}
}
DatabaseHelper.java (SQLite Database)
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
public class DatabaseHelper extends SQLiteOpenHelper {
// Implement SQLite database for storing user and news data.
// addUser and addNews methods would add data to their respective tables.
// checkUser would validate the user credentials for login.
// Add your SQLite queries and tables here
}
In order to download the PDF, You must follow on Youtube. Once done, Click on Submit
Follow On YoutubeSubscribed? Click on Confirm