Time of Update: 2018-12-05
我們大家都知道Android 2.2的JIT效能有了本質的提高,不過對於老版本的程式提高Java執行效率還有很多語言特點來說,對於Java 1.5之後將會有明顯的改進。下面的例子來自SDK: static class Foo {int mSplat;}Foo[] mArray = ...//上面的靜態類Foo的執行效果和效能,我們分三個方法zero、one和two來做對比。 public void zero() { //大多數人可能簡單直接這樣寫int sum = 0;for
Time of Update: 2018-12-05
一直嫌ndk麻煩,不過不用ndk也是很悲劇的。網上看了別人做的,東拼西湊的,ndk跟jni還是有點區別的,ndk中的簡單一些了,打住,開始了。ndk r7不用cyg也可以了,公司不上上qq,好不容易放個假,也懶得進linux折騰了,在Windows上qq,順便搞點東東。
Time of Update: 2018-12-05
大家好,今天給大家共用一下對PopupWindow使用動畫,先看一下目錄結構:MainActivity.java檔案package com.tracy.test;import android.app.Activity;import android.os.Bundle;import android.view.Gravity;import android.view.LayoutInflater;import android.view.View;import
Time of Update: 2018-12-05
/* * Copyright (C) 2011 The Rexsee Open Source Project * * Licensed under the Rexsee License, Version 1.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * *
Time of Update: 2018-12-05
Reply and search faster with the Gmail app for Androidhttp://gmailblog.blogspot.com/2013/03/reply-and-search-faster-with-gmail-app.htmlPosted by Andy Huang, Software EngineerWith today's launch of the new Gmail Android app, you can save time on the
Time of Update: 2018-12-05
一、在代碼中設定public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //去除title requestWindowFeature(Window.FEATURE_NO_TITLE); //去掉Activity上面的狀態列getWindow().setFlags(WindowManager.LayoutParams. FLAG_FULLSCREEN ,
Time of Update: 2018-12-05
bgimg0 = getImageFromAssetsFile("Cat_Blink/cat_blink0000.png");/** * 從Assets中讀取圖片 */ private Bitmap getImageFromAssetsFile(String fileName) { Bitmap image = null; AssetManager am = getResources().getAssets(); try
Time of Update: 2018-12-05
廣播被分為兩種不同的類型:“普通廣播(Normal broadcasts)”和“有序廣播(Ordered broadcasts)”。前者是完全非同步,所有接收者(邏輯上)都在同一時刻運行,對訊息傳遞的效率而言這是很好的做法,但缺點是:接收者不能將處理結果傳遞給下一個接收者,並且無法終止廣播Intent的傳播;然而後者是逐個執行接收者——系統會按照接收者聲明的優先順序別(聲明在intent-filter元素的android:priority屬性中,數越大優先順序別越高,取值範圍:-1000到100
Time of Update: 2018-12-05
第一:FrameLayout的妙用,架構布局是最簡單和最高效的布局類型之一。架構布局的子控制項被相對於布局的左上方來繪製。如果架構布局中存在多個子視圖,它們將按順序繪製,最後一個子控制項繪製在最上面。樣本:。第二:以前做J2ME平台,為了實現跑馬燈效果,實現方式是在UI線程(繪圖線程)不停的重新整理,通過改變座標來達到動畫效果。那時候看到Android上各種炫目的動畫,簡直嚇尿了,後來做了Android平台才知道,尿尿更健康。在Android平台,動畫效果封裝的非常好。簡單的動畫模型有兩種:tw
Time of Update: 2018-12-05
先上代碼package com.test;import android.app.Activity;import android.app.Service;import android.os.Bundle;import android.os.Vibrator;import android.view.View;import android.view.View.OnLongClickListener;import android.widget.TextView;public class
Time of Update: 2018-12-05
最後項目當中要用到,所以也就只能不停的找資料學習了,看了一天,有一些收穫,想寫一篇做個筆記,免得以後忘了,先發一張。以上這個就標題就是用的ViewPager做的,支援左右滑動,也支援點擊,大部分都可以,不錯,下面都是ListView 也有TextView 控制項,就是說你想用什麼都可以,還是挺好的。以上這張圖的效果就是傳說中的ViewFlipper效果了,好多的程式啟動的時候有用到這樣的效果,做個歡迎介面,不多說這些都很簡單,網上也有很多的例子,我也只是做個整理。以上這張圖片效果支援左右滑動,
Time of Update: 2018-12-05
android:id="@+id/editSms" android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="@string/saveSms" android:inputType="textMultiLine" android:gravity="left|top"
Time of Update: 2018-12-05
文章目錄 對google的android的平台的一些看法。 對google的android的平台的一些看法。 上個月的11月5號,google宣布推出基於Linux的手機操作的系統;同時聯合33家電訊廠商,製造商,晶片大廠!中國比較正式的報道:http://tech.sina.com.cn/focus/2007_gphone/index.shtml這是關於android的一個專題報道,可以參考一下。Google聯合33家廠商成立的OHA,
Time of Update: 2018-12-05
public void save() {@SuppressWarnings("rawtypes")File file = new File(SYSSETPATH);if (file.exists())file.delete();try {ObjectOutputStream objOutPutStream = new ObjectOutputStream(new
Time of Update: 2018-12-05
Android
Time of Update: 2018-12-05
public class TestActivity extends Activity { private TextView tv; private Button btn; //擷取手機螢幕解析度的類 private DisplayMetrics dm; public void onCreate(Bundle savedInstanceState) {
Time of Update: 2018-12-05
字型大小 對於能夠顯示文字的控制項(如TextView EditText RadioButton Button CheckBox
Time of Update: 2018-12-05
項目上遇到一個問題,初次載入資料是正確的,等到下拉重新整理、上拉載入的時候,資料就亂了,百度得到的結果,希望可以幫到遇到類似問題的朋友們。解決辦法:在重寫的adapter裡 添加一個方法reSetViewHolder (ViewHolder viewHolder)
Time of Update: 2018-12-05
1. 當項目中包含大量圖片,或者圖片過大方法1:等比例縮小圖片BitmapFactory.Options options = new BitmapFactory.Options(); options.inSampleSize = 4方法2:對圖片採用軟引用,及時地進行recyle()操作SoftReference<Bitmap> bitmap; bitmap = new SoftReference<Bitmap>(pBitmap); if(bitmap != null){
Time of Update: 2018-12-05
下午遇到一個問題,jni找不到類,解決步驟如下:1. 系統變數設定:(1)我的電腦-屬性-進階-環境變數增加系統變數:java_home:D:\Program Files\Java\jdk1.7.0_01(java安裝好後的路徑),Path變數中添加 %java_home%/bin,增加系統變數:classpath:.;D:\Program Files\Android\android-sdk\platforms\android-8\android (第1點android檔案夾路徑,特別注意要加"