Create a new Section
Before creating a new section please take note of the names of the elements the section is made of and the id of the block you need to add a new section.
To create a new section you will need to use the static method
Where params
is an ArrayList of MBAdminParameter
and params_file
is an ArrayList of MBAdminParameterFile
.
You will also need to provide the Locale
(in “it” like form) for multilanguage sake support.
If the locale you’ll provide is not supported the API will return an error.
For the address field you should just give the textual address, MBurger API will automatically retrieve latitude and longitude of the address.
For example, if your section is composed like:
title
-> text fieldcontent
-> text fieldlink
-> text fieldimage
-> array of media (images)
So your code for adding a new section (assuming the supported locale is the same as your device) will result like this:
Where getFileName()
, getMimeType()
, getUriRealPath(getApplication()
, img_uri
) are methods to obtain the image name, image mime type and the full file path from the image Uri you should implement on your own.
Last updated