项目截图
这里可以打开你的项目,双击config.xml
代码高亮(移植)
代码补全
项目编译我直接调用的命令
compile.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { new Thread(new Runnable() { public void run() { System.out.println("正在编译..."); progressBuild.setVisible(true); DroidDrawPanel.generate(); FileUtils.saveAsFileWriter(GlobalData.getProjectPath()+"/res/layout/main.xml",DroidDrawPanel.jtext.getText()); progressBuild.setValue(10); String projectPath = GlobalData.getProjectPath(); String projectPack = GlobalData.getProjectPack(); boolean A = Cmder.exeCmd("TOOL\\aapt.exe package -f -M " + projectPath + "\\AndroidManifest.xml -I TOOL\\android.jar -S " + projectPath + "\\res -J " + projectPath + "\\gen -m"); boolean B = Cmder.exeCmd("TOOL\\jdk\\bin\\javac.exe -encoding GBK -bootclasspath TOOL\\android.jar -classpath core.jar -d " + projectPath + "\\out " + projectPath + "\\src" + projectPack + "*.java " + projectPath + "\\gen" + projectPack + "*.java"); boolean C = Cmder.exeCmd("TOOL\\jdk\\bin\\java.exe -jar TOOL\\d8.jar " + projectPath + "\\out" + projectPack + "*.class --lib TOOL\\android.jar core.jar --output " + projectPath + "\\out"); if (A && B && C) System.out.println("文件编译完成"); else { progressBuild.setValue(0); Thread.currentThread().stop(); } progressBuild.setValue(50); boolean D = Cmder.exeCmd("TOOL\\aapt.exe package -f -M " + projectPath + "\\AndroidManifest.xml -S " + projectPath + "\\res -I TOOL\\android.jar -F " + projectPath + "/out/Test.ap_"); progressBuild.setValue(60); boolean E = Cmder.exeCmd("TOOL\\jdk\\bin\\java.exe -cp TOOL\\sdklib-26.0.0-dev.jar com.android.sdklib.build.ApkBuilderMain " + projectPath + "/out/Test.apk -v -u -z " + projectPath + "/out/Test.ap_ -f " + projectPath + "/out/classes.dex"); progressBuild.setValue(80); boolean F = Cmder.exeCmd("TOOL\\jdk\\bin\\jarsigner.exe -verbose -keystore TOOL\\test.keystore -storepass android -keypass android " + projectPath + "/out/Test.apk testalias"); progressBuild.setValue(100); System.out.println("APK编译完成"); progressBuild.setVisible(false); progressBuild.setValue(0); } }).start(); } });
xml文件的解析和拖动式的安卓界面开发是开源的,我直接搬运过来了,还有代码高亮是开源的,其他的都是直接一点一点码出来的
标签:setValue,projectPath,安卓,jar,大一,IDE,TOOL,progressBuild,out From: https://www.cnblogs.com/Frank-dev-blog/p/17323612.html