編輯:關於Android編程
1.先來一個基礎的配置文件(build.properties)
##最後生成目錄
#relase.abs.dir=C:\\Users\\Administrator\\Desktop
#
##工程絕對路徑
#storeapp.abs=F:\\ZhangLeRepository\\trunk\\Andorid\\StoreApp
#photoview.abs=F:\\ZhangLeRepository\\trunk\\Andorid\\PhotoView
#andbase.abs=F:\\ZhangLeRepository\\trunk\\Andorid\\AndBase
#xutils.abs=F:\\ZhangLeRepository\\trunk\\Andorid\\xutils
#
##SDK相關工具變量
#sdk.home=F:\\adt\\sdk
#sdk.platform=android-19
#jdk.home=F:\\java
#
#
##簽名配置
#keystore.path=???
#keystore.storepass=???
#keystore.keypass=???
#keystore.alias=???
3.上bulid.xml
Cleaning the project... Generating R.java / Manifest.java from the resources... Compiling aidl files into Java classes... Generating BuildConfig.java... Generating BuildConfig.java... Generating BuildConfig.java... Generating BuildConfig.java... proguard... ;} " /> ;}" /> ;} " /> ;}" /> Converting compiled files and external libraries into dex format file... Packaging resources and assets... Packaging an unsigned APK file... Packaging signed apk for release...
3.其中有個buildconfig的工具,這裡共享源碼,到處為可運行的jar即可
/** * 2014-6-11 上午11:07:22 * Created By niexiaoqiang */ package com.xiaoqiang.genbuildconfig; import java.io.File; import java.io.FileWriter; import java.util.HashMap; /** * 生成BuildConfig文件 * @author niexiaoqiang */ public class GenBuildConfig { public static final String ABDIR = "abdir"; public static final String PACKAGE = "pakage"; public static final String DEBUG = "debug"; public static final String FILENAME = "BuildConfig.java"; public static void main(String[] args) { int paramsLength = args.length; if (paramsLength % 2 == 0) { HashMapparams = new HashMap (); for (int i = 0; i < paramsLength; i = i + 2) { params.put(args[i], args[i + 1]); } String content = getBuildConfigContent(params); //創建文件夾 File dir = new File(params.get(ABDIR).toString()); if (!dir.exists()) { dir.mkdirs(); } createFile(content, dir, params.get(PACKAGE).toString()); } } /** * 創建文件 * @param content * @param dir * @param packageStr */ public static void createFile(String content, File dir, String packageStr) { File javaFileDir = new File(dir, packageStr.replace(".", "\\")); if (!javaFileDir.exists()) { javaFileDir.mkdirs(); } File javaFile = new File(javaFileDir, FILENAME); javaFile.setWritable(true); try { FileWriter writer = new FileWriter(javaFile, false); writer.write(content); writer.flush(); writer.close(); } catch (Exception e) { e.printStackTrace(); } } /** * 生成文件內容 * @param params * @return */ public static String getBuildConfigContent(HashMap params) { StringBuilder sb = new StringBuilder(); sb.append("/**\r\n"); sb.append(" * Create By com.xiaoqiang.genbuildconfig\r\n"); sb.append(" */\r\n"); sb.append("\r\n"); sb.append("package " + params.get(PACKAGE) + ";\r\n"); sb.append("\r\n"); sb.append("public final class BuildConfig {\r\n"); sb.append(" public final static boolean DEBUG = " + params.get(DEBUG) + ";\r\n"); sb.append("}"); return sb.toString(); } }
1.Android WebView 一些基本概念 在 Android 手機中內置了一款高性能 webkit 內核浏覽器,在 SDK 中封裝為一個叫做 WebVie
Paint類介紹Paint即畫筆,在繪制文本和圖形用它來設置圖形顏色, 樣式等繪制信息。1.圖形繪制setARGB(int a,int r,int g,int b);設置
今天我們來繼續學習百度語音識別SDK的相關內容,今天我們以百度語音識別SDK提供的API接口為前提,來實現自己的語音識別交互界面。在正式開始今天的文章之前,我們首先來了解
什麼是路由?說簡單點就是映射頁面跳轉關系的,當然它也包含跳轉相關的一切功能。路由框架的意義Android系統已經給我們提供了api來做頁面跳轉,比如startActivi