發表文章

目前顯示的是 8月, 2015的文章

DateFormat.format() convert Date object into readable string to a human | Android coding

圖片
After work How to get the current date-time via Java code in Android? Date d = new Date(System.currentTimeMillis() ); /* A specific moment in time, with millisecond precision. Values typically come from currentTimeMillis(), and are always UTC, regardless of the system's time zone. This is often called "Unix time" or "epoch time" */ Also, someone uses other way instead as below: Calendar.get(Calendar.MONTH);   // get month of today. Calendar.get(Calendar.YEAR);   // get year of today. Calendar.get(Calendar.SECOND); // get second of today. Calendar.get(Calendar.MINUTE); // get minute of today. ..... but it is not a good ideal to capture the information of Date(). Why?  (Maybe player wants to get more point in game for cheating, and then turn the date of calendar to be earlier.... The man is I. Hahaha...!!)  Because of changing the time of  Calendar,  It  absolutely affects the data you want to get is incorrect. However, there is a good

How to manage your Share Button on website via Jquery + Javascript

圖片
Somebody uses a lot of javascript functions in onclick attribute in html tag like <a>, <button>, ... and so on. However, there is a good way to help coder to manage 'click' event easier by using class attribute as below. HTML code: <ul class="shareList">   <li> <a href="javascript:void(0);" class=" facebook " onclick="..."></a> </li> <li><a href="javascript:void(0);" class=" twitter " onclick="..."></a> </li> <li><a href="javascript:void(0);" class=" googleplus " onclick="..."></a> </li> <li><a href="javascript:void(0);" class=" plurk " onclick="..."></a> </li> <li><a href="javascript:void(0);" class=" weibo " onclick="..."></a> </li> </ul> Javascript

颱風動態 | 超厲害的動態直播氣象網站 - 海流、氣溫、風向、...一覽無遺

圖片
windyty動畫截圖 Windyty 網站截圖 推薦網站 : www.windyty.com 各位關心氣象的人有福了,這個網站真的是有史以來最強大的氣象網站。它可以將所有的氣象資料,以動態影像的方式播放,用時間軸慢慢的演化未來的氣象預測變化。 大家可以透過下列圖示的介面操作看看,會有很多意想不到的驚喜喔!! 右下角,資訊顯示方式 網站下方,點擊PLAY按鈕,播放個時段動態

Google Tango Project | 全新虛擬實境的行動裝置即將誕生 | Project Tango Tablet Development Kits

圖片
source from Google Project Tango. 近期, Google 已經開始將 Porject Tango 堆動於南韓和加拿大地區,並且預計於 8 月 26 日繼續擴展計畫到丹麥,芬蘭,法國,德國,愛爾蘭,意大利,挪威,瑞典,瑞士和英國 ... 等歐洲國家地區,但 Tango develop kit 開發套件僅用於軟體開發。 ( 咦 !!! 台灣呢 ??? ) Porject Tango 是一個可透過視覺鏡頭,而做程式設計的行動平台開發套件。透過視覺鏡頭和 Porject Tango 的結合,行動裝置將有能力偵測附近的環境,做有效的虛擬視覺參數運算。 Porject Tango 可讓程式開發人員,透過這款開發套件,驅動 Android 行動裝置上的特殊鏡頭組;而這鏡頭組上有廣角鏡、深度感應器、高精度感知器 … 等等硬體設備。未來加上精準定位、室內導航、 GPS 、 real-time rendering 、 Unity 和 texture 等等的應用結合後,使視覺虛擬的人機互動應用範圍變的更為廣泛。 想必有人家中擁有 Microsoft XBOX 的 Kinect 攝影機。想像一下, Project Tango 的應用,就是將這樣的視覺感應攝影機技術導入行動裝置,並且被 Android APP 開發人員,不管是遊戲也好、地圖也好、生活工具也好,更為廣泛的被應用於 Android APP 當中,並且隨身帶著跑呢!! Project Tango Tablet Development Kits 官方網站 Projec Tango C API 入門 - Google Official.

Android | Supporting different screen sizes | drawable-ldpi、drawable-mdpi、drawable-hdpi、drawable-xhdp

圖片
How to transform px(pixel, the actual LCD pixel density) into dp( Density-independent Pixel ) : px = dp * (dpi / 160) dp = px * 160 / dpi (p.s. the dpi value is depend on your android device.) then somebody will say : how to get dpi value in your Android java code? all the meaning of parameters are : x_dpi = actual pixel for x-axle. y_dpi = actual pixel for y-axle. _density = a scaling factor for the Density Independent Pixel unit. (Maybe not 3.0, it depends on the devise of user.) densityDpi  =  The screen density expressed as dots-per-inch, and your screen is using now.  ( p.s. Also, metrics.densityDpi can get the same result to densityDpi too. ) The sample code value _density also tell me the truth that my Android phone, Snoy Xperia Z, uses drawable-xxhdpi folder for default resolution. If there is nothing in drawable-xxhdpi folder, Android system will back to grab the file by the same name in drawable-mdpi folder(default) for default. however, the