I am try to Creating Extension. and I need to access TinyDB Methods into my Extension. to Save and Retrieve Useful Extension Data.
I Try to import TinyDB as Follows but It Gives Me Following Error. i also Tried With super / this keywords and also try creating object using new key words. but all are giving me Something New Error.
It's important to note that TinyDB is just a wrapper around Android's SharedPreferences object. If you don't need additiona logic for managing the contents of a SharedPreferences instance, or need the App Inventor developer to have access to it, it might just be more portable to use the SharedPreferences directly.
Note That : The solution is worked for me. Thanks to : JEWEL
How can we access SharedPreferences Directly. I Don't Want to access TinyDB inside Extension Development.
Because i like to store Java Array inside SharedPreferences. i think Conversion from YailList to Java Array and Java Array to YailList it Problematic for me.
@SimpleFunction(description = "Get Tag Value as and Empty YailList")
public void getTinyList(String myTag) {
ArrayList<String> Ins = new ArrayList<>();
Ins = getArr(tinyDb.getDataValue(myTag,YailList.makeEmptyList()));
Ins.add("One");
Ins.add("Two");
tinyDb.StoreValue(myTag,YailList.makeList(Ins));
}
public ArrayList<String> getArr(YailList values) {
ArrayList<String> Strl = new ArrayList<>();
for (String val : values.toStringArray()) {
// parsed String
String d = String.valueOf(val);
Strl.add(d);
}
// and now you have the double list
return Strl;
}
Following Line Producing Error
Ins = getArr(tinyDb.getDataValue(Tabs,YailList.makeEmptyList()));
Thanks to Reply . . .
You are right another reason of this problem bunks in practical in engineering collage. and also copy pasting in practical exam. Thanks to Support Back Bencher !