Android Open Source - BCC Import Export Manage






From Project

Back to project page BCC.

License

The source code is released under:

MIT License

If you think the Android project BCC 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.bcc;
/*www .j  av a  2  s  .c  o m*/
import java.util.ArrayList;
import java.util.List;

import com.bcc.util.Facade;
import com.bcc.util.adaptor.ManageListAdaptor;
import com.sdsu.bcc.database.data.FilesInformation;

import android.app.ListActivity;
import android.app.ProgressDialog;
import android.content.res.Configuration;
import android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemLongClickListener;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.Toast;

public class ImportExportManage extends ListActivity {
  private static Facade m_store = new Facade();
  private ProgressDialog m_ProgressDialog = null;
  private List<FilesInformation> m_values = new ArrayList<FilesInformation>();
  private ManageListAdaptor m_adapter = null;
  private Runnable fetchList;
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.import_export_manage_list_view);
    
    RelativeLayout layout = (RelativeLayout)findViewById(android.R.id.empty);
    layout.setBackgroundColor(Color.parseColor("#FF001E2F"));
    
    ListView list = (ListView)findViewById(android.R.id.list);
    list.setBackgroundColor(Color.parseColor("#FF001E2F"));
    
    LayoutInflater inflater = getLayoutInflater();
    ViewGroup header = (ViewGroup)inflater.inflate(R.layout.header, list, false);
    
    list.addHeaderView(header, null, false);
    list.setOnItemLongClickListener(new OnItemLongClickListener() {

      @Override
      public boolean onItemLongClick(AdapterView<?> parent, View view,
          int position, long id) {
        Toast.makeText(ImportExportManage.this,
            "Item in position " + position + " clicked",
            Toast.LENGTH_LONG).show();
        // Return true to consume the click event. In this case the
        // onListItemClick listener is not called anymore.
        return true;
      }
    });
    
    m_adapter = new ManageListAdaptor(this, m_values);
    setListAdapter(m_adapter);
    
    fetchList = new Runnable(){
            @Override
            public void run() {
                getList();
            }
        };
        Thread thread =  new Thread(null, fetchList, "ImportExportListFetchBackground");
        thread.start();
        m_ProgressDialog = ProgressDialog.show(ImportExportManage.this,    
              "Please wait...", "Retrieving data ...", true);
  }
  
  @Override
  public void onConfigurationChanged(Configuration newConfig) {
    // do nothing when keyboard open
    super.onConfigurationChanged(newConfig);
  }
  
   private Runnable returnResponse = new Runnable() {

        @Override
        public void run() {
            if(m_values != null && m_values.size() > 0){
                m_adapter.notifyDataSetChanged();
                for(int i=0;i<m_values.size();i++)
                m_adapter.add(m_values.get(i));
            }
            m_ProgressDialog.dismiss();
            m_adapter.notifyDataSetChanged();
        }
    };
      
    private void getList(){
    try{
      m_values = m_store.getFilesList(this);
      Thread.sleep(500);
      Log.i("ARRAY", ""+ m_values.size());
    } catch (Exception e) { 
      Log.e("BACKGROUND_PROC", e.getMessage());
    }
    runOnUiThread(returnResponse);
    }

  @Override
  protected void onListItemClick(ListView l, View v, int position, long id) {
    super.onListItemClick(l, v, position, id);
    FilesInformation item = (FilesInformation) getListAdapter().getItem(position-1);
    Toast.makeText(this, item.getFileName() + " selected", Toast.LENGTH_LONG).show();
  }
}




Java Source Code List

com.bcc.AddBCCManage.java
com.bcc.AddBCC.java
com.bcc.BCCActivity.java
com.bcc.ImportExportBCC.java
com.bcc.ImportExportManage.java
com.bcc.OCRResult.java
com.bcc.SetPrefs.java
com.bcc.util.BCCUtil.java
com.bcc.util.Facade.java
com.bcc.util.adaptor.ManageBCCListAdaptor.java
com.bcc.util.adaptor.ManageListAdaptor.java
com.itwizard.mezzofanti.AssetsManager.java
com.itwizard.mezzofanti.CameraManager.java
com.itwizard.mezzofanti.CaptureLayout.java
com.itwizard.mezzofanti.CustomImageButton.java
com.itwizard.mezzofanti.DownloadManager.java
com.itwizard.mezzofanti.InstallActivity.java
com.itwizard.mezzofanti.Mezzofanti.java
com.itwizard.mezzofanti.OCR.java
com.itwizard.mezzofanti.OnScreenHint.java
com.sdsu.bcc.BCCConstants.java
com.sdsu.bcc.database.DatabaseImpl.java
com.sdsu.bcc.database.DatabaseOperation.java
com.sdsu.bcc.database.data.CardInformation.java
com.sdsu.bcc.database.data.CategoryInformation.java
com.sdsu.bcc.database.data.ContactInformation.java
com.sdsu.bcc.database.data.FilesInformation.java
com.sdsu.bcc.database.data.ImageInformation.java
com.sdsu.bcc.database.impl.BCCDataStore.java
com.sdsu.bcc.database.impl.CategoryDataStore.java
com.sdsu.bcc.database.impl.ContactDataStore.java
com.sdsu.bcc.database.impl.FilesDataStore.java
com.sdsu.bcc.database.impl.ImageDataStore.java
com.sdsu.bcc.file.FileDataStoreFactory.java
com.sdsu.bcc.file.FileDataStoreOperations.java
com.sdsu.bcc.file.impl.CSVDataStore.java