Time of Update: 2013-12-11
基於 Android NDK 的學習之旅-----HelloWorldHello World作為所有程式設計語言的起始階段,佔據著無法改變的地位,所有中/英/法/德/美……版本的編程教材中,hello world總是作為第一個TEST記錄於書本之中,所有的編程第一步就在於此了!經典之中的經典!hello world!下面介紹下NDK開發的Hello World1、Android 應用程式層
Time of Update: 2013-12-11
Class Overview: Xml代碼Base class for those who need to maintain global application state. You can provide your own implementation by specifying its name in your AndroidManifest.xml's <application> tag, which will cause that class
Time of Update: 2013-12-11
RadioGroup與RadioButton 控制項 首先需要在布局檔案中設定RadioGroup的屬性,然後在該RadioGroup中添加RadioButton的屬性。這也可以認為,RadioGroup是RadioButton的一個容器,首先建立容器,然後在容器中添加物體。程式碼片段如下: <RadioGroup
Time of Update: 2013-12-11
一般用網路攝影機拍攝的圖片都會大於1M,在anroid中載入這種大圖片的時候很容易記憶體不足,這時候我們可以對大圖進行縮放,普通的圖片則正常顯示 File file = new File(path);byte[] all=...;//path檔案的byteif(file.length()>1024*1024){ BitmapFactory.Options options=new
Time of Update: 2013-12-11
設定透明效果 大概有三種1、用android系統的透明效果Java代碼 android:background="@android:color/transparent" 例如 設定按鈕Java代碼 <Button android:background="@android:color/transparent"
Time of Update: 2013-12-11
Android Button 控制項綁定單擊事件 package com.android.test; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.TextView; import
Time of Update: 2013-12-11
1、一個簡單的樣本 Java代碼 public class View1 extends Activity { @Override public void onCreate(Bundle savedInstanceState) {
Time of Update: 2013-12-11
canon.mp3檔案放到raw目錄下 然後在程式裡讀取這個檔案:代碼為view plaincopy to
Time of Update: 2013-12-11
有時候我們想在listView上分類,或者呢 有時候一行顯示兩列內容,有時候需要三列內容 ,那怎麼實現呢,這裡呢就要使用Java代碼 class Section { String caption; Adapter
Time of Update: 2013-12-11
從網上找了一圈 大致有兩種方法方法一:Java代碼 <TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost"
Time of Update: 2013-12-11
As android developer, if you use the following command like:adb push file /system/..and meet problems like “failed to copy file to /system/…”, such as:failed to copy ‘file’ to ‘/system/…’: No space
Time of Update: 2013-12-11
android 代碼混淆1 proguard.cfg,這就是混淆所需的proguard指令碼啊。 其代碼如下: view plain-optimizationpasses 5 -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -dontpreverify -verbose -optimizations !code/simplification/
Time of Update: 2013-12-11
網上找到的多數是:控制其不消失,和消失。1// /**
Time of Update: 2013-12-11
為了方便在手機上(Galaxy Note with CM10),調試Android4.1 系統瀏覽器的代碼,進行代碼研究,我把系統瀏覽器編譯成了一個獨立的應用,不會跟ROM原來的系統瀏覽器產生衝突,可以很方便地在Eclipse自己建立的工程裡面對Java部分的代碼進行跟蹤調試,理論上C++的部分也可以通過GDB進行調試。自己編譯的庫,顯示Layer邊界和資訊首先系統瀏覽器可以認為分為3部分:1,Browser.Apk 一個全功能瀏覽器應用2,android.webkit
Time of Update: 2013-12-11
SeekBar 為ProgressBar 的子類,和ProgressBar 不同的是,SeekBar添加了一個可以拖動的滑塊,使用者可以按住滑塊左右移動,為SeekBar設定當前的值,因此最好不要在SeekBar左右放置可以擷取焦點的其它控制項。本例介紹了SeekBar的基本用法和支援的事件SeekBar.OnSeekBarChangeListener[java]public void onProgressChanged(SeekBar seekBar, int
Time of Update: 2013-12-11
在proguard中添加##---------------Begin: proguard configuration for Gson ----------# Gson uses generic type information stored in a class file when working with fields. Proguard# removes such information by default, so configure it to keep all of
Time of Update: 2013-12-11
1、圖片旋轉Bitmap bitmapOrg = BitmapFactory.decodeResource(this.getContext().getResources(), R.drawable.moon);Matrix matrix = new Matrix();matrix.postRotate(-90);//旋轉的角度 Bitmap resizedBitmap = Bitmap.createBitmap(bitmapOrg, 0,
Time of Update: 2013-12-11
今天剛剛學習完Sqlite資料庫的基礎知識,隨即把學到的東西記錄下來,以便隨後查閱,以下是自己對Sqlite資料庫的小結:1.Sqlite簡介
Time of Update: 2013-12-11
一談起ListView,我想大家都不陌生。而且最近該控制項特別紅,像QQ,人人和新浪用戶端裡都有它的影子。其實實現ListView非常的簡單。我想大家都用過各種各樣的控制項,比如說一個最簡單的TextView,我們都是在布局檔案裡加入TextView標籤,然後在Activity裡通過findViewById(int id)方法得到該對象的引用,最後調用TextView類的setText(CharSequence
Time of Update: 2013-12-11
剛開始學android,建了兩個工程後,今天建立了個android工程跑程式時顯示No Launcher activity found錯誤,模擬器也不運行。上網一查,發現問題出在整個項目的那個主配置xml中,一般名字都是叫AndroidManifest.xml裡面沒有配置啟動項(原因多種多樣),在<application></application>中少了這段代碼<activity android:name=".MainActivity"