Time of Update: 2018-12-04
學習了一段時間的android,今天回頭看了看Android中的Socket編程,發覺其實Socket編程並不是很難,我把android中的Socket編程整理一下,給出我們一般Socket的步驟。一、Socket編程分伺服器端和用戶端,首先,必須建立一個伺服器端,以供用戶端來串連。以下是建立伺服器端程式的基本思路:1、首先建立一個ServerSocket對象,並讓這個ServerSocket在某一個連接埠號碼進行監聽;2、調用ServerSocket對象的accept()方法;3、從Socke
Time of Update: 2018-12-04
轉自:http://www.cnblogs.com/l_dragon/archive/2011/08/09/2132409.html 就像dotnet開發要有MSDN,java開發要有jdk文檔一樣,在進行android開發之前,最好案頭也要有相應的協助文檔。其實android sdk本身裡麵包含了很多開發協助文檔(英文版)。具體的使用步驟如下1.開啟sdk下載協助文檔目錄 我的安裝目錄在 C:\Program Files\Android\android-sdk-windows\docs2
Time of Update: 2018-12-04
In android, we can highlight the button through custom images. Here is a example that will give you about how to set a image when the button is focused, pressed and focused pressed. we can set each image for each stage.Example for Android Button
Time of Update: 2018-12-04
Android裡有兩個類 android.view.GestureDetector android.view.GestureDetector.SimpleOnGestureListener (另外android.widget.Gallery好像是更牛x的OnGestureListener ) 1) 建立一個類繼承SimpleOnGestureListener,HahaGestureDetectorListener 可以實現以下event事件。 boolean
Time of Update: 2018-12-04
dex2jar 和 JD-GUI 這2個工具是學習android的好幫手 dex2jar : http://laichao.googlecode.com/files/dex2jar-0.0.7-SNAPSHOT.zip JD-GUI: windows版JD-GUI: http://laichao.googlecode.com/files/jdgui.zip linux版JD-GUI:
Time of Update: 2018-12-04
MainActivity如下:package cn.testip;import java.net.InetAddress;import java.net.NetworkInterface;import java.net.SocketException;import java.util.Enumeration;import android.os.Bundle;import android.app.Activity;/** * Demo描述: * 擷取行動裝置的IP地址 */public
Time of Update: 2018-12-04
MainActivity如下:package cn.testcallback;import android.os.Bundle;import android.app.Activity;/** * Demo描述: * Android中回調介面的使用 */public class MainActivity extends Activity {@Overrideprotected void onCreate(Bundle savedInstanceState)
Time of Update: 2018-12-04
MainActivity如下:package cn.test;import android.os.Bundle;import android.app.Activity;/** * Demo描述: * 在資源檔Strings.xml中的某個string裡使用預留位置 * 然後在代碼中將其替換 */public class MainActivity extends Activity {@Overrideprotected void onCreate(Bundle
Time of Update: 2018-12-04
項目需要用到ViewPager,毫不猶豫的引入了官方提供的android-support-v4.jar開發過程平淡無奇,簽名打包時出現了兩個問題1.使用eclipse匯出簽名apk出現錯誤[2011-11-03 16:07:52 - AndroidViewPager] Proguard returned with error code 1. See console[2011-11-03 16:07:52 - AndroidViewPager] Note: there were 95
Time of Update: 2018-12-04
說明:以下經驗是轉載的,出處在後面。對TextView的滾動高度興趣,有時間會做一個具體的測試……作者意圖:本來是想做一個顯示文字資訊的,當文字很多時View的高度不能超過一個固定的值,當文字很少時View的高度小於那個固定值時,按View的高度顯示。因為ScrollView沒有maxHeight,無法滿足需求,只好另找方法了。 View本身是可以設定ScrollBar,這樣就不一定需要依賴ScrollView了。TextView有個屬性maxLine,這樣也就滿足了需求了,只要設定一個Text
Time of Update: 2018-12-04
MainActivity如下:package cn.testalertdialog;import android.app.Activity;import android.app.AlertDialog.Builder;import android.app.Dialog;import android.os.Bundle;import android.view.LayoutInflater;import android.view.View;import
Time of Update: 2018-12-04
《Android Dev
Time of Update: 2018-12-04
早上在電腦上同步android的原始碼(使用 repo sync),提示“A new version of repo is available”,於是下載了最新的repo(curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > repo)再次執行repo還是同樣的提示,仔細看看下面還有幾行error: cannot run gpg: No such file or directoryerror: could not
Time of Update: 2018-12-04
Android中如何判斷系統當前是否處于飛行模式中:public static boolean IsAirModeOn(Context context) {return (Settings.System.getInt(context.getContentResolver(),Settings.System.AIRPLANE_MODE_ON, 0) == 1 ? true : false);}如何切換飛航模式public static void setAirplaneMode(Context
Time of Update: 2018-12-04
TableLayout的行數由開發人員直接指定,即有多少個TableRow對象(或View控制項),就有多少行。TableLayout的列數等於含有最多子控制項的TableRow的列數。如第一TableRow含2個子控制項,第二個TableRow含3個,第三個TableRow含4個,那麼該TableLayout的列數為4.TableLayout可設定的屬性包括全域屬性及儲存格屬性。1、全域屬性也即列屬性,有以下3個參數:android:stretchColumns
Time of Update: 2018-12-04
本人做了一個圖片瀏覽器,用了一些影像處理的演算法,這個是一部分,APK安裝包地址:http://static.apk.hiapk.com/html/2012/08/797656.html,歡迎下載和反饋;關於android系統映像特效處理之底片效果 public static Bitmap film(SoftReference<Bitmap> bmp) { // RGBA的最大值 final int MAX_VALUE = 255
Time of Update: 2018-12-04
原文地址:http://blog.csdn.net/xiaochun91103/article/details/6199120一、淡入效果:/anim/fade.xml內容如下:<?xml version="1.0" encoding="utf-8"?><alpha xmlns:android="http://schemas.android.com/apk/res/android"
Time of Update: 2018-12-04
如果你還沒有Android手機,那麼搭建一個Android的開發環境就能在Android模擬器中先體驗一下了。如果你想開發Android應用,那麼搭建一個Android開發環境是必須的。步驟:一:Java環境的搭建。由於Android需要在Java環境下才能運行,所以首先搭建Java環境。1 JDK的下載如果需要獲得JDK最新版本,可以到SUN公司的官方網站上進行下載,為:點擊開啟連結下載最新版本的Java
Time of Update: 2018-12-04
導語:美國IT網站CNET今天撰文稱,與微軟和蘋果不同,Google重點打造的Chrome OS和Android兩款作業系統有著完全不同的理念。雖然這會令Google的發展方向模糊不清,但由於這兩大系統所涉足的領域都已經成為當今科技界的重要發展趨勢,因此它們之間並不相互排斥。 以下為文章全文: 兩大系統 Google並非唯一一家擁有兩款作業系統的大型科技公司,但卻是唯一一家採用差距如此之大的方法經營兩款作業系統的企業。 Android和Chrome
Time of Update: 2018-12-04