Skip to main content

Installation

MorseIt is a lightweight Android app that requires Android 6.0 (Marshmallow) or later.
1

Download the app

Clone the repository or download the APK:
git clone https://github.com/subin23k/MorseIt.git
cd MorseIt
2

Build the project

Open the project in Android Studio:
  1. Select File > Open
  2. Navigate to the cloned directory
  3. Select OK
If Android Studio doesn’t automatically sync Gradle, select File > Sync Project with Gradle Files.
3

Run the app

Connect a physical device running Android 6.0 (API level 23) or later, or start an emulator configured to the same API level.Then select Run > Run ‘app’, or press Shift+F10.

Using MorseIt

Basic Translation

1

Enter your text

Type or paste text into the input field. The placeholder says “Enter your text to be translated here”.MorseIt input screen
2

Tap Translate

Press the Translate button to convert your text to Morse code.The Morse code will appear in the output field below, with each character separated by a space.
3

Copy to clipboard (optional)

Press the COPY button to copy the Morse code to your system clipboard.You’ll see a toast message confirming “Text Copied”.MorseIt output screen

Example Translations

Here are some examples of how text is translated to Morse code:
.-  .  .-..  .-..  --- 
Each character’s Morse representation is followed by a space. Unsupported characters (like ! or @) are passed through unchanged.

Translation Logic

The translation happens in the translateToMorse() method in MainActivity.java:
MainActivity.java
public String translateToMorse(String input_field_text) {
    Map<Character, String> map = new HashMap<>();
    StringBuilder morse_code = new StringBuilder();
    
    // Populate the Morse code mapping
    map.put('A', ".-");
    map.put('B', "-...");
    // ... (all letters, digits, and punctuation)
    
    // Translate character by character
    for (int i = 0; i < input_field_text.length(); i++) {
        char upperChar = (char) (input_field_text.charAt(i));
        String fetchedChar = map.get(upperChar);
        if (fetchedChar != null) {
            morse_code.append(map.get(upperChar));
        } else {
            morse_code.append(input_field_text.charAt(i));
        }
        morse_code.append(' ');
    }
    return morse_code.toString();
}

Clipboard Integration

The Copy button uses Android’s ClipboardManager to copy the Morse code:
MainActivity.java
Button button_copy = findViewById(R.id.button1);
myClipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);

button_copy.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        String text;
        text = t1.getText().toString();
        
        myClip = ClipData.newPlainText("text", text);
        myClipboard.setPrimaryClip(myClip);
        
        Toast.makeText(getApplicationContext(), "Text Copied",
                Toast.LENGTH_SHORT).show();
    }
});

Next Steps

Supported Characters

View the complete list of supported letters, digits, and punctuation

Build from Source

Learn how to build and customize MorseIt

Build docs developers (and LLMs) love