title: Get the PID of a process to kill it, without knowing its full name
body: <p>I'm coding an Android application. Now I'm going to a part where the application should kill a process. But I don't know its full name or its PID. I Know the commands:</p>
  
  <pre><code>android.os.Process.killProcess(Pid)
  </code></pre>
  
  <p>and </p>
  
  <pre><code>android.os.Process.getUidForName("com.android.email")
  </code></pre>
  
  <p>But my problem is that I don't know the full name of the process.</p>
  
  <p>It's an native code process, so not something like com.something.something</p>
  
  <p>The process is <code>/data/data/com.something.something/mybinary</code></p>
  
  <p>but it's running with commands like </p>
  
  <pre><code>/data/data/com.something.something/mybinary -a 123 -b 456
  </code></pre>
  
  <p>because of this I can't use </p>
  
  <pre><code>android.os.Process.getUidForName("/data/data/com.something.something/mybinary")
  </code></pre>