Posts by DecSoft

Show threads by DecSoft
3355 posts found, page 162 of 224

DecSoft (In thread: How to save the resulted Camera's control picture in Android)

Hello fakie,

I want to say a little more about this topic. Firstly I update AB right now with a couple of minor changes in the Camera control: now the "Quality" variable appear in the object inspector at designtime, and, I specify the JPEG as the encoding type for the captured image. Playing with the "Quality" variable and and the "TargetWidth" and "TargetWidth" ones, we may can get an smaller Base64 string to be uploaded, for example.

On the other hand, taking a look at the possible other results of the Camera's control, certainly they can give us the captured image's file URI, instead of their Base64 representation. The problem is what to do with that file URI... Certainly if we want to upload the captured image (not their Base64 representation) we must use another Cordova's plugin: the FileTransfer plugin, which is not included "out-of-the-box" in App Builder right now, but can be used like any other Cordova's plugin.

Maybe I can work in a FileTransfer included "out-of-the-box" in App Builder, but I can't promise nothing right now nor a time line. You can use it if you wanted right now, again, just like any other Cordova's plugin: using directly the plugin's Javascript API. However, and, said that, if we want a picture from the device's user, maybe we can achieve it without the usage of the Camera control.

We can use the Input File control (look at their "Accept" and "Capture" variables) in order to allow the user to get a picture from their device, and we can send the choosed image (not their Base64 representation) directly to our app's server, various samples shown how we can do it, like the "HttpClient" sample. This method has an additional advantage, and is that they work not only in Cordova's builded applications, but also in any modern browser. Take a look at the "ImagePick" and "ImagePick2" samples.

As an additional note, look at the "Camera", "Camera2", "Camera3" and "Camera4" samples. I just test right now the "Camera2" (for example) who take a picture from the camera and then upload the Base64 representation of the image: certainly they works acceptable in my device and with my internet connection: they take just a couple of seconds to upload the Base64 representation of the image. Then take a look at these samples if you are not take a look before!

Hope this information can help in some way!


DecSoft (In thread: How to save the resulted Camera's control picture in Android)

Hello fakie,

I am not sure if understand very well. Anyway, if you want to access the "[Camera2.Data]" variable from Javascript they are this in Javascript:

Anyway I want to investigate a little more about this, because the Camera control doens't offer right now other way than use the Base64 result. According to the documentation of the Cordova's Camera plugin we can get another possible kind of results, then I want to investigate about this other results and how we can deal with it the most easy way as possible.

P.S. If you don't want to wait, remember you can try to use the Camera plugin API directly instead the Camera control. Look at samples like "SendSMS" and "CordovaPlugins", and also look at the program's help file tutorial: "Cordova plugins".


DecSoft (In thread: How to send raw JSON data with the HttpClient control)

Hello there!

Another news about this topic is that the new App Builder release incorporates in their HttpClient control a new transformation "form" in addition to "json" and "data". You can take a look at the also new "HttpForm" application sample to look at that. Basically we can send data to a server like if use an HTML form, again, in addition to send "json" and (by default) just "data" (using the FormData Javascript object).

Hope this information can be useful here!


DecSoft (In thread: How do retrieve a device IME number and show in text label)

Hello Kasito,

Take a look at the official documentation of the Cordova's Device plugin and, in particular, to the ID that this plugin retrieve. On the other hand, maybe you can use a "hash" by join various device's information like the ID, model, etc. You can use the "StrHash" action to do that.

Something like this:

I am not completely sure, but, probably such "hash" can be considerated more or less unique Kasito.


DecSoft (In thread: How do retrieve a device IME number and show in text label)

Hello Kasito,

Are you tried with the Device's related actions? In particular the "DeviceID" action may can be enough for you. Take a look at the "Device" app sample. If you want to go a little more ahead, maybe this Cordova's plugin can be useful for you. Take a look at the Cordova's Plugins help tutorial and also the "CordovaPlugins" app sample and/or the "SendSMS" app sample.


DecSoft (In thread: Where to place external Javascript code in our applications)

Hello starin,

You must place the Javascript code in some app's/view's/control's event (between the couple "StartJS" and "EndJS" actions) or in an external Javascript file or maybe in an app's Javascript function. Depending on where you place it then you can use it in some or other way. For example, if you place the code in an app's function you can simply call to that function. If you place the code ni an external Javascript file, you must use a bit of Javascript to call it. Take a look at the "External" app sample and also at the "External Javascript" tutorial in the App Builder's help file.

P.S. The CSS code probably can work... but is a good idea to separate it into the app's Inline CSS option or in an external CSS file.


DecSoft (In thread: How to save the resulted Camera's control picture in Android)

Hello fakie,

Maybe the easy way to save the image in a file can be to use the Cordova's "Files" plugin and the "FileWrite" and "FileRead" actions, because all of them are included "out-of-the-box" in App Builder. However remember we are deal with the Base64 representation of the image and text files: we must save the image's Base64 and we read that later from the text file.

Maybe other Cordova's plugins allows us to work with files in other ways and we can use it from App Builder just like any other Cordova's plugin not included "out-of-the-box". Certainly working with files from an HTML5 application are something difficult, and probably with good reasons: are you ready and agree if a web application (a website) read your system files? Probably not.

About your question, I am not sure if understand very well, since you are talking about your "Camera2.Data" variable stores the previously assigned image... but there is not a way to do that, since the Camera control doens't have something like an assigned image. So maybe you are talking about an Image control and miss something in the middle?...


DecSoft (In thread: How to use gradient colors in app's views and other controls)

Hello frecciag50,

To use app's themes we only need to specify the themes to be included in the application from the app's options dialog. Once we do that we can use the "SetAppTheme" to establish a theme. Please take a look at the "Themes" and "Themes2" samples. Other samples like the "Calculator" one uses themes too.

See the below image:

From the "Included" list of themes we can choose one or more in order to put it availables for the application. The "Default" list of themes allows to choose what theme we want to use by default in the application. Once our application is running, we can use the "SetAppTheme" with the name of one of the "Included" themes in order to change use the specified theme in the application.


DecSoft (In thread: How to use gradient colors in app's views and other controls)

Hello frecciag50,

Here we can consider various things. First of all is the ability to use themes in App Builder: they include various themes we can use in our applications. If we want to use themes (we use the default one at least, but I talk about others too) we need to take care about changes in the app's style, since we can "break" the possible themes usage in someway. In few words, some themes can change the containters' background colors automatically... except if we change it firstly.

Said that, yes, we can apply style to one or more controls, and even to the app's view, and even to app's views who uses certain theme only, etc. A possible simple way to achieve what you wanted is to use the app's Inline CSS option. In that option we can place a code like the below one:

... the above code apply certain gradient style over the "Container1". If we want to apply such code to an entire app's view we can use their name for the CSS identifier: "#View1", "#View2", etc.. Certainly the code appear more or less complex, but furtunately they are generated using the Colorzilla Gradient Editor. Hope this information can be of your interest.


DecSoft (In thread: Dynamic scrollable list with input fields or possible alternatives)

Hello frecciag50,

I think you must take a look at these controls: Select, MultiSelect and Typeahead. The first one is the normal selectable HTML control, but this control surprise due to their looks in mobile devices, which is very good in my honest opinion. The second one is a "multiselectable" version of the Select control. The third one offer us a way to prepare a list with elements that only shown the ones that match what we type in the associated editbox. Please, tell me if you have any further question sir.


DecSoft (In thread: How to record audio from the device's microphone)

Hello Joshua,

now I am running the 'cordova_android_run.bat',downloading tons of files....for an hour
and it is still continuing...!
:rolleyes:

The first time we execute Cordova they download some of their dependencies like "Gradle". This can take a while, in particular if our internet connection is not too fast. The first apps build also requires more time than the next, since things like plugins are downloaded only one time. A more or less better computer also help with Apache Cordova.

Just a few months ago I change my old computer (about seven or eight years old) to other one, not too much expensive but better than the first one: I note how Cordova (and in general any other program of course) works like a charm on the new computer. Maybe just more RAM can helps too Joshua...


DecSoft (In thread: How to record audio from the device's microphone)

Hello Joshua,

Take a look a this forum's thread, since probably you also want to know (in the near future) how to deploy an APK in the Google Store, in particular, how to sign the APK file in order to upload it into the Google Store. ;)

Basically:

1º The Debug BAT can be used to get an APK to be tested in one or more devices.

2º The Release BAT can be used once we are ready to deploy our application in the Google Store.

3º The Run Bat can be used to directly build, install and run the application into a connected device or emulator.


DecSoft (In thread: How to record audio from the device's microphone)

Hello Joshua,

What you must do is to install Apache Cordova and the Android SDK. Once you are ready, you can use the App Builder app's options to create (AB does for you) the appropiate Cordova's configuration file. App Builder also creates for you various "BAT" files, that you can directly run in order to get the application compiled and running in a connected device.

You only need to do that: run the appropiate "BAT" file, which include instructions to create the Cordova's project, etc. In order to use Apache Cordova's plugins (not included out-of-the-box) we commonly only need to specify the plugin's ID in the app's options dialog: you can take a look at the "CordovaPlugins" and "SendSMS" samples.


DecSoft (In thread: How to record audio from the device's microphone)

Hello Joshua

Apache Cordova can run an Apk directly!?

Not exactly. Apache Cordova + Android SDK build our application and then install and run in an USB connected device, for example. We can also get only the APK and copy it to our device; or may we can use the Android SDK emulator. I think the first way (connect a device via USB) can be the best option.


DecSoft (In thread: How to record audio from the device's microphone)

Hello Joshua,

For testing my first android Project
Are there some links to let me learn how to compile my AB project in Cordova?

Sure. Take a look at this forum's thread and, in particular, to this step by step tutorial. You will not regret: once installed Apache Cordova you can compile and even run an APK in seconds.

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.

This website uses cookies only to store your preferences.

Ok! Hide this note More information