# BLE read and write don't work in APK, but work perfectly in live preview

**URL:** <https://community.thunkable.com/t/ble-read-and-write-dont-work-in-apk-but-work-perfectly-in-live-preview/2141789>\
**Category:** BLE / BlueTooth\
**Created:** [November 21, 2022, 2:42pm UTC](https://community.thunkable.com/t/ble-read-and-write-dont-work-in-apk-but-work-perfectly-in-live-preview/2141789 "2022-11-21T14:42:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lbonnell71](https://avatars.discourse-cdn.com/v4/letter/l/f9ae1b/32.png) [@lbonnell71](https://community.thunkable.com/u/lbonnell71)\
**Post date:** [November 21, 2022, 2:42pm UTC](https://community.thunkable.com/t/ble-read-and-write-dont-work-in-apk-but-work-perfectly-in-live-preview/2141789/1 "2022-11-21T14:42:15Z")

</div>

Hi folks,

my BLE app works just perfectly with the live preview on my Android 12 device A53, and mostly works from the APK. my app reads 5 Characteristics and Writes to 2 Characteristics one of the Characteristics is both read able and writeable (settings). Everything works perfectly in live preview in APK the single read and write Characteristic displays an error: something like operation was rejected (will verify tomorrow) My question is where do I go from here? how can I dive deeper into debugging the APK, what next steps can I take?

---

<div class="post-metadata">

**Author:** ![lbonnell71](https://avatars.discourse-cdn.com/v4/letter/l/f9ae1b/32.png) [@lbonnell71](https://community.thunkable.com/u/lbonnell71)\
**Post date:** [November 23, 2022, 12:42pm UTC](https://community.thunkable.com/t/ble-read-and-write-dont-work-in-apk-but-work-perfectly-in-live-preview/2141789/2 "2022-11-23T12:42:33Z")

</div>

So I’ll reply to my own questions: not sure what happened but I was storing characteristic id’s in an app variable and then in the BLE read and write I was assigning them from the app variables. I have no idea why it didn’t work for just one characteristic. But I ended up removing all characteristic id’s from app variables and just using the hardcoded text. deleted all unused app variables too, Did a re-download of APk and all was well.

Would love to know what was going on under the covers

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 1:12pm UTC](https://community.thunkable.com/t/ble-read-and-write-dont-work-in-apk-but-work-perfectly-in-live-preview/2141789/3 "2024-11-08T13:12:37Z")

</div>

Closed on November 8, 2024, 1:12pm UTC


