{"id":4596,"date":"2014-03-30T13:48:09","date_gmt":"2014-03-30T13:48:09","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/using-android-aapt-in-java-program-collection-of-common-programming-errors\/"},"modified":"2014-03-30T13:48:09","modified_gmt":"2014-03-30T13:48:09","slug":"using-android-aapt-in-java-program-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/using-android-aapt-in-java-program-collection-of-common-programming-errors\/","title":{"rendered":"using android aapt in java program-Collection of common programming errors"},"content":{"rendered":"<p>Old question, I know, but try this out:<\/p>\n<pre><code>String[] cmd = {\"aapt\", \"package\", \"-u\", \"-f\", \"-F\", \"\/\"\/\/home\/\/jay\/\/testing_FILES.apk\/\"\", \"\/\"\/\/home\/\/jay\/\/testing_FILES\/\"\"};\n\nRuntime run = Runtime.getRuntime();\nProcess pr = null;\ntry {\n    pr = run.exec(cmd);\n    pr.waitFor();\n} catch (IOException e) {\n    e.printStackTrace();\n} catch (InterruptedException e) {\n    e.printStackTrace();\n} finally {\n    if(pr != null){\n        close(pr.getOutputStream());\n        close(pr.getInputStream());\n        close(pr.getErrorStream());\n        pr.destroy();\n    }\n}\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Old question, I know, but try this out: String[] cmd = {&#8220;aapt&#8221;, &#8220;package&#8221;, &#8220;-u&#8221;, &#8220;-f&#8221;, &#8220;-F&#8221;, &#8220;\/&#8221;\/\/home\/\/jay\/\/testing_FILES.apk\/&#8221;&#8221;, &#8220;\/&#8221;\/\/home\/\/jay\/\/testing_FILES\/&#8221;&#8221;}; Runtime run = Runtime.getRuntime(); Process pr = null; try { pr = run.exec(cmd); pr.waitFor(); } catch (IOException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } finally { if(pr != null){ close(pr.getOutputStream()); close(pr.getInputStream()); close(pr.getErrorStream()); pr.destroy(); } [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4596","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4596","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4596"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4596\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4596"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4596"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4596"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}