August 1, 2018 at 7:29 am #15211
I need to save and load png and txt to some “external” memory to both ios and android.
Ios has no card but istead visble folders that few apps opt to use. Sharing is actually the better option as iy worls the same for both platforms.
I offer 50 pounds to buy a working simple code to load/save/share a png on Android and iOS.August 5, 2018 at 6:11 am #15245
I created example for android (not familiar with ios dev yet).
- Saving image from assets into external app folder /storage/emulated/0/Android/data/… I spent some time to force it saving into /0/Pictures/ etc – but it can’t. Looks like such folders isn’t accessible for NDK apps – I don’t know exactly.
- Saving text into Android/data/….
- Sharing – open Share… dialog for just saved file – via native java code
- Closing app by hardware Back button
- Little example of building UI based on mojox.
Sources + prebuilt project ( 69 mb): https://yadi.sk/d/EvAP-qEl3ZuEe7
Not exactly what you want but useful anyway (I hope).
Attachments:August 5, 2018 at 10:30 am #15250
Thanks. Will check into this as soon as I can. Great stuff, I sent you 2o pounds via paypal hope you find that’s fair also I will also support more regularly when can afford as you do amazing work for the Monkey2 community.August 5, 2018 at 1:27 pm #15252
I found my mistake for that:
I spent some time to force it saving into /0/Pictures/ etc – but it can’t. Looks like such folders isn’t accessible for NDK apps – I don’t know exactly.
To use any folder under /storage/emulated/0/ we must request permissions for android api 23+, or set api less level.
There is the topic about permissions: http://monkeycoder.co.nz/forums/topic/android-permissions/
But I can’t make permissin requester work on my galaxy s7, api 26, need more research why.
I choose the second way – set less api level: open \android-save-file.products\Android\app\build.gradle and set targetSdkVersion 21, that’s all.
Now we can use common monkey2’s file operations like `CreateDir( “/storage/emulated/0/MX2/” ).
New sources with FileBrowser are here: https://yadi.sk/d/dsyMDk3p3Zuhuf
Tap on image in files tree to open it. Tap on Share button to share latest opened image.
Attachments:August 7, 2018 at 2:07 am #15261
I don’t understand permission requester yet I have to check into that ! I read through the thread but the commands they use there seem to no longer work? Was that only a developing branch expriment that never made it into the final version?
You must be logged in to reply to this topic.