Kivy 시작하기 14.02 (모바일 앱 만들기 2)
사용 버전: Python 3.7.6, Kivy 1.11.1
사용 프로그램: Atom 1.43.0 x64
운영체제: 페도라 31 Workstation x64
Atom까지 설치한 상태에서 Atom 세팅을 해줍시다.
설정 창에 Install로 가서 autocomplete-python을 설치합니다.

atom-python-run도 설치합니다.

기본 Github 파일 경로도 수정해줍니다.

그다음, 휴대폰 android에서 사용할 수 있도록 .apk 파일로 만들어야 하는데 우리는 python for android를 사용할 겁니다.
https://python-for-android.readthedocs.io/en/latest/quickstart/
python -m pip install python-for-android


모든 의존성 있는 것들을 설치합니다.

1. git은 기존에 깔려있습니다.
2. ant을 설치합니다.
sudo dnf install ant

3. python2는 넘어갑니다. python3을 씁니다.
4. cython을 설치합니다.
python -m pip install cython
5. a java JDK는 ant를 설치하면서 같이 설치되었습니다.
6. zlib은 설치되어 있습니다.
7. libncurses를 설치합니다.
sudo dnf install ncurses-devel

8. unzip은 설치되어 있습니다.
9. virtualenv는 kivy를 설치하면서 설치되었습니다.
10. ccache를 설치해줍니다.
sudo dnf install ccache

11. autoconf를 설치합니다.

12. libtool을 설치합니다.
sudo dnf install libtool

13. cmake를 설치합니다.
sudo dnf install cmake

Android SDK와 Android NDK를 설치해야 합니다.

Android SDK
https://developer.android.com/studio
Download를 누릅니다.

설치를 합니다.

gzip을 풀어줍니다.
gzip -dv [파일명]

tar를 풀어줍니다.
tar -xvf [파일명]

Home 위치에 Android 디렉터리를 만듭니다.

위에 tar를 푼 android-studio를 Android 폴더로 옮깁니다.

android-studio/bin 디렉터리로 들어와서 ./studio.sh를 실행합니다.

다음의 화면 나옵니다.
OK를 누릅니다.


Next를 누릅니다.

Next를 누릅니다.

Next를 누릅니다.

Next를 누릅니다.

Finish를 누릅니다.

설치가 진행됩니다.

완료되면, Finish를 누릅니다.

Configure를 누릅니다.

Create Desktop Entry를 누르면, 바로 가기 아이콘이 생성됩니다.

OK를 누릅니다.

이제, Android NDK를 설치합니다.
https://developer.android.com/ndk/downloads
Linux 64-bit를 설치합니다.

다운로드를 누릅니다.

받은 zip 파일을 풀어줍니다.

압축이 풀린 파일을 옮깁니다.

이제, build-tools와 platforms를 확인해야 합니다.
Android SDK 디렉터리로 이동하여, sdkmanager를 실행합니다.
./sdkmanager --list

설치된 항목과 설치가 가능한 항목들이 보입니다.
build-tools는 29.0.3
platforms는 android-29로 되어있네요.
29는 API Level을 나타내며, Android OS 버전에 따라 API Level이 달라집니다.
https://developer.android.com/studio/releases/platformsdeveloper.android.com
그리고, 환경 변수 설정을 해줍니다.



NDKAPI에는 자신의 코드가 지원할 최소한의 Android 버전 Level을 적습니다.
저는 Android 5.0 Lollipop부터 지원하는 앱을 만들 생각입니다.
source ~/.bashrc를 적용합니다.

이제 사용할 준비가 모두 완료되었습니다.
끝.
앱:
https://play.google.com/store/apps/details?id=starlight.jaehwa.one
코드:
https://github.com/shwoghk14/Kivy_for_Starter
사용 프로그램: Atom 1.43.0 x64
운영체제: 페도라 31 Workstation x64
기획: URL 소스 자료를 내 휴대폰에 저장하는 앱.
Atom까지 설치한 상태에서 Atom 세팅을 해줍시다.
설정 창에 Install로 가서 autocomplete-python을 설치합니다.

atom-python-run도 설치합니다.

기본 Github 파일 경로도 수정해줍니다.

그다음, 휴대폰 android에서 사용할 수 있도록 .apk 파일로 만들어야 하는데 우리는 python for android를 사용할 겁니다.
https://python-for-android.readthedocs.io/en/latest/quickstart/
python -m pip install python-for-android


모든 의존성 있는 것들을 설치합니다.

1. git은 기존에 깔려있습니다.
2. ant을 설치합니다.
sudo dnf install ant

3. python2는 넘어갑니다. python3을 씁니다.
4. cython을 설치합니다.
python -m pip install cython
5. a java JDK는 ant를 설치하면서 같이 설치되었습니다.
6. zlib은 설치되어 있습니다.
7. libncurses를 설치합니다.
sudo dnf install ncurses-devel

8. unzip은 설치되어 있습니다.
9. virtualenv는 kivy를 설치하면서 설치되었습니다.
10. ccache를 설치해줍니다.
sudo dnf install ccache

11. autoconf를 설치합니다.

12. libtool을 설치합니다.
sudo dnf install libtool

13. cmake를 설치합니다.
sudo dnf install cmake

Android SDK와 Android NDK를 설치해야 합니다.

Android SDK
https://developer.android.com/studio
Download를 누릅니다.

설치를 합니다.

gzip을 풀어줍니다.
gzip -dv [파일명]

tar를 풀어줍니다.
tar -xvf [파일명]

Home 위치에 Android 디렉터리를 만듭니다.

위에 tar를 푼 android-studio를 Android 폴더로 옮깁니다.

android-studio/bin 디렉터리로 들어와서 ./studio.sh를 실행합니다.

다음의 화면 나옵니다.
OK를 누릅니다.


Next를 누릅니다.

Next를 누릅니다.

Next를 누릅니다.

Next를 누릅니다.

Finish를 누릅니다.

설치가 진행됩니다.

완료되면, Finish를 누릅니다.

Configure를 누릅니다.

Create Desktop Entry를 누르면, 바로 가기 아이콘이 생성됩니다.

OK를 누릅니다.

이제, Android NDK를 설치합니다.
https://developer.android.com/ndk/downloads
Linux 64-bit를 설치합니다.

다운로드를 누릅니다.

받은 zip 파일을 풀어줍니다.

압축이 풀린 파일을 옮깁니다.

이제, build-tools와 platforms를 확인해야 합니다.
Android SDK 디렉터리로 이동하여, sdkmanager를 실행합니다.
./sdkmanager --list

설치된 항목과 설치가 가능한 항목들이 보입니다.
build-tools는 29.0.3
platforms는 android-29로 되어있네요.
29는 API Level을 나타내며, Android OS 버전에 따라 API Level이 달라집니다.
https://developer.android.com/studio/releases/platformsdeveloper.android.com
그리고, 환경 변수 설정을 해줍니다.



NDKAPI에는 자신의 코드가 지원할 최소한의 Android 버전 Level을 적습니다.
저는 Android 5.0 Lollipop부터 지원하는 앱을 만들 생각입니다.
source ~/.bashrc를 적용합니다.

이제 사용할 준비가 모두 완료되었습니다.
끝.
앱:
https://play.google.com/store/apps/details?id=starlight.jaehwa.one
코드:
https://github.com/shwoghk14/Kivy_for_Starter
카테고리: BlackSmith, Kivy
댓글
댓글 쓰기
궁금한 점은 댓글 달아주세요.
Comment if you have any questions.