Another INI Saving Loading Problems

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Here is my properties setup for Android

    Please login to see this attachment.


    I've made a Windows application which works excellent, It uses (INI object) together with (File Object).. The file object creates an empty file called File.ini, then the INI object saves data in the File.ini

    ...group item group item so on.. which works great FANTASTIC!


    However. I want to create an Android app now of this same windows application I made, here is the problem...the INI all saved in the File.ini can't work anymore in the android app, because the way I coded it, save file here, load here from that same INI file.

    I read so many samples on how to save load in Android by Inserting your INI into the binary data elements. Then using a command like.. DataStorageDirectory$( "Android object" ) + "/" + "File.ini"

    However, How can I read a certain group, and, item in the INI from using DataStorageDirectory$( "Android object" ) + "/" + "File.ini" ?


    Another thing, this Windows Application doesn't work at all in the Android. .It crashes. Could this be a Version problem? I think API 34 and Android 14 is ok! don't you think?

    Another thing, How do you create, or delete or save ..that File.INI into Android? so it will work like Windows.


    If I can think anything else I'll added here...

    Another thing , that data elements in android feels so weird.. now because you have to remember the ini is inside the android?


    what I'm saying is or what I would like is.. what's the best solution to make Android read write that INI I made for windows...how can I transfer my work without going through the code events..conditions.. to get Android to read that INI like it suppose to in windows.


    Another thing, Is their special permissions? That has to be ticked.


    Another thing , how can you Create a file in Android or a directory

    Has Android prevented us all from creating files now?


    so, I have to change the current windows INI file from CurrentDirectory$( "File Object" ) + "/" + "Folder1/Folder2/File.ini" to

    DataStorageDirectory$( "Android object" ) + "/" + "Folder1/Folder2/File.ini"


    but how do you create, delete file folders using the DataStorageDirectory$ ? from within that data elements.


    just bear with me guys. I appreciate your help any help will do me now. My brain has to see it this way, sorry...


    Btw, this android example I downloaded and tried it doesn't work at all in my version API? Is their something wrong with api's?

    here is the code

    Please login to see this attachment.


    and files.. it doesnt work on my api

    Please login to see this attachment. and Please login to see this attachment.


    StefanS
    October 10, 2022 at 4:49 PM


    Im not to keen in this data element idea, thankyou

  • However, How can I read a certain group, and, item in the INI from using DataStorageDirectory$( "Android object" ) + "/" + "File.ini" ?

    There's an action in the INI object that lets you set the current ini file to be used, which is where you would use the above file path. Then you can access the groups/item string/item value using the relevant actions.

  • There's an action in the INI object that lets you set the current ini file to be used, which is where you would use the above file path. Then you can access the groups/item string/item value using the relevant actions.

    Ok I got you.. but what about the other problems now. .like creating files and folders deleting file folders in that data elements... or and writing groups and items in the data elements ini.

    or am i just stuck with just adding the entire INI into data elements and you cannot delete it.


    I'm Assuming it works like this.

    Get current file from elements.. add group or items..and elements will just store the data.

    Like it normally would in windows ..so clickteam has just made data elements to save or load just like windows would.. And, their is no need to create folders in data elements now?. So the file object is practically useless now ..now that your getting data and everything in elements? Sorry I need to know now before I actually go through a whole lot of code if you know what I mean.


    Good day

  • To be honest, I'm not sure if you can create INI files with the file object on the device, but I'm pretty sure you can move & delete files, but I think any kind of file ops needs to be done at the start of the application, otherwise it will just use whatever is already in the data storage directory, if there's anything there at all.

    Alternatively you could use an array for storage, which IIRC, I'm pretty sure can be created in an ad-hoc way on the device, and manipulated during runtime.

  • To be honest, I'm not sure if you can create INI files with the file object on the device, but I'm pretty sure you can move & delete files, but I think any kind of file ops needs to be done at the start of the application, otherwise it will just use whatever is already in the data storage directory, if there's anything there at all.

    Alternatively you could use an array for storage, which IIRC, I'm pretty sure can be created in an ad-hoc way on the device, and manipulated during runtime.

    Yeah.. I will have to start a new application and copy to and from Windows to Android. Like have 3 or 4 different operating systems..lol

  • Data storage in Android is borked. They changed the OS model of permissions three times. You can't change files just anywhere since Android 10 - only fixed folders, which Android object shows you.

    I would add read and write external storage permissions.

    Media storage is actually a SQLite database, as well as the files themselves, so it requires extra synchronization. What's annoying about how CT did things with file saving, is a lot of their error code is just "if there's an error, just quietly abort", so you don't even see things in logcat. That said, it's not impossible to edit the files in RuntimeAndroid to add that yourself.

    Darkwire Software Lead Programmer (C++ & C#)
    Please login to see this link. | Please login to see this link. | Please login to see this link. | Please login to see this link.

  • You start from INI but want to create and delete folders and files. Maybe File Object is the right tool you are looking for. Note you can only delete/create folders in the scoped area and data storage, BOTH are only available until uninstalling

    Ok ... Let me look at today ..or tonight. ..I will just start all over again! One .MFA for Windows Android and IOS Macintosh how they all have their ways. I've got android working ..yes.. you have to create a new.. MFA a whole completely..new MFA application man ... It will work.. just copy the code from windows to all of them..and check each line pass it through the compiler emulator whatever your using..check to see what clan be changed ..the good thing is my work is done graphics and stuff. Give me 3 more years.. I'll have it ready

    Lol!!

  • Hey! Thankyou guys..! You are truly the greatest programmers I've ever seen. Thank you


    I mean that to. Thankyou your all great in many ways . Like uhm..his name?? ... Hull..his great for saving samples at his website.. just shet like that.

  • You start from INI but want to create and delete folders and files. Maybe File Object is the right tool you are looking for. Note you can only delete/create folders in the scoped area and data storage, BOTH are only available until uninstalling

    Thankyou Fern,


    I saw the sample it was good.. but I only wanted to .. I guess you can't.


    I see what your done. I'll keep it on the back burners..


    Thanks keep up the good work

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!