Code

Support for Ringtones&Soundboard with Share|Set as Tone|Favorite

Support for Ringtones&Soundboard with Share|Set as Tone|Favorite

Cart 37 sales

Popular questions for this item

How do I delete categories B and C? I just want category A.

Open the project in android studio. Open app>java>soundboard>Mainactivity.java Delete everything and paste this code.
package com.awoapp.soundboard;
import android.Manifest;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.core.app.ActivityCompat;
import androidx.fragment.app.FragmentManager;
import com.google.android.material.navigation.NavigationView;
import androidx.core.view.GravityCompat;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.view.MenuItem;
import android.widget.RelativeLayout;
import android.widget.Toast;

import com.awoapp.FragmentPack.FragmentClass;
import com.awoapp.Utils.AdmobAds;
import com.awoapp.Utils.AppMet;
import com.google.android.gms.ads.AdView;
import com.google.firebase.analytics.FirebaseAnalytics;

import static com.awoapp.soundboard.CustomAdapter.mCountDownTimer;
import static com.awoapp.soundboard.CustomAdapter.mediaPlayer;

public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener {
    private FirebaseAnalytics mFirebaseAnalytics;
    public static FragmentManager fragmentManager;
    public static Activity pub_activity;
    AdView adView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        // Obtain the FirebaseAnalytics instance.
        mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);

        /*For admob  ads*/
        adView = new AdView(this);
        RelativeLayout relativeLayout = findViewById(R.id.adView);
        AdmobAds.AdmobBanner(adView, relativeLayout);
        AdmobAds.AdmobInterstitialRequest(MainActivity.this);

        /*Toolbar and preparing the menu.*/
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
        NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);

        fragmentManager = getSupportFragmentManager();
        pub_activity = MainActivity.this;
        FragmentClass.FragmentA(fragmentManager);

        setSupportActionBar(toolbar);
        ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
                this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
        drawer.addDrawerListener(toggle);
        toggle.syncState();
        navigationView.setNavigationItemSelectedListener(this);

    }

    @Override
    protected void onPause() {
        if (mediaPlayer != null) {
            mediaPlayer.stop();
            mCountDownTimer.cancel();
        }
        super.onPause();
    }

    @Override
    public void onBackPressed() {
        DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
        if (drawer.isDrawerOpen(GravityCompat.START)) {
            drawer.closeDrawer(GravityCompat.START);
        } else {
            AdmobAds.BackPressedCtrlAdmob(MainActivity.this);
            super.onBackPressed();
        }
    }

    @SuppressWarnings("StatementWithEmptyBody")
    @Override
    public boolean onNavigationItemSelected(MenuItem item) {
        // Handle navigation view item clicks here.
        int id = item.getItemId();

        switch (id) {
            case R.id.nav_fav:
                MediaPlayerCheck();
                FragmentClass.FragmentFavorite(fragmentManager);
                break;
            case R.id.nav_a:
                MediaPlayerCheck();
                FragmentClass.FragmentA(fragmentManager);
                break;
            case R.id.nav_b:
                MediaPlayerCheck();
                FragmentClass.FragmentB(fragmentManager);
                break;
            case R.id.nav_c:
                MediaPlayerCheck();
                FragmentClass.FragmentC(fragmentManager);
                break;
            case R.id.nav_rate:
                MediaPlayerCheck();
                /*Opens app on the google play for rate app.*/
                startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + getPackageName())));
                break;
            case R.id.nav_policy:
                MediaPlayerCheck();
                /*Private Policy*/
                startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(MyConstants.POLICY)));
                break;
            case R.id.nav_share:
                /*Share app*/
                Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
                sharingIntent.setType("text/plain");
                sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, "https://play.google.com/store/apps/details?id=" + getPackageName());
                startActivity(Intent.createChooser(sharingIntent, getResources().getString(R.string.share_intent_title)));
                MediaPlayerCheck();
                break;
            case R.id.nav_exit:
                /*Exit App*/
                AdmobAds.BackPressedCtrlAdmob(MainActivity.this);
                finish();
                break; }

        DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
        drawer.closeDrawer(GravityCompat.START);
        return true;
    }

    /*Request permission for android>v23*/
    @Override
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
        if (requestCode == 21) {

            if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
            } else {
                Toast.makeText(this, getResources().getString(R.string.request_error), Toast.LENGTH_SHORT).show();
            }
        }
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
    }

    /*Check permission for android v>23*/
    public void CheckPermission(Activity activity) {
        String diziPerm[] = {"android.permission.WRITE_EXTERNAL_STORAGE", "android.permission.READ_EXTERNAL_STORAGE", "android.permission.WRITE_SETTINGS"};
        int permCode = 21;
        if (ActivityCompat.checkSelfPermission(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(activity, Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(activity, Manifest.permission.WRITE_SETTINGS) == PackageManager.PERMISSION_GRANTED) {
            //   ShareSound.ShareSound(activity, "a" + String.valueOf(CustomAdapter.static_position));
        } else {

            AppMet.PermissionCheck(MainActivity.pub_activity, diziPerm, permCode);
        }
    }

    /*Check mediaplayer for stop.*/
    public static void MediaPlayerCheck() {
        if (mediaPlayer != null && mediaPlayer.isPlaying()) {
            mediaPlayer.stop();
        }
    }
}
open app>res>menu>activity_main_drawer.xml Delete everything and paste this code.
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    tools:showIn="navigation_view">

    <group android:checkableBehavior="single">
        <item
            android:id="@+id/nav_fav" 
            android:icon="@drawable/ic_action_favorite" 
            android:title="@string/str_nav_fav" />

        <item
            android:id="@+id/nav_a" 
            android:icon="@drawable/ic_action_bird" 
            android:title="@string/str_Fragment_A" />
        <!--<item-->
            <!--android:id="@+id/nav_b"-->
            <!--android:icon="@drawable/ic_action_insect"-->
            <!--android:title="@string/str_Fragment_B" />-->
        <!--<item-->
            <!--android:id="@+id/nav_c"-->
            <!--android:icon="@drawable/ic_action_mammal"-->
            <!--android:title="@string/str_Fragment_C" />-->
    </group>

        <group>
            <item
                android:id="@+id/nav_rate" 
                android:icon="@drawable/ic_action_rate" 
                android:title="@string/str_rate" />
            <item
                android:id="@+id/nav_share" 
                android:icon="@drawable/ic_action_share" 
                android:title="@string/str_share" />
            <item
                android:id="@+id/nav_policy" 
                android:icon="@drawable/ic_action_policy" 
                android:title="@string/str_private_policy" />
            <item
                android:id="@+id/nav_exit" 
                android:icon="@drawable/ic_action_exit" 
                android:title="@string/str_exit" />
        </group>

</menu>

by
by
by
by
by
by

Tell us what you think!

We'd like to ask you a few questions to help improve CodeCanyon.

Sure, take me to the survey