there are several ways to upload a file to our server: FTP, Postfile,… in this example we are going to convert the file into text using a Base 64 extension and upload that text using PHP.
Hello all,
Since the new version of Android, the encode of Base64 doesn't work anymore.
I do not succeed to get a string anymore whereas it worked very well.
Can you help me ?
Vincent
that is, if in the CreateDirectoryASD block you write: /my_directory, it will be created in: /storage/emulated/0/Android/data/'namepackage'/files/my_directory
If you are going to use this extension in Android 9 or lower, you can use the blocks that contain "ASD" as I have indicated above, you can also use the blocks that do not contain "ASD", in this case the BASE directory is:
/mnt/sdcard
that is, if in the CreateDirectory block you write: /my_directory, it will be created in: /mnt/sdcard/my_directory
This extension also contains the GetApi and GetSdkCodeName blocks, with these blocks you can check the version of Android that the device has installed.
Tested in companion on Android 10 (genymotion emulator) and Android 11 (real device Google Pixel 4a)
This works OK
For a file in the assets / media folder, this works OK
Thank you Juan for your good work
I note the extension for 10+ doesn't overwrite the earlier extension. Can both extensions be used at the same time, to handle different android versions ?
Tested apk Android 10 and 11. Works OK. (Couldn't see if the directory intoASD was created in Android 11 due to Google lockdown, but created in Android 10, but no errors).
I guess we just need an if else block if we are working in development mode to access assets, in the MIT companion directory.