Skip to content

Instantly share code, notes, and snippets.

// ... import ์ƒ๋žต
public class MyIntentService extends IntentService {
public MyIntentService() {
super("MyIntentService");
}
@Override
protected void onHandleIntent(Intent intent) {
// ... ์ƒ๋žต
<uses-permission android:name="android.permission.INTERNET" />
<application
android:icon="@mipmap/ic_launcher"
android:label="andtest"
android:usesCleartextTraffic="true">
<service
android:name=".MyIntentService"
@doyle-flutter
doyle-flutter / AndForegroundServiceMyService.java
Last active February 19, 2021 04:54
#07 ํฌ๊ทธ๋ผ์šด๋“œ - ์•ˆ๋“œ๋กœ์ด๋“œ : ์„œ๋น„์Šค
// ... import ์ƒ๋žต
// Permission - Manifest.xml : <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
public class MyService extends Service {
public MyService() {
}
@Override
public IBinder onBind(Intent intent) {
// TODO: Return the communication channel to the service.
throw new UnsupportedOperationException("Not yet implemented");
@doyle-flutter
doyle-flutter / AndForegroundServiceMainActivity3.java
Last active February 19, 2021 04:54
#07 ํฌ๊ทธ๋ผ์šด๋“œ - ์•ˆ๋“œ๋กœ์ด๋“œ : ์•กํ‹ฐ๋น„ํ‹ฐ
// ... import ์ƒ๋žต
// ๋ฐฑ๊ทธ๋ผ์šด์ฝ”๋“œ์— ์ถ”๊ฐ€ํ•˜์˜€์Šต๋‹ˆ๋‹ค
public class MainActivity3 extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main3);
ConstraintLayout c = (ConstraintLayout) findViewById(R.id.main3);
ResultReceiver mRecevier = new ResultReceiver(new Handler()){
@doyle-flutter
doyle-flutter / ForegroundFlutterMain.dart
Last active February 19, 2021 05:01
#07 ํฌ๊ทธ๋ผ์šด๋“œ - ํ”Œ๋Ÿฌํ„ฐ : ๋ฉ”์ธ
// ... import, main ์ƒ๋žต
class ForegroundPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text("Flutter Foreground")),
body: Center(
child: TextButton(
child: Text("PLAY"),
@doyle-flutter
doyle-flutter / ForegroundFlutterAndroidActivity.java
Last active February 19, 2021 05:01
#07 ํฌ๊ทธ๋ผ์šด๋“œ - ํ”Œ๋Ÿฌํ„ฐ : ์•ˆ๋“œ๋กœ์ด๋“œ ์•กํ‹ฐ๋น„ํ‹ฐ
// ... import ์ƒ๋žต
// ... ๊ธฐ์กด ๋‚ด์šฉ๊ณผ ๊ฐ™์ด ๊ตฌ์„ฑํ•˜์˜€์Šต๋‹ˆ๋‹ค
// * Service ํŒŒ์ผ ์ƒ์„ฑ ๋ฐ Permission ๋“ฑ๋กํ•ด์ฃผ์„ธ์š”(์•ˆ๋“œ๋กœ์ด๋“œ ๋‚ด์šฉ์„ ๋ฏธ๋ฆฌ ๋ณด์‹œ๋ฉด ์ˆ˜์›”ํ•ฉ๋‹ˆ๋‹ค)
public class MainActivity extends FlutterActivity {
private static final String CHANNEL = "app.james.cam/cam";
private static final String SEND_CHANNEL = "app.james.cam/cam2";
MethodChannel sendChannel;
private static final String BACK_CHANNEL2 = "app.james.cam/intentservice";
@doyle-flutter
doyle-flutter / ForegroundFlutterAndroidService.java
Created February 19, 2021 05:01
#07 ํฌ๊ทธ๋ผ์šด๋“œ - ํ”Œ๋Ÿฌํ„ฐ : ์•ˆ๋“œ๋กœ์ด๋“œ ์„œ๋น„์Šค
// ... import ์ƒ๋žต
// ... ์•ˆ๋“œ๋กœ์ด๋“œ ๋‚ด์šฉ ๊ทธ๋Œ€๋กœ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•˜์ง€๋งŒ
// ์•Œ๋ฆผ์˜ ์ด๋ฏธ์ง€ ๋‚ด์šฉ ๋ณ€๊ฒฝ ๋ฐ ์–ด๋…ธํ…Œ์ด์…˜์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค
public class MyService extends Service {
public MyService() {
}
@Override
public IBinder onBind(Intent intent) {
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Live</title>
<style>
*{
padding: 0;
@doyle-flutter
doyle-flutter / webRtcServerView.html
Last active February 21, 2021 12:55
webRTC ์„œ๋ฒ„ ์—ฐ๊ฒฐ
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>JAMES_DEV_TEST only PeerJS</title>
<style>
*{
padding: 0;
@doyle-flutter
doyle-flutter / webRtcServer.js
Last active February 21, 2021 13:43
webRTC ์„œ๋ฒ„์—ฐ๊ฒฐ
// * Node.js ๊ฐœ๋ฐœ ํ…Œ์ŠคํŠธ์šฉ HTTPS pem ์ƒ์„ฑ
// : ํ•ด๋‹น ์„œ๋ฒ„ ํŒŒ์ผ์˜ ์œ„์น˜์— keys ํด๋”๋ฅผ ์ƒ์„ฑํ•˜๊ณ  ์•„๋ž˜์˜ ๋‚ด์šฉ์œผ๋กœ ์ƒ์„ฑํ•œ pem์„ ๋‹ด์•„์ฃผ์„ธ์š”.
// > openssl genrsa 1024 > private.pem
// > openssl req -x509 -new -key private.pem > public.pem
// * npm i -s expreess https path
var express = require('express'),
app = express(),
fs = require('fs'),