Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8398919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:10:00+00:00 2026-06-09T21:10:00+00:00

I’m trying to create a Manga app for Android where the each Chapter has

  • 0

I’m trying to create a Manga app for Android where the each Chapter has its own Title,Publication Date, Description, etc. And each of said chapters belongs to a Manga object. Which would be a collection of Chapters and would include a list of the titles plus the Title of the Manga itself and the author(‘s) name(s). The data itself would be parsed from different webpages (but that’s another mater).

My confusion is about the class declarations. (i.e. implements, extends)

Ive tried many things but as of right now my code consists of having chapters as an inner class like so:

public abstract class Manga implements MangaList {
public String name;
public String author;
public int chapters;

// names of the XML tags
static final String CHANNEL = "channel";
static final String PUB_DATE = "pubDate";
static final  String DESCRIPTION = "description";
static final  String LINK = "link";
static final  String TITLE = "title";
static final  String ITEM = "item";

private final URL feedUrl;

protected Manga(String feedUrl){
    try {
        this.feedUrl = new URL(feedUrl);
    } catch (MalformedURLException e) {
        throw new RuntimeException(e);
    }
}

protected InputStream getInputStream() {
    try {
        return feedUrl.openConnection().getInputStream();
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}

List<Chapter> Chapter;

public class Chapter implements Comparable<Chapter> {

    final SimpleDateFormat FORMATTER = 
            new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss Z");
        private String title;
        private URL link;
        private String description;
        private Date date;

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title.trim();
        }
        // getters and setters omitted for brevity 
        public URL getLink() {
            return link;
        }

        public void setLink(String link) {
            try {
                this.link = new URL(link);
            } catch (MalformedURLException e) {
                throw new RuntimeException(e);
            }
        }

        public String getDescription() {
            return description;
        }

        public void setDescription(String description) {
            this.description = description.trim();
        }

        public String getDate() {
            return FORMATTER.format(this.date);
        }

        public void setDate(String date) {
            // pad the date if necessary
            while (!date.endsWith("00")){
                date += "0";
            }
            date = "";
            try {
                this.date = FORMATTER.parse(date.trim());
            } catch (ParseException e) {
                throw new RuntimeException(e);
            }
        }

        public Chapter copy(){
            Chapter copy = new Chapter();
            copy.title = title;
            copy.link = link;
            copy.description = description;
            copy.date = date;
            return copy;
        }

        @Override
        public String toString() {
            StringBuilder sb = new StringBuilder();
            sb.append("Title: ");
            sb.append(title);
            sb.append('\n');
            sb.append("Date: ");
            sb.append(this.getDate());
            sb.append('\n');
            sb.append("Link: ");
            sb.append(link);
            sb.append('\n');
            sb.append("Description: ");
            sb.append(description);
            return sb.toString();
        }

        @Override
        public int hashCode() {
            final int prime = 31;
            int result = 1;
            result = prime * result + ((date == null) ? 0 : date.hashCode());
            result = prime * result
                    + ((description == null) ? 0 : description.hashCode());
            result = prime * result + ((link == null) ? 0 : link.hashCode());
            result = prime * result + ((title == null) ? 0 : title.hashCode());
            return result;
        }

        @Override
        public boolean equals(Object obj) {
            if (this == obj)
                return true;
            if (obj == null)
                return false;
            if (getClass() != obj.getClass())
                return false;
            Chapter other = (Chapter) obj;
            if (date == null) {
                if (other.date != null)
                    return false;
            } else if (!date.equals(other.date))
                return false;
            if (description == null) {
                if (other.description != null)
                    return false;
            } else if (!description.equals(other.description))
                return false;
            if (link == null) {
                if (other.link != null)
                    return false;
            } else if (!link.equals(other.link))
                return false;
            if (title == null) {
                if (other.title != null)
                    return false;
            } else if (!title.equals(other.title))
                return false;
            return true;
        }

        public int compareTo(Chapter another) {
            if (another == null) return 1;
            // sort descending, most recent first
            return another.date.compareTo(date);
        }
}

My question is if this is an appropriate format or if there is a simpler way to create a List of Mangas, each with its own set of Chapters?

EDIT: I’ve looked it up and decided that using an SQLite Database would be a much simpler way to keep track of the large amount of data I will be parsing.

This way I can maintain two databases. One for Manga titles and authors, and another for the chapters and relevant information. The Related chapters will be linked to the Manga in each table through a reference ID.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T21:10:02+00:00Added an answer on June 9, 2026 at 9:10 pm

    I definitely think that there is an easier way to do this; however, it really depends on what you overall goal is. If you are trying to display this in a list you might consider using ListView, but if you are just using the data for content, then you can probably do something similar to what you have. Ultimately, you need to figure out what you are going to do with the app, then you can figure out the easiest way to implement it. Remember though: easier isn’t always better. Try and think long term about your project as in who is going to be maintaining this, is it going to grow or shrink, and whether you will add features.

    As for extends and implements they are subclasses and interfaces, respectively and has different rules regarding it and more information can be found here: http://docs.oracle.com/javase/tutorial/java/concepts/interface.html

    Best of luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to select an H1 element which is the second-child in its group
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.