Time of Update: 2015-04-30
標籤:android 儲存 擷取機身儲存路徑(可以通過openFileInput,openFileOutput進行操作)String path=Environment.getDataDirectory().getAbsolutePath();返回/data擷取內建SD卡路徑:public String getStorageDir(){ if(!(Environment.getExternalStorageState().
Time of Update: 2015-04-30
標籤:Happy NumberWrite an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the process
Time of Update: 2015-04-30
標籤: DescriptionThere is an apple tree outside of kaka‘s house. Every autumn, a lot of apples will grow in the tree. Kaka likes apple very much, so he has been carefully nurturing the big apple tree.The tree has N forks which are
Time of Update: 2015-04-30
標籤:本文原創自 http://blog.csdn.net/voipmaker 轉載註明出處。當採用webrtc 底層庫開發android,ios 原生應用時,由於移動端不像pc端,在頻寬穩定性,系統效能上都相差很大,所以針對行動裝置的webrtc需要做一些最佳化以提高通話效果,比如 webrtc中ice的keep alive包發送過於頻繁,在2g/3g網路時頻寬有限,而webrtc的ice
Time of Update: 2015-04-30
標籤:http://www.cnblogs.com/hanjun/archive/2012/12/01/2797622.html網路連接中用到的類: 一.Reachability 1.添加 Reachability 的.h和.m檔案,再添加SystemConfiguration.framework。 2.Reachability中定義了三種網路狀態: typedef Num{ NotReachable = 0,
Time of Update: 2015-04-30
標籤://// ViewController.m// 0429//// Created by apple on 15/4/29.// Copyright (c) 2015年 gense. All rights reserved.//#import "ViewController.h"#import "ProductCategory.h"@interface ViewController ()<UITableViewDataSource,UITableViewDelegate>
Time of Update: 2015-04-30
標籤:前言我們經常所程式設計語言的的進步速度是落後於硬體的發展速度的。但是最近幾年,閉包文法在各個語言中都有自己的體現形式,例如 • C語言中使用函數指標作為回呼函數的入口; • Java和C#語言中的Lambda文法運算式; • Objective-C語言中的Blocks文法; • C#語言中的Delegates文法; • C++語言中的Functions對象;曆史Peter J.
Time of Update: 2015-04-30
標籤:由於Key有Down和Up事件,所以會執行兩次。class editTextOnKeyClickListener implements etOnKeyClickListener { @Override public boolean onKeyClick(View v, int keyCode, KeyEvent event) { // TODO Auto-generated method stub if
Time of Update: 2015-04-30
標籤: 一、布局中軟鍵盤自動彈出 bargain_dialog_offer_edit.requestFocus(); bargain_dialog_offer_edit.setFocusable(true); InputMethodManager imm = (InputMethodManager)
Time of Update: 2015-04-30
標籤:iOS開發:建立真機調試認證工具/原料能上網的蘋果電腦瀏覽器Xcode 5.1.1以上蘋果開發人員帳號ITunes軟體iOS裝置(iPhone、ipad均可)方法/步驟1首先開啟蘋果的開發人員網站(Tips:這裡我就不貼網址了)點擊網站上方的Member
Time of Update: 2015-04-30
標籤:1、視圖組件與容器組件 Android絕大部分UI組件都放在android.widget和android.view包及其子包,所有的UI組件都繼承了View類,ViewGroup則用於其他組件的容器。 XML屬性 相關方法 說明 android:alpha
Time of Update: 2015-04-30
標籤:iOS中Block介紹(一)基礎一、概述Block是C層級的文法和運行時特性。Block比較類似C函數,但是Block比之C函數,其靈活性體現在棧記憶體、堆記憶體的引用,我們甚至可以將一個Block作為參數傳給其他的函數或者Block。二、熱身先看一個比較簡單的Block例子:int multiplier = 7; int (^myBlock)(int) = ^(int num) { &nb
Time of Update: 2015-04-30
標籤: iOS應用程式生命週期(前後台切換,應用的各種狀態)詳解 iOS的應用程式的生命週期,還有程式是運行在前台還是後台,應用程式各個狀態的變換,這些對於開發人員來說都是很重要的。 iOS系統的資源是有限的,應用程式在前台和在背景狀態是不一樣的。在後台時,程式會受到系統的很多限制,這樣可以提高電池的使用和使用者體驗。//開發app,我們要遵循apple公司的一些指導原則,原則如下:1、應用程式的狀態狀態如下:Not running 未運行
Time of Update: 2015-04-30
標籤:請先閱讀:http://blog.saymagic.cn/2015/02/16/release-library-to-jcenter.html 最外面的build.gradle// Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript { repositories { jcenter()
Time of Update: 2015-04-30
標籤:如何切圖? 瞭解iphone介面的尺寸 最小的解析度是320x480,我們把這個尺寸定為基準介面尺寸(baseline),基準尺寸所用的表徵圖定為1倍圖(1x)。 在實際設計過程中,為了降低設計成本,一般拿裝置最高的解析度作為設計稿的原始大小,拿iphone來說就是iphone5或5s的640x1136啦,當然也可以用iphone4或4s的640x960,因為寬度都是640px,他們切圖的標準是一樣的。顯然,以1倍圖的基準尺寸(寬320px)為相對的參考依據,
Time of Update: 2015-04-30
標籤:RatingBar為評分條控制項,預設效果為若干個綠色的星星,如果想將其換成其他自訂圖片就要自訂它的style。首先是布局檔案:1 <RatingBar android:id="@+id/app_ratingbar" style="@style/MyRatingBar" 2 android:layout_marginTop="4dip" android:layout_width="wrap_content" 3
Time of Update: 2015-04-30
標籤: 一個星期的努力終於搞定了視頻的播放,利用FFmpeg解碼視頻,將解碼的資料通過OpenGLES渲染播放。搞清楚了自己想知道的和完成了自己的學習計劃,有點小興奮。明天就是“五一”,放假三天,更開心啦。 本文實現視頻檔案的播放是在自己之前寫的文章實戰FFmpeg--iOS平台使用FFmpeg將視頻檔案轉換為YUV檔案 、 實戰OpenGLES--iOS平台使用OpenGLES渲染YUV圖片
Time of Update: 2015-04-30
標籤:PopupWindow 是一個可以顯示在當前 Activity 之上的浮動容器,PopupWindow 彈出的位置是能夠改變的,按照有無位移量,可以分為無位移和有位移兩種;按照參照對象的不同又可以分為兩種:相對某個控制項(Anchor 錨點)的位置和在父容器內部的相對位置。PopupWindow 的實現效果如下:PopupWindow 的實現代碼如下:建立 PopupWindowView contentView = View.inflate(R.layout.pop, null)// R.
Time of Update: 2015-04-30
標籤:一、簡單介紹程式碼範例: 1 #import "YYViewController.h" 2 #import "ASIHTTPRequest.h" 3 4 @interface YYViewController () 5 6 7 @end 8 9 @implementation YYViewController10 11 - (void)viewDidLoad12 {13 [super viewDidLoad];14 }15 16
Time of Update: 2015-04-30
標籤:android android開發 android應用 行動裝置 App開發 移動互連網