title: Get GPS coordinates from an Android via a terminal?
body: <p><strong>How can I get GPS coordinates from an Android device via a terminal?</strong> </p>
  
  <p>I've searched <em>everywhere</em> and all I've found is Java code for apps, but not a decent method by just using a plain shell. I'm not interested in passive geo-location that uses nearby cell towers and wifi endpoints, but a method that uses the built-in GPS on a device. Is this even possible? Oh and side question: </p>
  
  <p><strong>Is it possible to toggle GPS via a terminal when rooted without any user confirmation?</strong> </p>
  
  <p><strong>Edit:</strong></p>
  
  <p>I found a way to execute what I want properly. Using <code>/system/bin/settings</code>, I can toggle GPS itself without user confirmation. After that, I can run a binary I made with Android NDK, and using JNI I can request the users current location.</p>