• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

How to fix error coding

Android manifest.
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.secondapp"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="23"
        android:targetSdkVersion="30" />

    <application
        android:allowBackup="true"
        android:appComponentFactory="androidx.core.app.CoreComponentFactory"
        android:debuggable="true"
        android:extractNativeLibs="false"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:testOnly="true"
        android:theme="AppTheme" >
        <activity android:name="com.Second app.MainActivity" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>

Java:
/**
* Automatically generated file. DO NOT MODIFY
*/
package "com.Second app;"

public final class BuildConfig {
  public static final boolean DEBUG = Boolean.parseBoolean("true");
  public static final String APPLICATION_ID = "com.example.secondapp";
  public static final String BUILD_TYPE = "debug";
  public static final int VERSION_CODE = 1;
  public static final String VERSION_NAME = "1.0";
}

3 years on

i had the note 8 and upgraded to the note 10+ and i'm very happy that i did. never was quite happy with the note 8. it was a decent phone, it did have some slowness to it and the battery was so so for me. my note 10+ is beautiful, zippy, and can last for the entire day and then some on most days.

you might be able to get some good deals on the note10+ right now. if not then wait until they reveal the next note to come out. some rumors are saying that the new z fold 3 will replace the note line. and some are saying that there will be a note 21 before they do away with the note line all together. my guess would be around august we should know for sure.

Record the audio of a phone call (android java development)

I am developing an app that records call audio. My app is able to record system audio but hearing an audio that the app has recorded I noticed that when I accept the call, the audio seems to stop and only seems to restart when the call is ended. Could somebody tell me why? I am using MediaRecorder. I leave you my code below.

my code:

Code:
  @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
            BottomNavigationView bottomNavigationView = (BottomNavigationView) findViewById(R.id.bottom_navigation);
            rec = findViewById(R.id.btn_rec);
            chronometer = findViewById(R.id.chronometer);
            prgwait = findViewById(R.id.wait);
            stop = findViewById(R.id.btn_stop);
   
            ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.RECORD_AUDIO, Manifest.permission.WRITE_EXTERNAL_STORAGE}, REQUEST_RECORD_AUDIO_PERMISSION);
   
            rec.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
   
                    prgwait.setVisibility(View.VISIBLE); //start progress
                    chronometer.setVisibility(View.VISIBLE);
                    rec.setVisibility(View.GONE);
                    prgwait.setVisibility(View.GONE); //stop progress
                    stop.setVisibility(View.VISIBLE);
                    chronometer.setBase(SystemClock.elapsedRealtime());
                    chronometer.start();
                    Toast.makeText(MainActivity.this, "Registration started", Toast.LENGTH_SHORT).show();
                    //start rec
                    recorder = new MediaRecorder();
                    recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
                    recorder.setOutputFormat(output_formats[currentFormat]);
                    //recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
                    recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
                    recorder.setOutputFile(getFilename());
                    recorder.setOnErrorListener(errorListener);
                    recorder.setOnInfoListener(infoListener);
   
   
                    try {
                        recorder.prepare();
                        recorder.start();
                    } catch (IllegalStateException e) {
                        Log.e("REDORDING :: ", e.getMessage());
                        e.printStackTrace();
                    } catch (IOException e) {
                        Log.e("REDORDING :: ", e.getMessage());
                        e.printStackTrace();
                    }
   
                    audioManager = (AudioManager) getApplicationContext().getSystemService(Context.AUDIO_SERVICE); //record the audio of device
                    audioManager.setMode(AudioManager.MODE_IN_CALL);
                    audioManager.setSpeakerphoneOn(true); //enable the speaker for record the voices of the call
   
                    //end code for rec calls
                }
            });
   
   
            //stop a rec
   
            stop.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
   
                    prgwait.setVisibility(View.VISIBLE);   //start progressbar
                    stop.setVisibility(View.GONE);
   
   
   
                        chronometer.stop();
                        chronometer.setVisibility(View.GONE);
                        rec.setVisibility(View.VISIBLE);
   
                        audioManager.setSpeakerphoneOn(false); //turn off the speaker
   
                        try {
                            if (null != recorder) {
                                recorder.stop();
                                recorder.reset();
                                recorder.release();
   
                                recorder = null;
                            }
                        } catch (RuntimeException stopException) {
   
                        }
                        Toast.makeText(MainActivity.this, "Record saved", Toast.LENGTH_SHORT).show();
                        //end stop code
                        chronometer.setBase(SystemClock.elapsedRealtime());
                        prgwait.setVisibility(View.GONE);
                    }
   
            });

private String getFilename() {
        String filepath = Environment.getExternalStorageDirectory().getPath();
        File file = new File(filepath, AUDIO_RECORDER_FOLDER);

        if (!file.exists()) {
            file.mkdirs();
        }

        return (file.getAbsolutePath() + "/" + System.currentTimeMillis() + file_exts[currentFormat]);
    }

    private MediaRecorder.OnErrorListener errorListener = new MediaRecorder.OnErrorListener() {
        @Override
        public void onError(MediaRecorder mr, int what, int extra) {
            Toast.makeText(MainActivity.this,
                    "Error: " + what + ", " + extra, Toast.LENGTH_SHORT).show();
        }
    };

    private MediaRecorder.OnInfoListener infoListener = new MediaRecorder.OnInfoListener() {
        @Override
        public void onInfo(MediaRecorder mr, int what, int extra) {
            Toast.makeText(MainActivity.this,
                    "Warning: " + what + ", " + extra, Toast.LENGTH_SHORT)
                    .show();
        }
    };
}

Moto e Music is on phone , not showing in library

I will look at that, thank you. I am new to Android, apps, etc. I was happy to be able to get my music into YT music but you are correct, ads galore . I am again, NOT tech android savy and don't know how once I try Foodbar to get my music there. I will work on it thank you

Ok I have downoad the app you suggested and will get used to it. It worked fine during my 2 mile walk this morning ,but still will not play in my car when I select the bluetooth menu. It shows that it is listed in bluetooth, but it just won't play on my car when I chose bluetooth. I will work on that today. Thank you

Filter

Back
Top Bottom