Zhack
Zhack

Reputation: 1

Execute an external program from an android app

I need to execute 'nmap' binary for my app. I use the wrapper nmap4j, in which i write the path on the device "sdcard/Nmap/bin/nmap".

try {
    nmap4j.execute();
} catch(Exception e) {
    System.out.println("error execute " + e);
}

The following error : error execute org.nmap4j.core.nmap.NMapExecutionException: Cannot run program "sdcard/Nmap/bin/nmap": error=13, Permission denied

showed up, and the app crashes because of a null pointer exception later

Upvotes: -1

Views: 634

Answers (1)

Zhack
Zhack

Reputation: 1

So, I found the solution to THIS problem.

I used the Android Studio "Device File Explorer", and I uploaded my binay executable in the application data folder:

root/data/data/com.example.appname/

Hope it can help

Upvotes: 0

Related Questions