Browse Source

Mikrofon als Activity

Mikrofon
Julia Prölß 1 year ago
parent
commit
5b920359a1

+ 1
- 0
app/src/main/AndroidManifest.xml View File

<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.greenwatch"> package="com.example.greenwatch">


<uses-permission android:name="android.permission.RECORD_AUDIO" />
<application <application
android:allowBackup="true" android:allowBackup="true"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"

+ 11
- 0
app/src/main/java/com/example/greenwatch/MainActivity.java View File



import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;


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


public class MainActivity extends AppCompatActivity { public class MainActivity extends AppCompatActivity {


protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main); setContentView(R.layout.activity_main);

((Button)findViewById(R.id.buttonstartmicdetection)).setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view) {
Intent i = new Intent(MainActivity.this, Mikrofon.class);
startActivity(i);
}
});
} }
} }

+ 0
- 4
app/src/main/java/com/example/greenwatch/Mikrofon.java View File

package com.example.greenwatch;

public class Mikrofon {
}

+ 5
- 5
app/src/main/res/layout/activity_main.xml View File

android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".MainActivity"> tools:context=".MainActivity">


<TextView
<Button
android:id="@+id/buttonstartmicdetection"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Hello World!"
android:text="Starte Mikrofon Detection"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

Loading…
Cancel
Save