Android examples for File Input Output:Zip File
get Zip Entries Names
//package com.java2s; import java.io.*; import java.util.ArrayList; import java.util.Enumeration; import java.util.zip.ZipEntry; import java.util.zip.ZipException; import java.util.zip.ZipFile; public class Main { public static ArrayList<String> getEntriesNames(File zipFile) throws ZipException, IOException { ArrayList<String> entryNames = new ArrayList<String>(); Enumeration<?> entries = getEntriesEnumeration(zipFile); while (entries.hasMoreElements()) { ZipEntry entry = ((ZipEntry) entries.nextElement()); entryNames.add(new String(getEntryName(entry) .getBytes("GB2312"), "8859_1")); }/* w w w . jav a 2 s .c o m*/ return entryNames; } public static Enumeration<?> getEntriesEnumeration(File zipFile) throws ZipException, IOException { ZipFile zf = new ZipFile(zipFile); return zf.entries(); } public static String getEntryName(ZipEntry entry) throws UnsupportedEncodingException { return new String(entry.getName().getBytes("GB2312"), "8859_1"); } }