Importing images

89 views
Skip to first unread message

donmor3000

unread,
Apr 15, 2019, 10:49:03 AM4/15/19
to TiddlyWikiDev

I'm making an Android app implementing basic functions of TiddlyDesktop on my phone, where the app malfunctioning importing photos, but I can upload the same photo to Sogou.com.

Screenshot_1555338534.pngScreenshot_1555338580.pngScreenshot_1555338551.png

Part of logcat generated on error occored:

04-15 22:29:40.122 15224-15224/indi.donmor.tiddloid I/chromium: [INFO:CONSOLE(8830)] "Uncaught TypeError: Object.assign is not a function", source: file:///storage/emulated/0/123/121121.html (8830)

04-15 22:29:40.129 15224-15224/indi.donmor.tiddloid I/chromium: [INFO:CONSOLE(1146)] "Uncaught TypeError: Object.assign is not a function", source: $:/core/modules/wiki.js (1146)


The onShowFileChooser part(my minSdk is 21, targetSdk is 27, fileOpen is a static method opening the file dialog)
          @Override
         public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback, FileChooserParams fileChooserParams) {
            uploadMessage = filePathCallback;
           
MainActivity.fileOpen(TWEditorWV.this, fileChooserParams.getAcceptTypes(), new MainActivity.OnFileTouchedListener() {
               @Override
               public void onFileTouched(DialogInterface dialog, File file) {
                 
if (uploadMessage == null) return;
                 
Uri[] results = null;
                 
if (file != null && file.exists()) {
                     System.out.println(file.getAbsolutePath());
                     
System.out.println(file.toURI());
                     
try {
                     results
= new Uri[]{Uri.parse(file.toURI().toString())};
                     } catch (Exception e) {
                        e
.printStackTrace();
                     
}
                     
System.out.println(Uri.parse("file://"+file.getAbsolutePath()));
                     
System.out.println(results);
                 
}
                  uploadMessage.onReceiveValue(results);
                 
uploadMessage = null;
               
}

               
@Override
               public void onCanceled() {
                 
if (uploadMessage == null) return;
                 
uploadMessage.onReceiveValue(null);
                 
uploadMessage = null;
               
}
           
});
           
return true;
         
}
     
});


Does anybody have idea about this error? I'd appreciate it:-)

Jeremy Ruston

unread,
Apr 15, 2019, 1:32:34 PM4/15/19
to TiddlyWikiDev
Hi donmor3000

It sounds like the webview that you’re using to display TW5 doesn’t support the latest JavaScript features such as Object.assign(). However, the strange thing is that the error message references $:/core/modules/wiki.js, which does not currently use Object.assign(). Are you using the latest version of TW5?

Best wishes

Jeremy.

On 15 Apr 2019, at 15:49, donmor3000 <donmo...@gmail.com> wrote:

I'm making an Android app implementing basic functions of TiddlyDesktop on my phone, where the app malfunctioning importing photos, but I can upload the same photo to Sogou.com.


--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/6e80755f-6a5f-47ef-aa45-c6302f90f9ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<Screenshot_1555338534.png><Screenshot_1555338580.png><Screenshot_1555338551.png>

Joshua Fontany

unread,
Apr 15, 2019, 1:58:02 PM4/15/19
to TiddlyWikiDev
The 2 plugins I know of that use Object.assign() are TiddlyMap and my JsonMangler.

My JsonMangler does patch the wiki,js file, and IE11 errors out on this as well. I have been trying to track down where (in the load sequence) to polyfill this, but debugging IE11 is... difficult (or mine just keeps crashing for no reason).


If you do have one of these plugins installed, try a wiki without it as a test.

Best,
Joshua Fontany
Jeremy.

To unsubscribe from this group and stop receiving emails from it, send an email to tiddly...@googlegroups.com.

donmor3000

unread,
Apr 16, 2019, 8:24:53 AM4/16/19
to TiddlyWikiDev
I'm using API 23 Android 6.0 AVD,and I can import files using Via Browser on my phone, which uses WebView version 48. 
BTW I'm using file:// scheme. Is it possible that only content:// can be accepted by TiddlyWiki? But I imported a file successfully, which only provides file:// scheme. and I was not using onActivityResult. Is it possible that the problem is caused by this?

在 2019年4月16日星期二 UTC+8上午1:32:34,Jeremy Ruston写道:
Jeremy.

To unsubscribe from this group and stop receiving emails from it, send an email to tiddly...@googlegroups.com.

donmor3000

unread,
Apr 16, 2019, 8:28:17 AM4/16/19
to TiddlyWikiDev
But I was using empty.html from tiddlywiki.com <:-(

在 2019年4月16日星期二 UTC+8上午1:58:02,Joshua Fontany写道:

donmor3000

unread,
Apr 20, 2019, 11:41:26 AM4/20/19
to TiddlyWikiDev
Finally I succeeded...after changed my AVD to API 25 Android 7.0, which comes with WebView version 55. Still using file:// scheme. On lower version of system it fails, including my phone. But I wonder how could Via work.


在 2019年4月16日星期二 UTC+8上午1:32:34,Jeremy Ruston写道:
Hi donmor3000
Jeremy.

To unsubscribe from this group and stop receiving emails from it, send an email to tiddly...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages