로그 띄우지 않게 설정

-assumenosideeffects class android.util.Log {

    public static *** d(...);

    public static *** w(...);

    public static *** v(...);

    public static *** i(...);

}


기타 참고

proguard-android.txt와 proguard-android-optimize.txt가 있으며 앞의 것은 최적화를 수행하지 않고, 뒤의 것은 최적화를 수행한다.


참고

http://stackoverflow.com/questions/2446248/remove-all-debug-logging-calls-before-publishing-are-there-tools-to-do-this/2466662#2466662


http://www.reshout.com/?p=1288


http://stackoverflow.com/questions/5553146/disable-logcat-output-completely-in-release-android-app

설정

트랙백

댓글


adb install -l -r app-release.apk -l = forward lock -r = reinstall


- 해당 apk를 재설치 해준다.

설정

트랙백

댓글

참조 : http://stackoverflow.com/questions/18271429/difference-between-android-support-v7-appcompat-and-android-support-v4

android-support-v4.jar: Support android.app classes to assist with development of applications for android API level 4 or later. So that you will able to make your application backword compatible,

android-support-v7.jar It is recently added in latest support library updation. ActionBar to allow implementation of the action bar user interface design pattern back to Android 2.1 (API level 7) and higher. Use of this class requires that you implement your activity by extending the new ActionBarActivity class.

설정

트랙백

댓글

Gradle 업뎃하면서 쓰임새의 변화가 어느정도 생겼다.


참고 : http://tools.android.com/tech-docs/new-build-system/migrating-to-1-0-0


There are some additional other properties that were renamed as well, in both build types and product flavors.

ApplicationId in Library Projects

You cannot use applicationId to customize the package of a library project. The package name has to be fixed in library projects (and specified as packageName in the manifest). The Gradle plugin did not enforce this restriction earlier.

Renamed Properties in BuildTypes

runProguard => minifyEnabled
zipAlign => zipAlignEnabled
jniDebugBuild => jniDebuggable
renderscriptDebug => renderscriptDebuggable

Renamed Properties in ProductFlavors

flavorGroups => flavorDimensions
packageName => applicationId
testPackageName => testApplicationId
renderscriptSupportMode => renderscriptSupportModeEnabled
ProductFlavor.renderscriptNdkMode => renderscriptNdkModeEnabled


설정

트랙백

댓글


웹뷰 관련 개발하기 위해 여러가지 불편사항이 생기게 된다.

디버깅을 하기 힘들다는 점이 그 중 하나 일 것이다.

그래서 개선하고자 찾아본 결과 4.4 버젼 부터 웹뷰 디버깅이 가능하다는 것을 알게 되었다. ( 물론 4.0 이상 버젼도 되긴한다 - 아래 링크 참조 )

웹뷰 디버깅 링크를 클릭하면 자세히 나와있으니 참조하면 될거같다.


장비연결 상태 확인 url : chrome://inspect/#devices

설정

트랙백

댓글

http://sapandiwakar.in/eofexception-with-spring-rest-template-android/

설정

트랙백

댓글

Manifest merger failed : uses-sdk:minSdkVersion 14

 

http://stackoverflow.com/questions/24438170/manifest-merger-failed-uses-sdkminsdkversion-14

 

라이브러리도 version 타겟, 빌드 버젼 등등 확인해서 봐야할 것.

 

설정

트랙백

댓글

android imageview url

A/Android 2014. 8. 11. 20:47

From Android developer:

// show The Image
new DownloadImageTask((ImageView) findViewById(R.id.imageView1))
            .execute("http://java.sogeti.nl/JavaBlog/wp-content/uploads/2009/04/android_icon_256.png");
}

public void onClick(View v) {
    startActivity(new Intent(this, IndexActivity.class));
    finish();

}

private class DownloadImageTask extends AsyncTask<String, Void, Bitmap> {
    ImageView bmImage;

    public DownloadImageTask(ImageView bmImage) {
        this.bmImage = bmImage;
    }

    protected Bitmap doInBackground(String... urls) {
        String urldisplay = urls[0];
        Bitmap mIcon11 = null;
        try {
            InputStream in = new java.net.URL(urldisplay).openStream();
            mIcon11 = BitmapFactory.decodeStream(in);
        } catch (Exception e) {
            Log.e("Error", e.getMessage());
            e.printStackTrace();
        }
        return mIcon11;
    }

    protected void onPostExecute(Bitmap result) {
        bmImage.setImageBitmap(result);
    }
}

 

설정

트랙백

댓글

webview로 띄워서 서로 간의 커뮤니케이션을 해야할 경우가 반드시 생기기 마련이다.

예를 들면 google map v3를 써서 길찾기를 한다던지?

 

연동하는 방법을 배워보고자 한다.

 

우선 android studio에 프로젝트 하나 생성 후,

 

1. 추가

AndroidManifest.xml

<uses-permission android:name="android.permission.INTERNET" />

 

2. 액티비티, 웹

 

GoogleMapBridge googleMapBridge;

WebView webView;

 

onCreate

 

// 웹 뷰 로드

 webView.loadUrl("file:///android_asset/google_map.html");

// 자바스크립트 허용
 webView.getSettings().setJavaScriptEnabled(true);

 

// 해당 객체와 웹뷰 간의 연결
 webView.addJavascriptInterface(googleMapBridge, "GoogleApp");

 

 webView.setWebViewClient(new WebViewClient() {

// 페이지 로딩을 마쳤을 경우 작업
 public void onPageFinished(WebView view, String url) {

// 자바스크립트 메소드를 호출할 때, 페이지 로딩이 끝난 후 호출을 해야지 정상적으로 호출이 된다.
         googleMapBridge.sendMenu(1);
 }
 });

 

private class GoogleMapBridge {
        WebView webView;

        public GoogleMapBridge(WebView webView) {
            this.webView = webView;
        }

// 웹뷰에서 안드로이드의 메소드를 부름

        public void setMessage(final String mapX, final String mapY) {
            Message msg = new Message();
            Bundle bundle = new Bundle();

            bundle.putString("mapX", mapX);
            bundle.putString("mapY", mapY);
            msg.setData(bundle);

            targetHandler.sendMessage(msg);
        }

// 안드로이드에서 웹뷰로 자바스크립트 호출

        public void sendMenu(int num){
            webView.loadUrl("javascript:markMap(" + num + ")");
        }
    }

 

google_map.html

function init(){

// 자바스크립트에서 안드로이드로 호출

 window.GoogleApp.setMessage(1, 2);

}

 

// 안드로이드에서 이 메소드를 호출
 function markMap(num){
     // ....
 }

 

중요한 부분은 페이지 로딩이 다 끝난 후, 자바스크립트 호출을 할 수 있다는 거 주의 !

 

 

설정

트랙백

댓글

ListView 구현시에 뷰홀더(ViewHolder) 사용하기

 

http://theeye.pe.kr/archives/1253

 

설정

트랙백

댓글