[Android Samples視頻系列之ApiDemos] App-Activity-SetWallpaper

1.Demo說明與示範該Demo介紹如何在Android擷取當前Wallpaper,對Wallpaper做些修改,然後用修改後的映像重新設定Wallpaper,注意要在AndroidMainfest中加許可權<uses-permission android:name="android.permission.SET_WALLPAPER"

android Application的防反編譯Proguard和應用簽名

android APK防止反編譯:在android2.3之後的版本建立項目中會自動產生proguard.cfg和project.properties檔案,proguard.cfg檔案是混淆java代碼的設定檔,裡面對不需要混淆代碼的類檔案進行配置過濾,project.properties檔案裡設定android項目對應的版本和proguard.cfg的路徑。1.貼上自動產生的proguard.cfg檔案的內容:-optimizationpasses

Android實現頁面自動迴圈切換[Gallery]

Gallery組件主要用於橫向顯示映像列表,不過按常規做法。Gallery組件只能有限地顯示指定的映像。也就是說,如果為Gallery組件指定了10張映像,那麼當Gallery組件顯示到第10張時,就不會再繼續顯示了。這雖然在大多數時候沒有什麼關係,但在某些情況下,我們希望映像顯示到最後一張時再重第1張開始顯示,也就是迴圈顯示。要實現這種風格的Gallery組件,就需要對Gallery的Adapter對象進行一番改進。   Gallery組件的傳統用法   在實現可迴圈顯示映

.Android hook——LD_PRELOAD

《移動互連網之智能終端安全揭秘》中提到了android hook的一種方法,可以通過設定LD_PRELOAD環境變數來改變函數的執行流程從而達到hook的目的。書中的範例程式碼與陳皓部落格:http://www.bkjia.com/kf/201212/178312.html中一樣,部落格對LD_PRELOAD的危害闡述的非常清楚。  範例程式碼1. 以下是一段判斷使用者口令的程式,用到了標準c函數strcmproot@bt:~/programe# cat

android GridView實現圖庫預覽圖,多選模式下右上方打勾

    看到有初學者有這樣的需求: GridView實現圖庫預覽圖,多選模式下右上方打勾。(4.0圖庫的預覽圖多選時,多了個藍色邊框,其實是藍色背景)        GridView在自己實際開發中也沒用到過,就想試著實現下,寫個demo供初學者參考,高手略過。        先來個吧:      

Android開發——樣式和主題

一、基本概念 作用和網頁開發中的CSS是一樣的。樣式用在單個控制項上,主題應用在整個應用或一個或多個Activity上。   二、執行個體代碼 在res/values檔案夾下建立style.xml檔案,該檔案中體現了樣式的繼承。樣式的覆蓋和CSS一樣,也是就近原則。 [html]  <?xml version="1.0" encoding="utf-8"?>

Android的文本和輸入---拼字檢查器(一)

Android平台提供能夠讓你在應用程式中執行和訪問拼字檢查的拼字檢查器架構。這個架構是由Android平台提供的文本服務API之一。 要在應用程式中使用該架構,你就要建立一個特殊的Android服務類型,該服務會產生一個拼字檢查器的session對象。基於你提供的文本,該session對象會返回由拼字檢查器產生的拼字建議。 拼字檢查器的生命週期 顯示了拼字檢查器服務的生命週期:  圖1.拼字檢查服務的生命週期。 要進行拼字檢查,你的應

Android播放視頻(四)

[java]  package cn.c;  import java.io.File;  import android.app.Activity;  import android.content.Intent;  import android.net.Uri;  import android.os.Bundle;  import android.os.Environment;  import

[Android開發學習07]儲存簡單資料的利器--Preferences

一.基礎知識:Preferences是一種輕量級的資料庫儲存機制,主要用於記錄遊戲中的得分,應用程式上次登入的時間等。   二.編程實現:1. 介面編輯(res\layout\main.xml):[java]<?xml version="1.0" encoding="utf-8"?> <LinearLayout

Building a Simple User Interface

The graphical user interface for an Android app is built using a hierarchy of View and ViewGroup objects. View objects are usually UI widgets such as buttons or text fields and ViewGroup objects are invisible view containers that define how the

Starting Another Activity

Respond to the Send ButtonTo respond to the button's on-click event, open the main.xml layout file and add the android:onClick attribute to the <Button> element:<Button   

Running Your App (android)

 How you run your app depends on two things: whether you have a real Android-powered device and whether you're using Eclipse. This lesson shows you how to install and run your app on a real device and on the Android emulator, and in both

Android如何直接連結到預設瀏覽器

問題描述:我在webview中載入了一個 website。當點擊一個連結"Full Site",我想開啟手機的預設瀏覽器,如何?這個功能呢?目前它在web視圖中載入了完整的網站。解決方案:你需要在 WebView 對象上添加一個 WebViewClient[java]WebView myWebView = (WebView) findViewById(R.id.webview); myWebView.setWebViewClient(new

android修改開放類方法

當我們修改了google 開放出來的類。所謂開放的類與開放的API,這個只是javadoc的範疇,並不是java中public和private,也就是說,對於源碼的編譯無所謂,只是對javadoc的產生有影響關於類的開放和隱藏,是通過doc的注釋{@hide}來控制的。比如 Environment 這個類,我們新增了幾個成員方法,編譯的時候就會出現如下的錯誤:******************************You have tried to change the API from

Communicating with Other Fragments

In order to reuse the Fragment UI components, you should build each as a completely self-contained, modular component that defines its own layout and behavior. Once you have defined these reusable Fragments, you can associate them with an Activity

Android BroadcastReceiver(一)

Android BroadcastReceiver介紹: broadcastReceiver是android的四大組件之一,大部分的廣播是系統發出來的。例如,螢幕關閉,電池電量不足等等。應用同樣可以建立廣播,例如:當下載完成的時候,要讓其他的應用知道這個情況,需要用到broadcastreceiver,receiver沒有介面,它可能會建立一個status bar notification通知使用者。broadcastreceiver

android在特定情況下顯示按鈕

問題描述:在程式中建立了一個按鈕,如下:[java]<Button     android:id="@+id/admin_new_questions"             android:layout_width="fill_parent"    

Supporting Different Densities

Use Density-independent PixelsOne common pitfall you must avoid when designing your layouts is using absolute pixels to define distances or sizes. Defining layout dimensions with pixels is a problem because different screens have different pixel

android yuv2rgb方案

之前項目裡面需要解碼h264視頻,使用的是ffmpeg,解碼出來的是yuv,最好的顯示方法是通過opengl es 2.0來實現視頻的顯示,如果不會opengl es 2.0的話,那麼就必須將yuv2rgb然後在繪製映像,而yuv2rgb我只知道兩種方法1.通過ffmpeg裡面的sws_scale來實現,不過這種方法比較慢,2.這是我之前使用的方法在http://wss.co.uk/pinknoise/yuv2rgb/

android intent傳遞list

以前用到的沒整理,現在整理下,方便用: 一般介面返回一個list我們不能直接傳遞,定義為static類型吧,佔用記憶體又太大,所以我們想辦法定義為普通變數,通過itent傳遞,這個時候我們就必須把自訂的model實現序列化,繼承Parcelable介面。直接貼代碼: public class CityListInfo implements Parcelable;   List<CityListInfo> cityListInfos =

總頁數: 2771 1 .... 2274 2275 2276 2277 2278 .... 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.