OK, so I followed the guide listed here for Cordova. I have everything installed and all have version numbers, so they work. The Android adb is running and I followed all directions on what to install.
So, now what do i do?
Which .bat to I run?
I have three to choose from - debug, release and run.
I just need some hand holding getting my first app builder app to become a Android apk file.
Does App Builder sign them? What about the password protection I read about in the Android Studio apk guide?
I could not install Android Studio - the download kept failing. I did download and install the Android SDK, however.
Thank you.
Mike
Mike Felker
Hello Mike,
Certainly we have three differents BAT files, here is their purpose:
1º "Debug": Allow us to get an APK file for our application ready to be debugged in a device or emulator.
2º "Run": If we have attached our device to our computer, this BAT launch the application directly in that device.
3º "Release": This BAT creates an aligned APK file of our application ready to be signed and then deployed into the store.
How to sign our APK files to be published in the Google Play Store? Take look at this forum's thread.
OK. I see.
I was able to make a debug apk with no problem.
The only real problem I am having now is that when I run the app in Android after installing it, the app works fine, but the important image is not clickable in the HTML. I added a blank then the image.
The result works in windows when I test but DOES NOT WORK in Android as a Cordova app.
How can I make the image clickable in Android?
Mike
Mike Felker
Hello Mike,
It's very difficult to help without more information. Can you please provide me a little application in which I can take a look?
I just sent you an email through here with a link to the debug app.
Mike
Mike Felker
It seems that this may be what I need:
What do you think? Is this something available in app builder?
I got this from here:
https://developer.android.com/training/sharing/send.html
Mike
Mike Felker
Hello Mike,
After take a look at your application I understand what you wanted. Then I prepare a little application who uses an Image control and also an HTML control in order to shown the same image. I try with the HTML control in both ways: without an "A" tag and with an "A" tag for the image. Certainly the things does not happend than you expected, Mike, but, I think it's very reasonable.
We can react to image "clicks" (or "taps") in both cases: the Image control and the HTML control. But we can't expect something like a "share" dialog to appear when we tap along an image or other resources in an application, not only your application, but any application. These applications images cannot be "shared" by default.
About your proposed code and documentation, you can't simply use Java code in App Builder, except if you are capable to create a plugin for Apache Cordova: then you can use the Java code of the plugin from App Builder using the plugin's Javascript API. Certainly this is probably the way for a solution: uses a Cordova plugin.
But I am not sure if a plugin like that is already created, or maybe we can use someone like this or this other.
As an HTML5 site on a phone, it works 100%. You long press the image and a menu comes up. SHARE is one of the options.
As a cordova app, this goes away. You cannot SHARE and no menu comes up.
I need to share the emoji with whatever apps allow sharing.
How can I accomplish this? I need to finish this ASAP.
Would you be able to help using that 1st Cordova plugin (the file sharing one) you linked to?
Could you add that to app builder and show me how to utilize it?
In the end, no matter how I do it, whether it be a html report, a image control - I don't really care what - I need, in the end, the user to be able to share or copy and paste, the image into another app on their phone.
How can I get this done - today if possible?
Mike
Mike Felker
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.
David,
I TOTALLY appreciate your help. Please know that I feel your support is excellent.
Is there a way to initiate a browser in the detail scene? If it runs in a browser, then it should work, right?
If not, how would I utilize the clipboard control on the detail scene?
Mike
Mike Felker
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.
David,
OK, so I added a clipboard control to one of the detail scenes and a button to 'copy' it.
I KNOW this is wrong, but how would I format this to work with the Clipboard copy button:
I just need the correct syntax.
Mike
Mike Felker
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...
David,
How could we use this plugin in app builder:
https://github.com/agomezmoron/cordova-save-image-gallery
I think this may be it.
Save the image to the gallery and then from there the user can copy and paste it any way they want.
Mike
Mike Felker
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.
Actually, this one allows for HTML5 to gallery - so I can change the size on the fly:
https://github.com/devgeeks/Canvas2ImagePlugin
Mike
Mike Felker
David,
My problem is i've tried to add a Cordova plugin and none have worked for me. I'm not sure what i'm doing wrong, but anyway, tell me how I can use the last one I linked to in my app.
I know, I know - install the cordova plugin and then code it.
I'm under the gun here - any other help is appreciated.
Mike
Mike Felker
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.
According to the Cordova plugin instructions, I am supposed to find something like com.jsmobile.plugins.sms
Instead, they reference the following:
How do I find out the com.whatever.plugin.whatever?
Would it be org.devgeeks.Canvas2ImagePlugin?
Mike
Mike Felker
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.
I know. I've read that tutorial probably 20 times now. I just cannot get it.
What would YOU DO if a client asked you to create exactly what I am trying to create.
Remember, I am very new to your app builder and to app building in general. While I am a database programmer and do some light game programming in other languages, I am just not proficient in cordova and this kind of app building.
I really do appreciate your help, but I just want to finish this darn thing already.
Mike
Mike Felker
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.
David,
Let me ask you, how would I simply open a browser window in app studio?
If I could open up a browser window, then the image would be clickable/shareable, etc, right?
Is there a browser control in app studio?
Mike
Mike Felker
Hello Mike,
I am sorry, but I don't know "app studio"...
I meant your app builder software. Sorry. I actually do have a program called app studio (NSB App Studio), but I chose your software to create this.
My brain is scrambled.
Mike
Mike Felker
Hello Mike,
Maybe you can try with the "startapp" plugin linked above:
https://github.com/lampaa/com.lampa.startapp
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)...
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
Mike Felker
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!
If I were to send you the entire project, would you be able to implement this on ONE category (I can then do it to the rest)?
Mike
Mike Felker
Hello Mike,
What you can't understand from my above attached sample?
It seems pretty straightforward - however, one question. How would I share the right picture with the right size? Would I have to save a copy of each emoji at each size or can I do it programmatically?
Namely, emoji1_16_16.png, emoji1_32_32.png, emoji1_64_64.png, etc.
I would rather not do ALL that work - there are a lot of graphics and creating four or five sizes for each would be very tedious and time consuming - plus i'd have to load all of them into app builder with the file manager - would make for a very slow app.
If, however, we could use emoji1.png and set the width and height to be 16x16 or 32x32 or 64x64 that would be so much easier.
Can this be done?
Mike
Mike Felker
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!
David - you miss my point. I am very pleased about this - it's a true solution. However, I wanted to know if there is a quick and dirty way of managing various sizes of the graphics or do I have to do the work ahead of time and reference those.
If you look at it now, you can choose one of several sizes via a dropdown and then the app shows it - all using just one graphic. If I have to save each graphic at each size, that one becomes 6 images - so 20 graphics becomes 120 graphics. Across all categories, I may have to make 1,000 graphics. Ugh. If I don't have to, i'd rather not.
However, if the only way to do this is to link to a specific graphic, then i will have to bite the bullet and re-size each one. Perhaps I can find batch resizer software and do it almost automatically????
Either way, thank you SO MUCH for your help. It's likely you found the true solution to this.
Mike
Mike Felker
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.
So using what I already created, the user chooses a size and clicks on the graphic and that loads the detail page.
How would I use a if/then statement to put the name of the graphic in a variable and then use that variable to load the correct graphic?
For example, I choose baseball.png with a size of 32x32. I need a if/then statement to store a string "baseball_32_32.png" and then load that in using the javascript you wrote on the detail page.
Psuedocode:
If "32x32" was chosen, then loadImage="baseball_32_32.png"
I would have to do this for each and every graphic.
The other possibilities would be "baseball_16_16.png", "baseball_64_64.png", "baseball_128_128.png", and "baseball_256_256.png"
So the name "baseball" and ".png" would be consistent.
Not sure how to do this in app builder.
Mike
Mike Felker
I found a GREAT batch resizer with rename capability. Creating the graphic sizes will not be a big deal.
http://www.axiomx.com/picsizer.htm
Mike
Mike Felker
David,
When I share the file - which is 32x32 in size, it shares properly to, say, messager - but it comes in very large and blurry - as if it's sharing a much larger file.
What am I doing wrong?
Mike
Mike Felker
I added a image control, added the image to be shared, resized it to 32x32 and then put the code above into it and no difference - the shared graphic was big and blurry. I just don't get it.
I'm going to see what else you did in your example app and apk that maybe I missed.
Mike
Mike Felker
Your example app, when installed on my phone and run, is doing the same thing - the example graphic is being shared at like 256x256 or larger regardless of the actual size of the graphic being shared.
Mike
Mike Felker
Yeah, it's a big problem. I created a 32pixel by 32pixel blue square in photoshop. I called it blue.png
I added blue.png to the project and altered the above code to share blue.png
It shares fine, but comes in HUGE - like 256pixels by 256pixels.
I don't believe I did anything wrong, I just think its either a bug in the plugin or the messenger app (texting) on android is resizing it for some weird reason.
In any case, if i cannot send at size this solution won't work. I have searched and searched for anyone with a similar problem, but have found none. I texted my wife and the image she received was equally as large.
I wonder if there is a similar plugin but where sizes are taken into account?
Mike
Mike Felker
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".
You are correct. The question is, will my client accept it? It looks terrible when in the texting application the image looks horrible.
The best thing would be a way to copy and paste the image itself - I just do not know any way to do this. I'll keep searching.
Mike
Mike Felker
Check this out. I uploaded several of the 16x16 graphics to my web server. I went to the chrome browser on my phone and downloaded/shared a few of them. I brought them into the messaging app and they ALL looked totally crappy.
It's not the plugin or app builder. It's Android. I guess there is NOTHING I can do about this.
I have NO idea how to break this to my client. I am totally upset over this. I had no idea Android was this bad with small images.
Mike
Mike Felker
Ummmm. Thought. The one thing that looks PERFECT is the app icon. I used the company logo of my client (which is round) and it looks gorgeous. That was set in the app settings.
I wonder if it would be possible to use that same kind of interface to get small icons saved onto Android devices and retain their size?
I am sure it's not possible, but it vexes me that the icon can look so good and the rest cannot and they are all the same size.
Mike
Mike Felker
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.