안드로이드 Android (58) 썸네일형 리스트형 [모바일프로그래밍] 10-5 방송 수신자 activity_main.xml MainActivity.java package com.example.myapplication; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.os.BatteryManager; import android.os.Bundle; import android.widget.TextView; import android.widget.Toast; import androidx.appcompat.app.AppCompatActivity; public class Ma.. [모바일프로그래밍] 10-4 연결 타입 서비스 bind service activity_main.xml MainActivity.java package com.example.myapplication; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.ServiceConnection; import android.os.Bundle; import android.os.IBinder; import android.view.View; import android.widget.Toast; import androidx.appcompat.app.AppCompatActivity; public class MainActivity e.. [모바일프로그래밍] 10-3 Intent service class activity_main.xml DownloadService.java package com.example.myapplication; import android.app.Activity; import android.app.IntentService; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.os.Message; import android.os.Messenger; import android.renderscript.ScriptGroup; import android.util.Log; import java.io.IOException; import java.io.InputStream; im.. [모바일프로그래밍] 10-2 서비스 activity_main.xml MusicService.java package com.example.myapplication; import android.app.Service; import android.content.Intent; import android.media.MediaPlayer; import android.os.IBinder; import android.widget.Toast; public class MusicService extends Service { MediaPlayer myplayer; public IBinder onBind(Intent myintent) { return null; } public void onCreate() { myplayer = MediaPlayer.create(t.. [모바일프로그래밍] 10-1 스레드 개념 activity_main.xml MainActivity.java package com.example.myapplication; import android.os.Bundle; import android.os.SystemClock; import android.view.View; import android.widget.Button; import android.widget.ProgressBar; import android.widget.TextView; import androidx.appcompat.app.AppCompatActivity; public class MainActivity extends AppCompatActivity { ProgressBar myseekbar1, myseekbar2; Button b.. [모바일프로그래밍] 9-5 카메라 영상 캡처 activity_main.xml CameraPreview.java package com.example.myapplication; import android.content.Context; import android.hardware.Camera; import android.view.SurfaceHolder; import android.view.SurfaceView; import java.io.IOException; class CameraPreview extends SurfaceView implements SurfaceHolder.Callback { private SurfaceHolder mHolder; private Camera mCamera; public CameraPreview(Context contex.. [모바일프로그래밍] 9-4 오디오 녹음 activity_main.xml MainActivity.java package com.example.myapplication; import android.Manifest; import android.content.pm.PackageManager; import android.media.MediaPlayer; import android.media.MediaRecorder; import android.os.Bundle; import android.os.Environment; import android.view.View; import android.widget.Button; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatAc.. [모바일프로그래밍] 9-3 MediaPlayer 사용하는 방법 res에 raw 디렉토리를 만든 후 원하는 mp3 파일을 넣는다. 이때 파일명은 당연히 소문자여야 한다. activity_main.xml MainActivity.java package com.example.myapplication; import android.media.MediaPlayer; import android.os.Bundle; import android.view.View; import android.widget.Switch; import androidx.appcompat.app.AppCompatActivity; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedIns.. 이전 1 ··· 3 4 5 6 7 8 다음