<repo_name>vikjogit/openmicevent1<file_sep>/app/src/main/java/com/vikjo/openmicevent1/CreateEventActivity.java
package com.vikjo.openmicevent1;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.FirebaseDatabase;

public class CreateEventActivity extends AppCompatActivity implements View.OnClickListener {

    private EditText mEventName;
    private EditText mBusinessName;
    private EditText mEventDate;
    private EditText mEventTime;
    private EditText mEventLocation;
    private String databaseeventname;
    private Button Btncreateevent;



    private FirebaseAuth mAuth;



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_create_event);

        mEventName = (EditText)findViewById(R.id.editEventName);
        mBusinessName = (EditText)findViewById(R.id.editCompanyName);
        mEventDate = (EditText)findViewById(R.id.editEventDate);
        mEventTime = (EditText)findViewById(R.id.editEventTime);
        mEventLocation = (EditText)findViewById(R.id.editEventLocation);




        mAuth = FirebaseAuth.getInstance();

        findViewById(R.id.CreateEventButton).setOnClickListener(this);




    }







    private void CreateTheEvent(){




        final String eventname = mEventName.getText().toString();
        final String businessname = mBusinessName.getText().toString();
        final String eventdate = mEventDate.getText().toString();
        final String eventtime = mEventTime.getText().toString();
        final String eventlocation = mEventLocation.getText().toString();

        if(eventname.isEmpty()) {

            mEventName.setError("Event Name required");
            mEventName.requestFocus();
            return;


        }


        else if(businessname.isEmpty()) {

            mBusinessName.setError("Add your Business Name");
            mBusinessName.requestFocus();
            return;


        }


        else if(eventdate.isEmpty()) {

            mEventDate.setError("Add the date of the event");
            mEventDate.requestFocus();
            return;


        }


        else if(eventtime.isEmpty()) {

            mEventTime.setError("Add the time for the event");
            mEventTime.requestFocus();
            return;


        }


        else if(eventlocation.isEmpty()) {

            mEventLocation.setError("Add Location of the event");
            mEventLocation.requestFocus();
            return;


        }


        //we will store additional fields in firebase database

        Event event = new Event(eventname,businessname,eventdate,eventtime,eventlocation);





        FirebaseDatabase.getInstance().getReference("Events")
                .child(FirebaseAuth.getInstance().getCurrentUser().getUid())
                .setValue(event).addOnCompleteListener(new OnCompleteListener<Void>() {
            @Override
            public void onComplete(@NonNull Task<Void> task) {
                if(task.isSuccessful()){


                    Toast.makeText(CreateEventActivity.this,"Event Created Succesfully",Toast.LENGTH_SHORT).show();
                    //FirebaseDatabase.getInstance().getReference("Events")
                      //      .child(FirebaseAuth.getInstance().getCurrentUser().getUid())
                        //    .setValue()

                    Intent i = (new Intent(CreateEventActivity.this, BusinessHome.class));
                    finish();
                    startActivity(i);


                }

                else{
                    Toast.makeText(CreateEventActivity.this,"Event was not created, Try Again",Toast.LENGTH_SHORT).show();
                }
            }
        });
























    }





    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.CreateEventButton:
                CreateTheEvent();

        }
    }

}
<file_sep>/README.md
# openmicevent1

This app is an open mic event management app. An open mic is an event hosted by pubs and similar venues to gain new customers and audiences by providing them with entertainment.
When a business creates an open mic event, an artist is supposed to contact the business and let them know that he wants to perform there. This gives him/her a chance to showcase
their talents in a comfortable space. 
Basically, an artist gets a chance to perform in front of an audience without spending time to build one while the business gains new customers who come to see the performance

This app helps to bridge the gap between open mic venues and artists. Once you open the app, you can sign up as a business or an artist. 

If you are an artist:
You are shown what events are available for you to join, you can join them accordingly

If you're a business:
You need to create an event using the app and then the event will be visible to the artist

This app looks to make open mics a convinient affair for both artists as well as businesses.
<file_sep>/settings.gradle
include ':app'
rootProject.name='openmicevent1'
<file_sep>/app/src/main/java/com/vikjo/openmicevent1/MyArtistEvent.java
package com.vikjo.openmicevent1;

public class MyArtistEvent {

String eventforparticipants;

    public MyArtistEvent(String eventforparticipants) {
        this.eventforparticipants = eventforparticipants;
    }

    public void setEventforparticipants(String eventforparticipants) {
        this.eventforparticipants = eventforparticipants;
    }

    public MyArtistEvent(){


    }

    public String getEventforparticipants() {
        return eventforparticipants;
    }
}
