Changeset 42e7061 in dispositivos_moviles


Ignore:
Timestamp:
Nov 8, 2013, 8:38:50 AM (5 years ago)
Author:
Antonio Araujo Brett <aaraujo@…>
Branches:
master
Children:
ba6bc7c
Parents:
5366356
Message:

Al verificar firma electrónica de documento PDF desplegar las aplicaciones disponibles para mostrar el archivo PDF cuando se presiona el archivo. Ticket #28

Location:
TibisayMovil
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TibisayMovil/gen/ve/gob/cenditel/tibisaymovil/R.java

    r6f9915f r42e7061  
    112112    }
    113113    public static final class id {
    114         public static final int ImageView01=0x7f0c008b;
    115         public static final int TextView01=0x7f0c0078;
    116         public static final int action_settings=0x7f0c008c;
     114        public static final int ImageView01=0x7f0c008c;
     115        public static final int TextView01=0x7f0c0079;
     116        public static final int action_settings=0x7f0c008d;
    117117        public static final int archivo_descifrado=0x7f0c0024;
    118118        public static final int archivo_original_a_descifrar=0x7f0c0050;
    119119        public static final int archivo_original_a_firmar=0x7f0c0041;
    120120        public static final int archivo_original_pdf=0x7f0c0020;
    121         public static final int archivo_para_firmar=0x7f0c007e;
     121        public static final int archivo_para_firmar=0x7f0c007f;
    122122        public static final int arrow_show_errors=0x7f0c0025;
    123123        public static final int button_accept=0x7f0c0007;
     
    136136        public static final int button_clear_text=0x7f0c0005;
    137137        public static final int button_clear_zone=0x7f0c0003;
    138         public static final int button_delete=0x7f0c0054;
    139         public static final int button_finish=0x7f0c0086;
    140         public static final int button_finish_text=0x7f0c0087;
    141         public static final int button_finish_zone=0x7f0c0085;
     138        public static final int button_delete=0x7f0c0055;
     139        public static final int button_finish=0x7f0c0087;
     140        public static final int button_finish_text=0x7f0c0088;
     141        public static final int button_finish_zone=0x7f0c0086;
    142142        public static final int button_next=0x7f0c000c;
    143143        public static final int button_next_zone=0x7f0c000b;
    144         public static final int button_open=0x7f0c0061;
    145         public static final int button_recreate=0x7f0c007a;
     144        public static final int button_open=0x7f0c0062;
     145        public static final int button_recreate=0x7f0c007b;
    146146        public static final int button_remove_certificate=0x7f0c0011;
    147147        public static final int button_remove_certificate_text=0x7f0c0012;
    148148        public static final int button_remove_certificate_zone=0x7f0c0010;
    149         public static final int button_share=0x7f0c0089;
    150         public static final int button_share_text=0x7f0c008a;
    151         public static final int button_share_zone=0x7f0c0088;
    152         public static final int cert_chooser=0x7f0c0057;
    153         public static final int cert_chooser_install_button=0x7f0c0053;
    154         public static final int cert_data=0x7f0c005c;
    155         public static final int cert_description=0x7f0c0056;
    156         public static final int cert_item_alias=0x7f0c0058;
    157         public static final int cert_item_selected=0x7f0c005a;
    158         public static final int cert_item_subject=0x7f0c0059;
     149        public static final int button_share=0x7f0c008a;
     150        public static final int button_share_text=0x7f0c008b;
     151        public static final int button_share_zone=0x7f0c0089;
     152        public static final int cert_chooser=0x7f0c0058;
     153        public static final int cert_chooser_install_button=0x7f0c0054;
     154        public static final int cert_data=0x7f0c005d;
     155        public static final int cert_description=0x7f0c0057;
     156        public static final int cert_item_alias=0x7f0c0059;
     157        public static final int cert_item_selected=0x7f0c005b;
     158        public static final int cert_item_subject=0x7f0c005a;
    159159        public static final int certificate_issuer=0x7f0c004f;
    160160        public static final int certificate_list=0x7f0c0027;
     
    163163        public static final int certificate_valid_from=0x7f0c0015;
    164164        public static final int certificate_valid_until=0x7f0c004d;
    165         public static final int certificate_zone=0x7f0c0067;
    166         public static final int change_password=0x7f0c0062;
    167         public static final int confirmation=0x7f0c007c;
    168         public static final int confirmation_bar=0x7f0c006b;
    169         public static final int confirmation_decription=0x7f0c0068;
    170         public static final int confirmation_list=0x7f0c0069;
    171         public static final int confirmation_separator=0x7f0c006a;
    172         public static final int data_header=0x7f0c005b;
     165        public static final int certificate_zone=0x7f0c0068;
     166        public static final int change_password=0x7f0c0063;
     167        public static final int confirmation=0x7f0c007d;
     168        public static final int confirmation_bar=0x7f0c006c;
     169        public static final int confirmation_decription=0x7f0c0069;
     170        public static final int confirmation_list=0x7f0c006a;
     171        public static final int confirmation_separator=0x7f0c006b;
     172        public static final int data_header=0x7f0c005c;
    173173        public static final int decryption_result_layout=0x7f0c001e;
    174174        public static final int destinatario=0x7f0c002d;
    175         public static final int divider=0x7f0c0077;
    176         public static final int docs_data=0x7f0c005e;
     175        public static final int divider=0x7f0c0078;
     176        public static final int docs_data=0x7f0c005f;
    177177        public static final int documents_list=0x7f0c0051;
    178         public static final int fail_text=0x7f0c0066;
    179         public static final int file_check=0x7f0c0073;
    180         public static final int file_checkbox=0x7f0c006c;
     178        public static final int fail_text=0x7f0c0067;
     179        public static final int file_check=0x7f0c0074;
     180        public static final int file_checkbox=0x7f0c006d;
    181181        public static final int file_list=0x7f0c001d;
    182         public static final int file_radio=0x7f0c0072;
     182        public static final int file_radio=0x7f0c0073;
    183183        public static final int filename_data=0x7f0c002a;
    184         public static final int filename_modified=0x7f0c006d;
     184        public static final int filename_modified=0x7f0c006e;
    185185        public static final int filename_text=0x7f0c002b;
    186         public static final int files_to_sign=0x7f0c005d;
    187         public static final int fixing=0x7f0c0060;
    188         public static final int generalView=0x7f0c0055;
    189         public static final int imageListMainMenu=0x7f0c0074;
     186        public static final int files_to_sign=0x7f0c005e;
     187        public static final int fixing=0x7f0c0061;
     188        public static final int generalView=0x7f0c0056;
     189        public static final int imageListMainMenu=0x7f0c0075;
    190190        public static final int label_archivo_a_descifrar=0x7f0c001f;
    191191        public static final int label_archivo_a_firmar=0x7f0c0040;
     
    201201        public static final int layout_certificate_to_remove=0x7f0c0029;
    202202        public static final int layout_decrypted_file_and_arrow=0x7f0c0022;
     203        public static final int layout_pdf_signed_result=0x7f0c0053;
    203204        public static final int linearLayout=0x7f0c0017;
    204205        public static final int linearLayout1=0x7f0c0013;
     
    208209        public static final int listViewErrors=0x7f0c0043;
    209210        public static final int listViewFunctions=0x7f0c002f;
    210         public static final int lower_container=0x7f0c005f;
    211         public static final int nosignedfiles=0x7f0c0080;
    212         public static final int not_connected_text=0x7f0c0063;
    213         public static final int not_valid_text=0x7f0c0064;
     211        public static final int lower_container=0x7f0c0060;
     212        public static final int nosignedfiles=0x7f0c0081;
     213        public static final int not_connected_text=0x7f0c0064;
     214        public static final int not_valid_text=0x7f0c0065;
    214215        public static final int page_container=0x7f0c003e;
    215216        public static final int pages_spinner=0x7f0c003f;
    216         public static final int password=0x7f0c0079;
     217        public static final int password=0x7f0c007a;
    217218        public static final int path=0x7f0c001c;
    218219        public static final int pathstring=0x7f0c001b;
    219220        public static final int pkcs12_to_decrypt_description=0x7f0c001a;
    220         public static final int progress=0x7f0c0084;
     221        public static final int progress=0x7f0c0085;
    221222        public static final int sign_description=0x7f0c002e;
    222223        public static final int signature_date=0x7f0c0031;
    223         public static final int signature_errors=0x7f0c0071;
     224        public static final int signature_errors=0x7f0c0072;
    224225        public static final int signature_errors_text=0x7f0c0045;
    225         public static final int signature_icon=0x7f0c006f;
     226        public static final int signature_icon=0x7f0c0070;
    226227        public static final int signatures_list=0x7f0c0052;
    227         public static final int signer_data=0x7f0c006e;
     228        public static final int signer_data=0x7f0c006f;
    228229        public static final int signer_detail_errors=0x7f0c0046;
    229         public static final int signer_info=0x7f0c0070;
    230         public static final int signing=0x7f0c0082;
    231         public static final int signing_label=0x7f0c0083;
    232         public static final int summary=0x7f0c007f;
    233         public static final int summary2=0x7f0c0081;
     230        public static final int signer_info=0x7f0c0071;
     231        public static final int signing=0x7f0c0083;
     232        public static final int signing_label=0x7f0c0084;
     233        public static final int summary=0x7f0c0080;
     234        public static final int summary2=0x7f0c0082;
    234235        public static final int tableRow1=0x7f0c0032;
    235236        public static final int tableRow2=0x7f0c0036;
    236237        public static final int tableRow3=0x7f0c003a;
    237         public static final int textListMainMenu=0x7f0c0075;
    238         public static final int textView1=0x7f0c007b;
     238        public static final int textListMainMenu=0x7f0c0076;
     239        public static final int textView1=0x7f0c007c;
    239240        public static final int textView11=0x7f0c0033;
    240241        public static final int textView12=0x7f0c0034;
     
    246247        public static final int textView32=0x7f0c003c;
    247248        public static final int textView33=0x7f0c003d;
    248         public static final int the_button=0x7f0c007d;
    249         public static final int title=0x7f0c0076;
     249        public static final int the_button=0x7f0c007e;
     250        public static final int title=0x7f0c0077;
    250251        public static final int title_certificate_info=0x7f0c0048;
    251252        public static final int title_signature_date_info=0x7f0c0047;
    252253        public static final int title_signature_errors=0x7f0c0042;
    253254        public static final int type_image=0x7f0c0023;
    254         public static final int valid_text=0x7f0c0065;
     255        public static final int valid_text=0x7f0c0066;
    255256    }
    256257    public static final class layout {
  • TibisayMovil/res/layout/activity_verify_result_pdf.xml

    re68708b r42e7061  
    5050
    5151        <LinearLayout
     52            android:id="@+id/layout_pdf_signed_result"
    5253        android:layout_width="match_parent"
    5354        android:layout_height="0dp"
  • TibisayMovil/src/ve/gob/cenditel/tibisaymovil/PDFVerifyResultActivity.java

    rc14b8d2 r42e7061  
    44import java.io.File;
    55import java.io.InputStream;
    6 
    76
    87import android.net.Uri;
     
    1716import android.view.Window;
    1817import android.view.View.OnClickListener;
     18import android.webkit.MimeTypeMap;
    1919import android.widget.AdapterView;
    2020import android.widget.BaseAdapter;
     
    3939import java.util.ArrayList;
    4040import java.util.Random;
    41 
    4241import java.security.cert.X509Certificate;
    4342import java.text.SimpleDateFormat;
     
    8281                // ejecutar el proceso de verificacion del pdf
    8382                doVerification(pdfToVerify);
     83               
     84                LinearLayout layoutPdfFileResult = (LinearLayout) this.findViewById(R.id.layout_pdf_signed_result);
     85       
     86        OnClickListener pdfFileListener = new OnClickListener() {
     87            public void onClick(View v) {
     88               
     89                //Toast.makeText(getApplicationContext(), "**CLICK SOBRE EL archivo***", Toast.LENGTH_LONG).show();
     90               
     91                openIt(pdfToVerify, getMimeType(pdfToVerify));
     92            }
     93        };
     94        layoutPdfFileResult.setOnClickListener(pdfFileListener);
     95               
     96               
    8497               
    8598                // habilitar opciones de botones inferiores
     
    174187                        for (int l=0; l < fields.length; l++) {
    175188                                try {
    176                                         Toast.makeText(getApplicationContext(), "PDFVerifyResultActivity - reading certificate: "+Integer.toString(l)+ " "+
    177                                                 Integer.toString(fields[l].getInt(null)), Toast.LENGTH_SHORT).show();
     189                                        //Toast.makeText(getApplicationContext(), "PDFVerifyResultActivity - reading certificate: "+Integer.toString(l)+ " "+
     190                                        //      Integer.toString(fields[l].getInt(null)), Toast.LENGTH_SHORT).show();
    178191
    179192                                        caInput = new BufferedInputStream(getResources().openRawResource(fields[l].getInt(null)));
     
    475488        }
    476489       
     490    // funcion para obtener el tipo mime de un archivo
     491    public static String getMimeType(String url)
     492    {
     493        String extension = url.substring(url.lastIndexOf("."));
     494        String mimeTypeMap = MimeTypeMap.getFileExtensionFromUrl(extension);
     495        String mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(mimeTypeMap);
     496        return mimeType;
     497    }
     498
     499       
     500        // funcion para lanzar un intent que abra un archivo
     501    private void openIt(String pdfFile, String mimeType) {
     502               
     503                Intent shareIntent = new Intent();
     504                shareIntent.setAction(Intent.ACTION_VIEW);
     505                File file = new File(pdfFile);
     506                Uri uri = Uri.fromFile(file);
     507                Log.i("DEBUG", file.getPath());
     508                shareIntent.setDataAndType(uri, mimeType);             
     509                startActivity(Intent.createChooser(shareIntent, getResources().getText(R.string.open_it_using)));
     510        }
    477511       
    478512}
Note: See TracChangeset for help on using the changeset viewer.