android - How to know is there user added libraries into the project programmatically? -
in project, have included user created libraries. want check there libraries present in project. how this?
below code may help
public static void checklibrary(){ try { log.e(" in","checklibrary"); set<string> libs = new hashset<string>(); string mapsfile = "/proc/" + android.os.process.mypid() + "/maps"; bufferedreader reader = new bufferedreader(new filereader(mapsfile)); string line; while ((line = reader.readline()) != null) { if (line.endswith(".so")) { int n = line.lastindexof(" "); libs.add(line.substring(n + 1)); } } log.e("ldd", libs.size() + " libraries:"); (string lib : libs) { log.e("ldd", lib); } } catch (filenotfoundexception e) { // error handling... } catch (ioexception e) { // error handling... } }
Comments
Post a Comment