1

I am trying to run these shell commands via java but no success.Code executes perfectly but .so file do not exectue. while i use these commands in adb everything work perfeclty.

  

    private void submit() {
       System.out.println("doooooooooo");
          try {
               String[] commands = {"cd /data/data/com.dailydeals.usethisnow/lib", 
                                    "./libdeals.so" };
               Process p = Runtime.getRuntime().exec("/system/bin/sh -");
               DataOutputStream os = new DataOutputStream(p.getOutputStream());            
                  for (String tmpCmd : commands) {
                          os.writeBytes(tmpCmd+"\n");
                  }
              } catch (IOException e) {
              e.printStackTrace();    
              }
              System.out.println("doneooooooooo");
        } 

 
imz -- Ivan Zakharyaschev
  • 4,921
  • 6
  • 53
  • 104
user1350727
  • 11
  • 1
  • 2
  • Refer this post it will help you http://stackoverflow.com/questions/6882248/solved-running-shell-commands-though-java-code-on-android – Aerrow Apr 23 '12 at 08:06

1 Answers1

0

Executing shell commands in Android Applications (Android Programming)

Julien
  • 3,509
  • 20
  • 35
  • Perhaps, but the premise of the question is mistaken - as zapl pointed out a few minutes after you, there actually is no shell command to be run. Instead, there's a subroutine which would need to be dynamically loaded so that one or more functions it presumably contains can be called. – Chris Stratton May 04 '12 at 14:28