Time of Update: 2018-12-03
I have been asked several times, “What is the point of headless Android?” It’s not hard to see why the question is asked. Android, in essence, is a specialized user interface for a phone or tablet platform that runs on the Linux kernel. The Android
Time of Update: 2018-12-03
搞了二天終於把這個問題解決了。。原來是我sdk下載的android是1.5版本的。建立helloworld工程時選擇的是android1.5,AP8。建立完後直接就有幾個錯誤。還試了好幾遍。最終終於解決了。主要原因就是android版本太低,我下了個android2.2的就可以了。其中也參考了網上別人的方法,謝謝他們。把步驟總結如下,1.把工程裡buildpath裡添加進jre的編譯庫。2.下載android更高的版本,如2.2,在target裡面選擇下載的高版本android。3.重新buil
Time of Update: 2018-12-03
AlphaAnimation 控制漸層透明的動畫效果 1.android: fromAlpha 動畫起始時的透明度 2.android: toAlpha 動畫結束時的透明度 ScaleAnimation 控制尺寸伸縮的動畫效果 1.android:fromXScale 動畫起始時x座標的伸縮尺寸 2.android:toXScale 動畫結束時X座標的伸縮尺寸 3.android:fromYScale 動畫起始時Y座標的伸縮尺寸 4.android:toYScale
Time of Update: 2018-12-03
代碼:package com.nanguabing.splashactivity;import android.annotation.SuppressLint;import android.app.Activity;import android.os.Bundle;import android.os.Handler;import android.os.Message;import
Time of Update: 2018-12-03
一、如果想在Activity中得到新開啟Activity 關閉後返回的資料,需要使用系統提供的startActivityForResult(Intent intent, int requestCode)方法開啟新的Activity,新的Activity 關閉後會向前面的Activity傳回資料,為了得到傳回的資料,必須在前面的Activity中重寫onActivityResult(int requestCode, int resultCode, Intent data)方法。package
Time of Update: 2018-12-03
轉自:http://jakend.iteye.com/blog/11658121.採用linearlayout布局:Java code <LinearLayout android:id="@+id/main" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" >
Time of Update: 2018-12-03
自7日14決定學習Android,開始下載Android SDK算起,到現在已經五月有餘,現把學習情況,向各位CSDNer總結彙報下。引子
Time of Update: 2018-12-03
1.1 實現Remote Service有了AIDL定義之後,我們便可實現這這一介面類的定義,主要是提供一個Stub類的實現,在這個Stub對象裡,提供getPid(void)的具體實現。 private finalITaskService.Stub mTaskServiceBinder =new ITaskService.Stub() { public int getPid() { return Process.myPid(); }
Time of Update: 2018-12-03
在通常的C/C++代碼中,可以通過響應對記憶體操作不當引起的Segmentation Fault錯誤即訊號SIGSEGV(11)做出響應處理。只要在程式中設定SIGSEGV的handler中,調用libc的backtrace,打出對應的堆棧資訊,很快就能找到問題所在。但在Android中,bionic並不提供類似功能,而且log資訊是走的logger,通過logcat才可以看到。但是android也會輸出log資訊,象下面這樣: view plaincopy to clipboardprint?
Time of Update: 2018-12-03
可以一次開啟LOGV,LOGI,LOGD,也可以分別開啟:#undef NDEBUG //開啟LOGV/LOGI/LOGD#define LOG_NDEBUG 0 //開啟LOGV#define LOG_NIDEBUG 0 //開啟LOGI#define LOG_NDDEBUG 0 //開啟LOGD舉例舉例,如果要看AndroidRuntime的LOGI和LOGD,可以有這樣2種寫法:方法一NDEBUG-LOG_NDEBUG=LOG_NIDEBUG
Time of Update: 2018-12-03
comScore發布了最新的美國移動手機市場份額資料,蘋果的市場佔有率從8月的9.8%上升至11月的10.2%。由於iPhone 4S的發布,蘋果市場份額的增長幅度要比其他廠商大很多。的這張資料是所有手機使用者的統計情況,包括智能手機和非智能手機。對於智能手機市場,Google的Android市場份額繼續以46.9%領先,蘋果的市場份額為28.7%。除了Google和蘋果,其他智能手機平台都出現了市場份額下滑的情況。
Time of Update: 2018-12-03
在需要使用者輸入資料的時候,友好的介面是非常重要的,所以如果我們能在輸入框給使用者一些提示,將能很好的提高程式的易用性,android就給我們提供了這樣一個屬性,也就是android:hint。另外這個程式的textview裡面使用一下android中的shape屬性,可以參見我前一篇轉載的部落格。view plaincopy to
Time of Update: 2018-12-03
MyServiceActivity instance){ myActivity = instance; } public MyServiceActivity getInstance(){ return myActivity; }}2. 在activity中儲存執行個體 public class MyServiceActivity extends Activity {
Time of Update: 2018-12-03
package com.example.demodownload;import java.io.IOException;import java.io.InputStreamReader;import java.net.HttpURLConnection;import java.net.URL;import android.app.Activity;import android.app.ProgressDialog;import android.os.Bundle;import
Time of Update: 2018-12-03
1.初始SurfaceView類SurfaceView是View的一個特別子類,主要是提供應用程式一個輔助線程類來描繪圖形,輔助線程會讓surfaceView按照自己的速率在自己的畫布上描繪。因為是輔助線程來描繪SurfaceView對象,必須將輔助線程類提交給SurfaceHolder,當SurfaceHolder使用lockCanvas()方法鎖定畫布以後,可以在畫布上任意繪製,繪製完成後,就可以是用unlockCanvasAndPost()方法來解鎖畫布。主要代碼如下surfaceView
Time of Update: 2018-12-03
我們在做項目的時候,由於android內建的屬性不能滿足需求,android提供了自訂屬性的方法,其中的format是做什麼用的?以及如何使用它?下面列出一些常用的。1. reference:參考某一資源ID。 (1)屬性定義: <declare-styleable name = "名稱"> <attr name = "background" format = "reference" />
Time of Update: 2018-12-03
寫的是一個基本的常用的繪圖小程式寫的比較亂,只是為了練習直接上代碼package mars.com;import android.app.Activity;import android.os.Bundle;public class Demo_Activity extends Activity {private MyGraphics myGraphics = null;public void onCreate(Bundle savedInstanceState)
Time of Update: 2018-12-03
在第一節 Android使用binder訪問service的方式(一)中我們介紹了使用Messenger
Time of Update: 2018-12-03
1.intent 決定Activity所在的Task(Activity 堆棧)對於"standard" 和 "singleTop" 模式, 是task在產生intent,除非intent裡設定了FLAG_ACTIVITY_NEW_TASK 標誌,設定了此標誌,這個activity將選擇另外一個task。相對的 singleTask 和 singleInstance 模式標記activity作為一個task的根,他們永遠不會選擇另外一個task。 2.一個activity可以不可以有多個執行個體?
Time of Update: 2018-12-03
(說明:此文我在我的百度部落格上有,只是複製了一下,可是安裝卻連結的是百度,如果圖片無法看請直接存取我的部落格:http://hi.baidu.com/freeskyok )離線狀態下 android 環境搭建詳解 近來我對android編程突然產生了興趣,到論壇上看android環境的搭建,大多數都是差不多,但都要求必須聯上互連網才行。那不方便上網的地方該怎麼搭建這個環境,卻沒有找到讓人滿意的答案。經過兩天的摸索,折騰,終於搞定的離線狀態下怎麼進行android環境的搭建,且聽我從頭講起。