顯示具有 android 標籤的文章。 顯示所有文章
顯示具有 android 標籤的文章。 顯示所有文章

2015年7月28日 星期二

eclipse 轉換到 Android Studio 後 Proguard 混淆器 註解掉 util.Log 失效問題

最近開始將 eclipse 轉換到 Android Studio

對於gradle 不是太熟悉

輸出apk 後發覺

之前在eclipse 設定Proguard 

用dex2jax 反編譯apk 之後 還是可以看到 Log.d 程式碼

可以註解掉 程式中所有的 Log.d , Log.i 機制失效了

eclipse proguard 設定

1.project.properties 文件中

proguard.config=${sdk.dir}/tools/proguard/proguard-android-optimize.txt:proguard-project.txt


2014年8月22日 星期五

[Android] string.xml 的 錯誤訊息 error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?

Android 中 的 String.xml 中

若要使用到 String.format() 的話

例如

想顯示 已經下載了 多少 bit 的 檔案  format 成 數字格式

String.format(getResources().getString(R.string.update_downloaded),currentSize ,totalSize);

String.xml 中

 <string name="update_downloaded">Downloaded %s bit  of %s  bit</string>

會出現錯誤訊息

error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?