모바일 프로그래밍
DESCRIPTION
JNI 와 NDK 의 사용목적 및 기타 게임 프로그램. 모바일 프로그래밍. 전병우 이종민. 목차. Engine Multi-Platform Engine 설명 Interface Function Game Game Concept Game Flow Game 기획 JNI & NDK Break Limitation of NDK JNI, NDK Sound Sensor. Engine. Multi-Platform. Windows. Linux. Symbian. Engine. Mac. Palm. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/1.jpg)
모바일 프로그래밍JNI 와 NDK 의 사용목적 및 기타 게임 프로그램
전병우이종민
![Page 2: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/2.jpg)
목차
Engine Multi-Platform Engine 설명▪ Interface▪ Function
Game Game Concept Game Flow Game 기획
JNI & NDK Break Limitation of NDK JNI, NDK
Sound Sensor
![Page 3: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/3.jpg)
Engine
![Page 4: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/4.jpg)
Palm
Multi-Platform
Engine
Win-dows
Linux
Symbian
Mac
![Page 5: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/5.jpg)
Palm
Multi-Platform
Engine
Win-dows
Linux
Symbian
Mac
Interface
![Page 6: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/6.jpg)
Palm
Multi-Platform
Engine
Win-dows
Linux
Symbian
Mac
InterfaceFunction
![Page 7: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/7.jpg)
Engine 설명
Interface
• 외부 노출• Platform De-
pendant
Function
• 외부 노출• Platform In-
dependent
![Page 8: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/8.jpg)
Interface
Mark2Core
Mark2-Graphic
Mark2Ren-derSystem
UpdateRenderEvent
Main.cpp
![Page 9: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/9.jpg)
Interface
Mark2Core
Mark2-Graphic
Mark2Ren-derSystem
UpdateRenderEvent
Main.cpp
Android
Windows
WindowsMobile
![Page 10: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/10.jpg)
C++
C++
Activity.Java
Interface
Main.cpp
Android
Windows
WindowsMobile
JavaNDK
OpenGL ES
mainDirectXOpenGL
WinMainDirectMo-
bileOpenGL ES
![Page 11: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/11.jpg)
C++
C++
Activity.Java
Interface
Main.cpp
Android
Windows
WindowsMobile
JavaNDK
OpenGL ES
mainDirectXOpenGL
WinMainDirectMo-
bileOpenGL ES
JNI, NDK
![Page 12: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/12.jpg)
Interface
int APIENTRY WinMain(){
MApplication app(MApplication::RENDERSYSTEM_DIRECTMOBILEFIXED);
MWidget* pMainWidget = MNEW Galaxy3();app.exec();return 0;
}int APIENTRY WinMain(){
MApplication app(MApplication::RENDERSYSTEM_DIRECTX9);MWidget* pMainWidget = MNEW Galaxy3();app.exec();return 0;
}
![Page 13: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/13.jpg)
Interface
void init(const char* apkPath){ pApp = MNEW MApplication(MApplication::RENDERSYSTEM_OPENGLES); pMainWidget = MNEW Galaxy3;}bool update(){ bool bRunning = true; pApp->FrameStart(); bRunning = pApp->FrameUpdate(); pApp->FrameEnd(); pApp->MessagePump(); return bRunning;}
![Page 14: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/14.jpg)
InstanceArchieve
Load PictureXML ParserFixed PointDelegate
3D ObjectWrap Ren-
dererWidget Sys-tem
Function
Mark2Core
Mark2Ren-derSystem
Mark2-Graphic
Main.cpp
Message System
Sound
![Page 15: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/15.jpg)
Function.Instance
Filename MObject*
Filename MObject*
Filename MObject*
std::map<String, MObject*>
이중 충돌
![Page 16: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/16.jpg)
Function.Instance
First Use
Constructor
Reference++
Release
Reference--
Destroyer
![Page 17: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/17.jpg)
Function.Achieve
ZipMesh
Sound
User Inter-face
Etc
http://www.nih.at/libzip/
![Page 18: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/18.jpg)
Function.Load Picturehttp://www.libpng.org/pub/png/libp-ng.html
http://www.ijg.org/
Raw Image ColorCon-vert
RGB888
ARGB8888
RGBA8888
RGB565
![Page 19: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/19.jpg)
Function.XMLParserhttp://www.grinninglizard.com/tinyxml/
XMLFileXMLMeshLoader
XMLAnimationLoader
![Page 20: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/20.jpg)
Function.FixedPoint• Opengl ES 1.1• Direct MobileFixed
Point• Opengl ES 2.0• DirectX• Opengl
Floating Point
![Page 21: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/21.jpg)
Function.Delegatehttp://en.wikipedia.org/wiki/Signals_and_slots
http://en.wikipedia.org/wiki/Delegate_(.NET)
http://en.wikipedia.org/wiki/Observer_pattern
http://www.codeproject.com/KB/cpp/fd.aspxJaeWook Choi
![Page 22: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/22.jpg)
Function.Sound
Win-dows
MobileAndroidWin-
dows
MediaManager
AudioManager
MSound Warpper
![Page 23: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/23.jpg)
Function.3DObject
3ds MaxPlugin
3D ObjectXML
3D ObjectAnimation
XML
XMLParser
![Page 24: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/24.jpg)
Mark2RenderSystem
Function.WarpRenderer
WarpRendererDi-
rectX DirectMobile
Fixed Float
Opengl Opengl ES
An-droid
Win-dows
Mobile
CreateTex-ture
CreateLight
CreateMate-rial
MessagePumpBeginScene
EndScene Present
Mark2-Graphic
Mark2RenderSystem
![Page 25: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/25.jpg)
Function.WidgetSystem
Start GameCredit
Exit Game
S P A C E R A I L
GameWindow
Title
Menu
StartGame
Credit
ExitGameBackgroundStar
Widget
2DWid-get
2DWid-get
2DWid-get
2DWid-get
2DWid-get
3DWid-get
![Page 26: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/26.jpg)
Function.MessageSys-tem
GameWindow
Title
Menu
StartGame
Credit
ExitGameBackgroundStar
Start GameCredit
Exit Game
S P A C E R A I LClick~
!
Message Pumping
CompareUI Rect &
ClickPosition
![Page 27: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/27.jpg)
Function.MessageSys-tem
WindowsMessage
Proc
WindowsMobile
MessageProc
Android ActivityEvent Call-Back
MessageSystemPush Event
Pop Event
WidgetSystem
![Page 28: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/28.jpg)
Game
28세종대학교
An-droid
IOS
Win-dows
MobileWin-dows
Phone 7
Sym-bian
Palm
![Page 29: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/29.jpg)
Game
세종대학교 29
An-droid
Win-dows
Phone 7
Sym-bian
Palm
Win-dows
Mobile
IOS
![Page 30: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/30.jpg)
Game
![Page 31: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/31.jpg)
Game Concept
남극탐험
스카이로드
![Page 32: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/32.jpg)
Game Concept
카메라와 캐릭터를 고정시켜 조작감 극대화
Speed100 AU
Speed100 AU
![Page 33: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/33.jpg)
Game Flow
Play GameMy
RecordsOptions
Informa-tion
Exit
Space RailMy Records 선택
Back 선택
My Records1. 2009/11/04 2000122. 2009/11/04 2000123. 2009/11/04 2000124. 2009/11/04 2000125. 2009/11/04 200012
Back
Back 선택
Information 선택
Back 선택Option 선택
Exit 선택
Help
Option
Windows
Information
Credits
Back
Back
Credits
Back
Help
Back
Help 선
택Back 선
택
Back 선택Credits 선택
How to Play?~~~~~~~````~~~~~~~~```~~~~~~~~```~~~~~~~~```
Back
선택
선택
Back 선택
Help~~~~~~~~~~~~~~~~~~````~~~~~~~~```~~~~~~~~```~~~~~~~~```
![Page 34: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/34.jpg)
Game Flow
Play Game
My Records
Options
Informa-tion
Exit
Galaxy
Play Game 선택
Back 선택
행성 선택화면 선택
Back
조건 1)조건 2)조건 3)
Play
선택
선택Back
Back 선택
Play 선택
Back 선택
Back
Speed100 AU
![Page 35: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/35.jpg)
Game 기획
시작점
End
분명한 Goal
현재위치무제한으로 점프 스킬을 사용할 수 있다 .
점프 스킬 사용
![Page 36: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/36.jpg)
Game 기획
이동 동작
미사일 발사
파란미사일 발사체 생성
점프 불가
가스 분출구 봉쇄
점프 2 배
보조 날개 생성
공중 동작
가속
부스터 크기 최대
일반 이동
부스터 조금 발사
감속
부스터 방출 없음
![Page 37: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/37.jpg)
Game 기획이동 속도
속도가 빨라질 수록 맵 내려오는 속도가 증가한다 .
이동 방향
기본적으로 한 칸씩 좌우 이동이 가능하다 .
![Page 38: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/38.jpg)
Game 기획
속도 상승
속도 하강
무적 점프 2배
일반 이동 점프 불가 추락
미사일 발사
미사일 발사1 칸당 1 발
발사된 미사일과 NPC 충돌 시 사망
발사선 밟고 점프시 공중 발사
속도 상승상승 속도 = 최도 속도 * 2입장 시 급격한 상승 ( 정상
속도부터 )퇴장 시 급격한 하강 ( 정상 속도로 )
점프 2 배좌우로 2 칸 이동
정면으로 2 칸 이동
무적밟고 있는 동안 무적
일반 이동게임 시작 - 최고 속도 도달 2 초
좌우 점프 – 1 칸 이동정면 점프 - 1 칸 이동
속도 하강상승 속도 = 최도 속도 * (1/2)
입장 시 급격한 하강 ( 정상 속도부터 )
퇴장 시 급격한 상승 ( 정상 속도로 )
점프 불가점프 불가능 ( 통제 불가 )
추락시작 위치로 이동
![Page 39: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/39.jpg)
Game 기획
좌우로 이동( 끝까지 이동 )
플레이어를 향해 돌진등장 시
좌로 3 칸 이동 후정리 우로 3 칸 M 을 그리며 점프 이동 미사일 발사
Enemy 1 Enemy 1 Enemy 3 Enemy 4 Enemy 5
이동 속도 이동 속도 이동 속도
좌 , 우 이동 칸 수
이동 후 정지 시간
이동 속도
점프 후 정지 시간
이동 속도
이동 후 정지 시간Enemy 3 움직임
+ 미사일 발사 ( 턴
전 )
![Page 40: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/40.jpg)
Game 기획
A Type( 고정 ) B-1f Type C-1f Type( 빠른 좌회전 ) D-1F Type
C-2f Type( 빠른 우회전 )
C-1s Type( 느린 좌회전 )B-1s Type
E-1F Type ( 빠른 좌회전 )
D-2f Type
D-1s Type
D-2s Type
E-1F Type ( 느린 좌회전 )
E-1F Type ( 빠른 우회전 )
E-1F Type ( 느린 우회전 )
- 1 - - 1 -
- 1 -
- 1 - - 1 - - 1 -- 1 - - 1 -
F - Type G - Type
C-2s Type( 느린 우회전 )
- 1 - - 1 -
![Page 41: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/41.jpg)
JNI & NDK
JAVA C++Java Native Interface
![Page 42: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/42.jpg)
C - DynamicLink
Native Development Kit
Cross-Compiler
JNI & NDK
Dalvik
Java Native Interface
![Page 43: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/43.jpg)
JNI & NDK
Windows
Cygwin
Native Development Kit
Android.mk
Static Link
Android.mk Android.mk
Static LinkDynamic Link
Dynamic Link
Java Native Interface
JAVA
C Code
Software Development Kit
![Page 44: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/44.jpg)
Break Limitation of NDK
NDK
libc
libm
libzLibegl
C++
![Page 45: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/45.jpg)
Break Limitation of NDKhttp://www.crystax.net/android/ndk-r4.php
Crys-taX
C++ Ex-ception
RTTISTL
![Page 46: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/46.jpg)
JNI, NDK
static {System.loadLibrary("Mark2Core");
System.loadLibrary("Mark2Graphic"); //System.loadLibrary("Mark2RenderSystem_GLES"); System.loadLibrary("Makkolli"); }public native void nativeInit(String apkPath);public native void nativeUpdate();public native void nativeMousePush(int nX, int nY);public native void nativeMouseRelease(int nX, int nY);
C++ 로 만들어둔 Library 들 로드
Java C 로 통하는 함수 정의
![Page 47: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/47.jpg)
JNI, NDKclass MakkolliRenderer implements GLSurfaceView.Renderer {
public void onSurfaceCreated(GL10 gl, EGLConfig config) {m_SpaceRailAct.nativeInit(apkFilePath);
}
public void onDrawFrame(GL10 gl) {m_SpaceRailAct.nativeUpdate();
}}class MakkolliGLview extends GLSurfaceView {
public boolean onTouchEvent(final MotionEvent event){switch( event.getAction() ){
case MotionEvent.ACTION_DOWN:m_SpaceRailAct.nativeMousePush((int)event.getX(), (int)event.getY());
break;case MotionEvent.ACTION_UP:
m_SpaceRailAct.nativeMouseRelease((int)event.getX(), (int)event.getY());break;
}return true;}
}
Java C 로의 실질적인 함수
호출
![Page 48: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/48.jpg)
JNI, NDKJava C Inter-
face 에서 C 함수 정의 자동 생성
ndk-build 를 이용한 C 코드
컴파일
![Page 49: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/49.jpg)
JNI, NDK
include $(CLEAR_VARS)
MARK2CORE = \Mark2Core.cpp \………..../jni_tools.cpp
LOCAL_C_INCLUDES := LOCAL_MODULE := Mark2CoreLOCAL_SRC_FILES := $(MARK2CORE)
LOCAL_CFLAGS := -DANDROID_NDK -DMARK2CORE_EXPORTSLOCAL_CPP_EXTENSION := .cppLOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -ldl -llog -lzLOCAL_STATIC_LIBRARIES := libjpeglib libpnglib libzlib libtinyxml libzipinclude $(BUILD_SHARED_LIBRARY)
Android.mk
![Page 50: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/50.jpg)
JNI, NDK
/* DO NOT EDIT THIS FILE - it is machine generated */#include <jni.h>JNIEXPORT void JNICALL Java_makkolli_spacerail_SpaceRailActivity_nativeInit (JNIEnv *, jobject, jstring);JNIEXPORT void JNICALL Java_makkolli_spacerail_SpaceRailActivity_nativeUpdate (JNIEnv *, jobject);JNIEXPORT void JNICALL Java_makkolli_spacerail_SpaceRailActivity_nativeMousePush (JNIEnv *, jobject, jint, jint);JNIEXPORT void JNICALL Java_makkolli_spacerail_SpaceRailActivity_nativeMouseRelease (JNIEnv *, jobject, jint, jint);
자동으로 생성된 Java C Inter-
face 함수
![Page 51: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/51.jpg)
JNI, NDK#include <jni.h>#include "Mark2Core/Mark2Core.h"#define CB_CLASS "makkolli/spacerail/SpaceRailActivity“#define CB_CLASS_MSG_CB "OnMessage"#define CB_CLASS_MSG_SIG "(Ljava/lang/String;I)V“#define CB_CLASS_PLAYSOUND_CB "OnPlaySound"#define CB_CLASS_PLAYSOUND_SIG "(Ljava/lang/String;)V“#define CB_CLASS_STOPSOUND_CB "OnStopSound"#define CB_CLASS_STOPSOUND_SIG "(Ljava/lang/String;)V“#define CB_CLASS_PLAYLOOPSOUND_CB "OnPlayLoopSound"#define CB_CLASS_PLAYLOOPSOUND_SIG "(Ljava/lang/String;)V“#define CB_CLASS_PLAYEFFECTSOUND_CB "OnPlayEffectSound"#define CB_CLASS_PLAYEFFECTSOUND_SIG "(Ljava/lang/String;)V“#define CB_CLASS_STOPEFFECTSOUND_CB "OnStopEffectSound"#define CB_CLASS_STOPEFFECTSOUND_SIG "(Ljava/lang/String;)V“void MARK2CORE_API jni_PlayEffectSound(const char* strMusicName);void MARK2CORE_API jni_StopEffectSound(const char* strMusicName);void MARK2CORE_API jni_PlaySound(const char* strMusicName);void MARK2CORE_API jni_PlayLoopSound(const char* strMusicName);void MARK2CORE_API jni_StopSound(const char* strMusicName);void MARK2CORE_API jni_OutputString(const char* strOutputString);void MARK2CORE_API jni_Init(JNIEnv *env);
C Java 함수 정의
![Page 52: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/52.jpg)
JNI, NDKvoid MARK2CORE_API jni_OutputString(const char* strOutputString){
JNIEnv *env; g_VM->AttachCurrentThread(&env, NULL); jclass jNativesCls; jNativesCls = env->FindClass(CB_CLASS);
jmethodID jni_Method;
if (! jni_Method ) {// Get aref to the static method:jni.Natives.OnMessage jni_Method = env->GetStaticMethodID(jNativesCls, CB_CLASS_MSG_CB,
CB_CLASS_MSG_SIG); }
if (jni_Method) {// Call method env->CallStaticVoidMethod(jNativesCls, jni_Method, env-
>NewStringUTF(strOutputString), (jint) 2 ); }
}
C JAVA 로의 실질적인 함수
호출
![Page 53: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/53.jpg)
Sound
MediaMan-ager StopSound
Java Native Interface
AudioMan-ager
PlaySound
PlayEffect
StopEffect
![Page 54: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/54.jpg)
Event
Activity nativeReleaseJava Native Interface
nativePush
nativeAccelerome-ter
![Page 55: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/55.jpg)
Sensor
mSensorManager = (SensorManager)getSystemService(SENSOR_SERVICE);mAccSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);mSensorManager.registerListener(this, mAccSensor, SensorManager.SENSOR_DELAY_GAME);public void onSensorChanged(SensorEvent event) {
Sensor sensor = event.sensor;if (sensor.getType() == Sensor.TYPE_ACCELEROMETER) {
nativeAccelerometer(event.values[1], event.values[0], event.-values[2]);
}}
![Page 56: 모바일 프로그래밍](https://reader036.vdocuments.site/reader036/viewer/2022081416/56815dea550346895dcc0fea/html5/thumbnails/56.jpg)
Q & A