編輯:關於Android編程
View類的實現:
package com.bn.summer;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.View;
public class GGView3 extends View{
int COMPONENT_WIDTH;
int COMPONENT_HEIGHT;
boolean initflag=false;
Bitmap[] bma;
Paint paint;
int[] drawablesId;
int currIndex=0;
boolean workFlag=true;
public GGView3(Context father,AttributeSet as)
{
super(father,as);
this.drawablesId=new int[]
{
R.drawable.room1,
R.drawable.room2,
R.drawable.room3,
};
bma=new Bitmap[drawablesId.length];
initBitmaps();
paint=new Paint();
paint.setFlags(Paint.ANTI_ALIAS_FLAG);//消除鋸齒
new Thread()
{
public void run()
{
while(workFlag)
{
currIndex=(currIndex+1)%drawablesId.length;
GGView3.this.postInvalidate();
try
{
Thread.sleep(2500);
} catch (InterruptedException e)
{
e.printStackTrace();
}
}
}
}.start();
}
public void initBitmaps()
{
Resources res=this.getResources();
for(int i=0;i
Android 添加數據到本地Excel表中
由於項目需要,今天學習了一下如何將程序裡的數據添加到本地的Excel表中。下面為學習筆記:先上效果圖:首先,需要導入jxl.jar包到libs文件夾內。然後創建Excel
android開發之Monkey測試_自動化測試_看看你的應用夠不夠健壯
上篇提到讓應用自動抓取Crash日志提交到服務器,如果發布之前沒有經過嚴格測試(個人練手做的一些小應用),會發現有很多異常都是顯而易見的錯誤,只是沒有嚴格測試忽略了而已,
Music app框架設計及總結
總體上Music App分為UI界面、服務兩個模塊,其中關於音樂文件的播放都由服務負責,服務配合AIDL使用的,界面綁定服務後可以拿到服務裡所有參數及狀態進行UI刷新。A
Android打造屬於自己的時間鐘表
1、概述本文主要講解的是如何自定義一個時間鐘表,通過簡單的練習可以簡單學習Android當中自定義view的一些常用繪圖技巧,優化android繪圖操作。言歸正傳,首先看