2nd class
2nd class
Adding/download requirements
2. now get instance of 2 edit text or 1 button and create a variable for
findviewbyid(R.id.{id})
5. create a new java model class for and get instance of name,number
6. now make a black constructor and filled constructor of these instance
7. and make all getter and setter
CREATING DATA
3. under this create a object of your model class u make and use new {your model
class name} ({name},{numer})
4. and write variable name where u get firebase instance . collection and your
collection name on braket . document . set . your variable name of model class
object . add any lisniar
ex-
5. now on braket of your lisnear write add {your lisnear name} and click enter for
auto complete
6.now u get task on function
7. do if task.succesful then toast data added successful , else error
ex-
READ DATA
1. make a item file <XML> and degine your layout for recycler view | i first use
linear and 2 textview in that.
ex-
3. now go to mainactivity java class and make a function for getting data i named
it as {getalldata}
ex- public void getalldata()
{
}
(recyclerviewadaptor) again modification
1. now u see 1 constroctor then these is 1 element present in constructor so
get instance these like arrylist<{model class name}> array;
2. do this.activivy = activity; this.arry= arry;
3. so oncreateviewholder do return new RecyclerViewAdaptor{recycler view
adaptor}(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_name{your
item xml}, parent, false);
4. and on getitemcount return allarry{instance variable on 1.}.size();
5. and on Viewholder class on this get instance of your name email such as
TextView name,email; and under viewholder function on this class
6. write your instance variable name = itemview.findviewbyid(R.id.{text view
name id}); and same with number
7. last step of this read process go to onblindviewholder and write
holder.name{variable where u find id's}.setText(allarry{instace u get first of
arrlist}.get(position).getName{form your usermodel class getter}());
ddddddddddddddddddddddawerwearsfsdf