Java tutorial
//package com.java2s; //License from project: Apache License import android.content.Context; import java.io.IOException; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; import dalvik.system.DexFile; public class Main { public static List<String> getPackageAllClassName(Context context, String packageName) throws IOException { String sourcePath = context.getApplicationInfo().sourceDir; List<String> paths = new ArrayList<>(); if (sourcePath != null) { DexFile dexfile = new DexFile(sourcePath); Enumeration<String> entries = dexfile.entries(); while (entries.hasMoreElements()) { String element = entries.nextElement(); if (element.contains(packageName)) { paths.add(element); } } } return paths; } }