woheller69 / whoBIRD

Identify bird sounds in real time with this Android version of BirdNET. Bird sound recognition for more than 6,000 species worldwide.
GNU General Public License v3.0
292 stars 15 forks source link

Share problem #31

Closed stevedee closed 5 months ago

stevedee commented 5 months ago

Although I have used 'share' successfully a few times, I've just got back from an 18 day trip to Costa Rica and now have hundreds of detections but share is no longer working. Could this be because I have exceeded some kind of data size limit? Now when I press share, the app either 'blanks' or minimises for a while, or i get the message: "whoBird keeps stopping"

woheller69 commented 5 months ago

I have no idea if there is a size limit for sharing. All detections are packed into one string and are shared. For such long trips I would suggest to share detections every day to a file manager and store as text file and then maybe clear.

In case you have a rooted device you can access the sqlite database. I will maybe add an option to backup/restore the database in future.

woheller69 commented 5 months ago

If you know how to get a logcat that might also help

stevedee commented 5 months ago

OK running adb on Linux to device (LineageOS) in debug ...but I'm very Jet-lagged at the moment!

Don't know how I should filter logcat so for: adb logcat -v brief my output includes:- _10144 RequestorPkg: com.android.systemui UnderlyingNetworks: Null] ] D/PhoneSwitcherNetworkRequstListener( 3030): got request NetworkRequest [ REQUEST id=511, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED Uid: 10138 RequestorUid: 10144 RequestorPkg: com.android.systemui UnderlyingNetworks: Null] ] D/UntrustedWifiNetworkFactory( 1489): got request NetworkRequest [ REQUEST id=511, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED Uid: 10138 RequestorUid: 10144 RequestorPkg: com.android.systemui UnderlyingNetworks: Null] ] D/OemPaidWifiNetworkFactory( 1489): got request NetworkRequest [ REQUEST id=511, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED Uid: 10138 RequestorUid: 10144 RequestorPkg: com.android.systemui UnderlyingNetworks: Null] ] D/MultiInternetWifiNetworkFactory( 1489): got request NetworkRequest [ REQUEST id=511, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCNMANAGED Uid: 10138 RequestorUid: 10144 RequestorPkg: com.android.systemui UnderlyingNetworks: Null] ] E/ClientCache( 739): failed to get buffer, invalid process token W/TransactionTracing( 739): Could not find layer handle 0x7cc9cc81d0 W/TransactionTracing( 739): Could not find layer handle 0x7cc9cae910 W/TransactionTracing( 739): Could not find layer handle 0x7cc9cc53b0 W/TransactionTracing( 739): Could not find layer handle 0x7cc9cc81d0 W/TransactionTracing( 739): Could not find layer handle 0x7cc9cc72d0 E/BpTransactionCompletedListener( 739): Failed to transact (-32) W/TransactionTracing( 739): Could not find layer handle 0x7cc9cc7510 W/TransactionTracing( 739): Could not find layer handle 0x7cc9cbf7d0 W/TransactionTracing( 739): Could not find layer handle 0x7cc9cb9ef0 W/TransactionTracing( 739): Could not find layer handle 0x7cc9cbf950 W/ActivityTaskManager( 1489): Activity top resumed state loss timeout for ActivityRecord{a4a57df u0 org.woheller69.whobird/org.tensorflow.lite.examples.soundclassifier.MainActivity} t-1 f}} W/HidlServiceManagement( 2949): Waited one second for com.qualcomm.qti.uceservice@2.3::IUceService/com.qualcomm.qti.uceservice I/hwservicemanager( 688): Since com.qualcomm.qti.uceservice@2.3::IUceService/com.qualcomm.qti.uceservice is not registered, trying to start it as a lazy HAL.

Does this help?

woheller69 commented 5 months ago

let it crash again, note time

then

adb logcat -D > log.txt

remove stuff before time from log.txt

stevedee commented 5 months ago

Here you go:-

log_edit.txt

woheller69 commented 5 months ago

04-08 20:22:01.557 21117 21117 E AndroidRuntime: Caused by: android.os.TransactionTooLargeException: data parcel size 1524248 bytes

There seems to be a limit of 1MB for sharing. "The reason is the Inner Process Communication (IPC) bus has a 1mb limit" https://stackoverflow.com/questions/33182309/passing-bitmap-to-another-activity-ends-in-runtimeexception

stevedee commented 5 months ago

Many thanks woheller69, that's answered my question.

I need to get some sleep now, so will worry about how to get my hands on the sqlite database tomorrow.

woheller69 commented 5 months ago

on root you find it in data/data/org.woheller69.whobird/databases/BirdDatabase.db

stevedee commented 5 months ago

Don't want to root the phone. I was hoping to use adb to get a copy of the database. Is your app debuggable? ADB says its not when I run: run-as org.woheller69.whobird ...but I may be missing something.

woheller69 commented 5 months ago

no, it is not debuggable, and as far as I know a release version should never be...

stevedee commented 5 months ago

...not sure its really a problem with open-source code, but that's your choice.

woheller69 commented 5 months ago

Of course Google cannot prevent me from doing it, but for security reasons it is not a good idea. Even without direct access to ADB, malware installed on the device could potentially exploit debuggable apps for various purposes, such as data exfiltration, privilege escalation, or performing other malicious activities. So I think I will add a backup option for the database in future.

stevedee commented 5 months ago

I didn't mean to imply that Google was the problem, I mean the source code is available and its data is just about birds ...so not a great hackers target.

So unless you can do me a private debuggable version, don't worry, its not that important.

Thanks once again for a great app and your help with this. whoBird's simplicity is one of its srengths.

woheller69 commented 5 months ago

I cannot make a private debuggable version because the app is signed by F-Droid. You would have to uninstall and would lose the data. But I just implemented the backup of the database (copy/paste from one of my other apps). So once this is released you will get access.

woheller69 commented 5 months ago

probably V2.9

stevedee commented 5 months ago

You are a star!

stevedee commented 5 months ago

Many thanks for v2.9, it works great!

Is there anyway I can now clear the "Share" button; i.e. the 1.5M of data, or should I now uninstall then reinstall?

woheller69 commented 5 months ago

Just press the trash bin icon at the right

stevedee commented 5 months ago

Doh!