2009年8月4日 星期二

How to build, install, and execute the android app using the android SDK

1. Get the example of the app widget:

svn checkout http://wiktionary-android.googlecode.com/svn/trunk/ wiktionary-android-read-only

2. Intsall the eclipse 3.4 and ADT Plugin:

wget http://eclipse.stu.edu.tw/eclipse/downloads/drops/R-3.4-200806172000/eclipse-SDK-3.4-linux-gtk.tar.gz

Follow the instructions of "http://developer.android.com/sdk/1.5_r3/installing.html#installingplugin" to install the ADT Plugin for Eclipse.

3. Set the "PATH":

export PATH=/home/qustion/Qualcomm/android/eclipse:/opt/jdk1.6.0_10/bin:/home/qustion/Qualcomm/android/android-sdk-linux_x86-1.5_r3/tools:$PATH


Also, we can add the following statements into ~/.bash_profile:

PATH=/home/qustion/Qualcomm/android/eclipse:/opt/jdk1.6.0_10/bin:/home/qustion/Qualcomm/android/android-sdk-linux_x86-1.5_r3/tools:$PATH

export PATH

If we want the bash under the gnome-termial to execute the ~/.bash_profile, we must select the "Edit->Current Profile->Title and Command->Command " as "Run command as a login shell" .

4. Remove the old project directionary of eclipse and the old user directionary of android emulator :
rm -fr ~/workspace/
rm -fr ~/.android/

5. Create the android virtual device (name:qustion, platform version:1.5) and launch the emulator:
android create avd -n qustion -t 2
emulator @qustion &


6. Execute the eclipse ,import the example of the app widget to create the eclipse project, and install the example into the emulator:

eclipse &

Set "Window->Preferences->Android->SDK Location" to
"/home/qustion/Qualcomm/android/android-sdk-linux_x86-1.5_r3"
and then press "Apply".

File->New->Android Project->Create Project from existing source

Project->Clean

Run->Run

We can see the follwoing messages on the console (buid the example "Wiktionary" ):

[2009-08-05 10:24:15 - LookupActivity] Android Launch!
[2009-08-05 10:24:15 - LookupActivity] adb is running normally.
[2009-08-05 10:24:15 - LookupActivity] Performing com.example.android.wiktionary.LookupActivity activity launch
[2009-08-05 10:24:15 - LookupActivity] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'qustion'
[2009-08-05 10:24:15 - LookupActivity] Application already deployed. No need to reinstall.
[2009-08-05 10:24:15 - LookupActivity] Starting activity com.example.android.wiktionary.LookupActivity on device
[2009-08-05 10:24:18 - LookupActivity] ActivityManager: Starting: Intent { comp={com.example.android.wiktionary/com.example.android.wiktionary.LookupActivity}

7. How to execute the app widget:

在Android emulator桌面長壓約3秒,出現一個選單,裡有一個選項"Widgets",點選進去後就可以看到"Wiktionary",再點選他,之後在桌面就可以看到一個home screen app widget名叫 "Wiktionary",他顯示"http://en.wiktionary.org/wiki/Wiktionary:Main_Page"的"Word of the day "

Reference:

http://android-developers.blogspot.com/2009/04/introducing-home-screen-widgets-and.html
http://developer.android.com/guide/developing/eclipse-adt.html
http://www.jollen.org/blog/2009/07/jollen-android-programming-19.html

http://slackwiki.org/Login_Shell

6 則留言:

匿名 提到...

I do believe all of the concepts you have introduced in your post.

They are very convincing and will certainly work. Nonetheless, the posts are very short for novices.
Could you please lengthen them a bit from subsequent time?
Thank you for the post.

Also visit my web site; buygenf20.eklablog.com

匿名 提到...

My partner and I stumbled over here coming from a different
website and thought I might as well check things out.
I like what I see so now i am following you. Look forward to looking into your web page yet
again.

my web page :: beep.com

匿名 提到...

It's awesome in support of me to have a site, which is helpful in support of my know-how. thanks admin

Also visit my web blog: http://www.exodus3000.com/

匿名 提到...

Awesome post.

Feel free to visit my page erectile dysfunction treatment

匿名 提到...

If you wish for to obtain a good deal from this article
then you have to apply these techniques to your won website.


my website ... toe nail fungus cure

匿名 提到...

Excellent goods from you, man. I have understand your stuff previous to and
you are just extremely wonderful. I really
like what you have acquired here, certainly like what you are stating and the way in which you say
it. You make it enjoyable and you still take care of to keep it sensible.
I can't wait to read much more from you. This is really a tremendous website.

Feel free to surf to my site: semen volume