Time of Update: 2018-12-05
重裝作業系統後,要重新設定Android開發環境。配置成功後,添加原本項目時卻出現了錯誤!Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project Properties.解決方案:1.項目右鍵 ->android tools->Fix
Time of Update: 2018-12-05
實現一個簡單的瀏覽器功能:: 你看,可以上網羅。。。控制碼:package org.example.browserintent;import org.example.browserintent.R;import android.app.Activity;import android.content.Intent;import android.net.Uri;import android.os.Bundle;import android.view.KeyEvent;import android.
Time of Update: 2018-12-05
透明//Transparent半透明//Translucentpackage rw.Trans;import android.app.Activity;import android.content.Context;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.graphics.Canvas;import android.graphics.PixelFormat;import
Time of Update: 2018-12-05
前一陣子,老大安排我寫一個GPS的程式。大致就是用Android 提供的Location 服務,來獲得當前的位置資訊和衛星資訊。這裡就用到了LocationManager類,要使用它,先得獲得系統所提供的location_serviceprivate LocationManager locationManager;locationManager =
Time of Update: 2018-12-05
以前的筆記,做個備份。在android源碼中編譯ADW_Launcheremulator -image system.img -data userdata.img -ramdisk ramdisk.img1.下載ADW_Launcher源碼 cd /android-2.1/packages/apps/ mkdir ADW_Launcher cd ADW_Launchergit clone
Time of Update: 2018-12-05
package com.test;import java.util.ArrayList;import java.util.HashMap;import android.app.Activity;import android.os.Bundle;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.SimpleAdapter;public class
Time of Update: 2018-12-05
項目是要儲存上次檔案播放的位置,我使用SharedPreferences來儲存,索引值對分別是檔案路徑和當時播放的位置。 定義: SharedPreferences preferences = null;SharedPreferences.Editor editor = null;preferences = getSharedPreferences(TAG, Activity.MODE_PRIVATE);editor =
Time of Update: 2018-12-05
在這篇教程我將告訴你如何使用TabActivity ActivityGroup一起為了內嵌套的活動。該方法可以有幾個嵌套的活動沒有“失去”選項您標籤導航。這個想法是用一個LocalActivityManager開始了嵌套的活動。然後替換的看法和觀點ActivityGroup不同的活動。現在,這聽起來或許複雜,但它是非常簡單的。首先,TabActivity類。view plaincopy to clipboardprint?import android.content.Intent;
Time of Update: 2018-12-05
在android中context可以做很多操作,但是最主要的功能是載入和訪問資源。在android中有兩種context,一種是 application context,一種是activity context,通常我們在各種類和方法間傳遞的是activity context。比如一個activity的onCreate:protected void onCreate(Bundle state) {super.onCreate(state);TextView label = new
Time of Update: 2018-12-05
android 如何在對話方塊中擷取edittext中的資料本文來自:http://blog.sina.com.cn/s/blog_86193b540100tulr.html//得到自訂對話方塊 final View DialogView = a .inflate ( R.layout.loand, null); //建立對話方塊 AlertDialog dlg = new AlertDialog.Builder(loand.this)
Time of Update: 2018-12-05
NotificationManager 和Notification的使用總結(轉) (1)、使用系統定義的Notification 以下是使用範例程式碼: //建立一個NotificationManager的引用 String ns = Context.NOTIFICATION_SERVICE; NotificationManager mNotificationManager = (NotificationManager)getSystemService(ns); //
Time of Update: 2018-12-05
在在LinearLayout外麵包一層ScrollView即可,如下代碼Apidemo 中關於如何使用ScrollView說明,請參考:<ScrollView
Time of Update: 2018-12-05
下文轉自 http://blog.csdn.net/sinom/archive/2010/06/04/5646369.aspx然後c#代碼 加了個主函數。我的調試環境是pc端是win7 vs2008,服務端 android版本是2.2最近做的項目中有功能需求要在客戶使用PC體驗程式時,同時通知與PC通過USB資料線相連的OPhone手機開啟相應的網站。故需要編寫Windows用戶端與Android服務端的Socket通訊程式。由於我對OMS系統沒有研究,故想直接寫Android SDK
Time of Update: 2018-12-05
android中如何設定焦點在某一個指定的View上:view.requestFocus();大的捲軸設定:listView.setFastScrollEnabled(true);EditText游標在右邊,輸入內容從右往左:android:gravity="center_vertical|right"或者editText.setGravity(Gravity.RIGHT);EditText
Time of Update: 2018-12-05
開篇(著急的兄弟請自己過濾此段)一直想動手寫寫關於我怎麼做Android程式的,可是總是開啟之後不知道如何寫下去,只能無奈的關閉。今天,我下定決心一定要寫出來。1.關於如何偵聽返回鍵事件 不知道您有沒有這樣的體驗,做了個程式,不想讓使用者一直點擊返回鍵,不知不覺中退了出來。希望給使用者一個更為有好的提示,留下那些其實並沒有真的要退出的使用者。好吧,今天我就來說說如何?這一功能。
Time of Update: 2018-12-05
在Windows安裝Cygwin設定Windows PATH: <PATH>\Cygwin\bin;<PATH>\android-sdk-windows\platform-tools;<PATH>\android-sdk-windows\tools;<PATH>\android-ndk-r6;<PATH>\android-ndk-r6\toolchains\x86-4.4.3\prebuilt\windows\bin設定Windows
Time of Update: 2018-12-05
Android XMPP Service (Google Talk) + Google Map == Follow Me 分類:Mobile2007/11/27 10:22我在 Android SDK 上寫了一個簡單的程式 (姑且把她叫 Follow Me),來測試 Android 的 XMPP Services (Google Talk) & Google Map 整合,我希望可以透過 Google Talk,來追蹤 Contact Lists 現在的位置及互相通訊。例如可以透過
Time of Update: 2018-12-05
轉自:http://www.oschina.net/code/snippet_4873_44371、已將圖片儲存到drawable目錄下,通過圖片id獲得DrawableResource res=gerResource();Drawable drawable=res.getDrawable(id);//id為R.drawable.圖片名稱2、通過圖片id獲得BitmapResource res=gerResource();Bitmap
Time of Update: 2018-12-05
(Google 官網http://source.android.com/source/)一 編譯環境搭建1.初始話編譯環境源碼大小大約為6G,完成一次編譯需要25G左右,我的硬碟為50G.2.建立linux環鏡Google doc(http://source.android.com/source/)推介使用ubuntu 10.10 64位(LTS),我的系統就是這個版本.一般需要以下軟體:Python 2.5 -- 2.7, which you can download from python.
Time of Update: 2018-12-05
alljoyn個開源的引擎,支援藍芽或者wifi進行點對點的通訊。 AllJoyn is a peer-to-peer technology that enables ad hoc, proximity-based, device-to-device communication without the use of an intermediary server.True