JAVA/android_studio 2022. 10. 11. 18:21

- Android bind service example

 

https://link2me.tistory.com/1763

 

안드로이드 바인드 서비스 예제

안드로이드 바인딩 서비스 개요 startService() 메소드 대신 bindService() 메소드를 통해 시작되는 서비스를 서비스 바인딩이라 한다. 바인딩 서비스는 Activity가 클라이언트 역할을 하고, 서비스가 서

link2me.tistory.com

 

posted by cskimair
:
JAVA/android_studio 2022. 10. 11. 18:20

-

https://developer88.tistory.com/94

 

BindService 의 생성과 Activity 에서의 Bind

안드로이드 앱을 만들다보면, 백그라운드에서 동작하고 있는 Service와 Activity간에 인터랙션이 필요한 경우가 있습니다. 단순히 Service를 stop하고 start하며, intent로 데이터를 전달하는 것 뿐만이 아

developer88.tistory.com

 

posted by cskimair
:
JAVA/android_studio 2022. 10. 11. 16:50

 

-

https://medium.com/@zoyi_product/bluetooth-low-energy-ble-84b03705ffca

 

Bluetooth Low Energy(BLE) 파헤치기

스마트폰이 출시되어 대중화가 될 무렵, ‘스마트’한 개념의 밴드, 워치, 글래스 등이 출시되면서 웨어러블 디바이스 시장이 태동하기 시작했다. 그리고, 2015년 상반기, 애플워치의 등장으로

medium.com

 

posted by cskimair
:
JAVA/android_studio 2022. 9. 12. 15:01

 

 

 

PS C:\Users\CHANSEONG.KIM\Downloads\scrcpy-win64-v1.21> ./adb devices
List of devices attached
ce071717e4a55d1c047e    device
192.168.0.165:5555      device
emulator-5554   device

PS C:\Users\CHANSEONG.KIM\Downloads\scrcpy-win64-v1.21> ./adb -s ce071717e4a55d1c047e  connect  192.168.0.165
already connected to 192.168.0.165:5555
PS C:\Users\CHANSEONG.KIM\Downloads\scrcpy-win64-v1.21>
PS C:\Users\CHANSEONG.KIM\Downloads\scrcpy-win64-v1.21> type .\scrcpy-console.bat
@echo off
scrcpy.exe %*
:: if the exit code is >= 1, then pause
if errorlevel 1 pause
PS C:\Users\CHANSEONG.KIM\Downloads\scrcpy-win64-v1.21> .\scrcpy.exe --help  | findstr serial
    -s, --serial=serial
        The device serial number. Mandatory only if several devices are
PS C:\Users\CHANSEONG.KIM\Downloads\scrcpy-win64-v1.21> .\scrcpy --serial=ce071717e4a55d1c047e

-실행화면: scrcpy 실행후 연결된 폰 화면

scrcpy(v1.21)로 무선으로 연결한 화면 (최초연결시 유선연결은 필요함.  폰의 시리얼번호 알아낼때[./adb.exe devices ] 유선연결 필요함)

 

posted by cskimair
:
JAVA/android_studio 2022. 9. 7. 20:33

 

SPT Android Bluetooth packet sniffering(monitoring)

> Android mobile app.과 Bluetooth+MCU(STM32F107 CPU)통신할때 디버깅용

>> connection problem between mobile app.(android) and STM32F107 CPU through Bluetooth(Transparent mode)

 
https://support.honeywellaidc.com/s/article/How-to-capture-Bluetooth-traffic-from-and-to-an-Android-Device
 

How to capture Bluetooth traffic from and to an Android Device?

 

support.honeywellaidc.com

Resolution
On the applicable Android devices, it is possible to capture Bluetooth traffic as follows:
  • Go to Settings
  • If developer options is not enabled, enable it now.
  • Go into developer options
  • Enable the option Enable Bluetooth HCI snoop log
  • Enable the Bluetooth option and Connected to the device.
  • Perform the actions which need to be captured.
  • Turn off the Bluetooth on the device.
  • Disable the option Enable Bluetooth HCI snoop log
  • Make sure the device is connected to the PC.
  • As the relevant files might not be shown in a PC's file browser in 'Internal Storage', copy the file to a PC by means of the Android Debug Bridge:   adb pull /sdcard
  • The files of interest are btsnoop_hci.log and all files with the extension .cfa
These are binary files, which can be opened with Wireshark.
 
 
 
 
 

 

 
 
- google search for 'Android bluetooth packet sniffering'
 
 

 

 

posted by cskimair
:
JAVA/android_studio 2022. 9. 3. 16:50

아래 링크대로 해보니 제대로 연결됨. 

처음에는 USB케이블로 PC와 스마트폰을 연결할 필요가 있음. (이후 아래처럼 따라하면 케이블 제거해도 연결됨)

PS C:\Users\CH***IM\AppData\Local\Android\Sdk\platform-tools> .\adb.exe devices
List of devices attached
ce071717e4a55d1c047e    device

PS C:\Users\CH***IM\AppData\Local\Android\Sdk\platform-tools> .\adb.exe tcpip 5555
restarting in TCP mode port: 5555
PS C:\Users\CH***IM\AppData\Local\Android\Sdk\platform-tools> .\adb.exe  connect  192
.168.0.182
connected to 192.168.0.182:5555
PS C:\Users\CH***IM\AppData\Local\Android\Sdk\platform-tools> .\adb.exe devices
List of devices attached
192.168.0.182:5555      device

단,  아래와 같이 adb.exe 의 위치를 미리 찾아둬야 함.

> C:\Users\CH***IM\AppData\Local\Android\Sdk\platform-tools>

https://medium.com/android-news/wireless-debugging-through-adb-in-android-using-wifi-965f7edd163a

 

 

 

 

Wireless Debugging through ADB in Android using WiFi

In this article I am going to show you how you can debug your android app over WiFi.

medium.com

- PC와 안드로이드폰을 연결할때 실제 수행시 출력된 로그 
  > 192.168.0.182의 주소를 스마트폰이 가지고 있음. 
  > 연결이 안되서 ./adb.exe kill-server  로  adb종료하고 다시 시작시킴. 


PS C:\Users\CH***IM\AppData\Local\Android\Sdk\platform-tools> .\adb.exe  connect  192
.168.0.182
cannot connect to 192.168.0.182:5555: 연결된 구성원으로부터 응답이 없어 연결하지 못했거나,
호스트로부터 응답이 없어 연결이 끊어졌습니다. (10060)
PS C:\Users\CH***IM\AppData\Local\Android\Sdk\platform-tools> .\adb.exe  connect  192
.168.0.182
cannot connect to 192.168.0.182:5555: 연결된 구성원으로부터 응답이 없어 연결하지 못했거나,
호스트로부터 응답이 없어 연결이 끊어졌습니다. (10060)
PS C:\Users\CH***IM\AppData\Local\Android\Sdk\platform-tools> .\adb.exe   kill-server
PS C:\Users\CH***IM\AppData\Local\Android\Sdk\platform-tools> .\adb.exe  devices
* daemon not running; starting now at tcp:5037
* daemon started successfully
List of devices attached
ce071717e4a55d1c047e    device

PS C:\Users\CH***IM\AppData\Local\Android\Sdk\platform-tools> .\adb.exe tcpip 5555
restarting in TCP mode port: 5555
PS C:\Users\CH***IM\AppData\Local\Android\Sdk\platform-tools> .\adb.exe  connect  192
.168.0.182
cannot connect to 192.168.0.182:5555: 연결된 구성원으로부터 응답이 없어 연결하지 못했거나,
호스트로부터 응답이 없어 연결이 끊어졌습니다. (10060)
PS C:\Users\CH***IM\AppData\Local\Android\Sdk\platform-tools> .\adb.exe   kill-server
PS C:\Users\CH***IM\AppData\Local\Android\Sdk\platform-tools> .\adb.exe  devices
* daemon not running; starting now at tcp:5037
* daemon started successfully
List of devices attached
ce071717e4a55d1c047e    device

PS C:\Users\CH***IM\AppData\Local\Android\Sdk\platform-tools> .\adb.exe tcpip 5555
restarting in TCP mode port: 5555
PS C:\Users\CH***IM\AppData\Local\Android\Sdk\platform-tools> .\adb.exe  connect  192
.168.0.182
cannot connect to 192.168.0.182:5555: 현재 연결은 사용자의 호스트 시스템의 소프트웨어의 의
해 중단되었습니다. (10053)
PS C:\Users\CH***IM\AppData\Local\Android\Sdk\platform-tools> .\adb.exe  connect  192
.168.0.182
connected to 192.168.0.182:5555
PS C:\Users\CH***IM\AppData\Local\Android\Sdk\platform-tools>
posted by cskimair
: