android各種許可權及說明

android.permission.ACCESS_CHECKIN_PROPERTIES允許讀寫訪問”properties”表在checkin資料庫中,改值可以修改上傳( Allows read/write access to the “properties” table in the checkin database, to change values that get

Android圖片轉換類 1. Bitmap去色,轉換為黑白的灰階圖, 2. Bitmap圖片加圓角效果

/** * 處理圖片的工具類. * */public class ImageTools {/***//** * 圖片去色,返回灰階圖片 * @param bmpOriginal 傳入的圖片 * @return 去色後的圖片*/public static Bitmap toGrayscale(Bitmap bmpOriginal) {int width, height; height = bmpOriginal.getHeight();

關於android.view.WindowLeaked異常的解決方案

雖然是小問題一個,但也困擾了我一段時間,現在記下來,給自己做個備忘,也可以給其他人一個參考。 Android.view.WindowLeaked按字面瞭解,Window

android建立Menu詳解

  // 只調用一次 @Overridepublic boolean onCreateOptionsMenu(Menu menu) {}// Menu每次顯示前都會調用(適用於建立動態功能表項目,如果是動態菜單記得先調用menu.clear();清空現有的功能表項目) @Overridepublic boolean onPrepareOptionsMenu(Menu menu) {}// item被點擊後調用 @Overridepublic boolean

讓android應用程式跳轉到系統的各個設定頁面

在android SDK文檔中有這樣一個類,android.provider.Settings類提供android系統各個頁面的跳轉常量:  StringACTION_ACCESSIBILITY_SETTINGSActivity Action: Show settings for accessibility modules.StringACTION_ADD_ACCOUNTActivity Action: Show add account screen for creating a new

android:taskAffinity與android:finishOnTaskLaunch之我見

  最近做一個打電話相關的小app,用到了2個平時瞭解得少的屬性,也是看到一個國外相同項目這個做的,開始是直接複製過來的,沒去詳細瞭解,項目中期時,隨手刪了2行配置的屬性,由於平時基本沒用到,所以以為用處不大,結果出了寫小問題,這裡記錄一下。不廢話了,直接貼代碼和解釋吧,以下是我測試後的個人理解。  <activity android:name=".callscreen.CallScreenActivity"

[Android]為指定的應用建立案頭捷徑

    網上一搜一大把為自己的應用建立捷徑,但是本文的側重點在為“指定的應用”建立案頭捷徑。    常見的案頭捷徑有兩要素:1.應用程式名稱 2.應用表徵圖。    指定應用表徵圖的資訊是: // pkgContext為指定應用的上下文環境,iconIdentifier為一個整數,指定應用的表徵圖標識符 ShortcutIconResource iconRes = Intent.ShortcutIconResource.fromContext(pkgContext,

Android開發中常用到Intent的URI與樣本

下面是常用到的Intent的URI及其樣本,包含了大部分應用中用到的共用Intent。一、開啟一個網頁,類別是Intent.ACTION_VIEW  Uri uri = Uri.parse("http://blog.3gstdy.com/");  Intent intent = new Intent(Intent.ACTION_VIEW, uri);二、開啟地圖並定位到一個點  Uri uri = Uri.parse("geo:52.76,-79.0342″);  Intent intent =

android中dip、px相互換算

1. dip: device independent pixels(裝置獨立像素). 不同裝置有不同的顯示效果,這個和裝置硬體有關,一般我們為了支援WVGA、HVGA和QVGA 推薦使用這 這個,不依賴像素。

android 監聽SDCard安裝和卸載的程式碼片段(測試通過)

// 監聽類private final BroadcastReceiver sdcardListener = new BroadcastReceiver() { @Overridepublic void onReceive(Context context, Intent intent) { String action = intent.getAction(); Log.d("TAG", "sdcard action:::::" +

Android添加頂部通知(Notification)並處於“進行中中”(onGoing)

用過Android版的QQ的都知道,QQ返回的時候在頂部通知裡會出現一個企鵝,表明QQ正在運行,可以拉開通知,點擊手機QQ出現主介面,繼續運行。所以我想讓自己的軟體也出現這麼一個通知,並且可以快速的開啟查看。Android應用開發詳解 8.3 Notification和NotificationManager的使用 P178 /*** 添加頂部通知* @author liuzhao*/public void

Android RingtoneManager鈴聲管理

package com.Aina.Android;import java.io.File;import android.app.Activity;import android.content.Intent;import android.media.RingtoneManager;import android.net.Uri;import android.os.Bundle;import android.os.Environment;import android.view.View;import

提高android應用的效率–主要講解listview的最佳化

Adapter是listview和資料來源間的中間人。當每條資料進入可見地區時,adapter的getview()會被調用,返回代表具體資料的視圖。觸摸滾動時,頻繁調用。支援成百上千條資料。下面為顯示每條資料的xml檔案:<LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:orientation="horizontal"><ImageView

Android對話方塊-中篇-之建立自己的對話方塊

  Activities提供了一種方便管理的建立、儲存、回複的對話方塊機制,例如 onCreateDialog(int), onPrepareDialog(int, Dialog), showDialog(int),

android手動調用震動器(Vibrator)

Vibrator vv=(Vibrator) getApplication().getSystemService(Service.VIBRATOR_SERVICE);vv.vibrate(500);//震半秒鐘vv.vibrate(new long[]{10, 100, 20, 200}, -1);關 於vv.vibrate(new long[]{10, 100, 20, 200}, -1); 參數1:表示停10ms, 震100ms, 停20ms,震200ms參數2:-1

android彈出軟鍵盤

// 介面載入後彈出軟鍵盤 --- 不能彈出軟鍵盤的主要原因是Android程式未將螢幕繪製完成,所以延遲一定時間,彈出軟鍵盤。Timer timer = new Timer();timer.schedule(new TimerTask(){ @Override public void run() { App.imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS); }},

Android 監聽home鍵(android:launchMode=”singleTask” 與 onNewIntent(Intent intent) 的用法

android:launchMode="singleTask" 和 onNewIntent(Intent intent)兩個特性,現總結一下經驗:android:launchMode="singleTask" 配置在 Mainifest 中,它保證了棧中此Activity總是只有一個,無論你啟動它多少次;onNewIntent(Intent intent) 是Override

android為視頻、音樂、圖片等產生縮圖

1、Video對於視頻,取第一幀作為縮圖,也就是怎樣從filePath得到一個Bitmap對象。 private Bitmap createVideoThumbnail(String filePath) { Bitmap bitmap = null; MediaMetadataRetriever retriever = new MediaMetadataRetriever();try {

Android對話方塊-上篇-之系統對話方塊

 一、android有四種預設的Dialog實現:AlertDialog、ProgressDialog、DatePickerDialog、TimePickerDialog。另外你還可以繼承android.app.Dialog實現自已的dialog。  二、AlertDialog是一種能構造預設的一、二、三個按鈕的對話方塊和單選或多選的的選擇對話方塊。  三、ProgressDialog是繼函大自AlertDialog,除了AlertDialog功能外,它還能顯視進度圈或條的對話方塊。  四、Da

Android編程擷取手機型號,本機電話號碼,sdk版本及firmware版本號碼(即系統版本號碼)

Android開發平台中,可通過TelephonyManager 擷取本機資訊。TelephonyManager phoneMgr=(TelephonyManager)this.getSystemService(Context.TELEPHONY_SERVICE);  txtPhoneModel.setText(Build.MODEL); //手機型號  txtPhoneNumber.setText(phoneMgr.getLine1Number());//本機電話號碼 

總頁數: 2771 1 .... 295 296 297 298 299 .... 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.