Android Open Source - MorseCode Settings






From Project

Back to project page MorseCode.

License

The source code is released under:

Custom License You are free to download and edit the source code for personal use but not for commercial app purposes. We are going to use this code to create an app in the future.

If you think the Android project MorseCode listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.csc.morsecode;
//from w w  w  .j  a  va  2 s.  co  m
import java.util.HashSet;
import java.util.Set;

import android.util.Log;

import com.csc.morsecode.data.CodeMapping;
import com.csc.morsecode.handlers.Input;
import com.csc.morsecode.handlers.Output;


public class Settings {
  
  
  private static CodeMapping codeMapping = null;
  private static HashSet<Input> inputs = new HashSet<Input>();
  private static HashSet<Output> outputs = new HashSet<Output>();
  
  public static String getOutgoingPhoneNum() {
    return "585-739-1852";
  }
  
  //--------------------------------------------------------------------------
  
  public static CodeMapping getCodeMapping() {
    return codeMapping;
  }
  
  public static Set<Input> getInputs() {
    return inputs;
  }
  
  public static Set<Output> getOutputs() {
    return outputs;
  }
  
  public static double getTimeScale() {
    return 5.0;
  }
  //--------------------------------------------------------------------------
  
  public static boolean setCodeMapping(CodeMapping mapping) {
    if(mapping == null) {
      return false;
    }
    
    Log.d("Settings", "Setting code mapping: " + mapping);
    codeMapping = mapping;
    return true;
  }
  
  public static boolean addInput(Input in) {
    if(in == null) {
      return false;
    }
    
    Log.d("Settings", "Adding input: " + in);
    return inputs.add(in);
  }
  
  public static boolean addOutput(Output out) {
    if(out == null) {
      return false;
    }
    
    Log.d("Settings", "Adding output: " + out);
    return outputs.add(out);
  }
}




Java Source Code List

com.csc.morsecode.MainActivity.java
com.csc.morsecode.PopMessage.java
com.csc.morsecode.Settings.java
com.csc.morsecode.data.CodeMapping.java
com.csc.morsecode.data.Code.java
com.csc.morsecode.data.Encoding.java
com.csc.morsecode.handlers.ConsoleOutput.java
com.csc.morsecode.handlers.Input.java
com.csc.morsecode.handlers.MessageReceiver.java
com.csc.morsecode.handlers.Output.java
com.csc.morsecode.handlers.TapInput.java
com.csc.morsecode.handlers.VibratorOutput.java