Android Open Source - odcontrol-voice Nodo Device Adapter






From Project

Back to project page odcontrol-voice.

License

The source code is released under:

GNU General Public License

If you think the Android project odcontrol-voice 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

/**
Copyright 2014 Manuel Moscoso Dominguez/*from w ww .ja  v a2 s . c  o  m*/
This file is part of ODControl-Voice.

ODCOntrol-Voice is free software: you can redistribute it and/or modify 
it under the terms of the GNU General Public License as published by 
the Free Software Foundation, either version 3 of the License, or 
(at your option) any later version.

ODControl-Voice is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of 
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
GNU General Public License for more details.

You should have received a copy of the GNU General Public License 
along with ODControl-Voice.  If not, see <http://www.gnu.org/licenses/>.

**/
package cl.mamd.voice;

import java.util.List;

import cl.mamd.entity.NodoDevice;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

/**
 * 
 * @author mmoscoso  
 * @version 0.2
 * @comment Class for create adapter of Devices
 */
public class NodoDeviceAdapter extends BaseAdapter {
    private Context mcontext;
    private List<NodoDevice> values;
    

    public NodoDeviceAdapter(Context context, List<NodoDevice> nodos) {
        super();
        this.mcontext = context;
        this.values = nodos;
    }
    //@Override
    public View getView(int position, View rowView, ViewGroup parent) {
      
      LayoutInflater inflater = (LayoutInflater) mcontext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      
      rowView = inflater.inflate(R.layout.item_nodo_device,null);
      TextView textName = (TextView)rowView.findViewById(R.id.textViewName);
      TextView textIP = (TextView) rowView.findViewById(R.id.textViewIpAddress);
      TextView textCredentials = (TextView)rowView.findViewById(R.id.textView_Credentials);
      
      textName.setText(values.get(position).getName());
      textIP.setText(values.get(position).getIpaddress());
      textCredentials.setText("("+values.get(position).getUsername()+":"
          +values.get(position).getPasswd()+")");
      
      return rowView;
    }
  @Override
  public int getCount() {
    // TODO Auto-generated method stub
    return values.size();
  }
  @Override
  public Object getItem(int arg0) {
    // TODO Auto-generated method stub
    return arg0;
  }
  @Override
  public long getItemId(int position) {
    // TODO Auto-generated method stub
    return position;
  }
}




Java Source Code List

cl.mamd.communication.HTTPCheckAuthentication.java
cl.mamd.communication.HTTPExecuteInstruction.java
cl.mamd.datastore.DataStoreManager.java
cl.mamd.datastore.DataStoreOpenHelper.java
cl.mamd.entity.NodoDevicePort.java
cl.mamd.entity.NodoDevice.java
cl.mamd.voice.NodoDeviceActivity.java
cl.mamd.voice.NodoDeviceAdapter.java
cl.mamd.voice.NodoDevicePortActivity.java
cl.mamd.voice.NodoDevicePortAdapter.java
cl.mamd.voice.NodoDevicePortMainActivity.java
cl.mamd.voice.NodoVoiceRecognitionActivity.java
cl.mamd.voice.PreferenceVoice.java
cl.mamd.voice.VoiceMainActivity.java
cl.mamd.voice.VoicePreferenceFragment.java
cl.mamd.voice.tabfragment.FragmentDevicePortAnalog.java
cl.mamd.voice.tabfragment.FragmentDevicePortDigital.java
cl.mamd.voice.tabfragment.FragmentDevice.java