2011. 8. 24. 11:38 안드로이드
 <intent-filter>
                <action android:name="android.provider.Telephony.SMS_RECEIVED" />
 </intent-filter>
이렇게 쓰면되겠지 ?
android.bluetooth.intent.action.BONDING_CREATED
android.bluetooth.intent.action.BONDING_REMOVED
android.bluetooth.intent.action.DISABLED
android.bluetooth.intent.action.DISCOVERY_COMPLETED
android.bluetooth.intent.action.DISCOVERY_STARTED
android.bluetooth.intent.action.ENABLED
android.bluetooth.intent.action.HEADSET_STATE_CHANGED
android.bluetooth.intent.action.MODE_CHANGED
android.bluetooth.intent.action.NAME_CHANGED
android.bluetooth.intent.action.PAIRING_CANCEL
android.bluetooth.intent.action.PAIRING_REQUEST
android.bluetooth.intent.action.REMOTE_ALIAS_CHANGED
android.bluetooth.intent.action.REMOTE_ALIAS_CLEARED
android.bluetooth.intent.action.REMOTE_DEVICE_CONNECTED
android.bluetooth.intent.action.REMOTE_DEVICE_DISAPPEARED
android.bluetooth.intent.action.REMOTE_DEVICE_DISAPPEARED
android.bluetooth.intent.action.REMOTE_DEVICE_DISCONNECTED
android.bluetooth.intent.action.REMOTE_DEVICE_DISCONNECT_REQUESTED
android.bluetooth.intent.action.REMOTE_DEVICE_FOUND
android.bluetooth.intent.action.REMOTE_NAME_FAILED
android.bluetooth.intent.action.REMOTE_NAME_UPDATED
android.intent.action.AIRPLANE_MODE
android.intent.action.BATTERY_CHANGED
android.intent.action.BATTERY_LOW
android.intent.action.BOOT_COMPLETED
android.intent.action.CAMERA_BUTTON
android.intent.action.CONFIGURATION_CHANGED
android.intent.action.DATA_SMS_RECEIVED
android.intent.action.DATE_CHANGED
android.intent.action.DEVICE_STORAGE_LOW
android.intent.action.DEVICE_STORAGE_OK
android.intent.action.GTALK_CONNECTED
android.intent.action.GTALK_DISCONNECTED
android.intent.action.HEADSET_PLUG
android.intent.action.MANAGE_PACKAGE_STORAGE
android.intent.action.MEDIA_BAD_REMOVAL
android.intent.action.MEDIA_BUTTON
android.intent.action.MEDIA_EJECT
android.intent.action.MEDIA_MOUNTED
android.intent.action.MEDIA_REMOVED
android.intent.action.MEDIA_SCANNER_FINISHED
android.intent.action.MEDIA_SCANNER_SCAN_FILE
android.intent.action.MEDIA_SCANNER_STARTED
android.intent.action.MEDIA_SHARED
android.intent.action.MEDIA_UNMOUNTABLE
android.intent.action.MEDIA_UNMOUNTED
android.intent.action.NEW_OUTGOING_CALL
android.intent.action.PACKAGE_ADDED
android.intent.action.PACKAGE_CHANGED
android.intent.action.PACKAGE_INSTALL
android.intent.action.PACKAGE_REMOVED
android.intent.action.PACKAGE_RESTARTED
android.intent.action.POWER_CONNECTED
android.intent.action.POWER_DISCONNECTED
android.intent.action.PROVIDER_CHANGED
android.intent.action.REBOOT
android.intent.action.SCREEN_OFF
android.intent.action.SCREEN_ON
android.intent.action.TIMEZONE_CHANGED
android.intent.action.TIME_SET
android.intent.action.TIME_TICK
android.intent.action.UID_REMOVED
android.intent.action.UMS_CONNECTED
android.intent.action.UMS_DISCONNECTED
android.intent.action.WALLPAPER_CHANGED
android.media.RINGER_MODE_CHANGED
android.media.VIBRATE_SETTING_CHANGED
android.net.wifi.NETWORK_IDS_CHANGED
android.net.wifi.RSSI_CHANGED
android.net.wifi.SCAN_RESULTS
android.net.wifi.STATE_CHANGE
android.net.wifi.WIFI_STATE_CHANGED
android.net.wifi.supplicant.CONNECTION_CHANGE
android.net.wifi.supplicant.STATE_CHANGE
android.provider.Telephony.SIM_FULL
android.provider.Telephony.SMS_RECEIVED
android.provider.Telephony.WAP_PUSH_RECEIVED
춮처
http://www.dearsoft.org/tag/broadcastreceiver/
posted by 욱이다
2011. 8. 16. 15:57 안드로이드

http://ememomo.tistory.com/50 여기보면 c2dm라는 것이 있네요
구글 서버를 통해서 메세지를 주고 받는 방법입니다

posted by 욱이다
2011. 8. 16. 15:29 안드로이드


//완전 저장 기능이네 어플이 삭제 되지 않는 이상 값들이 저장되어있다

final static String SHAREPREFERENCE = "SHAREPREFERENCE";
 @Override
 protected void onResume() {
  // TODO Auto-generated method stub
  super.onResume();
  Log.i("ListViewActivity", "onResume");
  //임의 적으로다가 저장된 값이 있으면 읽어 들인다
  SharedPreferences prefs = getSharedPreferences(SHAREPREFERENCE, Activity.MODE_PRIVATE);
  String list1 = prefs.getString("LIST1", "없을 경우 기본값");
  String list2 = prefs.getString("LIST2", "없을 경우 기본값");
  int int1 = prefs.getInt("INT1", 0);
  int int2 = prefs.getInt("INT2", 0);
  Toast.makeText(this, list1 + list2 + int1 +" "+int2, Toast.LENGTH_SHORT).show();
  
 }

 
 @Override
 protected void onPause() {
  // TODO Auto-generated method stub
  super.onPause();
  Log.i("ListViewActivity", "onPause");
  //액티비티가 종료될때 값들을 임의 적으로다가 저장하는 것이다 
    pref = getSharedPreferences(SHAREPREFERENCE, Activity.MODE_PRIVATE);
  //저장을 위해 Edit객체 호출
  SharedPreferences.Editor edit = pref.edit();
  //지금까지 생성된 리스트뷰 텍스트 저장  
  edit.putString("LIST1", "홍길동" );
  edit.putString("LIST2", "김갑수" );
  edit.putInt("INT1", 1);
  edit.putInt("INT2", 2);
  //변경된 값 저장
  edit.commit();
 }

posted by 욱이다
2011. 6. 24. 16:46 안드로이드
웹뷰에 둥근모양의 prograssbar가 뜨는 예제다



public class Tab4 extends Activity {
    WebView web;
    Activity activity;
     final static String TAG = "TAB4";

     Dialog dialog;
     ProgressBar progress;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);

     
        getWindow().requestFeature(Window.FEATURE_PROGRESS);
        setContentView(R.layout.tabfour_bg);

        web = (WebView) findViewById(R.id.tab4_webview);
        web.getSettings().setJavaScriptEnabled(true);
        web.setWebViewClient(new DraptWebViewClient());
        web.setWebChromeClient(new DraptWebChormeClient());
        web.loadUrl("http://m.naver.com/");
       
//스타일에 맞는 다일얼로그를 생성했다
        dialog = new Dialog(this,R.style.prograssdialog);       
        dialog.addContentView(
                new ProgressBar(this),
                new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if ((keyCode == KeyEvent.KEYCODE_BACK)) {
            if (web.canGoBack())//뒤로 돌아가기 버튼을 눌렀을때 더 뒤로 갈수있으면 웹뷰를 뒤로 돌리고
                web.goBack();
 else //그렇지 않으면 다이얼로그 띄워서 앱을 종료할까 물어본다
                showDialog(0);
            return true;
        }
       
        return super.onKeyDown(keyCode, event);
    }

    @Override
    public Dialog onCreateDialog(int dialogId) {
        Dialog dialog = null;
        switch (dialogId) {
        case 0:
//커스텀 다이얼로그다 뒤로 가다가 더 뒤로 가기 힘들때 보여주는것 내 블로그 찾아보면 custom dialog라고 있다
            CustomDialog.Builder customBuilder = new CustomDialog.Builder(
                    Tab4.this);
            customBuilder.setTitle("Custom title").setMessage("Custom body")
                    .setNegativeButton("Cancel",
                            new DialogInterface.OnClickListener() {
                                public void onClick(DialogInterface dialog,
                                        int which) {
                                    Tab4.this.dismissDialog(0);
                                }
                            }).setPositiveButton("Confirm",
                            new DialogInterface.OnClickListener() {
                                public void onClick(DialogInterface dialog,
                                        int which) {
                                    dialog.dismiss();
                                }
                            });
            dialog = customBuilder.create();
            break;
        }
        return dialog;
    }

    private class DraptWebChormeClient extends WebChromeClient {

        /**
         * 페이지를 로딩하는 현재 진행 상황을 전해줍니다. newProgress 현재 페이지 로딩 진행 상황, 0과 100 사이의
         * 정수로 표현.(0% ~ 100%)
         */
        @Override
        public void onProgressChanged(WebView view, int newProgress) {
       
           

        }
    }

    private class DraptWebViewClient extends WebViewClient {
        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            view.loadUrl(url);
            Log.i(TAG,"shouldOverrideUrlLoading");
            return true;
        }

        @Override
        public void onPageFinished(WebView view, String url) {

            Log.i(TAG,"onPageFinished");
            dialog.dismiss();// 웹뷰 진행 상태를 닫는다

            super.onPageFinished(view, url);
        }

        @Override
        public void onPageStarted(WebView view, String url, Bitmap favicon) {
            // TODO Auto-generated method stub
     
            Log.i(TAG,"onPageStarted");
         
            super.onPageStarted(view, url, favicon);
//웹뷰 진행 상태를 띄운다
            if(dialog != null)
            {
                dialog.cancel();
                dialog = null;
            }
            dialog = new Dialog(Tab4.this,R.style.prograssdialog);   
            dialog.addContentView(
                    new ProgressBar(Tab4.this),
                    new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
           
           
            dialog.show();
        }

        @Override
        public void onLoadResource(WebView view, String url) {
            // TODO Auto-generated method stub
            Log.i(TAG,"onLoadResource");
           
            super.onLoadResource(view, url);
           
       

        }

        @Override
        public void onReceivedError(WebView view, int errorCode,

        String description, String failingUrl) {

            super.onReceivedError(view, errorCode, description, failingUrl);
            Toast.makeText(activity, "Oh no! " + description,
                    Toast.LENGTH_SHORT).show();

            switch (errorCode) {
            case ERROR_AUTHENTICATION:
                break; // 서버에서 사용자 인증 실패
            case ERROR_BAD_URL:
                break; // 잘못된 URL
            case ERROR_CONNECT:
                break; // 서버로 연결 실패
            case ERROR_FAILED_SSL_HANDSHAKE:
                break; // SSL handshake 수행 실패
            case ERROR_FILE:
                break; // 일반 파일 오류
            case ERROR_FILE_NOT_FOUND:
                break; // 파일을 찾을 수 없습니다
            case ERROR_HOST_LOOKUP:
                break; // 서버 또는 프록시 호스트 이름 조회 실패
            case ERROR_IO:
                break; // 서버에서 읽거나 서버로 쓰기 실패
            case ERROR_PROXY_AUTHENTICATION:
                break; // 프록시에서 사용자 인증 실패
            case ERROR_REDIRECT_LOOP:
                break; // 너무 많은 리디렉션
            case ERROR_TIMEOUT:
                break; // 연결 시간 초과
            case ERROR_TOO_MANY_REQUESTS:
                break; // 페이지 로드중 너무 많은 요청 발생
            case ERROR_UNKNOWN:
                break; // 일반 오류
            case ERROR_UNSUPPORTED_AUTH_SCHEME:
                break; // 지원되지 않는 인증 체계
            case ERROR_UNSUPPORTED_SCHEME:
                break; // URI가 지원되지 않는 방식
            }

        }
    }
}


<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">
    <WebView
        android:id="@+id/tab4_webview"
        android:layout_height="wrap_content"
        android:layout_width="fill_parent" />

       
</LinearLayout>






//이부분이 리소스 부분인데 스타일 정의하는것 보면 거의다가 투명으로 만들어버린다
//이것이 핵심이다
<style
        name="prograssdialog">

        <item
            name="android:windowFrame">@null</item>

        <item
            name="android:windowBackground">@android:color/transparent</item>
           
       
        <item
            name="android:windowIsFloating">true</item>

        <item
            name="android:windowContentOverlay">@null</item>

        <item
            name="android:windowTitleStyle">@null</item>

        <item
            name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>

        <item
            name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>

        <item
            name="android:backgroundDimEnabled">false</item>

        <item
            name="android:background">@android:color/transparent</item>
           
       
           
    </style>
posted by 욱이다
2011. 6. 24. 08:50 안드로이드


LayoutInflater mInflater1 = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
   View mDialogLayout1 = mInflater1.inflate(
     R.layout.alert_dialog_title, null);

   LayoutInflater mInflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
   View mDialogLayout = mInflater.inflate(R.layout.alert_dialog, null);
   
   
   builder.setPositiveButton("다시하기",
     new DialogInterface.OnClickListener() {
      public void onClick(DialogInterface dialog,
        int whichButton) {

      }
     });
   builder.setNegativeButton("다시하기",
     new DialogInterface.OnClickListener() {
      public void onClick(DialogInterface dialog,
        int whichButton) {

      }
     });
   
   builder.setCustomTitle(mDialogLayout1);

   builder.setView(mDialogLayout);

 builder.create();




<?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:background="@drawable/melon_list_select_bar_longtap"
 >
 <TextView
  android:text="title"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:gravity="center_horizontal|center_vertical"
  android:textSize="24px">

 </TextView>
</LinearLayout>

posted by 욱이다
2011. 6. 23. 21:39 안드로이드
출처 : http://blog.androgames.net/10/custom-android-dialog/

그냥 여기있는 소스 그대로다
리소스는 출처에도없어서 그냥 돌아다니는 아무 리소스 해서
header.png
footer.png
key.png
title.png로 이름 바꿔서 res\drawable에다가 너어뒀다

진짜 다이얼로그에서 타이틀 색깔 바꿀라고 엄청 노력했는데 이거 한방으로 끝났다 참으로 감사하다
멜론의 겨자색 다이어로그박스가 탐났었는데 드디어 원풀어다


Main.java

package np.comp.AlertDialogTest;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.widget.Button;
import android.widget.EditText;

/**
 * Intent intent = new Intent(Index.this, AlertDialogs.class);<br>
 * intent.putExtra(AlertDialogs.setMode, AlertDialogs.PROGRESS);<br>
 * 얼랏식으로 액티비티를 띄움.<br>
 *
 */
// 버턴을 상수값으로 지정했다.
public class Main extends Activity
{
    public static final String Mode = "MODE";
    public int setMode = 0;
    public static final String mode_InputText = "1";
    public static final String mode_Login = "2";
    private EditText edit = null;
    private Button button1 = null;
    private Button button2 = null;
    final static String PIN = "0000";
    final static int CUSTOM_DIALOG = 0;
    final static int DEFAULT_DIALOG=1;
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        showDialog(CUSTOM_DIALOG);   
    }
    @Override
    public Dialog onCreateDialog(int dialogId) {
        Dialog dialog = null;
        switch (dialogId) {
            case CUSTOM_DIALOG :
                CustomDialog.Builder customBuilder = new
                    CustomDialog.Builder(Main.this);
                customBuilder.setTitle("Custom title")
                    .setMessage("Custom body")
                    .setNegativeButton("Cancel",
                            new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int which) {
                            Main.this
                            .dismissDialog(CUSTOM_DIALOG);
                        }
                    })
                    .setPositiveButton("Confirm",
                            new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int which) {
                            dialog.dismiss();
                        }
                    });
                dialog = customBuilder.create();
                break;
            case DEFAULT_DIALOG :
                AlertDialog.Builder alertBuilder = new
                    AlertDialog.Builder(Main.this);
                alertBuilder.setTitle("Default title")
                    .setMessage("Default body")
                    .setNegativeButton("Cancel",
                            new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int which) {
                            dialog.dismiss();
                        }
                    })
                    .setPositiveButton("Confirm",
                            new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int which) {
                            Main.this
                            .dismissDialog(DEFAULT_DIALOG);
                        }
                    });
                dialog = alertBuilder.create();
                break;
        }
        return dialog;
    }
   
}

///이부분은 그냥 다이얼로그를 상속 받아서 재정의했는데 굳이 이럴 필요없이 CustomDialog create() 이부분을 적당히 긁어서 Main의 Dialog onCreateDialog부분에다가 적용시킨다면 소스 코드가 짧게 될 수있겠다
CustomDialog.java
package np.comp.AlertDialogTest;

import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

public class CustomDialog extends Dialog
{
    public CustomDialog(Context context)
    {
        super(context);
        // TODO Auto-generated constructor stub
    }
    public CustomDialog(Context context,int theme)
    {
        super(context,theme);
        // TODO Auto-generated constructor stub
    }
    public static class Builder {
         
        private Context context;
        private String title;
        private String message;
        private String positiveButtonText;
        private String negativeButtonText;
        private View contentView;
 
        private DialogInterface.OnClickListener
                        positiveButtonClickListener,
                        negativeButtonClickListener;
 
        public Builder(Context context) {
            this.context = context;
        }
 
        /**
         * Set the Dialog message from String
         * @param title
         * @return
         */
        public Builder setMessage(String message) {
            this.message = message;
            return this;
        }
 
        /**
         * Set the Dialog message from resource
         * @param title
         * @return
         */
        public Builder setMessage(int message) {
            this.message = (String) context.getText(message);
            return this;
        }
 
        /**
         * Set the Dialog title from resource
         * @param title
         * @return
         */
        public Builder setTitle(int title) {
            this.title = (String) context.getText(title);
            return this;
        }
 
        /**
         * Set the Dialog title from String
         * @param title
         * @return
         */
        public Builder setTitle(String title) {
            this.title = title;
            return this;
        }
 
        /**
         * Set a custom content view for the Dialog.
         * If a message is set, the contentView is not
         * added to the Dialog...
         * @param v
         * @return
         */
        public Builder setContentView(View v) {
            this.contentView = v;
            return this;
        }
        /**
         * Set the positive button resource and it's listener
         * @param positiveButtonText
         * @param listener
         * @return
         */
        public Builder setPositiveButton(int positiveButtonText,
                DialogInterface.OnClickListener listener) {
            this.positiveButtonText = (String) context
                    .getText(positiveButtonText);
            this.positiveButtonClickListener = listener;
            return this;
        }
 
        /**
         * Set the positive button text and it's listener
         * @param positiveButtonText
         * @param listener
         * @return
         */
        public Builder setPositiveButton(String positiveButtonText,
                DialogInterface.OnClickListener listener) {
            this.positiveButtonText = positiveButtonText;
            this.positiveButtonClickListener = listener;
            return this;
        }
 
        /**
         * Set the negative button resource and it's listener
         * @param negativeButtonText
         * @param listener
         * @return
         */
        public Builder setNegativeButton(int negativeButtonText,
                DialogInterface.OnClickListener listener) {
            this.negativeButtonText = (String) context
                    .getText(negativeButtonText);
            this.negativeButtonClickListener = listener;
            return this;
        }
 
        /**
         * Set the negative button text and it's listener
         * @param negativeButtonText
         * @param listener
         * @return
         */
        public Builder setNegativeButton(String negativeButtonText,
                DialogInterface.OnClickListener listener) {
            this.negativeButtonText = negativeButtonText;
            this.negativeButtonClickListener = listener;
            return this;
        }
        /**
         * Create the custom dialog
         */
        public CustomDialog create() {
            LayoutInflater inflater = (LayoutInflater) context
                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            // instantiate the dialog with the custom Theme
            final CustomDialog dialog = new CustomDialog(context,
                  R.style.Dialog);
            View layout = inflater.inflate(R.layout.dialog, null);
            dialog.addContentView(layout, new LayoutParams(
                    LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
            // set the dialog title
            ((TextView) layout.findViewById(R.id.title)).setText(title);
            // set the confirm button
            if (positiveButtonText != null) {
                ((Button) layout.findViewById(R.id.positiveButton))
                        .setText(positiveButtonText);
                if (positiveButtonClickListener != null) {
                    ((Button) layout.findViewById(R.id.positiveButton))
                            .setOnClickListener(new View.OnClickListener() {
                                public void onClick(View v) {
                                    positiveButtonClickListener.onClick(
                                            dialog,
                                            DialogInterface.BUTTON_POSITIVE);
                                }
                            });
                }
            } else {
                // if no confirm button just set the visibility to GONE
                layout.findViewById(R.id.positiveButton).setVisibility(
                        View.GONE);
            }
            // set the cancel button
            if (negativeButtonText != null) {
                ((Button) layout.findViewById(R.id.negativeButton))
                        .setText(negativeButtonText);
                if (negativeButtonClickListener != null) {
                    ((Button) layout.findViewById(R.id.negativeButton))
                            .setOnClickListener(new View.OnClickListener() {
                                public void onClick(View v) {
                                    positiveButtonClickListener.onClick(
                                            dialog,
                                            DialogInterface.BUTTON_NEGATIVE);
                                }
                            });
                }
            } else {
                // if no confirm button just set the visibility to GONE
                layout.findViewById(R.id.negativeButton).setVisibility(
                        View.GONE);
            }
            // set the content message
            if (message != null) {
                ((TextView) layout.findViewById(
                        R.id.message)).setText(message);
            } else if (contentView != null) {
                // if no message set
                // add the contentView to the dialog body
                ((LinearLayout) layout.findViewById(R.id.content))
                        .removeAllViews();
                ((LinearLayout) layout.findViewById(R.id.content))
                        .addView(contentView,
                                new LayoutParams(
                                        LayoutParams.WRAP_CONTENT,
                                        LayoutParams.WRAP_CONTENT));
            }
            dialog.setContentView(layout);
            return dialog;
        }
 
    }
}


<?xml version="1.0" encoding="utf-8"?>
<resources>
 <!-- 여기에서 가장 핵심은 이부분이다  보통의 다이어로그를 레이아웃으로만 커스텀 형식으로 만들다보면 다이얼로그의 테두리때문에 보기 싫어서 포기 할때가있다 하지만 이부분을 추가해서 소스 코드에 적용한다면 완전 내가 원하는 이미지로 만들어진 다이얼로그 박스를 볼수있다 -->
    <style name="Dialog" parent="android:style/Theme.Dialog">
         <item name="android:windowBackground">@null</item>
        <item name="android:windowNoTitle">true</item>
          <item name="android:windowIsFloating">true</item>
    </style>
 
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
 
    <style name="DialogText">
        <item name="android:textColor">#FF000000</item>
        <item name="android:textSize">12sp</item>
    </style>
 
    <style name="DialogText.Title">
        <item name="android:textSize">16sp</item>
        <item name="android:textStyle">bold</item>
    </style>
 
</resources>


MANIFEST.xml파일
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="np.comp.AlertDialogTest"
      android:versionCode="1"
      android:versionName="1.0">


    <application android:icon="@drawable/icon" android:label="@string/app_name">
       
        <activity android:name=".Main" android:configChanges="orientation"
                  
                  >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>
</manifest>
posted by 욱이다
2011. 6. 22. 16:25 안드로이드

decompile.zip

출처 : http://blog.naver.com/PostView.nhn?blogId=hks9999&logNo=30103399449

고칠려고했는데 출처의 설명이 워낙 잘되있어서 긁어왔는 정도입니다.

준비사항

1. Java SDK

  - 아래의 툴들을 실행하는데 필요한 JRE 및 JDK

  - 다운로드 : http://www.oracle.com/technetwork/java/javase/downloads/index.html

 

2. Dex2Jar( Dex -> Jar)

  - 설명 : (.Dex)파일을 Class압축파일(.Jar)로 변환

  - 다운로드 : http://code.google.com/p/dex2jar/downloads/list

  - 최신버젼 : dex2jar-0.0.7.8-SNAPSHOT.zip

  - 필요환경 : JRE(Java Runtime Enviroment) 필요

 

3. Jad(Java Decompiler)

  - Class 파일 -> 자바소스로 디컴파일

  - 다운로드 : http://www.varaneckas.com/jad

  - 최신버젼 : jad158g




디컴파일 과정 설명

 

1. 먼저 풀고자 하는 .apk파일을 압축을 해제
zip파일로 변경후 압축을 풀면된다

 

2. dex2jar툴을 사용하여 classes.dex파일을 class파일로 변환한다.
커멘트창에다가 명령어 넣음>>dex2jar classes.dex

다음으로
>>jad -d source -sjava *.class 와 같이 입력을 하자.

 옵션설명

  -d 는 source 디렉토리에 생성

  -s 는 디컴파일 되는 소스의 확장자를 java

   *.class 대상으로

xml디컴파일
set WANTFILENAME=%1%
java -jar AXMLPrinter2.jar %WANTFILENAME%.xml > %WANTFILENAME%.txt



여기보면 더 잘볼 수있게 해주는 방법이있네 

http://blog.naver.com/chanwoo0117?Redirect=Log&logNo=50162248661



posted by 욱이다
prev 1 next