Here's my WAI. It's much simpler since I don't try to save backups. But it
allows you to save any file from anywhere (but will silently fail if there
is a permissions mismatch).
I would like to see the code where you load the incoming file. I think you
might be using a better approach than I used (a simple urlLoad).
In the longer term, one of the weaknesses of AndTidWiki was how hard it was
to switch between TW files. Android now has a ViewPage layout. So you could
just swipe sidewise and change what file you're viewing.
Good luck!
-- Mark
On Saturday, December 22, 2018 at 7:02:12 AM UTC-8, BurningTreeC wrote:
>
>
> Yes, it would be great to see how you're doing the load/save. I started
>> out trying to load the actual bytes into memory, but it never quite worked
>> (never got past the load screen). Then changed approach to use loadUri and
>> that worked great.
>>
>> Hi Mark, here attached is my WebAppInterface Java file that does all the
> saving
>
> With your settings, are you able to save to an external drive?
>>
>
> I haven't tried yet but I'm curious, too. I'll let you know soon
>
>>
>>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/fe471e73-fc94-4016-bb80-1cd8e2dc12b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
package com.example.my32ndapplication;
import android.content.Context;
import android.util.Log;
import android.webkit.JavascriptInterface;
import android.widget.Toast;
import java.io.FileOutputStream;
public class WebAppInterface {
Context mContext ;
public static final String LOG_TAG = "32XND";
WebAppInterface(Context c) {
mContext = c;
}
@JavascriptInterface
public void saveFile(String pathname, String text) {
Toast.makeText(mContext,pathname,Toast.LENGTH_SHORT).show();
try {
//Log.e(LOG_TAG, dir + "/" + filename);
FileOutputStream outputStream = new FileOutputStream(pathname);
outputStream.write(text.getBytes());
outputStream.close();
} catch (Exception e) {
Log.d(LOG_TAG, "WAI: error" + e.getMessage());
e.printStackTrace();
}
}
}