seo優化排名, seo搜索引擎 | 十一月 2009
點擊這裡→ 港元980即時開設最強網上商店,無任何隱藏成本

seo優化排名, seo搜索引擎

網路推廣,網站排名,網站推廣,搜索網站,seo服務

Open Source的力量!下一個會被自由軟體毀滅的產業?

clock 十一月 26, 2009 18:10 by author Administrator

只要有夠多的使用需求,就會有人撰寫更多應用程式。

軟體Open Source化之後,誰有能力吃下這塊新的中小企業e化市場?

前一陣子搜尋網路上的自由軟體方案時,發現一套非常棒、功能齊全的電話交換機程式。從前提一些簡單的需求如錄音、調閱資料、同步監聽,通訊行的報價就動輒約7萬港元,而這套軟體可做到“百萬客服系統”的所有功能,還可整合另一套功能超強的客戶關係管理(CRM)程式(也是自由軟體)。

這套強大的交換機與客服系統需要多少費用呢?一台能跑Linux的電腦、一張1500港元起跳的PCI電話卡、網路佈線與網路電話,若加幾台Webcam,同時還能監視錄影,滿足公司型號、一般店面的兩的需求。不需要頂尖的伺服器,如EeeBox或某些可連網抓檔的硬碟盒,就跑得動Linux

Open Source化之後,我們可得到更大的“自由”。硬碟或電腦毀了?到附近的3C賣場搬一台回來,Linux光碟一灌,馬上可恢復使用。公司業務不能片刻暫停?那再加上一套設備(不到5千元),同時用Open Source的即時備援軟體,不用怕系統損壞時,廠商推託不來維修。只要使用者夠多,就會有人撰寫更多應用程式,或在超商販賣免費交換機系統的100個秘訣。

可預見的未來,一定會有廠商將保全系統、門禁系統整合進這套“中小企業包”,賺設備與佈線的費用。只要有廠商願意寫Linux的驅動程式,未來我們可在24小時購物網站上訂購硬體設備,插上網路孔後就可使用。在金融風暴下,什麼事都願意幹的科技公司,會讓這套系統更加完備、不易損壞,連小吃店都可以輕鬆搬一台回來裝。

地方性通訊公司面臨挑戰

當我看到這套費用低廉、功能強大的交換機系統時,我想到的是:那些靠資訊落差與不透明人事成本賺錢的地方性通訊公司,最好趕快準備轉型。雖然原有商家因轉換成本高,不會立刻換新交換機,但只要行銷能力夠強的大型業者進場,很快購買傳統交換機的新客戶就會大幅萎縮。就算是沒有電話客服人員的一般行業,基於擴充性與備援的考量,購買自由軟體的電話交換機還是明智的選擇。

誰能吃下這塊新的中小企業e化市場?我們想到的是許多不同產業的領導品牌。不過,Open Source方案的問題是:永遠有人可以提供比你便宜,或甚至免費的服務。所以明明實用性已經得到了確認,但未必有人願意做大型的商業推廣。

現在環境已成熟到“一觸即發”,但誰會來做第一個進場的勇者?或者因為香港市場太小、預期利潤太低,所以這套系統還是只能在懂程式的geek圈流傳?無論如何,我覺得這比Web2.0的商機具體多了。

推薦給同仁

Tell a Friend 

您想要瞭解更多的免費小竅門以便提升你的網站排名嗎?
請馬上聯繫我們網站管理員:
MSN: chenlinwu@cmmail.com 
Email: info@rank-ad.com


第一個評分

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


開始建立您的網上業務,點擊進入http://www.rank-ad.com/

加入每二週免費網上推廣提示電郵訂閱,即時獲贈免費關鍵字廣告課程及提升網站流量

加入每二週免費網上推廣提示電郵訂閱, 即時獲贈免費關鍵字廣告課程及提升網站流量
Fo Xuan Henry

建立你的 Facebook 電子名片

Bookmark and Share

Twitter Updates:

成功關鍵與失敗殺手——IT技術在網路事業中的角色!

clock 十一月 23, 2009 00:44 by author Administrator

經營網站需要具備許多功能,並運用IT程式來設計、創造。

缺少IT技術的網站,就像畫家沒有好的畫筆,難以讓創意具體化為現實,當然也無法對消費者產生吸引力。

我們從事網路生意超過10年,當中也開過好幾個的網上商店,當然不是個個都成功,有的也在蝕錢,最後都要被迫關閉。

從中我們得到了清楚的結論:不懂IT或沒能力料理IT技術問題,或者無法管理IT技術人員,根本沒資格經營網站。

IT就是裁縫手中的剪刀、廚師手中的菜刀、畫家手中的畫筆,不懂IT、沒能力管理IT的人,根本不可能經營好網站。

網站經營最大的本質就是線上上用系統與使用者溝通,任何實際的工具都用不上。所有的服務、功能,都要透過IT技術人員去“刻”出來,若IT技術跟不上的話,所有的創意都是空想。

所以IT既可能是網站成功的關鍵,更可能是網站失敗的殺手。

IT程式就像工廠的機器設備,沒有機器設備根本開不了工廠。機器設備只要壞了,維修就好;但是IT程式需要不斷地推陳出新,要增加功能、重新設計。

因此IT程式不是買來就能使用,還有更多的複雜問題要解決。

所以經營網站的第一步,就是要解決IT程式問題。解決的方法不外:

一、經營者本身就是技術人員;

二、經營者熟悉技術,不致受騙上當,有能力自己管理IT人員,或者發外包;

三、找到極可靠的IT技術人員,成為核心團隊;

四、有極可靠的IT外部顧問,或者是朋友,或者是花錢請來的。

網站經營者要思考,你對IT問題的解決方案,採取了上述四項中的哪一種方法?如果都沒有,你的網路事業註定失敗。

解決IT技術問題後,要注意的就是核心服務的確立,以及相關的IT設計與成本問題。你能想像的每一個服務、每一項功能,都代表IT技術人員要聽懂、要能做系統分析、要能轉換成程式,設計出來。這其中有兩個關鍵:時間與成本。

要花多少時間,這與你上線、開站有密切關聯,無法如期是網站經營者永遠的夢魔,因此預留調整的彈性時間是必要的思考。

要花多少錢,這與網站經營的投入成本與未來找到生意模式有關。任何瘋狂想像的服務,程式都寫得出來,只是代價多高、時間多長?

所以想像服務時,第一要注意的是系統程式成本。把功能做進階式的規劃,是常見的作法,先開站、服務再逐步到位。

總之,經營網路事業,IT很好也未必成功;但IT不行,一定失敗。

 

推薦給同仁

Tell a Friend 

您想要瞭解更多的免費小竅門以便提升你的網站排名嗎?
請馬上聯繫我們網站管理員:
MSN: chenlinwu@cmmail.com 
Email: info@rank-ad.com


第一個評分

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


開始建立您的網上業務,點擊進入http://www.rank-ad.com/

加入每二週免費網上推廣提示電郵訂閱,即時獲贈免費關鍵字廣告課程及提升網站流量

加入每二週免費網上推廣提示電郵訂閱, 即時獲贈免費關鍵字廣告課程及提升網站流量
Fo Xuan Henry

建立你的 Facebook 電子名片

Bookmark and Share

Twitter Updates:

Google Android 手機程式設計--常見的錯誤狀況與解決方式,Android 的內核程式碼

clock 十一月 18, 2009 12:57 by author Administrator

要連接 Google Map 請設定 XMPP Setting,加入你的 Gmail Account

 

Hey guys

I've been peacfully coding for about a week now with only a few problems, but right now out of goddamn nowhere the emulator started giving me that exception out of nowhere:

Java:

An error has occurred in process com.google.process.content. Unable to
start receiver com.google.android.xmppService.ServiceAutoStart:
java.lang.NullPointerException.


I changed only little in my code so I don't believe it is really my fault Confused

Now I cannot even run the Browser and the Maps without getting an NullPointerException Crying or Very sad

Help pls..

mrocket

 

Hello mrocket,

Up to now there are only two possible solutions for this problem.
On both you should save your data (database / other files - BEFORE Exclamation)

1.) Start the emulator once with "-wipe-data" on Additional Cmd-Line-Options:

 


or 2.)

Delete the emulator-image (userdata.img) located at:
WinXP: "C:\Documents and Settings\<win_loginname>\Local Settings\Application Data\Android\"
WinVista: "C:\Users\<win_loginname>\AppData\Local\Android\"

Both should fix it!

Regards,
plusminus

--------------------------------------------------

http://www.anddev.org/images/anddev_minilogo.png| Android Development Community / Tutorials

 

  

Android 的內核程式碼

Download : http://code.google.com/p/android/downloads/list

How to Make : http://blog.chinaunix.net/u/30686/showart_433547.html

download zip file( android_sdk_linux_m3-rc22a.zip ) and then install
my linux machine(FC7)

I could see kernel's image in ../tools/lib/images directory
file name : kernel-qemu, size : 1.2M

1. http://code.google.com/p/android/downloads/list
    download linux-2.6.23-android-m3-rc20.tar.gz android linux kernel
source
    and uncompress kernel source

2. goldfish architecture configuration file copy to .config
    goldfish configuration file in kernel/arch/arm/configs/
goldfish_defconfig

3. toolchain
   http://www.codesourcery.com/gnu_toolchains/arm/download.html
   checking radio box
      Target Platform : ARM uClinux
      Host Platform : IA32 GNU/LINUX
   and then download...

4. uncompress arm-2007q3-51-arm-uclinuxeabi-i686-pc-linux-gnu.tar
after download

5. evironment value setting /etc/bashrc
   PATH=$PATH:<arm-uclinuxeabi-* path>
   export PATH

6. kernel compiled by arm-uclinuxeabi-* compiler
    "make zImage"

7. kernel image(zImage) copy to <android>/tools/lib/images/

8. execute "emulator -console -debug-kernel -kernel zImage"

9. rename kenel image( zImage ) to kernel-qemu
    and execute "emulator -console -debug-kernel -kernel kernel-qemu"

注意:工具鏈裡面的gcc一定要選用GCC 3.3.*,GCC 4.2.*有問題。

 

參考文獻

1.        Android - An Open Handset Alliance Project - Open Source Licensing
http://code.google.com/android/kb/licensingandoss.html

2.        Ryan Paul, Why Google chose the Apache Software License over GPLv2 for Android, Published: November 06, 2007 - 09:26AM CT
http://arstechnica.com/news.ars/post/20071106-why-google-chose-the-apache-software-license-over-gplv2.html

3.        Installing the SDK
http://code.google.com/android/intro/installing.html

4.        Download the Android SDK
http://code.google.com/android/download.html

5.        Package Index
http://code.google.com/android/reference/packages.html

6.        Android 中文網 http://www.androidcn.net/

7.        Android 中文網- Documentation
http://www.androidcn.net/wiki/index.php/Documentation  

 

 






















第一個評分

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


開始建立您的網上業務,點擊進入http://www.rank-ad.com/

加入每二週免費網上推廣提示電郵訂閱,即時獲贈免費關鍵字廣告課程及提升網站流量

加入每二週免費網上推廣提示電郵訂閱, 即時獲贈免費關鍵字廣告課程及提升網站流量
Fo Xuan Henry

建立你的 Facebook 電子名片

Bookmark and Share

Twitter Updates:

Google Android 手機程式設計--Android 中的視覺畫元件展示館,Android 説明文件的閱讀指引,Android 與 Java 之間的關係

clock 十一月 16, 2009 18:45 by author Administrator

下列畫面顯示了 Android 中主要的視覺化元件的呈現外觀,這些範例在 Android SDK 中的 AdiDemo 專案中都有展示。

Android 説明文件的閱讀指引
每個 Android 文件都包含下列組成,其中的 XML Attributes 就是記載了其對映 XML 屬性的描述,在摘要與詳細內容兩段都有,整個文件的結構如下:

1.    類別定義 ex : class android.widget.TableRow.LayoutParams

2.   See Also : 記載相關類別的資訊

3.     Summary : 摘要

l     XML Attributes

XML Attributes inherited from class …

Constants inherited from class …

l      Fields

Fields inherited from class …

l      Public Constructors

l      Protected Methods

Methods inherited from class

4.   : 詳細內容

l      XML Attributes

XML Attributes inherited from class …

Constants inherited from class …

l      Fields

Fields inherited from class …

l     Public Constructors

l     Protected Methods

Methods inherited from class

 

Android Java 之間的關係

Android DVM 所採用的是 register based machine,與 Sun Stack Based machine 不同,而 Android 本身並不自稱 Java ,但實際上卻是 100 % JavaAndroid 為了迴避 Sun 採用了一些迂迴策略.


推薦給同仁

Tell a Friend 

您想要瞭解更多的免費小竅門以便提升你的網站排名嗎?
請馬上聯繫我們網站管理員:
MSN: chenlinwu@cmmail.com 
Email: info@rank-ad.com


第一個評分

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


開始建立您的網上業務,點擊進入http://www.rank-ad.com/

加入每二週免費網上推廣提示電郵訂閱,即時獲贈免費關鍵字廣告課程及提升網站流量

加入每二週免費網上推廣提示電郵訂閱, 即時獲贈免費關鍵字廣告課程及提升網站流量
Fo Xuan Henry

建立你的 Facebook 電子名片

Bookmark and Share

Twitter Updates:

Google Android 手機程式設計 -- 設定 Android 中Proxy的方法和Android 的函式庫列表

clock 十一月 14, 2009 16:43 by author Administrator

設定 Android Proxy的方法     

在程式中設定

在系統中設定

Android 的函式庫列表

 

推薦給同仁

Tell a Friend 

您想要瞭解更多的免費小竅門以便提升你的網站排名嗎?
請馬上聯繫我們網站管理員:
MSN: chenlinwu@cmmail.com 
Email: info@rank-ad.com


第一個評分

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


開始建立您的網上業務,點擊進入http://www.rank-ad.com/

加入每二週免費網上推廣提示電郵訂閱,即時獲贈免費關鍵字廣告課程及提升網站流量

加入每二週免費網上推廣提示電郵訂閱, 即時獲贈免費關鍵字廣告課程及提升網站流量
Fo Xuan Henry

建立你的 Facebook 電子名片

Bookmark and Share

Twitter Updates:

Google Android 手機程式設計--(附錄一: 範例程式的使用方法,Adb 除錯工具的使用)

clock 十一月 13, 2009 16:11 by author Administrator

附錄一: 範例程式的使用方法

Windows/preferences

 

附錄二  Adb 除錯工具的使用

 

推薦給同仁

Tell a Friend 

您想要瞭解更多的免費小竅門以便提升你的網站排名嗎?
請馬上聯繫我們網站管理員:
MSN: chenlinwu@cmmail.com 
Email: info@rank-ad.com


第一個評分

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


開始建立您的網上業務,點擊進入http://www.rank-ad.com/

加入每二週免費網上推廣提示電郵訂閱,即時獲贈免費關鍵字廣告課程及提升網站流量

加入每二週免費網上推廣提示電郵訂閱, 即時獲贈免費關鍵字廣告課程及提升網站流量
Fo Xuan Henry

建立你的 Facebook 電子名片

Bookmark and Share

Twitter Updates:

Google Android 手機程式設計--電話功能(Telephony),衛星定位,藍芽功能

clock 十一月 11, 2009 16:41 by author Administrator

Android 的電話功能主要在android.telephony這個函式庫當中,提供播打與接收電話的功能,其中最重要的兩個物件是 IPhone PhoneNumberUtils.

撥打電話

當你想要在程式中呼叫播打電話的功能時,必需在 AndroidManifest.xml 檔案中將允許程式播打電話的權限打開,其指令如下:

<uses-permission id="android.permission.CALL_PHONE" />

要建立 IPhone 物件,必需透過 ServiceManager 類別,以下是取得 IPhone 的方法:

private static IPhone getPhoneInterface() throws DeadObjectException {

    IServiceManager sm = ServiceManagerNative.getDefault();

    IPhone phoneService = IPhone.Stub.asInterface(sm.getService("phone"));

    return phoneService;

}

一但取得 IPhone 物件後,即可使用 call dial 來撥打電話,然後使用 endCall 來結束通話。 

        void  call(String number) : Place a call to the numer.

        void  dial(String number) : Dial a number.

        void  endCall(boolean hangupOnly) : End call or go to the Home screen

 

dial call 之間的差別是 dial 會顯示一個撥號介面,其上填入 number 這個電話號碼 ( number null,則撥號介面中將不會有預設的號碼)

另一種撥打電話的方法是對一個電話網址 (例如: tel:0988077312) 送出  CALL_ACTION的動作,即可進行通話供能。

另外、你也可以使用 DataStateIntentReceiver PhoneStateIntentReceiver 進行電話事件的註冊,以便取得撥號狀態 (IDLE, RINING, OFF_HOOK)、服務狀態 (in service, out of service, emergency only, powered off, roaming, operator name )、訊號強度、語音留言、連線狀態 (disconnectedconnectingconnected)、資料進出狀態 (data in, data out) 等等。

取得電話資訊

 

您也可以透過 TelephonyProperties 中的屬性值,取得許多手機相關的資訊,例如手機的電話號碼、SIM 卡的資訊等等,其方法是使用 os.SystemProperties.get() 函數,傳入 TelephonyProperties 中的對應參數即可取得之,反之、若使用os.SystemProperties.put() 則可設定這些參數。

 

範例一:取得 IMEI 國際手機代碼

android.os.SystemProperties.get(PROPERTY_IMEI)

範例二:取得手機的電話號碼

android.os.SystemProperties.get(PROPERTY_LINE1_NUMBER)

範例三:取得手機的語音郵件號碼

android.os.SystemProperties.get(PROPERTY_LINE1_VOICE_MAIL_NUMBER)

範例四:取得電信公司的名稱

android.os.SystemProperties.get(PROPERTY_SIM_OPERATOR_ALPHA)

範例五:取得國家的代碼

android.os.SystemProperties.get(PROPERTY_SIM_OPERATOR_ISO_COUNTRY)

 

衛星定位

 

與衛星定位相關得兩個函式庫是android.location com.google.android.maps,目前還再草案狀態未定案

衛星定位的程式

android.location

預計將支援四種地圖相關資訊 (classkmlnmeatrack),其中的 LocationManager LocationProvider 是核心元件。

要取得 Location Manager 的方式必需透過 Context,方法如下:

LocationManager lm = Context.getSystemService(Context.LOCATION_SERVICE);

 

控制 Google Map 的顯示

com.google.android.maps

此函式庫支援 GoogleMap 應用程式的控制,您可以透過 MapView 物件顯示 GoogleMap,但前題是您的 Activity 必需繼承 MapActivity

 

接著您可以透過 MapView 中的getController() getOverlayController() 去控制MapView

 

GoogleMap 上重疊顯示

http://davanum.wordpress.com/2007/11/19/drawing-overlays-for-android-maps-aka-search-for-starbucks/

藍芽功能

藍芽裝置由於具有獨特的搜尋裝置等特性,因此、某些功能無法納入普通的 TCP/IP 網路功能之下,因此、需要特殊的函式庫支援,在 Android 中,採用的是開放原始碼的 bluez 函式庫 ( Android 中路徑為 org.bluez)

開放原始碼的藍芽函式庫 - BlueZ

搜尋藍芽裝置

檔案與物件交換

透過藍芽連上 Internet  自製視覺化元件

http://code.google.com/android/toolbox/custom-components.html

您可以經由繼承 view, layout,或任何從 View 衍生下來的元件以自製.

These steps provide a high level overview of what you need to know to get started in creating your own components:

1.Extend an existing View class or subclass with your own class.

2. Override some of the methods from the superclass: the superclass methods to override start with 'on', for example, onDraw(), onMeasure(), and onKeyDown().

This is similar to the on... events in Activity or ListActivity that you override for life cycle and other functionality hooks.

3. Use your new extension class: once completed, your new extension class can be used in place of the view upon which it was based, but now with the new functionality

 The CustomView sample in the API Demos provides an example of a customized component. The custom component is defined in the LabelView class.

推薦給同仁

Tell a Friend 

您想要瞭解更多的免費小竅門以便提升你的網站排名嗎?
請馬上聯繫我們網站管理員:
MSN: chenlinwu@cmmail.com 
Email: info@rank-ad.com


第一個評分

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


開始建立您的網上業務,點擊進入http://www.rank-ad.com/

加入每二週免費網上推廣提示電郵訂閱,即時獲贈免費關鍵字廣告課程及提升網站流量

加入每二週免費網上推廣提示電郵訂閱, 即時獲贈免費關鍵字廣告課程及提升網站流量
Fo Xuan Henry

建立你的 Facebook 電子名片

Bookmark and Share

Twitter Updates:

Google Android 手機程式設計--影像與聲音功能

clock 十一月 10, 2009 14:10 by author Administrator

您可播放位於程式資源資料夾中的影音資源,也可以播放檔案系統中的影音檔,甚至播放網路上的影音檔案,但方法稍有差異。

播放內部影音資源 

MediaPlayer mp = MediaPlayer.create(context, R.raw.sound_file_1);

mp.prepare();

mp.start();

播放外部影音檔案

MediaPlayer mp = new MediaPlayer();

mp.setDataSource(PATH_TO_FILE);

mp.prepare();

mp.start();

播放網路上的影音檔案

ContentURI myURL = new ContentURI("http://myserver.com/link/to/my.mp3");

Intent intent = new Intent(Intent.VIEW_ACTION, myURL);

intent.setType("audio/*");

startActivity(intent);

擷取畫面

Bitmap copyWindowBitmap()

Return a copy of the bitmap holding the overall contents of the window this view is attached to.

void getAbsoluteLocationOnScreen(int[] location)

Computes the coordinates of this view on the screen.

錄音與錄影 

1. 啟動錄製功能

    recorder = new MediaRecorder();

    ContentValues values = new ContentValues(3);

 

    values.put(Video.MediaColumns.TITLE, SOME_NAME_HERE);

    values.put(Video.MediaColumns.TIMESTAMP, System.currentTimeMillis());

    values.put(Video.MediaColumns.MIME_TYPE, recorder.getMimeContentType());

   

    contentResolver = new ContentResolver();

   

    ContentURI base = Video.Media.INTERNAL_CONTENT_URI;

    ContentURI newUri = contentResolver.insert(base, values);

   

    if (newUri == null) {

        // need to handle exception here - we were not able to create a new

        // content entry

    }

   

    String path = contentResolver.getDataFilePath(newUri);

 

    // could use setPreviewDisplay() to display a preview to suitable View here

   

    recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);

    recorder.setAudioSource(MediaRecorder.AudioSource.MIC);

    recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);

    recorder.setVideoSize(176, 144); // QCIF

    recorder.setVideoFrameRate(15);

    recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H263);

    recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);

    recorder.setOutputFile(path);

   

    recorder.prepare();

    recorder.start();

2. 停止錄製功能

recorder.stop();

recorder.release();

照相功能

 

 

 

推薦給同仁

Tell a Friend 

您想要瞭解更多的免費小竅門以便提升你的網站排名嗎?
請馬上聯繫我們網站管理員:
MSN: chenlinwu@cmmail.com 
Email: info@rank-ad.com


第一個評分

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


開始建立您的網上業務,點擊進入http://www.rank-ad.com/

加入每二週免費網上推廣提示電郵訂閱,即時獲贈免費關鍵字廣告課程及提升網站流量

加入每二週免費網上推廣提示電郵訂閱, 即時獲贈免費關鍵字廣告課程及提升網站流量
Fo Xuan Henry

建立你的 Facebook 電子名片

Bookmark and Share

Twitter Updates:

Google Android 手機程式設計--第九章:二維繪圖功能,2D 動畫功能,3D 動畫OpenGL

clock 十一月 8, 2009 19:05 by author Administrator

Android 的繪圖相關物件

android.graphics.Camera

android.graphics.drawable.Drawable

 

Paint

  setStyle

  setColor

  setStrokeWidth(strokeWidth);

  setAntiAlias(true);

  setARGB(255, 255, 255, 255);

Path

PathEffect

 

Matrix

  .setPolyToPoly(src, 0, dst, 0, src.length >> 1);

 

Paint.FontMetrics

mFontMetrics = mPaint.getFontMetrics();

整合練習 - 繪圖版範例

2D 動畫功能

Bitmap

createBitmap(int[] colors, int width, int height, boolean hasAlpha)

int         getPixel(int x, int y)

int         height()

void  setPixels(int[] pixels, int offset, int stride, int x, int y, int width, int height)

int         width()

Canvas :

  setDevice()

  boolean     clipPath(Path path, ClipMode mode)

boolean      clipRect(float left, float top, float right, float bottom)

       Intersect the current clip with the specified rectangle, which is expressed in local coordinates.

void          drawBitmap(Bitmap bitmap, Rect src, Rect dst, Paint paint)

void    drawBitmap(Bitmap bitmap, float left, float top, Paint paint)

void    drawBitmap(Bitmap bitmap, Rect src, RectF dst, Paint paint)

void    drawCircle(float cx, float cy, float radius, Paint paint)

void    drawColor(int color)

void    drawColor(int color, Mode mode)

void    drawLine(float startX, float startY, float stopX, float stopY, Paint paint)

void    drawOval(RectF oval, Paint paint)

void    drawPaint(Paint paint)

void    drawPath(Path path, Paint paint)

void    drawPoint(float x, float y, Paint paint)

void    drawPoints(float[] pts, int offset, int length, Paint paint)

void    drawPoints(float[] pts, Paint paint)

void    drawPosText(char[] text, int index, int count, float[] pos, Paint paint)

void    drawPosText(String text, float[] pos, Paint paint)

void    drawRGB(int r, int g, int b)

void    drawRect(RectF rect, Paint paint)

void    drawRect(float left, float top, float right, float bottom, Paint paint)

void    drawRect(Rect r, Paint paint)

void    drawRoundRect(RectF rect, float rx, float ry, Paint paint)

void    drawText(String text, int start, int end, float x, float y, Paint paint)

void    drawText(char[] text, int index, int count, float x, float y, Paint paint)

void    drawText(String text, float x, float y, Paint paint)

void    drawText(CharSequence text, int start, int end, float x, float y, Paint paint)

void    drawTextOnPath(String text, Path path, float hOffset, float vOffset, Paint paint)

void    drawTextOnPath(char[] text, int index, int count, Path path, float hOffset, float vOffset, Paint paint)

變形與轉換

Android 中二維的動畫功能主要在 android.view.animation 函式庫中,包含兩種動畫功能,第一種是二維轉換 (tweened animation) ,第二種是逐畫面的動畫(frame by frame animation)

二維轉換總共有四種基本轉換

1.    AlphaAnimation 透明度轉換 (transparency changes)

2.    RotateAnimation旋轉 (rotations)

3.    ScaleAnimation 縮放 (growing or shrinking)

4.    TranslateAnimation 位移 (position changes)

 

描述二維轉換的方式又可分為 1. 使用 XML 2. 使用 Java 程式 兩種方法。

 

(1)  使用 XML 描述二維轉換

<set android:shareInterpolator="true"

     android:interpolator="@android:anim/ease_in_interpolator">

 

    <translate android:fromXDelta="0"

               android:toXDelta="30"

               android:duration="800"

               android:fillAfter="true"/>

   

    <set android:duration="800"

         android:pivotX="50%"

         android:pivotY="50%" >

 

        <rotate android:fromDegrees="0"

                android:toDegrees="-90"

                android:fillAfter="true"

                android:startOffset="800"/>

   

        <scale android:fromXScale="1.0"

                android:toXScale="2.0"

                android:fromYScale="1.0"

                android:toYScale="2.0"

                android:startOffset="800" />

    </set>

 

    <translate android:toYDelta="-100"

               android:fillAfter="true"

               android:duration="800"

               android:startOffset="1600"/>

</set>

 

(2)  使用 Java 實作二維轉換

// Create root AnimationSet.

AnimationSet rootSet = new AnimationSet(true);

rootSet.setInterpolator(new EaseInInterpolator());

rootSet.setRepeatMode(Animation.NO_REPEAT);

 

// Create and add first child, a motion animation.

TranslateAnimation trans1 = new TranslateAnimation(0, 30, 0, 0);

trans1.setStartOffset(0);

trans1.setDuration(800);

trans1.setFillAfter(true);

rootSet.addAnimation(trans1);

 

// Create a rotate and a size animation.

RotateAnimation rotate = new RotateAnimation(

       0,

       -90,

       RotateAnimation.RELATIVE_TO_SELF, 0.5f,

       RotateAnimation.RELATIVE_TO_SELF, 0.5f);

       rotate.setFillAfter(true);

       rotate.setDuration(800);

 

ScaleAnimation scale = new ScaleAnimation(

       1, 2, 1, 2, // From x, to x, from y, to y

       ScaleAnimation.RELATIVE_TO_SELF, 0.5f,

       ScaleAnimation.RELATIVE_TO_SELF, 0.5f);

       scale.setDuration(800);

       scale.setFillAfter(true);

 

// Add rotate and size animations to a new set,

// then add the set to the root set.

AnimationSet childSet = new AnimationSet(true);

childSet.setStartOffset(800);

childSet.addAnimation(rotate);

childSet.addAnimation(scale);

rootSet.addAnimation(childSet);

 

// Add a final motion animation to the root set.

TranslateAnimation trans2 = new TranslateAnimation(0, 0, 0, -100);

trans2.setFillAfter(true);

trans2.setDuration(800);

trans2.setStartOffset(1600);

rootSet.addAnimation(trans2);

 

// Start the animation.

animWindow.startAnimation(rootSet);

 

載入與啟動二維轉換

// Hook into the object to be animated.

TextView animWindow = (TextView)findViewById(R.id.anim);

 

// Load the animation from XML (XML file is res/anim/move_animation.xml).

Animation anim = AnimationUtils.loadAnimation(AnimationSample.this, R.anim.move_animation);

anim.setRepeatMode(Animation.NO_REPEAT);

 

// Play the animation.

animWindow.startAnimation(anim);

3D 動畫 OpenGL

Android 使用 OpenGL這個 3D 動畫遊戲引擎的嵌入式版本,稱為 OpenGL|ES,這和 J2ME 中的 JSR239 OpenGL ES API 大至上是相同的,但並不完全一樣。

OpenGL 的範例

Android 中使用 OpenGL 時,首先要先繼承 View 這個物件,然後在程式中取得 OpenGLContext 這個物件,接著在 onDraw() 這個函數中執行對應的繪圖的功能,以下是一個範例。

 

class GLView extends View

{

    public GLView(Context context)

    {

        mGLContext = new OpenGLContext(0);

    }

    @Override

    protected void onDraw(Canvas canvas) {

        GL10 gl = (GL10)(mGLContext.getGL());

        mGLContext.waitNative(canvas, this);

            gl.glViewport(0, 0, w, h);

            float ratio = (float)w / h;

            gl.glMatrixMode(gl.GL_PROJECTION);

            gl.glLoadIdentity();

            gl.glFrustumf(-ratio, ratio, -1, 1, 2, 12);

            gl.glDisable(gl.GL_DITHER);

            gl.glClearColor(1,1,1,1);

            gl.glEnable(gl.GL_SCISSOR_TEST);

            gl.glScissor(0, 0, w, h);

            gl.glClear(gl.GL_COLOR_BUFFER_BIT);

            gl.glMatrixMode(gl.GL_MODELVIEW);

            gl.glLoadIdentity();

            gl.glTranslatef(0, 0, -3.0f);

            gl.glScalef(0.5f, 0.5f, 0.5f);

            gl.glRotatef(mAngle, 0, 1, 0);

            gl.glRotatef(mAngle*0.25f,  1, 0, 0);

            gl.glColor4f(0.7f, 0.7f, 0.7f, 1.0f);

            gl.glEnableClientState(gl.GL_VERTEX_ARRAY);

            gl.glEnableClientState(gl.GL_COLOR_ARRAY);

            gl.glEnable(gl.GL_CULL_FACE);

            mCube.draw(gl);

            mAngle += 1.2f;

     mGLContext.waitGL();

          }

    }

 Android android.media.MediaPlayer 函式庫提供了影片與聲音的播放功能,另外也在android.media.MediaRecorder中提供了錄音與錄影的功能,但這些功能在模擬器當中將無法運作,只有真實的手機才會具備此功能。

推薦給同仁

Tell a Friend 

您想要瞭解更多的免費小竅門以便提升你的網站排名嗎?
請馬上聯繫我們網站管理員:
MSN: chenlinwu@cmmail.com 
Email: info@rank-ad.com


第一個評分

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


開始建立您的網上業務,點擊進入http://www.rank-ad.com/

加入每二週免費網上推廣提示電郵訂閱,即時獲贈免費關鍵字廣告課程及提升網站流量

加入每二週免費網上推廣提示電郵訂閱, 即時獲贈免費關鍵字廣告課程及提升網站流量
Fo Xuan Henry

建立你的 Facebook 電子名片

Bookmark and Share

Twitter Updates:

Google Android 手機程式設計--第八章:網路函式庫

clock 十一月 7, 2009 13:55 by author Administrator

Android 的網路函式庫採用了標準的 java.net.* 中的網路函式庫,包含 Socket, URL, InetAddress, . 等物件,並且將 Android 所擴充的物件放在 android.net.* 中,以補充原先 java 網路函數上的不足,另外、Android 也從 apache當中取用了 httpClient 的函式庫以形成更完整的網路架構。

網路相關函式庫

Socket 程式設計

Apache HttpClient

Android 的網路函式庫

XMPP 網路服務協定

XMPP : ineXtensible Messaging and Presence Protocol

 

Totally *Unofficial* Android GTalk Client (Send/Receive XMPP Messages)

http://davanum.wordpress.com/2007/11/23/totally-unofficial-android-gtalk-client-sendreceive-xmpp-messages/

 

WebKit 瀏覽器的控制

Android 中所採用的瀏覽器是 WebKit,和 iPhone 中的一樣,要控置瀏覽器很簡單,只要 import android.webkit.WebView 後,呼叫 loadUrl() 函數載入網頁即可。

推薦給同仁

Tell a Friend 

您想要瞭解更多的免費小竅門以便提升你的網站排名嗎?
請馬上聯繫我們網站管理員:
MSN: chenlinwu@cmmail.com 
Email: info@rank-ad.com


第一個評分

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


開始建立您的網上業務,點擊進入http://www.rank-ad.com/

加入每二週免費網上推廣提示電郵訂閱,即時獲贈免費關鍵字廣告課程及提升網站流量

加入每二週免費網上推廣提示電郵訂閱, 即時獲贈免費關鍵字廣告課程及提升網站流量
Fo Xuan Henry

建立你的 Facebook 電子名片

Bookmark and Share

Twitter Updates:



© 版權所有 海神科技有限公司

© 版權所有 海神科技有限公司