Android Open Source - Android-Apps Commands






From Project

Back to project page Android-Apps.

License

The source code is released under:

Apache License

If you think the Android project Android-Apps 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.kniezrec.voiceremote2;
//from www. ja  v  a2  s. c  om
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;

import com.kniezrec.voiceremote2.R;

import android.content.Context;

public class Commands {
  /*
   * Buttons
   */
  public static final int BTN_SOURCE = 1;
  public static final int BTN_S_HDMI1 = 233;
  public static final int BTN_POWER_OFF = 2;
  public static final int BTN_1 = 4;
  public static final int BTN_2 = 5;
  public static final int BTN_3 = 6;
  public static final int BTN_4 = 8;
  public static final int BTN_5 = 9;
  public static final int BTN_6 = 10;
  public static final int BTN_7 = 12;
  public static final int BTN_8 = 13;
  public static final int BTN_9 = 14;
  public static final int BTN_0 = 17;
  public static final int BTN_VOLUME_UP = 7;
  public static final int BTN_VOLUME_DOWN = 11;
  public static final int BTN_CHANNEL_UP = 18;
  public static final int BTN_CHANNEL_DOWN = 16;
  public static final int BTN_MUTE = 15;
  public static final int BTN_MENU = 26;
  public static final int BTN_INFO = 31;
  public static final int BTN_ENTER = 104;
  public static final int BTN_UP = 96;
  public static final int BTN_DOWN = 97;
  public static final int BTN_LEFT = 101;
  public static final int BTN_RIGHT = 98;
  public static final int BTN_EXIT = 45;
  public static final int BTN_TELETEXT = 44;
  public static final int BTN_CHANNEL_LIST = 107;
  public static final int BTN_PAUSE = 74;
  public static final int BTN_PLAY = 71;
  public static final int BTN_STOP = 70;
  public static final int BTN_INTERNET = 147;
  public static final int BTN_TOOLS = 75;
  public static final int BTN_RETURN = 88;
  public static final int BTN_TIMEOUT_PAUSE = -1;

  /*
   * Actions
   */
  public static final int SHOW_ALL = 1000;
  public static final int SHOW_ALL_BACK = 2000;
  public static final int SHOW_ONLY_FAV = 1001;
  public static final int NOT_FOUND = -2;
  public static final int STOP = 1002;
  public static final int WRITE = 1004;
  public static final int TO_QUIET = 1005;
  public static final int TO_LOUD = 1006;
  public static final int EXEC_CHN = 1007;

  private HashMap<String, Integer> hashBTN_POWER_OFF;
  private HashMap<String, Integer> hashBTN_1;
  private HashMap<String, Integer> hashBTN_2;
  private HashMap<String, Integer> hashBTN_3;
  private HashMap<String, Integer> hashBTN_4;
  private HashMap<String, Integer> hashBTN_5;
  private HashMap<String, Integer> hashBTN_6;
  private HashMap<String, Integer> hashBTN_7;
  private HashMap<String, Integer> hashBTN_8;
  private HashMap<String, Integer> hashBTN_9;
  private HashMap<String, Integer> hashBTN_0;
  private HashMap<String, Integer> hashBTN_VOLUME_UP;
  private HashMap<String, Integer> hashBTN_VOLUME_DOWN;
  private HashMap<String, Integer> hashBTN_CHANNEL_UP;
  private HashMap<String, Integer> hashBTN_CHANNEL_DOWN;
  private HashMap<String, Integer> hashBTN_MUTE;
  private HashMap<String, Integer> hashBTN_INFO;
  private HashMap<String, Integer> hashBTN_ENTER;
  private HashMap<String, Integer> hashBTN_UP;
  private HashMap<String, Integer> hashBTN_DOWN;
  private HashMap<String, Integer> hashBTN_LEFT;
  private HashMap<String, Integer> hashBTN_RIGHT;
  private HashMap<String, Integer> hashBTN_EXIT;
  private HashMap<String, Integer> hashBTN_TELETEXT;
  private HashMap<String, Integer> hashBTN_CHANNEL_LIST;
  private HashMap<String, Integer> hashBTN_PAUSE;
  private HashMap<String, Integer> hashBTN_PLAY;
  private HashMap<String, Integer> hashBTN_STOP;
  private HashMap<String, Integer> hashBTN_INTERNET;
  private HashMap<String, Integer> hashBTN_RETURN;
  private HashMap<String, Integer> hashBTN_HDMI;

  public List<String> toRemove;
  public List<String> favouriteChannels;
  public List<String> review;
  public List<String> review_back;
  public List<String> stop;
  public List<String> favouriteList;
  public List<String> toLoudList;
  public List<String> toQuietList;
  public List<String> write;

  private Context ctx;
  private final static String SEM = ";";

  public ArrayList<HashMap<String, Integer>> all;
  public ArrayList<HashMap<String, Integer>> numeric;

  public static final ArrayList<RemoteButton> BUTTONS = new ArrayList<RemoteButton>();

  static {
    BUTTONS.add(new RemoteButton(R.id.src, BTN_SOURCE));
    BUTTONS.add(new RemoteButton(R.id.enter, BTN_ENTER));
    BUTTONS.add(new RemoteButton(R.id.up, BTN_UP));
    BUTTONS.add(new RemoteButton(R.id.down, BTN_DOWN));
    BUTTONS.add(new RemoteButton(R.id.left, BTN_LEFT));
    BUTTONS.add(new RemoteButton(R.id.right, BTN_RIGHT));
    BUTTONS.add(new RemoteButton(R.id.chlist, BTN_CHANNEL_LIST));
    BUTTONS.add(new RemoteButton(R.id.off, BTN_POWER_OFF));
  }

  public Commands(Context context) {
    ctx = context;
    all = new ArrayList<HashMap<String, Integer>>();
    numeric = new ArrayList<HashMap<String, Integer>>();
  }

  private void addToList(int resource, HashMap<String, Integer> map,
      int code, boolean isNum) {
    String res;
    String[] array;

    res = ctx.getResources().getString(resource);
    array = res.split(SEM);
    map = new HashMap<String, Integer>();
    Integer _code = Integer.valueOf(code);
    for (String s : array) {
      map.put(s, _code);
    }
    all.add(map);
    if (isNum) {
      numeric.add(map);
    }
  }

  public void loadFavourities(String preference) {
    favouriteList = null;
    if (preference != "") {
      String[] a = preference.split(":");
      favouriteList = Arrays.asList(a);
    }
  }

  public void loadResources() {

    String _value = ctx.getResources().getString(R.string.toRemove);
    toRemove = Arrays.asList(_value.split(SEM));

    _value = ctx.getResources().getString(R.string.write);
    write = Arrays.asList(_value.split(SEM));

    _value = ctx.getResources().getString(R.string.review);
    review = Arrays.asList(_value.split(SEM));

    _value = ctx.getResources().getString(R.string.reviewBack);
    review_back = Arrays.asList(_value.split(SEM));

    _value = ctx.getResources().getString(R.string.favouriteChannels);
    favouriteChannels = Arrays.asList(_value.split(SEM));

    _value = ctx.getResources().getString(R.string.end);
    stop = Arrays.asList(_value.split(SEM));

    _value = ctx.getResources().getString(R.string.toLoud);
    toLoudList = Arrays.asList(_value.split(SEM));

    _value = ctx.getResources().getString(R.string.toQuiet);
    toQuietList = Arrays.asList(_value.split(SEM));

    addToList(R.string.turnOff, hashBTN_POWER_OFF, BTN_POWER_OFF, false);
    addToList(R.string.O, hashBTN_0, BTN_0, true);
    addToList(R.string.one, hashBTN_1, BTN_1, true);
    addToList(R.string.two, hashBTN_2, BTN_2, true);
    addToList(R.string.three, hashBTN_3, BTN_3, true);
    addToList(R.string.four, hashBTN_4, BTN_4, true);
    addToList(R.string.five, hashBTN_5, BTN_5, true);
    addToList(R.string.six, hashBTN_6, BTN_6, true);
    addToList(R.string.seven, hashBTN_7, BTN_7, true);
    addToList(R.string.eight, hashBTN_8, BTN_8, true);
    addToList(R.string.nine, hashBTN_9, BTN_9, true);
    addToList(R.string.volUp, hashBTN_VOLUME_UP, BTN_VOLUME_UP, false);
    addToList(R.string.volDown, hashBTN_VOLUME_DOWN, BTN_VOLUME_DOWN, false);
    addToList(R.string.prevChannel, hashBTN_CHANNEL_DOWN, BTN_CHANNEL_DOWN,
        false);
    addToList(R.string.nextChannel, hashBTN_CHANNEL_UP, BTN_CHANNEL_UP,
        false);
    addToList(R.string.mute, hashBTN_MUTE, BTN_MUTE, false);
    addToList(R.string.info, hashBTN_INFO, BTN_INFO, false);
    addToList(R.string.enter, hashBTN_ENTER, BTN_ENTER, false);
    addToList(R.string.up, hashBTN_UP, BTN_UP, false);
    addToList(R.string.down, hashBTN_DOWN, BTN_DOWN, false);
    addToList(R.string.left, hashBTN_LEFT, BTN_LEFT, false);
    addToList(R.string.right, hashBTN_RIGHT, BTN_RIGHT, false);
    addToList(R.string.exit, hashBTN_EXIT, BTN_EXIT, false);
    addToList(R.string.teletext, hashBTN_TELETEXT, BTN_TELETEXT, false);
    addToList(R.string.channelList, hashBTN_CHANNEL_LIST, BTN_CHANNEL_LIST,
        false);
    addToList(R.string.pause, hashBTN_PAUSE, BTN_PAUSE, false);
    addToList(R.string.play, hashBTN_PLAY, BTN_PLAY, false);
    addToList(R.string.stop, hashBTN_STOP, BTN_STOP, false);
    addToList(R.string.internet, hashBTN_INTERNET, BTN_INTERNET, false);
    addToList(R.string.ret, hashBTN_RETURN, BTN_RETURN, false);
    addToList(R.string.hdmi, hashBTN_HDMI, BTN_S_HDMI1, false);

  }

}




Java Source Code List

com.kniezrec.remoterecorder.Communication.java
com.kniezrec.remoterecorder.MainServiceConnection.java
com.kniezrec.remoterecorder.MainService.java
com.kniezrec.remoterecorder.RequestType.java
com.kniezrec.remoterecorder.Request.java
com.kniezrec.voiceremote2.BSeriesKeyCodeSenderFactory.java
com.kniezrec.voiceremote2.BSeriesSender.java
com.kniezrec.voiceremote2.CSeriesButtons.java
com.kniezrec.voiceremote2.CSeriesKeyCodeSenderFactory.java
com.kniezrec.voiceremote2.CSeriesSender.java
com.kniezrec.voiceremote2.CommandsFragment.java
com.kniezrec.voiceremote2.Commands.java
com.kniezrec.voiceremote2.Discovery.java
com.kniezrec.voiceremote2.FSeriesButtons.java
com.kniezrec.voiceremote2.Group.java
com.kniezrec.voiceremote2.HelpFragment.java
com.kniezrec.voiceremote2.HostnamePreference.java
com.kniezrec.voiceremote2.KeyCodeSender.java
com.kniezrec.voiceremote2.ListActionsFragment.java
com.kniezrec.voiceremote2.MainActivity.java
com.kniezrec.voiceremote2.MainFragment.java
com.kniezrec.voiceremote2.Mapper.java
com.kniezrec.voiceremote2.MyExpandableListAdapter.java
com.kniezrec.voiceremote2.NewActionEdit.java
com.kniezrec.voiceremote2.NewActionSingleEdit.java
com.kniezrec.voiceremote2.NewAction.java
com.kniezrec.voiceremote2.RemoteButton.java
com.kniezrec.voiceremote2.SenderFactory.java
com.kniezrec.voiceremote2.Sender.java
com.kniezrec.voiceremote2.SettingsActivity.java
com.kniezrec.voiceremote2.TextSender.java
com.kniezrec.voiceremotefree.BSeriesKeyCodeSenderFactory.java
com.kniezrec.voiceremotefree.BSeriesSender.java
com.kniezrec.voiceremotefree.CSeriesButtons.java
com.kniezrec.voiceremotefree.CSeriesKeyCodeSenderFactory.java
com.kniezrec.voiceremotefree.CSeriesSender.java
com.kniezrec.voiceremotefree.Commands.java
com.kniezrec.voiceremotefree.Discovery.java
com.kniezrec.voiceremotefree.FSeriesButtons.java
com.kniezrec.voiceremotefree.HelpActivity.java
com.kniezrec.voiceremotefree.HostnamePreference.java
com.kniezrec.voiceremotefree.KeyCodeSender.java
com.kniezrec.voiceremotefree.ListActionsActivity.java
com.kniezrec.voiceremotefree.MainActivity.java
com.kniezrec.voiceremotefree.Mapper.java
com.kniezrec.voiceremotefree.NewActionEdit.java
com.kniezrec.voiceremotefree.NewActionSingleEdit.java
com.kniezrec.voiceremotefree.NewAction.java
com.kniezrec.voiceremotefree.RemoteButton.java
com.kniezrec.voiceremotefree.SenderFactory.java
com.kniezrec.voiceremotefree.Sender.java
com.kniezrec.voiceremotefree.Setings.java
com.kniezrec.voiceremotefree.SettingsActivity.java
com.kniezrec.voiceremotefree.TextSender.java
com.kniezrec.xbmcgear.connection.AndroidApplication.java
com.kniezrec.xbmcgear.connection.Connection.java
com.kniezrec.xbmcgear.connection.GearJSON.java
com.kniezrec.xbmcgear.connection.JSONRPCRequest.java
com.kniezrec.xbmcgear.connection.JSONRequestFactory.java
com.kniezrec.xbmcgear.connection.NSDResolve.java
com.kniezrec.xbmcgear.connection.NSDSearch.java
com.kniezrec.xbmcgear.connection.ProviderConnection.java
com.kniezrec.xbmcgear.connection.ProviderService.java
com.kniezrec.xbmcgear.connection.ResponseParser.java
com.kniezrec.xbmcgear.connection.WakeOnLan.java
com.kniezrec.xbmcgear.player.Kodi.java
com.kniezrec.xbmcgear.player.Player.java
com.kniezrec.xbmcgear.player.Playlist.java
com.kniezrec.xbmcgear.player.Song.java
com.kniezrec.xbmcgear.player.Video.java
com.kniezrec.xbmcgear.preferences.HostTable.java
com.kniezrec.xbmcgear.preferences.Host.java
com.kniezrec.xbmcgear.preferences.HostsDataSource.java
com.kniezrec.xbmcgear.preferences.HostsDatabaseHelper.java
com.kniezrec.xbmcgear.preferences.SharedPreferencesUtil.java
com.kniezrec.xbmcgear.presentation.AnimationManager.java
com.kniezrec.xbmcgear.presentation.AutoConfigurationActivity.java
com.kniezrec.xbmcgear.presentation.HostSetActivity.java
com.kniezrec.xbmcgear.presentation.InstanceActivity.java
com.kniezrec.xbmcgear.presentation.MainActivity.java
com.kniezrec.xbmcgear.presentation.StyleDialogFragment.java
com.kniezrec.xbmcgear.presentation.ViewMode.java
com.uraroji.garage.android.lame.SimpleLame.java
com.uraroji.garage.android.mp3recvoice.RecMicToMp3.java
de.quist.samy.remocon.Base64.java
de.quist.samy.remocon.Base64.java
de.quist.samy.remocon.ConnectionDeniedException.java
de.quist.samy.remocon.ConnectionDeniedException.java
de.quist.samy.remocon.Key.java
de.quist.samy.remocon.Key.java
de.quist.samy.remocon.Loggable.java
de.quist.samy.remocon.Loggable.java
de.quist.samy.remocon.RemoteReader.java
de.quist.samy.remocon.RemoteReader.java
de.quist.samy.remocon.RemoteSession.java
de.quist.samy.remocon.RemoteSession.java