adb shell screenrecord /sdcard/FILE_NAME.mp4


SD 카드에 저장됨... 

그만 저장하고 싶을 땐. ctrl + c

'Android' 카테고리의 다른 글

URL 파일 확인.  (0) 2016.01.12
GridLayout  (0) 2015.07.06
webpage interface  (0) 2014.12.22
Android Eclipse - Could not find *.apk  (0) 2014.12.10
android case expressions must be constant expressions  (0) 2014.12.10
Posted by iRang1101
,

URL 파일 확인.

Android 2016. 1. 12. 14:43
	
private boolean isExist(String url)
	{
		try {
			URLConnection con = new URL(url).openConnection();
			HttpURLConnection urlCon = (HttpURLConnection)con;
			urlCon.setRequestMethod("HEAD");
			urlCon.setFollowRedirects(false);
			int rescode = urlCon.getResponseCode() ;
			if ( rescode == 200 ) { 
				return true;
			}
			
		} catch (Exception e) {
			// TODO Auto-generated catch block
		}
		return false; 
	}

'Android' 카테고리의 다른 글

동영상 캡쳐. Using ADB  (0) 2016.03.30
GridLayout  (0) 2015.07.06
webpage interface  (0) 2014.12.22
Android Eclipse - Could not find *.apk  (0) 2014.12.10
android case expressions must be constant expressions  (0) 2014.12.10
Posted by iRang1101
,

GridLayout

Android 2015. 7. 6. 17:23


 

android.support.v7.widget.GridLayout 

 android:id="@+id/myGrid" 

 xmlns:app="http://schemas.android.com/apk/res-auto"

 android:layout_width="match_parent"

 android:layout_height="80dp"

 android:layout_weight="1"

 android:background="@color/black_translucence" 

 app:columnCount="6"

 app:rowCount="4"

태그는  생략. 

GridLayout은 가로세로 설정한 갯수로.. childView를 배치한다. 


'Android' 카테고리의 다른 글

동영상 캡쳐. Using ADB  (0) 2016.03.30
URL 파일 확인.  (0) 2016.01.12
webpage interface  (0) 2014.12.22
Android Eclipse - Could not find *.apk  (0) 2014.12.10
android case expressions must be constant expressions  (0) 2014.12.10
Posted by iRang1101
,

webpage interface

Android 2014. 12. 22. 17:41

webView를 사용하여 화면을 보여줄때... 

wb과 app과의 인터페이스가 필요할때가 있었다. 


1. web페이지에서 app을 호출할 경우는 다음과 같다. 

step 1 : 웹페이지

			
function reqMsg(arg){
	window.AndroidFunction.sendMessage(arg);
}
			

step 2 : app에서의 activity

	
_wvNews = (WebView)findViewById(R.id.webView);
		_wvNews.getSettings().setJavaScriptEnabled(true);
		_wvNews.getSettings().setLoadsImagesAutomatically(true);
		_wvNews.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
		_wvNews.getSettings().setLoadWithOverviewMode(true);
		_wvNews.setWebViewClient(new WebViewClientClass());
		
		_wvNews.addJavascriptInterface(new WebAppInterface(this), "AndroidFunction");
		
		_wvNews.loadUrl("http://www.test.co.kr/~testUser/test.html");



public class WebAppInterface {
	    Context mContext;

	    /** Instantiate the interface and set the context */
	    WebAppInterface(Context c) {
	        mContext = c;
	    }

	    /** Show a toast from the web page */
	    @JavascriptInterface
	    public void sendMessage(final String msg) {
	    	 MainActivity.this.runOnUiThread(new Runnable() {
	             public void run() {	            	 

	            	 Log.e(TAG, "msg= " + msg);

	             }
	             
	         });
	  
	     }
	}



2. app에서 webpage의 javascript 호출 시... 

step 1 : 웹페이지

	
function recvAndroidMsg(arg){
	document.getElementById("title").innerHTML = arg;
}
	

	




Hello JavaScript



step 2 : app에서의 activity

	
_wvNews.loadUrl("javascript:recvAndroidMsg('"+purchase.getSku()+"')");   


'Android' 카테고리의 다른 글

URL 파일 확인.  (0) 2016.01.12
GridLayout  (0) 2015.07.06
Android Eclipse - Could not find *.apk  (0) 2014.12.10
android case expressions must be constant expressions  (0) 2014.12.10
java.nio.BufferOverflowException  (0) 2014.10.29
Posted by iRang1101
,
뻘짓 ㅡ.ㅡ

1. Project -> Properties

2. Select Android from left-and side list

3. Uncheck the 'Is Library" checkbox. 


'Android' 카테고리의 다른 글

GridLayout  (0) 2015.07.06
webpage interface  (0) 2014.12.22
android case expressions must be constant expressions  (0) 2014.12.10
java.nio.BufferOverflowException  (0) 2014.10.29
Animation  (0) 2014.10.13
Posted by iRang1101
,

android 14버전에서 android case expressions must be constant expressions 에러 발생시.. 

switch 비교 대상의 값이 final로 선언해야 한다고 한다. 

R.id.xxxxx의 값은 final이 아니기에 에러가 발생한다. 

무슨 옵션이 있을 것 같긴 한데..... 

당장 해결책은 switch를 if - else문로 변경.. !!!


'Android' 카테고리의 다른 글

webpage interface  (0) 2014.12.22
Android Eclipse - Could not find *.apk  (0) 2014.12.10
java.nio.BufferOverflowException  (0) 2014.10.29
Animation  (0) 2014.10.13
기기별 dpi  (0) 2014.07.09
Posted by iRang1101
,

앱을 Building은 성공했으나... 디바이스에 올라갈때.. 에러가 발생했다. 


Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.


원인은 모름 . 

해결책 : 

1. 프로젝트의 Properiters -> java Build Path -> Libraries

2. Android Dependencies를 Remove한다. 


'Android' 카테고리의 다른 글

Android Eclipse - Could not find *.apk  (0) 2014.12.10
android case expressions must be constant expressions  (0) 2014.12.10
Animation  (0) 2014.10.13
기기별 dpi  (0) 2014.07.09
View 위치 찾기.  (0) 2014.05.21
Posted by iRang1101
,

Animation

Android 2014. 10. 13. 14:47

Animation inFromRight = 

new TranslateAnimation( Animation.RELATIVE_TO_PARENT,  +1.0f, 

Animation.RELATIVE_TO_PARENT,  0.0f,

Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,   0.0f

);



new TranslateAnimation ( fromXtype, fromXvalue, 

toXtype, toXvalue, 

fromYtype, fromYvalue, 

toYtype, toYvalue) ; 


'Android' 카테고리의 다른 글

android case expressions must be constant expressions  (0) 2014.12.10
java.nio.BufferOverflowException  (0) 2014.10.29
기기별 dpi  (0) 2014.07.09
View 위치 찾기.  (0) 2014.05.21
NDK 빌드할 때... multiple target patterns. Stop.  (0) 2014.05.09
Posted by iRang1101
,

기기별 dpi

Android 2014. 7. 9. 14:54

'Android' 카테고리의 다른 글

java.nio.BufferOverflowException  (0) 2014.10.29
Animation  (0) 2014.10.13
View 위치 찾기.  (0) 2014.05.21
NDK 빌드할 때... multiple target patterns. Stop.  (0) 2014.05.09
NDK 사용중... Android NDK:Warning:APP_PLATFORM 에러 해결...  (0) 2014.05.09
Posted by iRang1101
,

View 위치 찾기.

Android 2014. 5. 21. 09:51

view 위치 찾기.

절대 위치... 

Rect rectf = new Rect();
<imageView>or<view>.getLocalVisibleRect(rectf);

Log.d("WIDTH        :", String.valueOf(rectf.width()));
Log.d("HEIGHT       :", String.valueOf(rectf.height()));
Log.d("left         :", String.valueOf(rectf.left));
Log.d("right        :", String.valueOf(rectf.right));
Log.d("top          :", String.valueOf(rectf.top));
Log.d("bottom       :", String.valueOf(rectf.bottom));


'Android' 카테고리의 다른 글

Animation  (0) 2014.10.13
기기별 dpi  (0) 2014.07.09
NDK 빌드할 때... multiple target patterns. Stop.  (0) 2014.05.09
NDK 사용중... Android NDK:Warning:APP_PLATFORM 에러 해결...  (0) 2014.05.09
Setting drawableLeft in a TextView  (0) 2014.03.06
Posted by iRang1101
,