How to Create a Morse Code Converter Android App?
Morse code is a way in which one can encode characters and text using dots and dashes. The international Morse codes contain 26 letters of the alphabets and some non-English letters that are Arabic numerals as well as some punctuation. In Morse code, there is no difference between the upper and lower case letters. The transmission of the Morse Code is measured in dot durations. The Morse Code Converter App is an app that is used to convert the given statements to Morse Code. This is done by using Android Studio. The Languages that are used are Java and XML. So in this article lets create a Morse Code Converter Android App using the Java language. This project also involves the conversion of the Morse Code into relevant Statements. It means both encoding and decoding can be done using this Android app.
Software Tools Required
The software tools required in this project are:
- ANDROID-STUDIO IDE (1.0.2)
- SDK having API level-21(minimum version)
- JAVA 7 and above
- An android smartphone – version 4.2.2(Jelly bean and above) (only for testing the software)
Step 1: Create a New Project To create a new project in Android Studio please refer How to Create/Start a New Project in Android Studio. Note that select Java as the programming language. Step 2: Create a Round Button This step is optional (only if you want a black button with round corners). In the project tab, in the left-hand corner of the screen, click on the app folder. Then, click on the res folder. Then, right-click on the drawable folder and select New then select Drawable Resource file. Give this resource file a name. Remember one can use only lower case letters for the name of the resource file. Write the code below to create a resource file for black buttons with round corners. Use this resource file as background in the XML code of buttons to get black buttons with round corners.
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="rectangle"> <corners android:radius="15dip" /> <stroke android:width="1dip" android:color="#5e7974" /> <gradient android:angle="-90" android:endColor="#091037" android:startColor="#0C000E" /> </shape> </item> </selector>