Programming/android2022. 5. 12. 08:18

핸드폰을 HDMI로 연결해서 쓰다보니 세로 모드에서 HDMI 미러링시

작게 나오는게 그게 아쉬워서, 세로 모드를 화면 돌린채로 가득 채울수 없나 찾아보는 중.

 

the HDMI output can be rotated, after unlocking the rotation lock:

adb shell root
adb shell remount
adb shell setprop persist.demo.hdmirotation portrait
adb shell setprop persist.demo.hdmirotationlock false
adb shell setprop persist.demo.singledisplay true
adb reboot
one can then set the wm's display geometry:

adb shell wm size 1080x1920
adb shell wm size 1920x1920
or switch the user_rotation:

settings put system user_rotation 1
settings put system user_rotation 3
the NXP community seems to be the source.

[링크 : https://stackoverflow.com/questions/54468895]

[링크 : https://m.clien.net/service/board/cm_andro/11264652]

 

Posted by 구차니
Programming/android2022. 3. 11. 10:07

파워 + 볼륨 다운은 리부팅이라 액정 나간 지금 상태로는 쓸모가 없고..

파워 + 볼륨 업 + 볼륨 다운을 한번 시도해 봐야겠네

 

[링크 : https://www.digitub.org/guide/how-to-force-shutdown-your-android-device/]

'Programming > android' 카테고리의 다른 글

android hdmi rotate  (4) 2022.05.12
안드로이드 앱 자동 실행 설정  (0) 2022.03.02
안드로이드 system.img 마운트 하기  (0) 2022.02.18
안드로이드 64bit 지원  (0) 2021.07.27
핸드폰으로 만든 앱 올리기  (0) 2020.06.17
Posted by 구차니
Programming/android2022. 3. 2. 13:35

 

RECEIVE_BOOT_COMPLETED
Added in API level 1

public static final String RECEIVE_BOOT_COMPLETED
Allows an application to receive the Intent.ACTION_BOOT_COMPLETED that is broadcast after the system finishes booting. If you don't request this permission, you will not receive the broadcast at that time. Though holding this permission does not have any security implications, it can have a negative impact on the user experience by increasing the amount of time it takes the system to start and allowing applications to have themselves running without the user being aware of them. As such, you must explicitly declare your use of this facility to make that visible to the user.

Protection level: normal

Constant Value: "android.permission.RECEIVE_BOOT_COMPLETED"

[링크 : https://developer.android.com/reference/android/Manifest.permission#RECEIVE_BOOT_COMPLETED]

[링크 : https://joyfulhome.tistory.com/108]

[링크 : https://heisanbug.tistory.com/5]

'Programming > android' 카테고리의 다른 글

android hdmi rotate  (4) 2022.05.12
안드로이드 강제 종료  (0) 2022.03.11
안드로이드 system.img 마운트 하기  (0) 2022.02.18
안드로이드 64bit 지원  (0) 2021.07.27
핸드폰으로 만든 앱 올리기  (0) 2020.06.17
Posted by 구차니
Programming/android2022. 2. 18. 18:54

simg2img 유틸리티를 이용해서 변환 후 ext4로 마운트

 

mkdir sys
./simg2img system.img sys.raw
sudo mount -t ext4 -o loop sys.raw sys/

[링크 : https://stackoverflow.com/questions/8663891/how-to-mount-the-android-img-file-under-linux]

'Programming > android' 카테고리의 다른 글

안드로이드 강제 종료  (0) 2022.03.11
안드로이드 앱 자동 실행 설정  (0) 2022.03.02
안드로이드 64bit 지원  (0) 2021.07.27
핸드폰으로 만든 앱 올리기  (0) 2020.06.17
안드로이드 문자열 (string.xml)  (0) 2020.06.11
Posted by 구차니
Programming/android2021. 7. 27. 17:24

라즈베리 4 가지고 놀다보니 얘도 64bit OS가 나오는데

그럼 우리가 사용하는 안드로이드는 64bit인가 32bit 인가 궁금해서 찾아보는데

순정(?)으로는 알아낼 방법이 없는 듯?

 

 

[링크 : https://secur1ty.tistory.com/75] adb

[링크 : https://openart.tistory.com/2504] 3rd party app

[링크 : https://metalkin.tistory.com/81] android api

 

2019년 8월 1일부터 Google Play에 게시되는 앱에서는 64비트 아키텍처를 지원해야 합니다

[링크 : https://developer.android.com/distribute/best-practices/develop/64-bit?hl=ko]

Posted by 구차니
Programming/android2020. 6. 17. 18:07

개발 컴퓨터에서는 adb가 있어야 하니 우분투에서는 아래의 패키지를 설치하고

$ sudo apt-get install adb

[링크 : https://developer.android.com/studio/run/device?hl=ko]

 

핸드폰에서는 개발자 모드로 들어가서

설정 - 시스템 - 휴대전화 정보 - 빌드번호 3번 클릭

설정 - 시스템 - 개발자옵션 - USB 디버깅 활성화 해주고

[링크 : https://blog.naver.com/lifeformula/221685090225]

 

안드로이드 스튜디오에서는

Run - Select Device 에서 핸드폰이 인식되면 골라주고 실행하면 끝

Posted by 구차니
Programming/android2020. 6. 11. 15:48

string.xml 에는 아래와 같이 되어있는데

안드로이드 스튜디오에서는 string editor 쓰면 된다지만, 솔찍히 너무 느려서(i5-2500을 탓해야 하나..)

string.xml에 복붙해서 수정하는데 훨신 빠르다.

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="hello">Hello!</string>
</resources>

 

액티비티 xml 쪽에서는 아래와 같이 @string/문자열식별자 식으로 쓴다.

<TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/hello" />

 

도움말 안보고 막 쓰다 보니 되서 냅두긴 했는데.. 이게 코드에서는 정석인가?

String string = getString(R.string.hello);

 

[링크 : https://appcafe.tistory.com/31]

[링크 : https://developer.android.com/guide/topics/resources/string-resource?hl=ko]

 

+

i18n 적용은, values-국가코드 식으로 구분해서 쓰면 되는 듯

res/values/strings.xml
res/values-fr/strings.xml
res/values-ja/strings.xml

 

이미지도 문자열 처럼 drawable-국가코드 식으로 되는 듯

res/drawable/
res/drawable-ja/

[링크 : https://developer.android.com/guide/topics/resources/localization?hl=ko]

'Programming > android' 카테고리의 다른 글

안드로이드 64bit 지원  (0) 2021.07.27
핸드폰으로 만든 앱 올리기  (0) 2020.06.17
안드로이드 HTTP를 이용한 REST API 호출  (0) 2020.06.10
retrofit 어렵네..  (0) 2020.06.09
Android Logcat  (0) 2020.06.09
Posted by 구차니
Programming/android2020. 6. 10. 20:22

말은 거창한데 Retrofit2 사용하려다가 (못해먹겠어서)

간단하게 부르기만 하고

JSON 결과받아오지 않기 때문에 파싱을 하지 않아도 되기 때문에

wget이나 curl 처럼 단순하게 호출만 하는 녀석을 찾아 봄

 

 

AsyncTask 라는걸 쓰니 간단하게 구현이 가능하다.

import android.os.AsyncTask;
import android.util.Log;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class RestAPITask extends AsyncTask {
    // Variable to store url
    protected String mURL;

    // Constructor
    public RestAPITask(String url) {
        mURL = url;
    }

    // Background work
    @Override
    protected Object doInBackground(Object[] objects) {
        String result = null;

        try {
            // Open the connection
            URL url = new URL(mURL);
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
            conn.setRequestMethod("GET");
            InputStream is = conn.getInputStream();

            // Get the stream
            StringBuilder builder = new StringBuilder();
            BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF_8"));
            String line;
            while ((line = reader.readLine()) != null) {
                builder.append(line);
            }

            // Set the result
            result = builder.toString();
        }
        catch (Exception e) {
            // Error calling the rest api
            Log.e("REST_API", "GET method failed: " + e.getMessage());
            e.printStackTrace();
        }
        return null;
    }
}

 

아래는 호출하는 쪽. 경고가 발생하는데 일단 무시중

new RestAPITask("http://192.168.219.201:3000/api/ws").execute();

 

[링크 : https://calvinjmkim.tistory.com/16]

'Programming > android' 카테고리의 다른 글

핸드폰으로 만든 앱 올리기  (0) 2020.06.17
안드로이드 문자열 (string.xml)  (0) 2020.06.11
retrofit 어렵네..  (0) 2020.06.09
Android Logcat  (0) 2020.06.09
안드로이드 could not find method  (0) 2020.06.07
Posted by 구차니
Programming/android2020. 6. 9. 17:27

패키지 하나 쓰기 왜케 어럽냐..

 

okhttp를 따로 끌어와야 하나? 자동으로 끌려온다는 말이 있어서 안끌어왔더니 에러난다.

 

근데 구버전인지.. 지금 버전에 하면 compile 대신 implementation을 쓰라고 경고를 띄운다.

그리고 최신버전은 2.6.1 인데 2.3.0 으로 떨어지다니..

compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'

[링크 : https://www.journaldev.com/13639/retrofit-android-example-tutorial]

 

+

Call() 에 결과 없이(JSON으로 받지 않고) 처리하는 방법

@GET("path/to/void/api")
Call<Void> garageMove();

[링크 : https://stackoverflow.com/questions/47237106/retrofit-2-3-url-call-without-return-value]

 

+

2020.06.16

어노테이션 설명이 있어서 좀 보기가 수월한 듯.

 

[링크 : https://kor45cw.tistory.com/5]

Posted by 구차니
Programming/android2020. 6. 9. 17:23

기본으로 될 줄 알았는데, 자바를 너무 만능으로 생각한걸까..

아무튼 logcat 이라는 기능이 android.util.Log 패키지로 존재하기 때문에 사용하려면 import 해주어야 한다.

 

import android.util.Log;

 

사용 방법은 다음과 같이 

Error / Warning / Information / Debug / Verbose 의 약자로 붙이면 된다.

Log.e(String, String) (오류)
Log.w(String, String) (경고)
Log.i(String, String) (정보)
Log.d(String, String) (디버그)
Log.v(String, String) (상세)

[링크 : https://developer.android.com/studio/debug/am-logcat?hl=ko]

Posted by 구차니