Hi, Please find attached a tiny wrapper for the native ALAssets framework of iOS which let you get all the photos from the phone, put photos, create album, ... I have added the basic features like get all assets, albums, thumbnails, create album, put an asset to an album,... You can add a lot...
www.b4x.com
test:
'groupx = familyphotos
Dim bmp As Bitmap
Dim MyPhotos As ALAssets
MyPhotos.Initialize(Me,"MyPhotos")
MyPhotos.CreateAlbum(groupx)
MyPhotos.AddBitmapToAlbum(groupx,bmp) ' app explode
the album is created correctly, and the photo is saved on root of photos, but nothing on the specific album
any help? thank you
I used ALAssets time ago and worked nicely --> Just searched my code (probably, based on some example in the library thread). There are some differences.
Basically, after creating an album, you should wait until it is really created before storing anything in it.
The way to do it is:
Call MyPhotos.GetAssets immediatelly after creating the album, and wait for the MyPhotos_Ready event.
Since the 'MyPhotos_Ready' event means that the operation is finsihed but not that the folder is already created, as a sanity check, I'd call MyPhotos.GetAlbums and iterate through the resulting list
Only if the folder exists, then save the bitmap. If not, call MyPhotos.GetAssets again (and wait for the _Ready event) until it is already there