Hello Mike,
I think we can't do too much in this case, because the "shared image" is shown by the application to use in their own way. For example, in my tests, the SMS application take the image and show a preview "as is", respecting the image size; GMail, however, shown me a larger image preview, the same than Twitter, which also offer the ability to apply some filters to the shared image.
However, we need to take in consideration that one thing is the application representation and other thing is the shared image. For example, GMail shown a larger image representation for the image preview, but finally the image than GMail attach to the email (in order to be shared) is the original image file, that is, have the size of the original image. So the shared file is correct, but their representation in the "shared application" depend on every "shared application".
Hello Mike,
No. There is no dirty way to manage various image sizes. You must provide an URL (local or remote) for an specific image, who have their specific size. Yes; maybe we can serve remote images in a dynamic way, but this implies to work with remote URLs, a remote server and remote scripts. Maybe you want to go ahead in this way or may you want to use local files. It's your choice.
The problem is you never can share the images in the way that you try at the principle. You let the browser to share it, wich is something completely different than using the Apache Cordova plugin. In fact, as you know, we need to use a plugin like that. You try for example by share an HTML IMG tag, which is something unaceptable. You really need to share files or URLs.
Starting by this... it's your choice to use remote URLs or local URLs. And prepare the things in order to deal with it.
Hello,
I am very sorry you can't get the point... so you can now share images, but don't want to prepare such images... then I really don't know what to say Mike. I don't think the application become "slow" if you add images on it. Maybe the the app's sizes increases, but no more. On the other hand, and (I hope) as you can see in the plugin's documentation, you can use remote URLs instead local images, then, if you wanted, use it!
Hello Mike,
What you can't understand from my above attached sample?
Hello to all,
Why on earth is it SO absolutely impossible to simply click on an image in android? That is so messed up.
Not sure how to implement either of the above plugins but thank you so much for helping.
Mike
In my opinion it's completely reasonable to don't share images by default. Maybe a browser vendor think different, because an internet image is "by default" already public... but normally you don't expect to tap on an image in an application and then simply "share it" with others...
Anyway, I try with this refered Cordova's plugin and appear good: we can share images using their remote URL and also the application local URL. Then I carefully recommend you, Mike, to study that plugin, because they offer some customizable options that may you want to know.
For example, in order to share an image (and only an image) we can use a code like the below:
In the above case we shared the application's icon, but we can refer to any other app's image file. The plugin is better than others, not only because they allow us to use app local files, but also because they always shown the shared dialog, so we can choose the application to use everytime we wanted to share the image.
The plugin also allow us to share other things, not only images. We can share text, URLs and more, so take a look at the ]plugin's website and read carefully their documentation. Below is a sample application who uses the plugin, and the Zip file includes also the APK file so you can take a look directly in your device:
shared_sample.zip
Take a look!
Hello,
Thanks Samuel! Anyway, I am continue trying somethings... for example, this Cordova's plugin looks good, but unfortunatelly only can share images using remote URLs and only with the SMS messages application... they works, but only with absolute URLs and the SMS application and not others.
I want to try now with this other plugin (already mentioned above)...
Hello Mike,
Maybe you can try with the "startapp" plugin linked above:
https://github.com/lampaa/com.lampa.startapp
Hello Mike,
I am sorry, but I don't know "app studio"...
Hello Mike,
If a client ask me for something like that (knowing what I know already) I reply we can't use App Builder (nor any Cordova based application) to do that, except if we firstly found a developer who can create some kind of Cordova plugin to do the background task, if possible... Of course anybody can say to any client that anything is possible... but this is not truth nor honest.
If we can share URLs instead of images, then maybe we can go ahead, but:
1º Probably such images must be available in a remote server, to share useful URLs.
2º I am not sure if only sharing an URL can be sufficient, but probably not, to be honest.
I am sorry, Mike, but I tried several possible solutions and anyone convince me or finally works as you expected.
Hello Mike,
I don't think such plugin can help here... but anyway (please, read this tutorial) we need to use the ID "https://github.com/devgeeks/Canvas2ImagePlugin.git" in order to use that plugin.
Hello Mike,
Sorry, but I am right now trying another possible solution for your problem... maybe you can understand I only had a couple of hands. But anyway, I can't study a plugin API for you, Mike: I provide you tutorials and samples in App Builder to do that. If you have some specific problem, ask here for help.
Hello Mike,
App Builder includes a tutorial and varios samples about how we can use Cordova plugins. Basically this plugins offer to us a Javascript API we can use. In principle, all the Cordova plugins can be used, then, try it and ask if you have some particular problem.
Hello,
But, certainly I am not sure the objective of copy an HTML tag into the clipboard... on the other hand, remember the image URL is part of your application, and not accesible out of the application, therefore, even if you can copy the image tag, the URL of the image can't work...
Hello Mike,
I think you can't initiates the browser in the "detail scene", if for that you understand an app's view. I the first place, how we knows the browser that we wanted is available? Also, how we knows if the default browser support something like "share images"?
Maybe you can stufy the usage of the "com.lampa.startapp" plugin:
https://github.com/lampaa/com.lampa.startapp
They allow us to launch "intents". I try it without success, but maybe I am not doing everyting well. On the other hand, I am not sure if we can "share" an URL of our application... then probably you need to provide "served side" images...
About the Clipboard, App Builder includes the Clipboard sample, so you can take a look. In fact we only need to call to theh CopyToClipboard action.
Hello Mike,
As an HTML5 app on a phone it may works because your application is running inside a browser: it's the browser who offer you a share dialog for the image, as well they does if you tab a link or certain other elements. However, when your application is running in Apache Cordova, there is any browser, but the application is running in a "WebView", based in Chrome, but not the Chrome browser itself.
I am try to help you already Mike. I try with an HTML control and an Image control. I try by put the image in an IFrame control. I try with one of the above linked plugins (lamp), I try with the "OpenWindow" action by using the Browser plugin: and unfortunatelly any of these approachs works as you expected.
Maybe a possible way is to use the image URL along the Clipboard control. But I am not sure if this approach can work, in the first place, and if can satisfy you, in the second place, because in this case we are not sharing an image "in a binary way", but just an image URL.
Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.