2012年8月31日 星期五

Good Mobile Web & Web Design Hint


http://www.mobilexweb.com/blog/mobile-web-html5-performance-optimization


After you design done, use W3C tools to verify the HTML5 page.

checklink: check the page link could go to the target page or file.
https://validator.w3.org/checklink

HTML5 validator: check your page is meet HTML5 format.
https://validator.w3.org/

CSS validator: check your css file is meet CSS format.
http://jigsaw.w3.org/css-validator/

HTML5 test - compare browsers tool
http://html5test.com/

CanIuse HTML5 canvas
http://caniuse.com/#feat=canvas

Use different IE version to test your web page (Simulator):
http://netrenderer.com/index.php

Javascript for DOM keycode
http://www.dotblogs.com.tw/corner/archive/2009/07/19/9583.aspx

Javascript Lib:
JQuery:
http://jquery.com/

JQueryUI:
http://jqueryui.com/
http://ui.jquery.com/

Examples:

1. HTML5 & javascript game: (Chinese)
    http://www.slideshare.net/azole/javascript-html51?related=1
    http://www.slideshare.net/azole/javascript-html5-2-ball?related=2




2012年8月30日 星期四

BT 4.0 Chipset Solution


目前BT4.0 分為 Single mode Dual mode;
Single mode 可以說是 Sensor mode, GATT & GAP Profile, 目前有看到 Heart rate, Thermometer, (Glucose)
Dual mode 目前只看到 HCI, 也就是需要外掛 MCU drive Bluetooth, 並沒有看到有Flash type ;

Dual Mode若有出 external Flash, 依目前市場狀態肯定會比原先的BT,
因為它兼容double function, H/W S/W架構也會不同, 推估也不太會有這樣solution~

另一類Cost down solution就是使用Single mode, Client & Server 客制 GATT profile, 打通兩邊的 UART port, SPP模擬 ;
但這是客制化, 也就是不會是個標準~

由以下可以看出 Marvell, Broadcom 主打 PC/NB/MACHCI solution;
CSR雖有跨到 sensor, 依官網 Solution比較像是作客制solution
目前仍以 TI solution 最完整,

整體來看, 各家陸續在推出BT4.0 solution, SIG也在持續推廣標準profile,
雖有市場已經有devices採用,
Samsung Galaxy S3
Apple's iPhone 4S iPad (3rd gen)
Apple MacBook Air, Mac Mini and MacBook Pro (Retina, June 2012)
Pebble E-Paper Watch
Google Nexus 7 tablet

預估至少還要在過半年, solution 會比較成熟, 尤其在Software Application~
Bluetooth BLE Chip Vendor
Single mode
Dual mode
TI
CC2540 / CC2541
CC2564
Broadcom

BCM20702
BCM43142 (WiFi + BLE4.0)
Nordic
nRF8001

CSR
CSR µEnergy®
CSR8000 (v3, v4, FM)
Marvell

88W8897 (WiFi-ac, NFC, BT4.0)
EM Microelectronic
EM9301


若有錯誤, 請不吝嗇指教~ Thanks,

References:
CSR / TI / Nordic / Marvell / EM Microelectronic / Broadcom Office website

Use Microsoft IE browser on MAC

It's really magic that you can use IE browser on MAC.
Generally, it's needed to install Microsoft Windows OS then you can use IE.
For MAC users, people often use bootcamp, VMware or Virtual BOX to install MS OS for Intel CPU Macbook.
Now we can use the tool called WineBottler to install IE.

http://www.macuknow.com/node/10055

But it seems not support ActiveX. Ha~

2012年8月28日 星期二

[Android] Use Webview class to develop WEB App



If you want to deliver a web application as a part of a client App, can use WebView. The WebView class is an extension of Android's View class that allows you to display web pages as a part of your activity layout.
It does not include any features of a fully developed web browser, such as navigation controls or an address bar.

The demo code as below:

1. Import the Web View class
import android.webkit.WebView;  

2. Declass Web View and use loadUrl
WebView webView = new WebView(this);
webView.loadUrl("http://your web site");
setContentView(webView);

3. Also need to add permission to access your Internet.
Add permission setting at androidmanifest.xml 
<uses-permission android:name="android.permission.INTERNET" />

4. Develop web and make layout similar to Android App.


Taking Screenshots Of Your Android Device

Easy way is that use your Android tool - Dalvik Debug Monitor.

Just run the DDMS.BAT in your Android SDK tools folder.

And make sure your device is set enable USB debugging.
You can do this by going to Settings ->Applications->Development and click to enable “USB Debugging.”

Once that’s done, go ahead and plug your mobile phone into the USB port. Since you’ve already installed the driver for your device, your computer will identify and connect – if it doesn’t then just browse to directly where you downloaded the driver files (again, you’ll only have to do this once.)

Then you can get your device screen.

Also refer to this page: http://www.addictivetips.com/mobile/how-to-take-screenshots-of-android-device/

[Xcode] Follow the rule before submitting your App


Apple has his own review guide line needed to follow up.
https://developer.apple.com/appstore/resources/approval/guidelines.html

Don't forget to read Apple human interface guidance.

Also need to check other developer experiences such as:
http://mobileorchard.com/avoiding-iphone-app-rejection-from-apple/

2012年8月27日 星期一

[Xcode] Submit App when using core plot

When you arching your App and do validate at Organizer, the message may show "[Your App name]  does not contain a single-bundle application or contains multiple products."


1. Click on the Project CorePlot-CocoaTouch and go to the Build Settings.  Set "Skip Install" to Yes.
2. Click on the CorePlot-CocoaTouch target and set "Skip Install" to Yes.
3. Click Build Phases and under Copy Headers, move all of the Public and Private entries to the Project section.

Re-arching your App then your should pass validate check.

2012年8月22日 星期三

[Xcode] Viewing Console Output and Device Logs


The iOS frameworks, such as UIKit, send log entries to the console to indicate, among other things, when an unexpected event occurs. You can emit console messages in your iOS apps, too. One way to emit console messages is to use the NSLog function. Console logs can help you analyze your app’s logic and track down bugs.

When running your app in a simulator, you can access the app’s console logs in the Console app (located in /Applications/Utilities)

Mac OSx terminal sudo

I think for security reason, OSx require user not use blank password to run sudo command.

The content below is referred from Apple website:



 Mac OS X v10.6 or later, if you press the Return key at the password prompt without entering a password, the message "Sorry, try again." will be displayed and you will be prompted for a password again.
If your administrator account has no password (a blank password), you must give that user a password before using thesudocommand.
After you are done using thesudocommand, you can change your account password again, although it is recommended that your administrator account have a non-blank password.

Use UISwitch in custom UIViewTableCell

I use UISwitch in my cells and can do add, edit and delete.

But UISwitch is always disappeared after change to ON of OFF.
I search Google and find a lot of developer has this issue and spend a lot of time to debug.

Finally, this bug has removed. Why?

Don't put the code to the cell configure function and that will let you run the code several times.

    cell.accessoryView = enableUISwitch;
    cell.editingAccessoryView = enableUISwitch;


Use accessoryView is good because you need to get UISwitch status: ON or OFF.



- (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject
       atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type
      newIndexPath:(NSIndexPath *)newIndexPath

Then you can use didChangeObject to get which row of UISwitch's status otherwise it can't be got.

It is only just run one time enough. 


This bug makes me almost crazy for two days.

2012年8月21日 星期二

台股投資參考資訊

1. 使用 yahoo 查 法人進出及資券比重等資訊
http://tw.stock.yahoo.com/d/i/major.html

2. Money DJ: 各種投資 information
http://www.moneydj.com

3. 公開資訊觀測站,查公司財務報表
http://mops.twse.com.tw/mops/web/t147sb04_q1

4. 巨亨網:各種投資 information
http://www.cnyes.com

5. 經建會經濟指標
http://index.cepd.gov.tw/inQuery.aspx?lang=1&type=it01


Bluetooth BLE 4.0 USB dongle for Mac

I use google for several days to find the product of Bluetooth 4.0 USB dongle for Mac OSx. There are many relative articles talking about that but not confirm which can really support Mac OSx and most is support for Microsoft Windows. Finally, I found the article talking about Here. Use this dongle and your OSx must be upgrade to the newest mountain lion, mine is not. The dongle is IOGEAR GBU521 Bluetooth 4.0 Micro Adapterwhich is Broadcom’s BCM20702A0 chip. The author said that OSx just can find USB device but the driver doesn't work. 
Luckily, the author said it can work on OSx 10.7.4,that means I don't need to upgrade my OSx.
But should hack the kext files:
/System/Library/Extensions/IOBluetoothFamily.kext.
BroadcomUSBBluetoothHCIController.kext
 /System/Library/Extensions/IOBluetoothFamily.kext/Contents/PlugIns/ and you’ll find another kext named BroadcomUSBBluetoothHCIController.kext.
open up the Contents folder. In that folder you should find the Info.plist file.
Use System Information utility to get device id.
idProduct and idVendor is integer and need to convert from hex to int.
Info.plist is like XML file for more detail refer to the page I found.
I gonna try it later after buy one dongle.

And I also found the dongle here but it is CSR chip costs higher.
Another is the Cirago dongle worked great for me after setting the NVRAM flag.
In Taiwan, can buy the dongle
WED-210V4 

Remember OSx version just support 10.7.4 or later.

If you want to use BLE dongle for iOS simulator, refer to this http://developer.apple.com/library/ios/#technotes/tn2295/_index.html.





2012年8月20日 星期一

NFC Android phone

List the Android smart phones have NFC hardware including Galaxy Nexus, Sony Xperia S and HTC One X.

Facebook for Websites


Facebook supports some useful tools can let your website to connect FB.
First, you need to go to Facebook developer and create Facebook App.
Then you will get App ID and security number before doing that, Facebook will require your certification.
Just enter your phone number, that's easy way to do.
Copy and paste Javascript of Facebook social plug-in and post your wall to your suitable web page.
Change App ID and security string. Then it will work. You can post your comments and like button on your FB.

2012年8月19日 星期日

How to detect mobile devices on your website

This article is good to explain for all. http://webdesign.about.com/od/mobile/a/detect-mobile-devices.htm

To summary that:
1. Use Javascript to detect mobile devices. I think most web browser support it.
2. CSS: Just change CSS for mobile devices but it's may a little hard to edit in the same page.
3. Use PHP, ASP or JSP etc. to catch client device type. Not sure that it can detect all.

If using Javascript, try to detect display width like this.

<script type="text/javascript">
<!--
if (screen.width <= 699) {
document.location = "mobile.html";
}
//-->
</script>
or 
For iOS devices: iPhone & iPod
<script language=javascript>
<!--
if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
   location.replace("http://your site/mobile.html");
}
-->
</script>



2012年8月14日 星期二

Support Bluetooth BLE Smart phone


It seems the HTC One X and the Motorola RAZR has BLE libraries that work as of now and running on Android 4.X.  Samsung Galaxy S3 have not released any API or dev kit for developing applications.

TI Bluetooth useful information

Refer to here and some technique files can't be found in office website.

2012年8月9日 星期四

AMOLED 介紹 ﹠ TFT LCD

http://www.investor.com.tw/onlinenews/freeColArticle.asp?articleNo=449
這篇寫的很詳細,值得紀錄下來~

http://singleontheearth.wordpress.com/2007/11/14/液晶電視面板-與-代數的迷失/

http://big5.xinhuanet.com/gate/big5/bj.xinhuanet.com/bjpd-wq/2012-06/15/content_25396770.htm

面板世代
玻璃基板尺寸(mm2
經濟切割產品
4
680×880
7英寸以下液晶屏
4.5
730×920
10.1英寸以下液晶屏
5
1100×1300
26英寸以下液晶屏
6
1500×1800
37英寸以下液晶屏
7
1870×2200
47英寸以下液晶屏
7.5
1950×2250
47英寸以下液晶屏
8.5
2200×2500
55英寸以下級液晶屏
10
2880×3130
42-65寸級液晶屏

Update application on MAC

Use iTunes to update the current application tool and found that Apple has new agreement must to be acceptable. Click Okay but iTunes doesn't show any agreement.
Try it again next day, then finally iTunes showed the agreement page. It seems the iTunes server is not stable and maybe too many users link and request service at the same time.

2012年8月8日 星期三

About the link for setting Web server on Mac



http://jingjong404.blogspot.tw/2012/08/blog-post.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+JingjongsBlog+(JingJong's+Blog)

2012年8月7日 星期二

[Xcode] Archive does not appear in xcode4 organizer

If you do not find the archives file in your organizer, may change the setting as below.


For the "Release" configuration do the following:
  • Set "Skip Install" to YES on your project
  • Set "Skip Install" to NO on your application target
  • Set "Skip Install" to YES on all static library targets that are included

idev101



Find all static libraries (ones usually have the project icon and are sitting on the left-hand navigator side. Go to the build settings and :
search for Skip Install and select YES instead of NO.
in build phases, under copy headers, move all public and private files to Project section.

icon miss, searching Google and found that.


  • Icon.png (57x57)
  • Icon@2x.png (114x114)
  • Icon-72.png (72x72)
  • iTunesArtwork (512x512)

  • http://knowledgetransferinobjectivec.blogspot.in/2012/05/itunesartwork-in-ios-apps.html

The office documents :
http://developer.apple.com/library/ios/#qa/qa1686/_index.html

[Xcode] Scene is unreachable due to lack of entry points

That is because using View controller in storyboard without defining identifier. Any of view controllers in storyboard needed to be defined even if the scene of view controller not used.

The log shows as:
Scene is unreachable due to lack of entry points and does not have an identifier for runtime access via -instantiateViewControllerWithIdentifier

QR code 應用

原先的條碼大多是一維, 儲存資訊量有限, 資料越大的話, 條碼也會越長; QR code 為一種二維條碼編碼方式,為日本人約1999年發佈使用, 可以儲存到文字及數字上千個字, 資料量相當的大; 二維條碼常應用在, 海報作為連結, 或是產品條碼, 因尺寸限制的關係, 需縮小;
最多的應用是, 結合 http link 產生QR code, 因 smart phone 風行, 藉由鏡頭讀取 QR code, 而直接連結到 http 網址。

產生QR code的方式, 有很多方式; 若線上產生的話, 可藉由 Kaywa 或 Goqr 等產生。

2012年8月4日 星期六

糖尿病控制

以下連結有針對世界主要血糖濃度指標,
http://www.ilshb.gov.tw/dmmanual_index.php?nid=3
歐洲,美國,台灣 & SDM等