Time of Update: 2018-12-05
今天來和大家分享一下android中UI設計裡面常會用到的style和theme。首先,style和theme都是資源,android提供了很多這樣的預設資源。你可以來使用它們。同時你也可以自己定義style和theme。這非常的簡單,只需要在res/values/這個路徑裡面建立一個.xml檔案,而且他的根節點必須是<resources>.對每一個style和theme,給<style>element增加一個全域唯一的名字,也可以選擇增加一個父類屬性,我們寫的style
Time of Update: 2018-12-05
package com.turboradio.googlesdk;import android.app.Activity;import android.os.Bundle;import android.widget.ArrayAdapter;import android.widget.AutoCompleteTextView;public class Ex_4_13 extends Activity {private static final String [] autoStr = { "
Time of Update: 2018-12-05
一.你要開啟一個網頁你可以自己寫一個webview,在自己的程式中就可以開啟.wv = (WebView) findViewById(R.id.webView1);wv.getSettings().setJavaScriptEnabled(true);wv.setScrollBarStyle(0);WebSettings webSettings =
Time of Update: 2018-12-05
android 地圖服務開發 INSTALL_FAILED_MISSING_SHARED_LIBRARY 錯誤解決 地圖服務開發中遇到此類錯誤大體分為以下兩種情況解決:(論壇裡大多都是屬於第一種情況的答案,但是遇到第二種情況論壇的解決基本無效)。情況一:如果你用模擬器偵錯工具 首先檢查AndroidManifest.xml,確保已經寫了<uses-library android:name=”com.google.android.maps” /> 其次確保你建立工程的時候
Time of Update: 2018-12-05
1 package com.turbo; 2 3 import android.app.Activity; 4 import android.os.Bundle; 5 import android.widget.RatingBar; 6 import android.widget.Toast; 7 8 public class AndroidSeekBar extends Activity { 9 @Override10 protected void
Time of Update: 2018-12-05
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" >
Time of Update: 2018-12-05
1 package com.turboradio.googlesdk; 2 3 import java.util.regex.Matcher; 4 import java.util.regex.Pattern; 5 6 import android.app.Activity; 7 import android.app.PendingIntent; 8 import android.content.Intent; 9 import android.os.Bundle;10 import
Time of Update: 2018-12-05
1 package com.turboradio.googlesdk; 2 3 import java.io.File; 4 5 import android.app.Activity; 6 import android.os.Bundle; 7 import android.view.View; 8 import android.widget.EditText; 9 import android.widget.TextView;10 11 public class Ex_4_11
Time of Update: 2018-12-05
Android多媒體學習總結MediaPlayer 中的方法介紹:MediaPlayer的執行個體化 MediaPlayer player = MediaPlayer.create(this,R.raw.&&);player.getCurrentPosition() 得到當前播放位置player.getDuration() 得到檔案播放時間player.getVideoHeight() 得到視頻的高度player.getVideoWidth() 得到視頻的寬度player.
Time of Update: 2018-12-05
/** * 傳送簡訊 */ private void sendMessage(){ Uri smsToUri = Uri.parse("smsto:"); Intent intent = new Intent(android.content.Intent.ACTION_SENDTO,smsToUri); intent.putExtra("sms_body", "我覺得這個【" + pd.name + "】不錯,用#也買酒手機商城#,隨時隨地買正品紅酒~立即下載體驗【" + SHARE_
Time of Update: 2018-12-05
代碼部分:<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" >
Time of Update: 2018-12-05
json資料格式解析我自己分為兩種;一種是普通的,一種是帶有數組形式的;普通形式的:伺服器端返回的json資料格式如下:{"userbean":{"Uid":"100196","Showname":"\u75af\u72c2\u7684\u7334\u5b50","Avtar":null,"State":1}}分析代碼如下:// TODO 狀態處理 500 200 int res = 0; res =
Time of Update: 2018-12-05
android
Time of Update: 2018-12-05
<?php$REQUEST_METHOD = $_SERVER['REQUEST_METHOD'];echo $REQUEST_METHOD;if($REQUEST_METHOD == 'GET'){$name = $_GET['name'];$pwd = $_GET['pwd']; if($name == 'Neeke' && $pwd == 'Neeke'){echo '你好:'.$name;}else{echo '登入失敗!';}}else
Time of Update: 2018-12-05
通過撥打到電話案例學習 intent 的使用方法. 由於是小程式,所以採用 UI介面-> Activity->業務層 自上而下的順序來編寫代碼. 由於要用到系統功能,要在AndroidMainfest.xml 加入 <uses-permission android:name="android.permisson.CALL_PHONE" /> 1.介面設計 res/layout/main.xml main.xml<?xml version="
Time of Update: 2018-12-05
package com.turboradio.googlesdk; import android.app.Activity;import android.os.Bundle;import android.view.MotionEvent;import android.view.View;import android.view.animation.Animation;import android.view.animation.AnimationUtils;import
Time of Update: 2018-12-05
摘自:http://www.cnblogs.com/mudoot/archive/2011/11/16/Writing_Efficient_Android_Code.html ,以便後記.對於佔用資源的系統,有兩條基本原則: 不要做不必要的事 不要分配不必要的記憶體 1.避免建立對象 除非必要,應盡量避免儘力對象的執行個體。 當你從使用者輸入的資料中截取一段字串時,盡量使用substring函數取得未經處理資料的一個子串,而不是為子串另外建立一份拷貝。這樣你就有一
Time of Update: 2018-12-05
RelativeLayout用到的一些重要的屬性: 第一類:屬性值為true或false android:layout_centerHrizontal 水平置中 android:layout_centerVertical 垂直置中 android:layout_centerInparent 相對於父元素完全置中 android:layout_alignParentBottom 貼緊父元素的下邊緣
Time of Update: 2018-12-05
一. Log 日誌輸出 可在 Window->Show View->Other->Android->Log Cat 調出 Log Cat 介面 常用的日誌: 普通運行資訊:i 錯誤資訊:e 輸出日誌: Log.i(TAG, strings); 其中TAG 為日誌標識符,一般用類名表示(方便查看此日誌是某個類的輸出),且常聲明為靜態常量.stirngs 為要輸出的字串.例: Log.i(TAG, strings)public
Time of Update: 2018-12-05
開發中很常見的一個問題,項目中的listview不僅僅是簡單的文字,常常需要自己定義listview,自己的Adapter去繼承 BaseAdapter,在adapter中按照需求進行編寫,問題就出現了,可能會發生點擊每一個item的時候沒有反應,無法擷取的焦點。原因多半是 由於在你自己定義的Item中存在諸如ImageButton,Button,CheckBox等子控制項(也可以說是Button或者Checkable