android2019. 8. 27. 14:45
android2019. 8. 1. 09:59

AndroidManifest에 서비스를 등록하면 exported 라는 속성을 지정할 수 있다.

default 값은 true이며, 이는 다른 앱이나 시스템에서 해당 서비스를 access 할 수 있음을 의미.

해당 값이 false일 경우, 오로지 앱내부에서만 실행 가능함.

 

 

The "exported" attribute describes whether or not someone else can be allowed to use it.

So if you have "exported=false" on an Activity, no other app, or even the Android system itself, can launch it. Only you can do that, from inside your own application.

So settings "exported=false" on the Activity marked as the LAUNCHER Activity would basically tell the system that it cant launch your application, ever.

As for the error you mentioned, i don't see any services in your manifest? Where is that warning shown for you?

 

출처 : 

https://stackoverflow.com/questions/49471423/android-manifests-androidexported-false-prevents-app-from-running-on-device

Posted by easy16
android2019. 7. 30. 13:19

어느 버전부터인가 이런 메시지와 함께 broadcast가 제대로 전달되지 않는다.

그래서 온라인상의 example들이 의도와 다르게 동작하지 않아 혈압 상승을 유발.

 

그럴 땐 intent에 아래와 같이 ComponentName을 생성하여 보내고자하는 broadcast intent에 달아주자.

ComponentName의 인자로는 class 객체를 넣어줘야 하는데 kotlin에서는 아래와 같은 방식으로 호출하면 된다.

 

 "BroadcastQueue: Background execution not allowed: receiving Intent"

 

override fun onKeyUp(keyCode: Int, event: KeyEvent?): Boolean {

if ( keyCode == KeyEvent.KEYCODE_1){
Log.d("easy", "pressed keycode_1")

var i = Intent("a.b.c")
var comp = ComponentName(application, TestBroadCastReceiver::class.java)

i.setComponent(comp)

or

var comp = ComponentName(application, "com.test.testapplication.receiver.TestBroadCastReceiver")

i.setComponent(comp)

or

i.setPackage("com.test.testapplication")

or

다른 앱에서 실행 할 경우
var comp = ComponentName("com.test.testapplication","com.test.testapplication.receiver.TestBroadCastReceiver")
i.setComponent(comp)
i.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES)

 

 

* 삽질 후 알아냄  : 참고로 receiver는 TestBroadCastReceiver.java를 포함하는 경로이며 ComponentName의 package name에서는 제외한다. 

 


sendBroadcast(i)}

return super.onKeyUp(keyCode, event)
}

Posted by easy16
android2019. 7. 15. 10:02

Ex1)

#dumpsys activity broadcasts

 

Ex2)

#dumpsys activity broadcasts history

 

출처 :

https://stackoverflow.com/questions/4599972/showing-all-broadcast-events-on-android

Posted by easy16
android2019. 7. 3. 17:51

Jack server failed to (re)start, try 'jack-diagnose' or see Jack server log
No Jack server running. Try 'jack-admin start-server'
No Jack server running. Try 'jack-admin start-server'

 

 

 

 

.jack-server/config.properties 아래와 같이 설정

 

SERVER_PORT_SERVICE = 8076

SERVER_PORT_ADMIN = 8077

 

실험을 통해 설정 파일 $ HOME / .jack-settings 에서 포트 번호  수정 해도 아무런 효과없음

 

.jack-server/config.properties

 

jack.server.service.port = 8076 

jack.server.admin.port = 8077

 

 

각설하고 두개 파일의 포트를 위와 같이 설정하면 해결되었음.

 

 

 

 

http://www.voidcn.com/article/p-gvwcusqg-mc.html

Posted by easy16
android2019. 7. 3. 17:24

expexport LC_ALL=C

Posted by easy16
android2019. 7. 1. 10:05

Android framework 소스에서 LOG 출력방법

#define LOG_NDEBUG 1 <= LOGE, LOGW, LOGI, LOGD 출력. LOGV 제외

#define LOG_NDEBUG 0 <= LOGV를 포함한 모든 LOG 출력

 

참고로 LOG_NDEBUG에 의해 제어되는 소스코드는 system/core/include/cutils/log.h 이다.



출처: https://yonomi.tistory.com/61 [Stone Of Days]

Posted by easy16
android2019. 4. 2. 14:37

 

The message rarely happens from chromium(android mediashell) and it's recoverable by resetting device or factory reset... but the main cause is current time mismatching.

It's recovered by settings time again.

 

see the post below.

https://www.thesslstore.com/blog/fix-ssl-connection-errors-android-phones/

'android' 카테고리의 다른 글

gcc: execv returned (No such file or directory)  (0) 2019.07.03
NDEBUG?  (0) 2019.07.01
platform key Android studio에서 사용하기  (0) 2018.12.03
onNewIntent callback in activity  (0) 2018.09.13
Android framework에서의 KeyEvent 처리 순서  (0) 2018.09.04
Posted by easy16
android2018. 12. 3. 16:19



Platfrom key가 존재하는 경로에서 아래의 명령어를 차례로 실행


openssl pkcs8 -in platform.pk8 -inform DER -outform PEM -out platform.priv.pem -nocrypt


openssl pkcs12 -export -in platform.x509.pem -inkey platform.priv.pem -out platform.pk12 -name AndroidDebugKey


keytool -importkeystore -destkeystore platform.jks -srckeystore platform.pk12 -srcstoretype PKCS12 -srcstorepass android -alias AndroidDebugKey



중간에 물어보는 암호는 그냥 android로 설정한다.



keystore path : "C:\Users\username\.android\

결과물을 Android Studio의 default.keystore로 replace.

replace 이전, 기존의 것은 backup 할 것.

Posted by easy16
android2018. 9. 13. 17:24

Sample code 

public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);


Button btn = (Button)findViewById(R.id.button);

btn.setOnClickListener(new View.OnClickListener(){

@Override
public void onClick(View v) {


Intent intent = new Intent(MainActivity.this, MainActivity.class );
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP );
intent.putExtra("aaa",1);
intent.putExtra("bbb",2);
intent.putExtra("ccc",3);

startActivity(intent);
}
}

);


}

@Override
protected void onNewIntent(Intent intent) {

super.onNewIntent(intent);
Log.d("easy", "onNewIntent called");
if ( null != intent){
int defaultValue = 0;
Log.d("easy", "aaa : "+intent.getIntExtra("aaa",0));
Log.d("easy", "bbb : "+intent.getIntExtra("bbb",0));
Log.d("easy", "ccc : "+intent.getIntExtra("ccc",0));
}

}
}

Activity가 foreground로 동작하고 있을 때, 해당 Activity로 startActivity를 호출할 경우 onNewIntent Callback이 호출된다. 


주의) addFlag를 추가하지 않으면 실행되지 않음


결과 : 


09-13 17:21:41.448  7123  7123 D easy    : onNewIntent called

09-13 17:21:41.448  7123  7123 D easy    : aaa : 1

09-13 17:21:41.448  7123  7123 D easy    : bbb : 2

09-13 17:21:41.448  7123  7123 D easy    : ccc : 3

Posted by easy16