Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / Kotlin

Smart Android Template for Data Performance

5.00/5 (1 vote)
22 Apr 2024CPOL2 min read 2.6K   44  
Smart Android Template for Data Performance with International Signals Code as a Sample
This is the presentation of the ISCodeJava and ISCodeKotlin projects which may be useful for beginners in Android. Also may be useful for presentation some catalogues with the images and texts.

Introduction

This is the first my experience with Android just I want to check it on my capabilities to redesign my programing skills based on MFC Visual Studio C++ to some other technologies.

The Android Studio occurred quite user-friendly and intuitively comprehensive. These my projects may be a usefull template for the beginners in Android as me myself.

Background

The International Signals Code was selected as a good template to arrange Menu, Resycler View, Fragment Transitions and other basic Android features. Two projects were developed in Java and Kotlin base.

 Building Notes.

Both projects ISCodeJava and ISCodeKotlin were developed in Android Studio 2023.1.1.27-windows.

Even if you are first time working with Android just  select menu Run->Run 'app'  and the program ISCode should start building and working if you connect your physical device to your computer or configure the emulator device on Android Studio.

Codes explanations.

All the Menu and Touch Screen Commands has been done with the standard Android technologies. Therefore I feel nothing to explain better then in the standard tutorials. Key moment in this solution  is the Data Storage of the five attributes of each command:

 abstract public class ISCodeData {
   // Image assets 
  @DrawableRes
  static public final int[] FLAGS_DRAWABLES = {
          R.drawable.alfa,
          R.drawable.bravo,
          R.drawable.charlie,
          ..........
        };	
 static public final int[] MORSE_DRAWABLES = {
          R.drawable.zz_alfa,
          R.drawable.zz_bravo,
          R.drawable.zz_charlie,
         ..........
        };
static public final String[] NAME_STRINGS = {
          "alfa",
          "bravo",
          "charlie",
          ..........
        };
  static public final String[] ENG_STRINGS = {
          "Diver below (when stationary)",
          "I am taking on or discharging explosives",
          "Yes(affirmative)",
         ..........
        };
 static public final String[] RUS_STRINGS = {
          "У меня спущен водолаз; держитесь в стороне от меня и следуйте малым ходом",
          "Я гружу, или выгружаю, или имею на борту опасный груз",
          "Утвердительный ДА или <Значение предыдущей группы должно читаться утвердительно>",
         ..........
        };
};

It is uderstood that the images of the first two arrays are to be presented in the directory ...app/src/main/res/drawable-nodpi with the names fall in the names in the arrays. Also it is uderstood that the sizes of the arrays above must be the same.

Your own applications development using the project provided.

You may pick up any of these projects, rename it with the standard Android Studio technologies and combine and improve the codes as you like.

Even if you have not any Android programming skills you may change the texts in RUS_STRINGS array to your own language texts and you will obtain the contextual information of the International Signals Code in your native language.

Also you can change all the texts in the class ISCodeData and the images in the directory ...app/src/main/res/drawable-nodpi with the items corresponding to any other information list (say, IMO Fire Control Signs, or any other similiar catalogue). No changes in the program context required(or just a few in layout).

Your references to my codes if any should be highly appreciated.

Points of Interest

I believe these projects will be interesting for people just starting to study Android technologies.

The program was registered in RuStore.

The icon for the program  UNIFORM-WHISKEY means "Pleasant Cruise!"

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)