Save json response in raw folder in kotlin programming - kotlin

I want to create a checkbox and save the data in preference(raw) folder.
{"endpoint": ""} is created in the raw folder
When i check the box, it save my data with the name "local" in the preference between " " . How can I do? Anyone who help me?

Related

Create a folder about an item with Microsoft Graph Sharepoint

How do I create a folder on my list? I can create a file but I can't define a type.
Should I define a type column? But how can I create a column with a type characteristic?
I am using Graph Explorer to build and want to use PHP after for my Laravel website.
Thank you for your answers !
After testing and testing, i find my request.
If it can help someone :
POST https://graph.microsoft.com/v1.0/sites/{site-id}/drive/items/{item-id}/children
site-id is composed about two ID, site-id and subsite-id.
To find your site-id :
GET https://graph.microsoft.com/v1.0/sites/root
My subsite-id is my groupsite id, you can find him on :
GET https://graph.microsoft.com/v1.0/sites/{sites-id}/lists?search=doc
After i did a request to find {item-id} :
GET https://graph.microsoft.com/v1.0/sites/{site-id}/drive/root:/test
And to end :
POST https://graph.microsoft.com/v1.0/sites/{site-id}/drive/items/{item-id}/children
You can create a new list with a document library as a template. Then you will have a new drive in the root of your site where you can create a folder.

Extracting Variables and storing as a separate file out of watson

I want to be able to store context variables into a text file. Im using this code:
"context" : {
"number_extract" : "<? input.text.extract('[\\d]+',0) ?>"
}
to extract variables into and store in context variable. I want to extract variables completely out of watson and into a a folder on my computer.
I also know you can make a database driven bot using this:
https://console.bluemix.net/docs/tutorials/slack-chatbot-database-watson.html#build-a-database-driven-slackbot
This will only store variables into the database but i want the variables extracted and put into a file out of watson.

prestashop mail customisation, and module translation

i have two question
1 - i installed referral program module , and i would like to customise the referralprogram-invitation.html mail template
so i putted the new template under : prestashop_root/themes/my_theme/modules/referralprogram/mails/referralprogram-invitation.html
but i doesn't work !
2 - i would like to add some extra text to the program page of referral program module
so i copied the file already included with the module under
prestashop_root/themes/my_theme/modules/referralprogram/translations/fr.php and I added the new text translation in this form
$_MODULE['<{referralprogram}prestashop>program_MD5'] = 'new text';
and it does not work?!!
You only forgot the language folder. Your mail templates must not be in :
prestashop_root/themes/my_theme/modules/referralprogram/mails/referralprogram-invitation.html
but in
prestashop_root/themes/my_theme/modules/referralprogram/mails/fr/referralprogram-invitation.html
If you want to add text to the program page, you must:
First, make a copy of the file : prestashop_root/modules/referralprogram/views/templates/front/program.tpl to prestashop_root/themes/my_theme/modules/referralprogram/views/templates/front/program.tpl
Then, you need to modify this file and add the text you want, where you want. To be translatable, your text must be added like this {l s='new text' mod='referralprogram'}.
Finally, you need to translate this text via the Localization > Traductions page of your BO and not directly in the fr.php file.
Do not hesitate if you need more information,
Paul.

How to creat and read databse in actionscript3 ( ini or sql )?

I need a way to create a swf application that creates a file in the same folder that my swf will be and to be able to read and write stuff on it so i can have a "save" file.
I wanna know if that's possible and the easiest way for me to do it.
Thanks
About the database, you have a similar question here and also a positive answer, hope will help you.
To save your file you will need to use the File API
var file:File = File.desktopDirectory.resolvePath("myFileName.txt");
var stream:FileStream = new FileStream();
stream.open(file, FileMode.WRITE);
stream.writeUTFBytes("This is my text file.");
stream.close();

insert/read html file from blob field

How can I INSERT and RETRIEVE with SQL language, an HTML document from a BLOB field into db2 on ibmI ??
I put the testing.html inside fylesystem but I don't know if this way is correct or if I can also use a file into my local PC.
I tried this code from STRSQL without success:
INSERT INTO LIB/FILE VALUES('','C','000001',BLOBFROMFILE(/PATH/testing.html))
Is it possible to enter an HTML document type or is there another type field to manage it?
After this procedure I need also a SQL string than can read it.
Thanks!
$data = file_get_contents("/PATH/testing.html");
$data = mysql_real_escape_string($data);
$query = "INSERT INTO FILE VALUES('','C','000001','$data')";
mysql_query($query);
edit:
linux file system
lets assume you are working on /var/www/username/public_html/ folder
when u try /PATH/testing.html
program looking for /PATH/testing.html
direct access to root folder probably u dont have that right
in the other hand when you try PATH/testing.html ( no / at start )
program look for /var/www/username/public_html/PATH/testing.html