Wow — a new whale has arrived 🐋 #anonim_fw0 a.k.a @Ben_Manlapaz just showed true capability, creating massive waves with 49 #NFTs 🌊🔥 Huge respect and gratitude for bringing such strong energy into the #NFToa ecosystem 🙌 #eCash $XEC #NFTCommunity #NFTCollectors #CryptoMarket pic.twitter.com/mJpkQMU3Su
— NFToa (@nftoa_) September 6, 2025
Who doesn't know the guitar? From young to old, from village to city, almost every time we find people playing the guitar. The problem is sometimes they don't know whether the guitar tone is right while the price of effects or guitar tuners is relatively expensive.

Guitar Tuner Android
There's nothing wrong with us as IT people, helping them create a simple application to match their guitar tones to standard.
This application is equipped with 6 buttons, each representing 1 string, and a button to exit. If the "A String" button is clicked, then the android produces the sound of an A guitar string. That's roughly the idea.
For this project, please download from the internet the guitar string sounds (www.omayib.com/downloads).
Come on, now let's look at the application code.
Create a new project
Create a new folder /res/raw. Paste the guitar string sound file in this folder, see the picture

Figure 21.1. Fill in the /res/raw folder
3. First prepare the string data in Strings.xml
1: <?xml version="1.0" encoding="utf-8"?>
2: <resources>
3: <string name="hello">Pilih salah satu string</string>
4: <string name="app_name">Guitar Tuner </string>
5: <color name="bg">#ffffff</color>
6: <color name="textColor">#ff0000</color>
7: <color name="textColor2">#000000</color>
8: <string name="e1">Senar E</string>
9: <string name="a">Senar A</string>
10: <string name="d">Senar D</string>
11: <string name="g">Senar G</string>
12: <string name="b">Senar B</string>
13: <string name="e2">Senar E</string>
14: <string name="keluarBtn">Keluar</string>
15: <string name="Deskripsi_Gambar">Guitar Image</string>
16: </resources>4. Now we make the layout in Main.xml
1: <?xml version="1.0" encoding="utf-8"?>
2: <ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
3: android:id="@+id/scrollView1"
4: android:layout_width="fill_parent"
5: android:layout_height="fill_parent" >
6:
7: <LinearLayout
8: android:layout_width="fill_parent"
9: android:layout_height="wrap_content"
10: android:background="@color/bg"
11: android:orientation="vertical" >
12:
13: <TextView
14: android:layout_width="fill_parent"
15: android:layout_height="wrap_content"
16: android:fitsSystemWindows="true"
17: android:focusable="true"
18: android:focusableInTouchMode="true"
19: android:gravity="top"
20: android:text="@string/hello"
21: android:textColor="@color/textColor2" />
22:
23: <ImageView
24: android:id="@+id/imageView1"
25: android:layout_width="wrap_content"
26: android:layout_height="wrap_content"
27: android:layout_gravity="center_horizontal"
28: android:contentDescription="@string/Deskripsi_Gb"
29: android:scaleType="center"
30: android:src="@drawable/gitar" />
31:
32: <Button
33: android:id="@+id/stringE1"
34: android:layout_width="fill_parent"
35: android:layout_height="wrap_content"
36: android:text="@string/e1" >
37: </Button>
38:
39: <Button
40: android:id="@+id/stringA"
41: android:layout_width="fill_parent"
42: android:layout_height="wrap_content"
43: android:text="@string/a" >
44: </Button>
45:
46: <Button
47: android:id="@+id/stringD"
48: android:layout_width="fill_parent"
49: android:layout_height="wrap_content"
50: android:text="@string/d" >
51: </Button>
52:
53: <Button
54: android:id="@+id/stringG"
55: android:layout_width="fill_parent"
56: android:layout_height="wrap_content"
57: android:text="@string/g" >
58: </Button>
59:
60: <Button
61: android:id="@+id/stringB"
62: android:layout_width="fill_parent"
63: android:layout_height="wrap_content"
64: android:text="@string/b" >
65: </Button>
66:
67: <Button
68: android:id="@+id/stringE"
69: android:layout_width="fill_parent"
70: android:layout_height="wrap_content"
71: android:text="@string/e2" >
72: </Button>
73:
74: <TextView
75: android:id="@+id/keterangan"
76: android:layout_width="fill_parent"
77: android:layout_height="wrap_content"
78: android:layout_gravity="center_horizontal"
79: android:text=""
80: android:textColor="@color/textColor"
81: android:textStyle="bold" >
82: </TextView>
83:
84: <Button
85: android:id="@+id/keluar"
86: android:layout_width="wrap_content"
87: android:layout_height="wrap_content"
88: android:layout_gravity="right"
89: android:text="@string/keluarBtn" >
90: </Button>
91:
92: </LinearLayout>
93:
94: </ScrollView>5. Following is the activity tunerGitar.java
1: package code.tunerGitar;
2:
3: import android.app.Activity;
4: import android.media.MediaPlayer;
5: import android.os.Bundle;
6: import android.view.View;
7: import android.view.View.OnClickListener;
8: import android.widget.Button;
9: import android.widget.TextView;
10: import android.widget.Toast;
11:
12: public class tunerGitar extends Activity {
13:
14: private static final String isPlaying = "Kamu
15: mendengarkan ";
16: private MediaPlayer player;
17: private Button EButton;
18: private Button BButton;
19: private Button GButton;
20: private Button DButton;
21: private Button AButton;
22: private Button E2Button;
23: private Button keluar;
24: TextView keterangan;
25:
26: /** Called when the activity is first created. */
27: @Override
28: public void onCreate(Bundle savedInstanceState) {
29: super.onCreate(savedInstanceState);
30: setContentView(R.layout.main);
31: EButton = (Button) this.findViewById(R.id.stringE);
32: EButton.setOnClickListener(new OnClickListener() {
33: @Override
34: public void onClick(View arg0) {
35: playSound(1);
36: }
37: });
38: BButton = (Button) this.findViewById(R.id.stringB);
39: BButton.setOnClickListener(new OnClickListener() {
40: @Override
41: public void onClick(View arg0) {
42: playSound(2);
43: }
44: });
45: GButton = (Button) this.findViewById(R.id.stringG);
46: GButton.setOnClickListener(new OnClickListener() {
47: @Override
48: public void onClick(View arg0) {
49: playSound(3);
50: }
51: });
52: DButton = (Button) this.findViewById(R.id.stringD);
53: DButton.setOnClickListener(new OnClickListener() {
54: @Override
55: public void onClick(View arg0) {
56: playSound(4);
57: }
58: });
59: AButton = (Button) this.findViewById(R.id.stringA);
60: AButton.setOnClickListener(new OnClickListener() {
61: @Override
62: public void onClick(View arg0) {
63: playSound(5);
64: }
65: });
66: E2Button = (Button)this.findViewById(R.id.stringE1);
67: E2Button.setOnClickListener(new OnClickListener() {
68: @Override
69: public void onClick(View arg0) {
70: playSound(6);
71: }
72: });
73: keluar = (Button) this.findViewById(R.id.keluar);
74: keluar.setOnClickListener(new OnClickListener() {
75: @Override
76: public void onClick(View arg0) {
77: tunerGitar.this.finish();
78: }
79: });
80: keterangan = (TextView)
81: this.findViewById(R.id.keterangan);
82: }
83:
84: @Override
85: public void onPause() {
86: try {
87: super.onPause();
88: player.pause();
89: } catch (Exception e) {
90: }
91: }
92:
93: public void onStop() {
94: super.onStop();
95: player.stop();
96: }
97:
98: private void playSound(int arg) {
99: try {
100: if (player.isPlaying()) {
101: player.stop();
102: player.release();
103: }
104: } catch (Exception e) {
105: Toast.makeText(this, e.toString(),
106: Toast.LENGTH_SHORT).show();
107: }
108: if (arg == 1) {
109: player = MediaPlayer.create(this, R.raw.e3);
110: keterangan.setText(isPlaying + "String E");
111: } else if (arg == 2) {
112: player = MediaPlayer.create(this, R.raw.b2);
113: keterangan.setText(isPlaying + "String B");
114: } else if (arg == 3) {
115: player = MediaPlayer.create(this, R.raw.g2);
116: keterangan.setText(isPlaying + "String G");
117: } else if (arg == 4) {
118: player = MediaPlayer.create(this, R.raw.d2);
119: keterangan.setText(isPlaying + "String D");
120: } else if (arg == 5) {
121: player = MediaPlayer.create(this, R.raw.a1);
122: keterangan.setText(isPlaying + "String A");
123: } else if (arg == 6) {
124: player = MediaPlayer.create(this, R.raw.e1);
125: keterangan.setText(isPlaying + "String E");
126: }
127: player.setLooping(true);
128: player.start();
129: }
130: }Happy guitar playing!!!!
