Time of Update: 2018-12-07
Belkin introduces WeMo light switch, control your household lighting from your Android device | Android CentralBelkin introduces WeMo light switch, control your household lighting from your Android deviceAccessoriesBy Richard Devine | Jan 06 2013 |
Time of Update: 2018-12-07
一開始我是用static來做全域,後來在網上看見老外有一個很好的辦法 public class MyApp extends Application { private Integer[] state; public Integer[] getState() { return state; } public void setState(Integer[] state) { this.state = state; } @Override public void onCreate() { //
Time of Update: 2018-12-07
正如你所熟悉的那樣,Android支援大多數傳統的功能表項目選項,包括icon、shortcut、checkbox和radio button,如下描述: Checkboxes和Radio ButtonsCheckboxes和radio buttons作為功能表項目在擴充菜單和子功能表中可見,4-6所示。設定功能表項目為checkbox,使用setCheckable方法。checkbox的狀態由setChecked方法控制。 Radio
Time of Update: 2018-12-07
要監聽android打電話和接電話,只需下面2步驟第一步,寫一個Receiver繼承自BroadcastReceiverimport android.app.Service;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.telephony.TelephonyManager;import
Time of Update: 2018-12-07
Redirection樣本涉及到三個Acitivity: RedirectEnter, RedirectMain,RedirectGetter。樣本的主Activity為 RedirectEnter ,RedirectEnter 啟動 RedirectMain, 而Activity 會根據某個條件來決定是否將應用的控制權傳給RedirectGetter 或是保持在RedirectMain。應用代碼中使用到了Shared Preferences (在之前的樣本中介紹過)。
Time of Update: 2018-12-07
先來最終的效果吧:我們的main.xml檔案內容為:<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"
Time of Update: 2018-12-07
Android程式一般都有drawable-hdpi、drawable-mdpi、drawable-ldpi三個檔案夾,用來放置不同解析度的圖片,由系統自動調用最合適的圖片。其對應關係為:hdpi:WVGA 800×480 | WVGA854 854×480mdpi:HVGA 480×320ldpi:QVGA
Time of Update: 2018-12-07
幸運轉盤 英文名: LuckyWheel這是一款有趣並且有用的小軟體,你可以讓它來幫你決定一些你拿不準主意的事,比如:去哪家餐館吃午餐?周末看哪部電影?讓誰去買複印紙?甚至於..給誰投選票? 軟體特性:好玩、實用,多人蔘與更有趣支援安裝到SD卡(需要2.2版或更高的作業系統)支援語音便捷輸入(需要2.0版或更高的作業系統,並安裝Google Voice
Time of Update: 2018-12-07
列表(ListView)、表格(GridView),這在手機應用上面肯定是少不了的,怎樣實現比較複雜一點的介面呢,先看一下我的。 這樣布局的情況是最基本的,也是最常用的,網上關於這樣的布局有多種版本的實現方法,但是有很多需要自己實現Adapter,那樣子是比較複雜而且沒有必要的,因為我們有簡約而不簡單的SimpleAdapter。1. ListViewSimpleAdapter的核心代碼:for (int i = 0; i < 10; i++) {Map<String,
Time of Update: 2018-12-07
UIhttps://github.com/pakerfeldt/android-viewflowhttps://github.com/lorensiuswlt/NewQuickAction3Dhttps://github.com/cyrilmottier/GreenDroidhttp://actionbarsherlock.com/ ORMhttp://ormlite.com/http://androrm.the-pixelpla.net/https://www.activeandroid.co
Time of Update: 2018-12-07
EditText 屬性EditText繼承關係:View-->TextView-->EditText。 EditText的屬性很多,這裡介紹幾個: android:layout_gravity="center_vertical" 設定控制項顯示的位置:預設top,這裡置中顯示,還有bottom android:hint="請輸入數字!" 設定顯示在空間上的提示資訊 android:numeric="integer" 設定只能輸入整數,如果是小數則是:
Time of Update: 2018-12-07
android:layout_weight="1"這一句可以使中間的textview權重增大,從而後面的checkbok可以居右顯示。android:focusable="false" android:focusableInTouchMode="false"
Time of Update: 2018-12-07
那我們的實際需要在執行的操作是:開啟終端 ,首先,以 root 許可權在 /etc/udev/rules.d/ 的目錄下建立 .rules 設定檔。命令:sudo touch 51-Android.rules接下來,我麼需要編輯剛剛建立的.rules檔案命令:gedit 51-Android.rules內陸運輸在其中輸入:SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"然後,賦予許可權命令:chmod a+r
Time of Update: 2018-12-07
android體系中的應用程式層本身就整合了打電話發簡訊的功能.那麼怎麼使用呢?/*發簡訊*/class SendMsgClickListener implements OnClickListener { public void onClick(View v) { //調用Android系統API傳送簡訊 Uri uri = Uri.parse("smsto:15800001234"); Intent intent
Time of Update: 2018-12-07
AsyncTask是個不錯的東西,可以使用它來做下載進度條。代碼講解如下:package com.example.downloadfile;import java.io.File;import java.io.FileOutputStream;import java.io.InputStream;import java.net.HttpURLConnection;import java.net.URL;import android.app.Activity;import android.app.
Time of Update: 2018-12-07
demo1代碼 Code highlighting produced by Actipro CodeHighlighter
Time of Update: 2018-12-07
不得不說,JSON 格式的確是非常美妙的,速度快而且簡化了很多操作在 Android 下,Android SDK 已經為我們封裝好了整個與 JSON 有關的操作,使用非常方便以下就是一個標準的 JSON 請求的實現過程:HttpPost request = new HttpPost(url); // 先封裝一個 JSON 對象 JSONObject param = new JSONObject(); param.put("name", "rarnu");
Time of Update: 2018-12-07
package com.android.cist.camera.view; import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.util.HashMap; import java.util.Map; import android.app.Activity; import android.app.AlertDialog; import
Time of Update: 2018-12-07
前段世界在一個應用中調用系統內建的傳送簡訊的Intent,但是接收者的號碼一直穿不過去,代碼如下:Uri smsToUri = Uri.parse("smsto:123456"); Intent sendIntent = new Intent(Intent.ACTION_VIEW, smsToUri); sendIntent.putExtra("sms_body", "Hello dear world"); sendIntent.setType("vnd.android-dir/mms-sms"
Time of Update: 2018-12-07
現在每天都在忙,而且一忙起來,就把寫筆記的事情放在了後面,最近在寫程式的時候,突然要使用全域變數,就按照以前的方式,寫了一個類,然後把變數都聲明為靜態變數,然後做為全域變數使用,但是在進行Activity切換的時候,突然發現,在前面一個Acitivty中賦值後,但是在後面卻無法擷取到,剛開始以為是有其它地方有問題,但是後來檢查發現也沒有問題,這個問題困擾了一個來小時,後來又換一種寫法,就是使用Application,但是在使用的時候,也發現有這種問題,當時真是感覺不知道如何處理了,在網上查資料也