-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added feature to export and save collection in device #53
base: master
Are you sure you want to change the base?
Conversation
Thanks for contribution. It looks neat. Your PR will be merged right after i complete tests on both ios and android platforms. |
Thank you for the update. I appreciate the review and look forward to the merge once the testing is complete. |
e9b1561
to
c8a4edd
Compare
I wanted to follow up on the pull request I submitted a couple of weeks ago. Since then, I've addressed and resolved some additional bugs that were identified. I’ve also made sure that the feature for saving files is functioning correctly. Could you please review and merge the pull request when you have a chance? Your feedback is greatly appreciated. Thank you for your time! |
I could not complete the tests due to health problems. I will merge this pull request as soon as possible. Thank you for your understanding. |
Thank you for the update. I hope you’re feeling better soon. Please take your time, and let me know if there’s anything specific you need from me regarding the pull request. |
Hello I have been testing this feature since yesterday. There is couple of problems related to Android permissions. First of all im using an Android 13 device. Devices with previous versions of Android can access storage with READ & WRITE permissions declared in AndroidManifest.xml. This permissions are allowed in app settings. And your pr supports that. Starting from Android 13, we have to stick to FilePicker and let the user choose a directory. But in my tests i have picked different directories including documents, podcasts, pictures etc. Most of the directories did not work. (OS Error: Operation not permitted, errno = 1) I have researched for fixing this error and i learned that MANAGE_EXTERNAL_STORAGE permission can be requested. But its considered very dangerous by Google and i have seen that Play Store usually blocks applications with this permission. So we cannot use this method to access storage. Also i couldn't export as json. Due to datetime values. I am pretty sure that there is more bugs about json. There is json encode/decode helpers for unsupported types in mondroid to fix display and save issues. We can use them while exporting to json. But it will export values like "datetime:2024-09-22" etc. I mean; exported data will not be usefull unless its imported by mondroid. We wont be able to import it to Mongodb compass or any other client. You can take a look at the custom encode/decode table in mondroid readme.md I could export as csv but the exported values for some types are not containing the values. Only toString() values are presented. (Infinity and binary values, im sharing a screenshot of csv data below) We need to discuss what we need in export feature. Do we need export and import data within Mondroid itself? Or do we need to share the exported data? Our best bet is only allowing json exports with using custom json encoders that already built for Mondroid. And save our exported file to temp folder or appdata path. Then open a share dialog to allow user to send data with mail or chat applications. Best regards. |
Thank You for the reply. I primarily test on Android 12 (storage was working fine) after your reply I tested on Android 14 and came to know about the issues. I was busy in my college exams so I could not reply you regarding this. Thanks for your reply and my apologies for the delay. Let me look in to this and try to solve. I'll let you know once solved. Regarding encoding issues, it would be a great help if you can share me the data which would result in improper encoding and decoding, so that I can test the app with that. Thank You, |
Export Collection and save to Device
Additional Dependencies:
Now you can Export a collection as JSON or CSV
Code:
https://github.com/Abi-CP/mondroid.git
Branch: features/export-collection
Screenshots:
![Screenshot_20240815-165824](https://private-user-images.githubusercontent.com/110963357/358225348-9321beb4-8ae4-4362-9939-55626bda9994.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5MzIyODIsIm5iZiI6MTczODkzMTk4MiwicGF0aCI6Ii8xMTA5NjMzNTcvMzU4MjI1MzQ4LTkzMjFiZWI0LThhZTQtNDM2Mi05OTM5LTU1NjI2YmRhOTk5NC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwN1QxMjM5NDJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zOTE3MGVmZGM2MzMwNGNkODM2MzljOTk4ODkzOWU1YjhmZDE1MzRmOGFlOGEwMzVmM2VhMmMxNDk5YjUzYWJjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.d4bqVEl2MwWJ-o9bc0tev4Z258d7oo4ZFXq2fCXouoE)
![Screenshot_20240815-170004](https://private-user-images.githubusercontent.com/110963357/358225346-186686e7-8d07-4dff-bf26-7804d3a751e7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5MzIyODIsIm5iZiI6MTczODkzMTk4MiwicGF0aCI6Ii8xMTA5NjMzNTcvMzU4MjI1MzQ2LTE4NjY4NmU3LThkMDctNGRmZi1iZjI2LTc4MDRkM2E3NTFlNy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwN1QxMjM5NDJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zZTA1NGU2ZThiMzIzOGRmMWJmZTVkMTY1NmM4MGUwZWZjMTk4Y2JkNTY3N2JiZWU4ZmMwMjdhYWZiMDgwNGE1JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.CmBPNA_BFg--JnkaSag4fPjIh4Izvoq_urvRwi5W8PU)
![Screenshot_20240815-170022](https://private-user-images.githubusercontent.com/110963357/358225341-136014af-3e66-44c1-8caf-4c0670cc4a75.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5MzIyODIsIm5iZiI6MTczODkzMTk4MiwicGF0aCI6Ii8xMTA5NjMzNTcvMzU4MjI1MzQxLTEzNjAxNGFmLTNlNjYt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NTcwZjE2NTIzYzg1Y2EwOWFjYmQxZjY3MGUwZWY0ZGY5OGNjNmJkJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.7nZ5TY9DiPfiu_Ceaf9yTUd2p_WQeEmAaDWIMAdNob4)
![Screenshot_20240815-170103](https://private-user-images.githubusercontent.com/110963357/358225331-5b8f968e-6af2-46de-8f8e-a34902795dde.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5MzIyODIsIm5iZiI6MTczODkzMTk4MiwicGF0aCI6Ii8xMTA5NjMzNTcvMzU4MjI1MzMxLTViOGY5NjhlLTZhZjItNDZkZS04ZjhlLWEzNDkwMjc5NWRkZS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwN1QxMjM5NDJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yOWJiMzUyODg4MTM2OWRiOTIwNDUxZDZhNTI2M2I4YWRjZmFkNDBkZDc3Y2Q0ZmQxYmMxMjE5MjEwYTVlNjRiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.0X-tzpjUU_rd_u5FgjDw9aoMvKwikrC-fjjND56ccVw)
![Screenshot_20240815-170111](https://private-user-images.githubusercontent.com/110963357/358225318-bf339a62-8f01-40cb-bc92-568c79f944b0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5MzIyODIsIm5iZiI6MTczODkzMTk4MiwicGF0aCI6Ii8xMTA5NjMzNTcvMzU4MjI1MzE4LWJmMzM5YTYyLThmMDEtNDBjYi1iYzkyLTU2OGM3OWY5NDRiMC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwN1QxMjM5NDJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02MmRiZGM3MjdiMDA0NmE0ZDcwMmFjYWQyZTE5N2FkNmU4NzBkMDM0NmU1OTgyYTcxYmY5N2JjNWI1MzM2MmVlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.48pZBMNhbk-8thVCPSDjGzAvyk8nYGUUjuUucvK4Izo)
![Screenshot_20240815-170141](https://private-user-images.githubusercontent.com/110963357/358225302-86767b20-95c3-43e3-9e84-0604ffd88334.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5MzIyODIsIm5iZiI6MTczODkzMTk4MiwicGF0aCI6Ii8xMTA5NjMzNTcvMzU4MjI1MzAyLTg2NzY3YjIwLTk1YzMtNDNlMy05ZTg0LTA2MDRmZmQ4ODMzNC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwN1QxMjM5NDJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mMmViYjQ3MDkwMTMyZDZiOTFmNmY4MWVhZmFiZjdmYjRkMWRiNzQzM2VkOGJkM2E5YjNhZWJhY2I5MWU4NjExJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.sy3bSzPbWHnPC0I8iO_43rXrQpxBxBFBYX84hW4VaZM)
Happy Coding!