http://techcrunch.com/2012/03/24/apple-udids/
Apple 開始正式退回使用到 UDID 的 App。
去年 9 月開始說不要再用了,果然不是嘴砲!
2012年3月26日 星期一
2012年3月21日 星期三
Android Library Project After ADT v14
http://tools.android.com/tips/non-constant-fields
要將有用到R.xxx.xxx的 switch case 改為if else
要將有用到R.xxx.xxx的 switch case 改為if else
2012年3月8日 星期四
Intergate Zxing To Android Project
http://damianflannery.wordpress.com/2011/06/13/integrate-zxing-barcode-scanner-into-your-android-app-natively-using-eclipse/
2012年3月7日 星期三
Draw Path On Android MapView
Google MyTracks
http://code.google.com/p/mytracks/source/browse/MyTracks/src/com/google/android/apps/mytracks/MapOverlay.java
Other Sample Code
http://stackoverflow.com/questions/4408671/android-draw-route-on-a-mapview-with-twoo-poi-s
Background Log GPS
http://code.google.com/p/gpslogger/source/browse/trunk/GPSLogger/src/com/prom2m/android/gpslogger/service/GPSLoggerService.java
http://code.google.com/p/mytracks/source/browse/MyTracks/src/com/google/android/apps/mytracks/MapOverlay.java
Other Sample Code
http://stackoverflow.com/questions/4408671/android-draw-route-on-a-mapview-with-twoo-poi-s
Background Log GPS
http://code.google.com/p/gpslogger/source/browse/trunk/GPSLogger/src/com/prom2m/android/gpslogger/service/GPSLoggerService.java
2012年3月6日 星期二
Android Load Local Image To WebView
前提:
我已經把圖檔抓到Local端了,用 openFileOutput 寫入了。
方法1:
注意!!
用loadData時,要把 '#', '%', '\', '?' 分別轉換成 %23, %25, %27, %3f
且因為這個方法無法從遠端讀取資料,必須要把圖檔讀出來做過Base64 Encode
( Android 2.2 才有 Base64.java這個 Class,沒有需要自己去偷過來用!)
方法2:
個人較推薦,較不會犯錯。
我已經把圖檔抓到Local端了,用 openFileOutput 寫入了。
方法1:
注意!!
用loadData時,要把 '#', '%', '\', '?' 分別轉換成 %23, %25, %27, %3f
且因為這個方法無法從遠端讀取資料,必須要把圖檔讀出來做過Base64 Encode
( Android 2.2 才有 Base64.java這個 Class,沒有需要自己去偷過來用!)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
InputStream is; | |
try { | |
is = openFileInput(fileName); | |
ByteArrayOutputStream baos = new ByteArrayOutputStream(); | |
byte[] buffer = new byte[10240]; | |
int count; | |
while(-1 != (count = is.read(buffer, 0, buffer.length))) { | |
baos.write(buffer, 0, count); | |
} | |
baos.flush(); | |
byte[] imageRaw = baos.toByteArray(); | |
baos.close(); | |
is.close(); | |
//Base64 is copy from Android 2.2 source code due to the min SDK version is 2.1. | |
String image64 = Base64.encodeToString(imageRaw, Base64.DEFAULT); | |
String html = String.format("<body style=\"margin:0;padding:0;border:0;\"><img width=\"100%%25\" src=\"data:image/jpeg;base64,%s\" /></div>", image64); | |
getWebView().loadData(html, "text/html; charset=UTF-8", null); | |
} catch (Exception e) { | |
e.printStackTrace(); | |
onFail(e); | |
} |
方法2:
個人較推薦,較不會犯錯。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File file = getFileStreamPath(fileName); | |
String path = file.getAbsolutePath(); | |
String html = "<body style=\"margin:0;padding:0;border:0;\"><img width=\"100%\" src=\"file://" + path + "\" /></body>"; | |
getWebView().loadDataWithBaseURL("http://noneed.url", html, "text/html", "UTF-8", "about:blank"); |
2012年3月1日 星期四
Android afreechart
afreechart為android上一套免費的繪圖lib,是把jfreechart porting過來的。
Bug:
XYTextAnnotation 553行 應該為outlinePaintType
如果有設背景會讓字和背景色一樣,導致看不出來。
http://code.google.com/p/afreechart/source/browse/trunk/afreechart/src/org/afree/chart/annotations/XYTextAnnotation.java
Bug:
XYTextAnnotation 553行 應該為outlinePaintType
如果有設背景會讓字和背景色一樣,導致看不出來。
http://code.google.com/p/afreechart/source/browse/trunk/afreechart/src/org/afree/chart/annotations/XYTextAnnotation.java
訂閱:
文章 (Atom)