/**

     * e.printStackTrace(); 실행결과를 System.out 객체가 아닌 String 객체에 저장하여 반환

     * @param e 예외클래스 객체

     * @return

     */

    public String printStackTraceToString(Throwable e) {

        StringBuffer sb = new StringBuffer();

 

        try {

            sb.append(e.toString());

            sb.append("\n");

            StackTraceElement element[] = e.getStackTrace();

            for (int idx = 0; idx < element.length; idx++) {

                sb.append("\tat ");

                sb.append(element[idx].toString());

                sb.append("\n");

            }

        } catch (Exception ex) {

            return e.toString();

        }

 

        return sb.toString();

    }



[출처]http://blog.naver.com/ddak2ya/30151431652

Posted by MR 손
,

 

SuperOneClickv2.3.3-ShortFuse.7z

 

rootexplorer_2.16.apk

 

superuser.apk

Posted by MR 손
,
TextMate 1.5.1 (948)


s/n: change 98 8*****************************************************************************90 eb 15 c6 85 18

s/n: change 98 89 14 24 e8 5f d5 10 00 31 c0 eb 15 c6 85 18 to 98 89 14 24 e8 5f d5 10 00 40 90 eb 15 c6 85 18
Posted by MR 손
,

manifest.xml에 동일한<activity>가 두개 이상 있을때 발생하는 에러 

06-28 13:34:25.644: ERROR/Launcher(10360): Launcher does not have the permission to launch Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=mrsohn.CTSave/.CTMainActivity }. Make sure to create a MAIN intent-filter for the corresponding activity or use the exported attribute for this activity.
06-28 13:34:25.644: ERROR/Launcher(10360): java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=mrsohn.CTSave/.CTMainActivity } from ProcessRecord{40cd9c68 10360:org.zeam.core/10196} (pid=10360, uid=10196) requires null
06-28 13:34:25.644: ERROR/Launcher(10360):     at android.os.Parcel.readException(Parcel.java:1322)
06-28 13:34:25.644: ERROR/Launcher(10360):     at android.os.Parcel.readException(Parcel.java:1276)
06-28 13:34:25.644: ERROR/Launcher(10360):     at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1351)
06-28 13:34:25.644: ERROR/Launcher(10360):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1374)
06-28 13:34:25.644: ERROR/Launcher(10360):     at android.app.Activity.startActivityForResult(Activity.java:2827)
06-28 13:34:25.644: ERROR/Launcher(10360):     at org.zeam.Launcher.startActivityForResult(Launcher.java:1128)
06-28 13:34:25.644: ERROR/Launcher(10360):     at android.app.Activity.startActivity(Activity.java:2933)
06-28 13:34:25.644: ERROR/Launcher(10360):     at org.zeam.Launcher.startActivitySafely(Launcher.java:1922)
06-28 13:34:25.644: ERROR/Launcher(10360):     at org.zeam.ApplicationsGridView.onItemClick(ApplicationsGridView.java:160)
06-28 13:34:25.644: ERROR/Launcher(10360):     at android.widget.AdapterView.performItemClick(AdapterView.java:284)
06-28 13:34:25.644: ERROR/Launcher(10360):     at android.widget.AbsListView$PerformClick.run(AbsListView.java:1936)
06-28 13:34:25.644: ERROR/Launcher(10360):     at android.os.Handler.handleCallback(Handler.java:587)
06-28 13:34:25.644: ERROR/Launcher(10360):     at android.os.Handler.dispatchMessage(Handler.java:92)
06-28 13:34:25.644: ERROR/Launcher(10360):     at android.os.Looper.loop(Looper.java:123)
06-28 13:34:25.644: ERROR/Launcher(10360):     at android.app.ActivityThread.main(ActivityThread.java:3687)
06-28 13:34:25.644: ERROR/Launcher(10360):     at java.lang.reflect.Method.invokeNative(Native Method)
06-28 13:34:25.644: ERROR/Launcher(10360):     at java.lang.reflect.Method.invoke(Method.java:507)
06-28 13:34:25.644: ERROR/Launcher(10360):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
06-28 13:34:25.644: ERROR/Launcher(10360):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
06-28 13:34:25.644: ERROR/Launcher(10360):     at dalvik.system.NativeStart.main(Native Method)



안드로이드 프로젝트 빌드중에 에러가 발생할수 있다.
해당경우는 manifest.xml에 등록된 <receiver>로 등록된 클래스의 경로가 올바르지 못할때 발생한다
경로를 잘 잡아주도록 한다

06-29 11:08:45.824: ERROR/AndroidRuntime(1898): /system/csc/customer.xml ==> cannot open file

06-29 11:08:45.824: ERROR/AndroidRuntime(1898): /system/csc/feature.xml ==> cannot open file

06-29 11:08:46.059: WARN/ActivityManager(252): No content provider found for:

06-29 11:08:46.078: WARN/ActivityManager(252): No content provider found for:

06-29 11:08:46.086: WARN/PackageParser(252): /data/app/vmdl1081128854.tmp (at Binary XML file line #29): <receiver> does not have valid android:name


Posted by MR 손
,

MrsohnMirror.zip






 

 
package com.Mirror;
 
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
 
public class Mirror extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        /**
         * 갤럭시s 거울실행
         */
        Intent intent = new Intent();
        //intent.setClassName("패키지명", "실행할 클래스명");
        intent.setClassName("com.sec.android.widgetapp.mirror", "com.sec.android.widgetapp.mirror.Mirror");
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        startActivity(intent);
     // 기존 빈 화면의 activity가 남아 있으므로, 다른 클래스를 실행 하는 동시에 activity종료
        finish();    
    }
    @Override
    public void onBackPressed() {
        // TODO Auto-generated method stub
        super.onBackPressed();
        finish();
    }
}

Posted by MR 손
,

File path = new File("/sdcard/voice");

if(! path.isDirectory()) {

path.mkdirs();
 
}

 

Posted by MR 손
,

<receiver android:name="BroadCastReceiver">

        <intent-filter>

               <action android:name="android.app.action.ACTION_PASSWORD_FAILED"/>

               <action android:name="android.app.action.ACTION_PASSWORD_SUCCEEDED"/>

               <action android:name="android.app.action.DEVICE_ADMIN_DISABLED"/>

               <action android:name="android.app.action.DEVICE_ADMIN_DISABLE_REQUESTED"/>

               <action android:name="android.app.action.DEVICE_ADMIN_ENABLED"/>

               <action android:name="android.bluetooth.a2dp.action.SINK_STATE_CHANGED"/>

               <action android:name="android.bluetooth.adapter.action.DISCOVERY_FINISHED"/>

               <action android:name="android.bluetooth.adapter.action.DISCOVERY_STARTED"/>

               <action android:name="android.bluetooth.adapter.action.LOCAL_NAME_CHANGED"/>

               <action android:name="android.bluetooth.adapter.action.SCAN_MODE_CHANGED"/>

               <action android:name="android.bluetooth.adapter.action.STATE_CHANGED"/>

               <action android:name="android.bluetooth.device.action.ACL_CONNECTED"/>

               <action android:name="android.bluetooth.device.action.ACL_DISCONNECTED"/>

               <action android:name="android.bluetooth.device.action.BOND_STATE_CHANGED"/>

               <action android:name="android.bluetooth.device.action.CLASS_CHANGED"/>

               <action android:name="android.bluetooth.device.action.FOUND"/>

               <action android:name="android.bluetooth.device.action.NAME_CHANGED"/>

               <action android:name="android.bluetooth.devicepicker.action.DEVICE_SELECTED"/>

               <action android:name="android.bluetooth.devicepicker.action.LAUNCH"/>

               <action android:name="android.bluetooth.headset.action.AUDIO_STATE_CHANGED"/>

               <action android:name="android.bluetooth.headset.action.STATE_CHANGED"/>

               <action android:name="android.intent.action.ACTION_POWER_CONNECTED"/>

               <action android:name="android.intent.action.ACTION_POWER_DISCONNECTED"/>

               <action android:name="android.intent.action.ACTION_SHUTDOWN"/>

               <action android:name="android.intent.action.AIRPLANE_MODE"/>

               <action android:name="android.intent.action.BATTERY_CHANGED"/>

               <action android:name="android.intent.action.BATTERY_LOW"/>

               <action android:name="android.intent.action.BATTERY_OKAY"/>

               <action android:name="android.intent.action.BOOT_COMPLETED"/>

               <action android:name="android.intent.action.CAMERA_BUTTON"/>

               <action android:name="android.intent.action.CONFIGURATION_CHANGED"/>

               <action android:name="android.intent.action.DATA_SMS_RECEIVED"/>

               <action android:name="android.intent.action.DATE_CHANGED"/>

               <action android:name="android.intent.action.DEVICE_STORAGE_LOW"/>

               <action android:name="android.intent.action.DEVICE_STORAGE_OK"/>

               <action android:name="android.intent.action.DOCK_EVENT"/>

               <action android:name="android.intent.action.EXTERNAL_APPLICATIONS_AVAILABLE"/>

               <action android:name="android.intent.action.EXTERNAL_APPLICATIONS_UNAVAILABLE"/>

               <action android:name="android.intent.action.GTALK_CONNECTED"/>

               <action android:name="android.intent.action.GTALK_DISCONNECTED"/>

               <action android:name="android.intent.action.HEADSET_PLUG"/>

               <action android:name="android.intent.action.INPUT_METHOD_CHANGED"/>

               <action android:name="android.intent.action.LOCALE_CHANGED"/>

               <action android:name="android.intent.action.MANAGE_PACKAGE_STORAGE"/>

               <action android:name="android.intent.action.MEDIA_BAD_REMOVAL"/>

               <action android:name="android.intent.action.MEDIA_BUTTON"/>

               <action android:name="android.intent.action.MEDIA_CHECKING"/>

                <action android:name="android.intent.action.MEDIA_EJECT"/>

               <action android:name="android.intent.action.MEDIA_MOUNTED"/>

               <action android:name="android.intent.action.MEDIA_NOFS"/>

               <action android:name="android.intent.action.MEDIA_REMOVED"/>

               <action android:name="android.intent.action.MEDIA_SCANNER_FINISHED"/>

               <action android:name="android.intent.action.MEDIA_SCANNER_SCAN_FILE"/>

               <action android:name="android.intent.action.MEDIA_SCANNER_STARTED"/>

               <action android:name="android.intent.action.MEDIA_SHARED"/>

               <action android:name="android.intent.action.MEDIA_UNMOUNTABLE"/>

               <action android:name="android.intent.action.MEDIA_UNMOUNTED"/>

               <action android:name="android.intent.action.NEW_OUTGOING_CALL"/>

               <action android:name="android.intent.action.PACKAGE_ADDED"/>

               <action android:name="android.intent.action.PACKAGE_CHANGED"/>

               <action android:name="android.intent.action.PACKAGE_DATA_CLEARED"/>

               <action android:name="android.intent.action.PACKAGE_INSTALL"/>

               <action android:name="android.intent.action.PACKAGE_REMOVED"/>

               <action android:name="android.intent.action.PACKAGE_REPLACED"/>

               <action android:name="android.intent.action.PACKAGE_RESTARTED"/>

               <action android:name="android.intent.action.PHONE_STATE"/>

               <action android:name="android.intent.action.PROVIDER_CHANGED"/>

               <action android:name="android.intent.action.REBOOT"/>

               <action android:name="android.intent.action.SCREEN_OFF"/>

               <action android:name="android.intent.action.SCREEN_ON"/>

               <action android:name="android.intent.action.TIMEZONE_CHANGED"/>

               <action android:name="android.intent.action.TIME_SET"/>

               <action android:name="android.intent.action.TIME_TICK"/>

               <action android:name="android.intent.action.UID_REMOVED"/>

               <action android:name="android.intent.action.UMS_CONNECTED"/>

               <action android:name="android.intent.action.UMS_DISCONNECTED"/>

               <action android:name="android.intent.action.USER_PRESENT"/>

               <action android:name="android.intent.action.WALLPAPER_CHANGED"/>

               <action android:name="android.media.AUDIO_BECOMING_NOISY"/>

               <action android:name="android.media.RINGER_MODE_CHANGED"/>

               <action android:name="android.media.SCO_AUDIO_STATE_CHANGED"/>

               <action android:name="android.media.VIBRATE_SETTING_CHANGED"/>

               <action android:name="android.net.conn.BACKGROUND_DATA_SETTING_CHANGED"/>

               <action android:name="android.net.wifi.NETWORK_IDS_CHANGED"/>

               <action android:name="android.net.wifi.RSSI_CHANGED"/>

               <action android:name="android.net.wifi.SCAN_RESULTS"/>

               <action android:name="android.net.wifi.STATE_CHANGE"/>

               <action android:name="android.net.wifi.WIFI_STATE_CHANGED"/>

               <action android:name="android.net.wifi.supplicant.CONNECTION_CHANGE"/>

               <action android:name="android.net.wifi.supplicant.STATE_CHANGE"/>

               <action android:name="android.provider.Telephony.SIM_FULL"/>

               <action android:name="android.provider.Telephony.SMS_RECEIVED"/>

               <action android:name="android.provider.Telephony.SMS_REJECTED"/>

               <action android:name="android.provider.Telephony.WAP_PUSH_RECEIVED"/>

               <action android:name="android.speech.tts.TTS_QUEUE_PROCESSING_COMPLETED"/>

               <action android:name="android.speech.tts.engine.TTS_DATA_INSTALLED"/>

        </intent-filter>

</receiver>


Posted by MR 손
,

 

BroadcastReceiver 를 등록하기 위해선

extends BroadcastReceiver 된 클래스와

manifest에 receiver에 등록 해주어야 한다.  

 


==========================================================
테스트
하기 위한 Activity 

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView; 

public
class BroadCastReceiverActivity extends Activity{ 
    @Override 
    protected void onCreate(Bundle savedInstanceState) { 
        // TODO Auto-generated method stub 
        super.onCreate(savedInstanceState);        

        LinearLayout ll = new LinearLayout(this); 
        ll.setOrientation(LinearLayout.VERTICAL);   

        Button broadCastTestBtn = new Button(this);
        broadCastTestBtn.setText("브로드캐스트 시작");         

        int llHeight = LinearLayout.LayoutParams.FILL_PARENT; 
        int llWidth = LinearLayout.LayoutParams.WRAP_CONTENT;

        

        ll.addView(broadCastTestBtn, new LinearLayout.LayoutParams(llHeight, llWidth));

        

        setContentView(ll);

// 테스트 버튼을 눌러서 Logcat 확인 하면 BroadCastReceiverEx onReceive응답을 확인할수 있다.

        broadCastTestBtn.setOnClickListener(new OnClickListener() { 

           @Override 
            public void onClick(View v) {                

                Log.e("MrsohnSampleCode", "BroadCastReceiverActivity : onClick");
// manifest <action 지정된 메시지로 호출 
// mrsohn.samplecode.FIRE  는 형식적으로
// 패키지명(mrsohn.samplecode.)+메시지(FIRE:임의적으로)   만들도록 한다.
// 자신에 마음대로 만들어도 상관 없음. (단 manifest 에 등록되어 있어야 할것)

                Intent intent = new Intent("mrsohn.samplecode.FIRE"); 
//Intent receiver 전달, getExtra 값을 전달 한다. 
                intent.putExtra("type", "warning");        

                //Broadcast 보내기 
                sendBroadcast(intent);               

                //Broadcast 순차적으로 보낼때 
                //sendOrderedBroadcast(intent, null);

            } 
        }); 
    } }

============================================================================================================================

import android.content.BroadcastReceiver;
import android.content.Context;

import android.content.Intent;

import android.net.Uri;

import android.util.Log;

 

public class BroadCastReceiverEx extends BroadcastReceiver{

      

    @Override

    public void onReceive(Context context, Intent intent) {

        

        // 수신 Intent 처리

        Uri data = intent.getData();

        String type = intent.getStringExtra("type");

        

        // 수신된 Intent 조건을 확인하여 로직 실행

        if (type.equals("warning")) {

            Log.e("MroshnSampleCode", "BroadCastReceiverEx : onReceiver");

            

        }

        

    }

 

}

===========================================================================================================================

Manifest 설정

<!-- BroadcastReceiver 액티비티 -->

    <activity android:name.BroadCastReceiverActivity" android:label="" />

     <!-- manifest receiver 등록하기

클래스명을 적어준다.-->

        <receiver android:name=".BroadCastReceiverEx">

            <intent-filter>

                <action android:name="mrsohn.samplecode.FIRE"></action>

            </intent-filter>

        </receiver> 

** manifest 등록 하지 않고
자바 코드로 BroadcastReceiver 등록할 수도 있다.

 IntentFilter filler =
         new IntentFilter("mrsohn.samplecode.FIRE"); //BroadcastReceiver
action  

//BroadcastReceiver 클래스 
BroadCastReceiverEx r = new BroadCastReceiverEx();  
//등록하기       
registerReceiver(r, iller);
 
            

//해제할 때는
unregisterReceiver(receiver);

 

    

Posted by MR 손
,