Android中Parcelable介面用法

1. Parcelable介面Interface for classes whose instances can be written to and restored from a Parcel。 Classes implementing the Parcelable interface must also have a static field called CREATOR, which is an object implementing the Parcelable.Creator

將Android項目打包成APK檔案

Android項目開發完成以後就得將android專案檔打包成apk檔案,放到市場上去,以便於讓別人也來分享你的應用啊!接下來介紹一下個人打包apk的過程。1、產生keystore檔案在命令列中,輸入以下命令:keytool -genkey -alias android.keystore -keyalg RSA -validity 100000 -keystore

Error generating final archive: Debug certificate expired on xxxxxx(日期)(Android工程上有個叉)

今天遇到一個很詭異的問題,之前編寫的正確無誤的Android工程,在這次開啟Eclipse之後,工程上居然有個大紅色的叉:仔細查看各程式,沒有任何錯誤,只有個別警告。開啟Window-Show View-Problems,如所示:會看到錯誤原因:Error generating final archive: Debug certificate expired on xxxxxx(日期)這是因為認證到期了。解決方案:C:/Documents and Settings/USER.android

Android中判斷當前網路是否可用

應用情境:實現判斷當前網路是否可用當前有可用網路,如:當前沒有可用網路,如:實現步驟:1、擷取ConnectivityManager對象Context context = activity.getApplicationContext();// 擷取手機所有串連管理對象(包括對wi-fi,net等串連的管理)ConnectivityManager connectivityManager = (ConnectivityManager)context.getSystemService(Context.

Android匯入一個工程時提示 Invalid project description的解決方案

今天在網上下了個源碼,匯入的時候發現出現Invalid project description的提示,翻譯成中文就是“無效的項目描述”的意思,搞不明白遂百度找到瞭解決辦法,現記錄並共用之!Android匯入一個工程時提示 Invalid project description字樣,當我們單擊<Details>按鈕查看詳細內容可以看到overlaps the location of another

Android中的顯示單位

常用:1、px (pixels)像素:一般HVGA 代表320x480 像素,這個用的比較多。2、dip 或dp (device independent pixels)裝置獨立像素:這個和裝置硬體有關,一般為了支援WVGA、HVGA 和QVGA 推薦使用這個,不依賴像素。3、sp (scaled pixels — best for text size)比例像素:主要處理字型的大小,可以根據系統的字型自適應。不太常用:1、in (inches)英寸2、mm (millimeters)毫米3、pt

Android中SharedPreferences用法

1.SharedPreferences簡介為了儲存軟體的設定參數,Android 平台為我們提供了一個SharedPreferences 類,它是一個輕量級的儲存類,特別適合用於儲存軟體配置參數。使用SharedPreferences 儲存資料,其背後是用xml檔案存放資料,檔案存放在/data/data/<package name>/shared_prefs 目錄下。2.擷取SharedPreferences對象方法:SharedPreferences pre = Context.

android開發圖片解析度適配

1.drawable-(hdpi,mdpi,ldpi)的區別 dpi是“dot per inch”的縮寫,每英吋像素數。 四種密度分類: ldpi (low), mdpi (medium), hdpi (high), and xhdpi (extra high) 一般情況下的普通螢幕:ldpi是120,mdpi是160,hdpi是240,xhdpi是320。2.WVGA,HVGA,QVGA的區別 VGA是“Video Graphics Array”,顯示標準為640*480。

Android中Application類用法

Application類Application和Activity,Service一樣是Android架構的一個系統組件,當Android程式啟動時系統會建立一個Application對象,用來儲存系統的一些資訊。Android系統自動會為每個程式運行時建立一個Application類的對象且只建立一個,所以Application可以說是單例(singleton)模式的一個類。通常我們是不需要指定一個Application的,系統會自動幫我們建立,如果需要建立自己的Application,那也很簡

讓Android支援自訂的ttf字型

 所謂無圖無真相,先看: Java代碼如下: package yc.android.fonts;import android.app.Activity;import android.graphics.Typeface;import android.os.Bundle;import android.widget.TextView;public class Y_fonts extends Activity {/** Called when the activity is first

Android中取得手機螢幕大小

先看:  其實就是 DisplayMetrics類 的應用 ,代碼如下:package yc.android.resolution;import android.app.Activity;import android.os.Bundle;import android.util.DisplayMetrics;import android.view.View;import android.widget.Button;import android.widget.TextView;public

1、android基於openfire+smack開發之【架構瞭解】

一、什麼是XMPP?Extensible Messaging and Presence Protocol,簡單的來講,它就是一個發送接收處理訊息的協議,但是這個協議發送的訊息,既不是二進位的東東也不是字串,而是XML。二、什麼是IM?Instant Messenger,及時通訊軟體,就是大家使用的QQ、MSN Messenger和Gtalk等等。其中Gtalk 就是基於XMPP 協議的一個實現,其他的則不是。當前IM

安卓利用Intent分享資訊

最基本分享方法:Intent intent = new Intent(Intent.ACTION_SEND); // 啟動分享發送的屬性intent.setType("text/plain"); // 分享發送的資料類型intent.setPackage(packAgeName);intent.putExtra(Intent.EXTRA_SUBJECT, "xx分享"); // 分享的主題intent.putExtra(Intent.EXTRA_TEXT, "分享內容"); // 分享的內容mA

山寨威武 仿冒Xoom先於行貨獲得Android 4.0升級

對於我國的山寨產品,大家總是抱著懷疑的態度。然而眾多的山寨廠商在這種目光之下卻越來越希望用實際來證明自己的實力。近日,深圳ODM廠商太和時代發布了一款號稱全球首款的Tegra2+Android4.0的平板(現在僅有華碩的Transformer Prime“號稱”將內建Android 4.0,但它依然未發售),讓眾多一線品牌尷尬無比。該款平板搭載Tegra2處理器,系統內建Android

Android遠程service aidl的用法

AIDL即android

Android配置開發環境

剛開始搭建開發環境的時候,有幾個容易出問題的地方,記下來以備參考。 必須的程式:  Eclipse,java的IDE,:http://www.eclipse.org/downloads/ JDK,:http://www.oracle.com/technetwork/java/javase/downloads/index.html其他很多資料上給的都是Sun的,因為Oracle已經把Sun收購了,因此現在地址已經都換了。 Android

Eclipse3.6開發Android經常卡的解決辦法

新版本在智能提示的時候經常卡死,找了很多辦法,但很多也不管用。今天終於解決了:  http://www.cnblogs.com/zenghanxi/archive/2010/08/13/1799229.html 新下了eclipse3.6,很開心,多了一些新功能。好景不長,沒用多久就卡起來了,又下了個最瘦的那個版本都卡,找了好久,關了很多東西都沒有用,終於發現原來是 "Usage Data Collector"

android 常用代碼

// 建立一個toast對象private Toast toast; public void showMsg(String arg) { if (toast == null) { toast = Toast.makeText(this, arg, Toast.LENGTH_SHORT); } else { toast.cancel(); toast.setText(arg); }

android 資料庫 備份還原某android平板項目開發筆記—計劃任務備份

詳情參考  某android平板項目開發筆記---計劃任務備份建立一個類繼承 AsyncTaskpublic class BackupTask extends AsyncTask<String, Void, Integer> { private static final String COMMAND_BACKUP = "backupDatabase"; public static final String COMMAND_RESTORE =

android 調用照相功能

參考 Android拍照、錄影、錄音代碼範例 public class MyCameraActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

總頁數: 2771 1 .... 309 310 311 312 313 .... 2771 Go to: 前往

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.