I've seen an Android project structure in the image below. What does "Bean" mean in this structure? or Why does that folder name "Bean"?
Asked
Active
Viewed 1,273 times
-2
-
its a package name my friend – AskNilesh Jul 24 '18 at 04:53
-
@NileshRathod: do you understand my question clearly? – duy hoang Jul 24 '18 at 04:54
-
bean means your getter() and setter() method – Ganesh Gudghe Jul 24 '18 at 04:55
-
1This has nothing to do with android `reastBean` is just package . And the word `bean` can be resemble to `POJO` of java. – ADM Jul 24 '18 at 04:58
-
@duyhoang yes i have read and understand your question clearly – AskNilesh Jul 24 '18 at 04:59
-
@NileshRathod: that folder is used to contain model classes when using Retrofit to get data (Json format) from a webservice – duy hoang Jul 24 '18 at 05:07
-
@duyhoang Read https://stackoverflow.com/questions/3295496/what-is-a-javabean-exactly. – ADM Jul 24 '18 at 05:10
1 Answers
4
Bean
in java is basically a single class encapsulate many objects into a single object and there properties can be manipulated by using getter
and setter
method.We also call it model class. The below code snippet is an example of bean class.
public class Book implements Serializable{
private String isbn;
private String title;
private String author;
private String publisher;
private int pages;
/**
* Default constructor
*/
public Book() {
this.isbn = "";
this.title = "";
this.author = "";
this.publisher = "";
this.pages = 0;
}
public String getIsbn() {
return isbn;
}
public void setIsbn(final String isbn) {
this.isbn = isbn;
}
public String getTitle() {
return title;
}
public void setTitle(final String title) {
this.title = title;
}
public String getAuthor() {
return author;
}
public void setAuthor(final String author) {
this.author = author;
}
public String getPublisher() {
return publisher;
}
public void setPublisher(final String publisher) {
this.publisher = publisher;
}
public int getPages() {
return pages;
}
public void setPages(final int pages) {
this.pages = pages;
}
}
In your case i think the package you pointed contained all the bean classes

Abhijit Chakra
- 3,201
- 37
- 66