Time of Update: 2018-12-05
android 公開靜態內部類BroadcastReceiver第一次寫部落格,寫得不好盼大家指正. 當想實現廣播接收功能時,因java 是單繼承,所以一般一個類都會extends Activity,所以會想到內部類來extends BroadcastReceiver,這中間可能會出現兩種異常1:java.lang.RuntimeException: Unable to instantiate receiver
Time of Update: 2018-12-05
李華明Himi 原創,轉載務必在明顯處註明:轉載自【黑米GameDev街區】 原文連結: http://www.himigame.com/android-game/389.html 今天一個開發人員問到我為什麼遊戲開發要刪除項目下的hdpi、mdpi和ldpi檔案夾;下面詳細給大家解答一下: 首先童鞋們如果看過我寫的《【Android遊戲開發二十一】Android
Time of Update: 2018-12-05
最終代碼結構圖:代碼詳解:main.xml<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent"
Time of Update: 2018-12-05
最終:當我們在最下邊的gallery中切換圖片時,上面的大圖片會自動切換,切換時有動畫效果哦,很簡單的一個程式,有待完善更多的功能!activity代碼:package cn.com.chenzheng_java;import android.app.Activity;import android.content.Context;import android.os.Bundle;import android.view.View;import
Time of Update: 2018-12-05
:activity代碼:package cn.com.chenzheng_java;import java.util.Timer;import java.util.TimerTask;import android.app.Activity;import android.os.Bundle;import android.os.Handler;import android.os.SystemClock;import android.util.Log;import android.view.View;
Time of Update: 2018-12-05
何謂組織喜好設定啊,實際上就是為喜好設定分組!分組之後,我們首頁只顯示組名,當我們點擊進去的時候,才會顯示具體的喜好設定列表。代碼:<?xml version="1.0" encoding="utf-8"?><PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" android:key="edittext_screen" android:title="螢幕標題"
Time of Update: 2018-12-05
本文章主要講解下AsyncTask的使用。 首先,我們得明確下一個概念,什麼是UI線程。顧名思義,ui線程就是管理著使用者介面的那個線程! android的ui線程操作並不是安全的,並且和使用者直接進行介面互動的操作都必須在ui線程中進行才可以。這種模式叫做單線程模式。我們在單線程模式下編程一定要注意:不要阻塞ui線程、確保只在ui線程中訪問ui組件。
Time of Update: 2018-12-05
直接給上個詳細的解說代碼:package cn.com.chenzheng_java.media;import java.io.IOException;import android.app.Activity;import android.media.MediaRecorder;import android.os.Bundle;/** * @description 對通過android系統手機進行錄音的一點說明測試 * @author chenzheng_java * @since 2011/03
Time of Update: 2018-12-05
清理android的案頭應該怎麼實現呢?在activity中重寫ContextWrapper裡定義的方法clearWallpaper @Override public void clearWallpaper() throws IOException { // TODO Auto-generated method stub super.clearWallpaper(); }
Time of Update: 2018-12-05
參考: http://android.blog.51cto.com/268543/316255ImageView的屬性android:scaleType,即 ImageView.setScaleType(ImageView.ScaleType)。android:scaleType是控製圖片如何 resized/moved來匹對ImageView的size。ImageView.ScaleType / android:scaleType值的意義區別: CENTER
Time of Update: 2018-12-05
TCP Socket用戶端編寫 public class SocketActivity extends Activity {private Button startButton = null; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) {
Time of Update: 2018-12-05
經過一下午的研究,終於讓catcake的samples完全跑起來了,但是離真正的開發,還有一段距離。catcake的code地址為http://code.google.com/p/catcake/我們可以看到這樣的檔案結構。-如所示,有個hello_catcake例子,我們將include和lib整個檔案都拷貝進來,在Android.mk中我們做如下修改:LOCAL_PATH := $(call my-dir)include $(CLEAR_VARS)LOCAL_MODULE := hello_
Time of Update: 2018-12-05
activecreateor.bat 內容為:@echo offrem Copyright (C) 2007 The Android Open Source Projectremrem Licensed under the Apache License, Version 2.0 (the "License");rem you may not use this file except in compliance with the License.rem You may obtain a copy
Time of Update: 2018-12-05
1.Foreground Process: 前端的進程狀態: 正處於Activity Resume()狀態 正處於與bound服務互動狀態 正處於服務在前台啟動並執行狀態,(startForeground()被調用,例如:播放音樂) Service生命週期函數正在被執行(onCreate(),onStart(),onDestory()) BroadcastReceiver正在執行onReceive()方法 殺死Foreground
Time of Update: 2018-12-05
[First written by Steve Guo, please keep the mark if forwarding.] The original URL from : http://letsgoustc.spaces.live.com/blog/cns!89AD27DFB5E249BA!470.entryHere is the overall picture.There are two processes in the scenario. Mountd is a native
Time of Update: 2018-12-05
引起crashpublic class MainActivity extends Activity {Button click2Crash; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Log.i("Thread0",
Time of Update: 2018-12-05
private void killProcess(Context mAct) { // TODO Auto-generated method stub Log.i(TAG, "killProcess"); String packageName = mAct.getPackageName(); String processId = ""; try { Runtime r =
Time of Update: 2018-12-05
public class MainActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); TextView v= null; v.setText("abc");
Time of Update: 2018-12-05
1. andriod 代碼層次 |-- Makefile : 系統的 Makefile |-- bionic : C 庫函數的替代品 |-- bootable : 和引導相關的代碼 |-- build : 是編譯和配置所需要的指令碼和工具 |-- dalvik : java 虛擬機器 |-- development : 程式開發所需要的模板和工具 |-- external : 用的外部的開源的擴充庫,編譯產生在目錄 /lib |
Time of Update: 2018-12-05
簽名的必要性1、 防止你已安裝的應用被惡意的第三方覆蓋或替換掉。2、 開發人員的身份標識,簽名可以防止抵賴等事件的發生。 開發Android的人這麼多,完全有可能大家都把類名,包名起成了一個同樣的名字,這時候如何區分?簽名這時候就是起區分作用的。另外由於開發商可能通過使用相同的Package