Tell us what you want!

6,222 views
Skip to first unread message

Dave Smart

unread,
Oct 26, 2013, 10:22:13 AM10/26/13
to androi...@googlegroups.com
Let us know what you want adding to AndroidScript.  We've got a growing 'Todo' list but we are not quite sure what people are going to want the most, so let us know in this thread.

Here are some things we plan to do (in no particular order):-

- Allow packaging and easy sharing of apps using some sort of zipped folder mechanism.
- Create a dedicated community web site where people can upload, share and rate apps and show off their projects (work started already).
- Allow building of APK's for users of the 'Pro' version.
- Support controlling and programming of the fantastic new Espruino board (partially done).
- Do more HTML samples.
- Do more documentation
- Do some tutorials.
- Allow creation of background service apps.
- Support the Bluetooth controlled 'Sphero' ball (great teaching kids to program).
- Support WIFI direct.
- Allow access to NFC.
- Allow reading QR codes.
- Add some sort of simple physics based game engine (probably WebGL based).
- Allow access to contacts.
- Allow use of local sqlite databases.
- Add face detection.
- Support reading the battery status.



Sciallo

unread,
Oct 31, 2013, 2:27:00 PM10/31/13
to androi...@googlegroups.com
OpenAccessory support anyone?

Brad

unread,
Dec 6, 2013, 10:20:53 AM12/6/13
to androi...@googlegroups.com
Hi,

How about support for listening for / receiving android system/broadcast intents and sending android intents :) ?

Dave Smart

unread,
Dec 6, 2013, 11:27:50 AM12/6/13
to androi...@googlegroups.com
Hi Brad,

Actually certain forms of intent are already supported...  Check out the "Shared Data" sample.  This example receives the intent associated with the 'Share Via' option found in many applications.  I could perhaps generalize the intent mechanism but it might get a bit complicated.

Is there a particular type of intent you want to send or receive?
Message has been deleted

nenes raclor

unread,
Dec 20, 2013, 4:49:51 PM12/20/13
to androi...@googlegroups.com
please lego EV3 compatibility 
thanks
great job

david shumate

unread,
Dec 29, 2013, 12:40:31 AM12/29/13
to androi...@googlegroups.com
Any way to sideload jQuery, spServices or other javascript frameworks? That could be useful.

Freek Bomhof

unread,
Dec 29, 2013, 3:51:15 PM12/29/13
to androi...@googlegroups.com
In addition to the (good!) documentation that you already have, may I suggest making an overview of all objects, methods, functions and operators that are supported? Not everything seems to be documented, and I just went through all the examples in order to find out about some functions.

Other (small) things that could be useful:
- create directory on SD card
- read the device's date and time
- access the microphone

Dave Smart

unread,
Dec 30, 2013, 4:27:26 AM12/30/13
to androi...@googlegroups.com
Hi, you can make a folder like this:- 

app.MakeFolder( "/sdcard/MyNewFolder");

Check the "Camera Snap" example to see it in action.  I know these functions should be documented and I'm working on that :)

I will add 'Getting data and time' and 'Accessing the microphone' to my 'to do' list.

Regards
David

Freek Bomhof

unread,
Dec 30, 2013, 4:34:07 AM12/30/13
to androi...@googlegroups.com
:-) (I could/should have gone through the examples more carefully...)

Dave Smart

unread,
Dec 30, 2013, 6:09:31 AM12/30/13
to androi...@googlegroups.com
You might want to consider buying a Sony SmartWatch2... the pro version of AndroidScript (which will be released soon) allows you to display info from your apps on the watch face via Bluetooth.  Then then you could just glance at your watch to read the lap count instead of getting your phone out... the watch is also water proof :)

Dave Smart

unread,
Dec 30, 2013, 10:26:35 AM12/30/13
to androi...@googlegroups.com
Hi,

Regarding external JavaScript libs:-

You can already make use of javascript libs such as jQuery, jqPlot etc if you build your app as an HTML page and load it into a WebView... but you can't currently include external libs into your main script file.  I'll have to think about that one :) 

P.S. You can however access the the 'app' object from your html pages, by including this line in the header of your html page:-

<script src="file:///android_asset/app.js"></script>

This means you can then access the phone's sensors, file system etc from your html code.  You can also call the app.Execute() function in your html code to execute code in your main script.  If you make your WebView fill the entire screen you can make nearly your whole app using html if you like.

Examine the source of this file for an example :-  http://www.filewrench.com/AndroidScript/Samples/jqPlot/bar.html

Regards
David

david shumate

unread,
Jan 2, 2014, 5:08:18 PM1/2/14
to androi...@googlegroups.com
Thanks for that update David...  I guess a better question from me for including scripts and such may have been to include some sort of web service capability; the consumption of them.  Appreciate the response and look forward to developing with this amazing tool as it grows.  

Sincerely,

Dave

jason flanagan

unread,
Jan 14, 2014, 1:37:29 PM1/14/14
to androi...@googlegroups.com
Allow access to NFC
And build .apk
Would be awesomp id be willing to pay
thank you!

Chris Ziolkowski

unread,
Jan 28, 2014, 1:19:05 PM1/28/14
to androi...@googlegroups.com
Hi;
The two things that would be great are:
Instructions on how to connect to androidscript to my laptop/pc browser for remote coding
Bluetooth connectivity

I have been using/following Espruino for a while and think it would be great to work with one syntax on both the user and the sensor sides!

Thanks,
Chris

David Whittaker

unread,
Feb 21, 2014, 9:08:48 AM2/21/14
to androi...@googlegroups.com
Hi, I'd like to vote for raw USB access (openDevice by VendorID/Product I'd and controlTransfer are all I'd need). I understand marshaling the buffer in and out of Javascript in a universally useful way is not necessarily straightforward (is it a string, array of bytes/shorts/ints, some binary struct, etc.), so maybe I'm really just voting for the plugin api.

I'm working on building an ecosystem of inexpensive lab measurement devices based on little-wire for high school science labs. Pasco/Vernier make similar products, but for 10 times the cost of a simple USB implementation. This makes them inaccessible to most high schools. A photogate for $10 or less can open a lot of options for a physics teacher. Being able to interact with their sensors directly through a simple scripting language would open up even more educational opportunities.

Dave Smart

unread,
Feb 22, 2014, 4:43:48 AM2/22/14
to androi...@googlegroups.com
Hi David, 

Inexpensive lab measurement devices sounds great!  I think RAW USB access is probably too complicated and fiddly to bring right up to the JavaScript level.. but as you suggested, a plugin would be the place to provide access to your devices.  The plugin architecture is working right now in the latest alpha version of AndroidScript, so if you want to give it a go then let me know.  (I can give you the Java USB serial code I used too, which might help you).

Regards
David

Roger Court

unread,
Mar 5, 2014, 7:19:06 AM3/5/14
to androi...@googlegroups.com
I'd vote for APK compilation, SQLite and a physics engine, for my own selfish purposes.

These features also seem like a great way to monetise the app. It's a fantastic piece of work already, and while it's good to see that it's being so actively developed, there's no better incentive to a developer than an app that's making money ;)

Chris Doudet

unread,
Mar 18, 2014, 5:51:52 AM3/18/14
to androi...@googlegroups.com
hi all,

A solid documentation 
because i don't know where to search built in functions or properties.

great job
Message has been deleted

Chris Doudet

unread,
Mar 19, 2014, 3:19:43 AM3/19/14
to androi...@googlegroups.com
For a growing community :
A community shared repository with access like the shared by mail, plus Ranking function and facebooktwitter publication

Android editor. :
Code completion
copy code in help forms (or i missed something)
Best highlighting code
Liste of function (in this code)

Dave Smart

unread,
Mar 20, 2014, 7:33:03 AM3/20/14
to androi...@googlegroups.com
Hi Chris,

You will be glad to hear we are working on a GIT backed repository and ranking system (with a friendly front end).

Chris Doudet

unread,
Mar 21, 2014, 10:31:00 AM3/21/14
to androi...@googlegroups.com
GIT repo is Good News.

Things i would like :

a TreeView.
a GridView.

Thanks

Chris Doudet

unread,
Mar 22, 2014, 11:20:26 AM3/22/14
to androi...@googlegroups.com
hi,

some SVN stuff...

google spreadsheet

Артем Колесник

unread,
Mar 23, 2014, 2:59:32 AM3/23/14
to androi...@googlegroups.com
How can I edit script using my notebook?I don't understand:'(

Dave Smart

unread,
Mar 23, 2014, 5:54:42 AM3/23/14
to androi...@googlegroups.com
Hi, this is not quite the right thread for this question (you should start a new thread) but here is your answer.... 

- Connect your Android device and your Notebook to Wifi.
- Press the little arrow button at the top of AndroidScript.
- A dialog box will popup with an http address.
- Type this address into your browser's address bar.
- You can now edit, run, debug your scripts and upload images etc.

Regards
David

Dave Smart

unread,
Mar 31, 2014, 7:12:49 AM3/31/14
to androi...@googlegroups.com
We've added a new experimental function call "LoadScript" in the latest release.  Perhaps you would like to try it out for us and see if it does what you require.

It's used at the top of your script like this:-  


app.LoadScript( "/Misc/external.js" );

function OnStart()
{   
}

Chris Doudet

unread,
Apr 3, 2014, 8:09:39 AM4/3/14
to androi...@googlegroups.com
Folder To Organise the App Sceen.

Schnee Wittchen

unread,
Apr 5, 2014, 3:35:07 AM4/5/14
to androi...@googlegroups.com
Hello David,

editing and debugging the scripts on a PC via WiFi is great.
One feature I'm missing is to download the folder of the script ( including subfolders of assets like Img etc ) to your PC. Optionally zipped.
This would make it also easier to post the scripts here.

best regards
Schnee

Dave Smart

unread,
Apr 5, 2014, 5:37:31 AM4/5/14
to androi...@googlegroups.com
Hi Schnee,

Yes, that's a good idea... in the mean time you can do this :-

- Turn on the 'show hidden folder's option of your Android file browser.
- Choose the "Share via Email" option for your App.
- Choose Gmail but then discard the email.
- Look in the /sdcard/.AndroidScript/Temp folder and you will find your zipped up App.

(Notice the dot on the front of .AndroidScript... all folders that start with a dot are hidden in Android)

Regards
David

Jean Marc

unread,
Apr 11, 2014, 9:00:39 AM4/11/14
to androi...@googlegroups.com
"- Allow building of APK's for users of the 'Pro' version."

This would be very nice :)

Jose Viña

unread,
Jun 4, 2014, 4:42:38 PM6/4/14
to androi...@googlegroups.com
Examine the source of this file for an example :-  http://www.filewrench.com/AndroidScript/Samples/jqPlot/bar.html

Hi Dave,

I've been browsing the documentation and the forum for almost one hour, and I cannot figure out how to install js libraries locally for my application to use them.

1) The jqPlot sample in the phone seems to load some html files under fldr = "file:///Sys/Html/jqPlot/", but I cannot manage to find those and inspect them, to see how the jquery and the jqplot libraries are loaded from local files.

2) Your example linked above illustrates how to load the app.js library at the external html page, but it links to online jquery/jplot libraries, so it doesn't help me in fiding out how to download them and use them offline.

The best suggestion I found so far is at https://groups.google.com/forum/#!searchin/androidscript/samples$20html/androidscript/hMJRSV0VsxI/bQ2Y9VWu9Y0J so I will definitely try it, but it is all a bit cryptic. Specially, the fact that I need to downlod jquery and jqplot again, while the examples on my phone already use them...

Can you please point me to some example of a HTML page that I can use with CreateWebView to display jqplot data offline, without having to install those libraries again?

Cheers,

jose.

Schnee Wittchen

unread,
Jun 4, 2014, 9:21:08 PM6/4/14
to androi...@googlegroups.com
Hello Jose,

probably it is worth to discuss this in its own thread, as other people might find it useful, but will not find it in this thread.

Anyway, you say that your phone has already loaded the libraries for jquery/jplot. Do you know the path to it? Is it another AndroidScript sample?
What I did for one of my examples is, to download the respective libraries from the jqplot website and place it in a subfolder of my sample application.
Maybe you like to have a look at this example. It is not perfect, not even finished yet, but might give some hints for your question.
It is a self-containing file to make it completely independent from the system. Therefore the libraries are included. I'm not sure if this is legal, though.

Once again, please start your own thread for this question.
best regards
Schnee
CreateSineWave.spk

Dave Smart

unread,
Jun 5, 2014, 5:07:13 AM6/5/14
to androi...@googlegroups.com
Hi Jose,

Check out this post:-  "Using 3rd Party JavaScript libraries in a WebView"

Regards
David

Jose Viña

unread,
Jun 5, 2014, 6:48:05 AM6/5/14
to androi...@googlegroups.com
Dave: Perfect! All is clear now. Thanks a lot!

Schnee: thanks for sharing your code! Dave already created that thread, all my questions are addressed in there.

Cheers,

jose.

James Newton

unread,
Jun 5, 2014, 1:37:46 PM6/5/14
to androi...@googlegroups.com
I would like to see support for USB OTG so I can write an app for the BusPirate or other OTG connected devices. 

Dave Smart

unread,
Jun 8, 2014, 3:18:33 AM6/8/14
to androi...@googlegroups.com
Hi James,

You can already use serial over USB OTG (if your device supports it).  Check out the "USB Espruino" sample in the AndroidScript App.

Regards
David

Paolo Amoroso

unread,
Jun 23, 2014, 6:33:16 AM6/23/14
to androi...@googlegroups.com
Here are the features I’d like AndroidScript to provide. I know Dave’s todo list is pretty long, and some of my suggestions may be substantial projects. However, they may be useful for understanding what users value and identifying any potential low-hanging fruits.

Although I checked the documentation and this forum, I may have missed some already available features. here’s my list:
radio button control
  • Holo Light support
  • ability to edit the most common manifest options in the upcoming APK generator (e.g. changing the package, version code/name, supported screen sizes, and so on)
  • an activity starter
  • as much of the intent functionality as possible, including sharing data to apps, in a way that looks standard to users (I know partial support is already available)
  • function/method documentation lookup in the Wi-Fi editor
  • a JavaScript console for evaluating expressions (the browser’s console doesn’t have access to the app state and context)
  • a user interface designer
  • source and asset file cloud storage and synchronization (I know GitHub support is under way, but Google Drive and similar services might also be useful)

Jorge Ramirez

unread,
Jul 28, 2014, 5:22:46 PM7/28/14
to androi...@googlegroups.com
I would like to have the SetOnTouch() method to not only accept a callback function but to execute some code directly, for simpler thing is much faster to just run the code..

maybe just accept an anonymous function would do in some cases like:

obj.SetOnTouch( function() { //....do something } );

When trying to dynamically create objects I found hard to assign a function to each of the generated buttons...

salvatore fusto

unread,
Jul 29, 2014, 2:31:48 AM7/29/14
to androi...@googlegroups.com
Jorge,
i already pointed out the lack of anonymous functions to be used in event handler, expecially to pass arguments, so +1 for this
regards
salvatore

sankarshan dudhate

unread,
Aug 4, 2014, 10:09:52 AM8/4/14
to androi...@googlegroups.com
Hi David. After a search of a month, I actually found a good blogging site. I have created a blog on tumblr. I have created first post Introduction to Android Script. It was posted on Sunday. Have a look at it and suggest me if I can have something better.

Regards,
Sankarshan Dudhate

Link http://sandudhate.tumblr.com/post/93668951307/introduction-to-android-script

Dave Smart

unread,
Aug 6, 2014, 1:07:15 PM8/6/14
to androi...@googlegroups.com
Hi sankarshan,

This thread should be about wanted features for Android Script. So if you want to talk about your blog, then start a new thread and we can discuss it there.

Regards
David

Max Cat

unread,
Aug 6, 2014, 2:49:14 PM8/6/14
to androi...@googlegroups.com
Hello

first i want to say this app is the best and great for people like me(develop,system and around tinker), i have a question are you using Rhino or Nashorn for this?
I would love if we had Themes for the editor. and maybe export the script as a apk too would be nice ;)

Dave Smart

unread,
Aug 6, 2014, 3:08:13 PM8/6/14
to androi...@googlegroups.com
Hi,

AndroidScript uses the Chrome JavaScript engine.  This has the advantage that any enhancements that Google make to the Chrome engine will also be available to AndroidScript users :) 

Generally you can use most of the functionality that you would normally use in a Chrome Web Browser including XMLHttp, Web Sockets, SVG and JQuery... plus all the built in functions of the AndroidScript 'app' object which give you access to the native device GUIs and hardware.

I'm inches away from releasing an APK building plugin so watch this space!

Regards
David

Steve Garman

unread,
Aug 7, 2014, 5:36:25 AM8/7/14
to androi...@googlegroups.com
For saving stable versions of an app I am working on, it would be really nice to have the facility to make a copy of an app under another name.

What I am looking for is something identical to the "rename" option but leaving the original app intact.

As a matter of interest, I have blogged a very restricted workaround I'm currently using at http://androidscriptkiddy.blogspot.co.uk/2014/08/make-copy-of-project.html

sankarshan dudhate

unread,
Aug 7, 2014, 9:36:13 AM8/7/14
to androi...@googlegroups.com
David, please add an plugin which can open .SPK files.

sankarshan dudhate

unread,
Aug 7, 2014, 9:37:27 AM8/7/14
to androi...@googlegroups.com
I am not able to open .SPK files on my Android. Add a plugin for that.

Jorge Ramirez

unread,
Aug 7, 2014, 5:56:46 PM8/7/14
to androi...@googlegroups.com
I use the send to mail option to save versions of my apps and email it to a Trello board to follow the developing process...


Screen Shot 2014-08-07 at 17.18.27.png

Danny Croft

unread,
Aug 10, 2014, 8:12:12 AM8/10/14
to androi...@googlegroups.com
How about support. A website dedicated to this software? I am having a major problem and can't use my computer and thus far everyone is stumped. It will connect fine, but the editor GUI, is unobtainable. Only about half an inch shows up and the rest scrolls by under a blank frame or something. It's like someone put a sheet of paper on error the screen. I have a pic of it, but u don't have a website, so I can't upload it. Money in hand, ready to buy, but why would I if I can't use it. Please help.
danny Croft.

Dave Smart

unread,
Aug 10, 2014, 9:45:54 AM8/10/14
to androi...@googlegroups.com
Hi Danny,

Well I think you got pretty good and rapid support really.... Both from Schnee and myself (the author of AndroidScript).

I'm glad you got is sorted in the end by dumping IE8.  That is really a VERY old browser and would not support WebSockets and many other things required by AndroidScript anyway.

Regards
David

Jorge Ramirez

unread,
Aug 17, 2014, 10:06:53 PM8/17/14
to androi...@googlegroups.com
Very good sugestions Cosmin!

Steve Garman

unread,
Aug 18, 2014, 1:35:10 AM8/18/14
to androi...@googlegroups.com
Could you offer a quick and dirty way to get user text input?

I envisage something that works like the yes/no dialogue but with a TextEdit added. The buttons would be OK and Cancel.

The OnTouch event would pass a result containing either null (if cancelled) or the text entered.

salvatore fusto

unread,
Aug 20, 2014, 12:09:59 PM8/20/14
to androi...@googlegroups.com
Hi all,
i'm testing the 1.08 IDE and apreciate a lot the multifile js editor: imho it is great to modularize the code.
it would be wonderfull if i can save library files in a selectable folder rather than in the app root only.
regards
salvatore

Jorge Ramirez

unread,
Aug 22, 2014, 6:56:36 PM8/22/14
to androi...@googlegroups.com
Are notifications planed? are those part of making "background service apps"?

thanks!

Dave Smart

unread,
Aug 23, 2014, 4:11:02 AM8/23/14
to androi...@googlegroups.com
Generic notifications are planned yes, that is fairly high on the 'Todo' list :)

Aerik Sylvan

unread,
Aug 24, 2014, 4:00:57 PM8/24/14
to androi...@googlegroups.com
APK export, definitely. Dave, a thought, you could provide it ss s service for a small fee per export and create a revenue stream that way...

Awesome work.

Jorge Ramirez

unread,
Aug 24, 2014, 5:36:38 PM8/24/14
to androi...@googlegroups.com
APK export is promised for the next update:

Aerik Sylvan

unread,
Aug 26, 2014, 1:52:06 PM8/26/14
to androi...@googlegroups.com
How about the ability to email attachments (directly - can we already do this?) and some basic network transfer operations like HTTP and FTP client operations (so I can upload and download files).

Aerik Sylvan

unread,
Aug 27, 2014, 12:11:23 AM8/27/14
to androi...@googlegroups.com
Ah, I just figured out (duh) that I can make ajax requests.  Sweet.  I think it becomes easy to forget that it's javascript.  Maybe a good question is, "what normal javascript functions (if any) does this not support?"  It would be nice to understand if this environment behaves like a browser with no window or document... it seems to; calls to document.write don't generate errors.

Dave Smart

unread,
Aug 27, 2014, 3:48:25 AM8/27/14
to androi...@googlegroups.com
Hi Aerik,

Yes, you can make AJAX requests... basically you are running in an invisible Android WebView which supports almost everything you would normally use in a browser.  There's a sample on this forum called "Using HTTP GET to fetch data from a web server".

Also, if you want to use third party JavaScript libraries, you can use the app.LoadScript method at the top of your script to load them in.

Regarding email attachements:- It should be easy to add this since I wrote the code but never exposed it.  I'll expose that functionality in the next release.

Regards
David

Jorge Ramirez

unread,
Aug 27, 2014, 11:16:00 AM8/27/14
to androi...@googlegroups.com
Will there be any way to embed a new font on a program without using a webview? Is that possible in Android? I would love to change fonts!

Another thing, for what I've see the text size is not absolute (or relative?), it change between devices rendering the whole 0-1 relative scale unreliable, would it be possible to set the size of the text with an "absolute relative" size, just as the other controls? example: txt.SetTextSize (0.1). 

What I would like (to not break current programs):

  1. If the parameter passed to SetTextSize is between 0 and 1: use the relative scale (calculate the fraction of the screen and make the text fit that space).
  2. If the parameter passed is > 1: use the way it used now.
Thanks!

Jorge Ramirez

unread,
Aug 27, 2014, 7:47:30 PM8/27/14
to androi...@googlegroups.com
  • I would like to have an option to generate the SPK to a folder without having to send it via mail.
  • I would like to be able to clear the debug window.
Message has been deleted

Steve Garman

unread,
Aug 28, 2014, 12:44:09 AM8/28/14
to androi...@googlegroups.com
+1 on the spk.
If it could be generated to a special folder, I'd be delighted.

Dave Smart

unread,
Aug 28, 2014, 5:04:57 AM8/28/14
to androi...@googlegroups.com
Hi Guys,

You can clear the debug window on the Wifi Editor by right clicking in it.

I like the idea of the font scaling but font sizes are proving to be quite difficult as I have already tried to make fonts show the same on all devices but unfortunately it seems that each manufacturer changes the font scaling for their devices. On some devices the default is for 'Medium' fonts on others it is 'Large' and one manufacturers medium is not the same as another's medium!  I'm going to have another go at this soon tho :)

I will add the SPK generation to folder to the 'Todo' list, but the SPK is in fact created in a hidden folder called /sdcard/.AndroidScript/Temp so you can get at it if you enable showing of hidden folders in your phone's file browser.

Regards
David

Jorge Ramirez

unread,
Aug 28, 2014, 12:28:37 PM8/28/14
to androi...@googlegroups.com
Hey Dave, I have this work around for my font scaling problem, I tested it in my phone changing the system font size (what caused problems before) and the orientation and seems to work very well!


//Called when application is started.
function OnStart()
{
    
    toSize = calcFontSize();
    
    //Create a layout with objects vertically centered.
    lay = app.CreateLayout( "linear", "VCenter,FillXY" );
    lay.SetBackColor("red");

    //Create a text label and add it to layout.
    txt10 = app.CreateText( "10% of the screen" );
    txt10.SetTextSize( 0.1*toSize );
    txt10.SetBackColor("green");
    lay.AddChild( txt10 );
    
    txt20 = app.CreateText( "20% of the screen" );
    txt20.SetTextSize( 0.2*toSize );
    txt20.SetBackColor("blue");
    lay.AddChild( txt20 );
    
    txt30 = app.CreateText( "30% of the screen" );
    txt30.SetTextSize( 0.3*toSize );
    txt30.SetBackColor("white");
    lay.AddChild( txt30 );
    
    txt40 = app.CreateText( "40% of the screen" );
    txt40.SetTextSize( 0.4*toSize );
    txt40.SetBackColor("yellow");
    lay.AddChild( txt40 );
    
    //Add layout to app.    
   // lay.SetVisibility( "hide" );
    app.AddLayout( lay );
    
    
    //show the sum of the heights
    app.ShowPopup(  "Total height: " + (1*txt10.GetHeight() +
                    1*txt20.GetHeight() +
                    1*txt30.GetHeight() +
                    1*txt40.GetHeight()) );
}

function calcFontSize() {
    
    //create a local variable for a new layout
    var lay = app.CreateLayout( "linear", "VCenter,FillXY" );
    
    //create a test text
    var txt = app.CreateText("Test Text");
    
    //use a big font to make the calculation more exact
    txt.SetTextSize ( 200 );
    lay.AddChild( txt );
    
    //we don't want to be seen in the UI
    lay.SetVisibility( "hide" );
    app.AddLayout( lay );
    
    //Calculate the proportion between the text size used
    //and the height of the generated text
    //the result is the text size necessary to get a full size
    //(ie. 1) text
    var fullSize = 200 / txt.GetHeight();
    app.DestroyLayout ( lay );
    return fullSize
}

Basically I create a dummy text object with a fixed size and calculate is height  attribute and scale from there.

To use I just multiply my desired percentage with that result. 

Can anyone test it on their phones?

I attach my results (portrait and landscape with small, normal and big fonts).

Cheers!

Screenshot_2014-08-28-13-22-58.png
Screenshot_2014-08-28-13-23-07.png
Screenshot_2014-08-28-13-23-31.png
Screenshot_2014-08-28-13-23-40.png
Screenshot_2014-08-28-13-24-11.png
Screenshot_2014-08-28-13-24-23.png

Dave Smart

unread,
Aug 28, 2014, 4:15:03 PM8/28/14
to androi...@googlegroups.com
Hi Jorge,

That's an interesting solution...  It could be useful. Thanks.

Steve Garman

unread,
Sep 3, 2014, 4:23:31 AM9/3/14
to androi...@googlegroups.com
Are there any plans to implement RadioButtons?
I can see that grouping them might be interesting.

I'm currently using checkboxes that unset the others.
The user-interface is not very intuitive.

Jorge Ramirez

unread,
Sep 3, 2014, 9:47:44 PM9/3/14
to androi...@googlegroups.com
When sending an SPK can we get the name of the script on the subject line? thanks!

Jorge Ramirez

unread,
Sep 3, 2014, 9:49:18 PM9/3/14
to androi...@googlegroups.com
I remember another thing:

When making a list you can only touch the text of the list to trigger the SetOnTouch callback, I should work in the complete wide of the list, much more usable!

Jorge Ramirez

unread,
Sep 4, 2014, 11:43:52 AM9/4/14
to androi...@googlegroups.com
When making a list you can only touch the text of the list to trigger the SetOnTouch callback, I should work in the complete wide of the list, much more usable!

Now I see that if you set a height for the list it works as I said, all the width of the item is considered as a touch, if you leave the parameter blank it only triggers when touching the text, it's clearly a bug. 

Jorge Ramirez

unread,
Sep 5, 2014, 12:31:04 PM9/5/14
to androi...@googlegroups.com
Will there be any way to embed a new font on a program without using a webview? Is that possible in Android? I would love to change fonts!

I come back to this point, as I think it was never addressed.

In the possibility that is not possible to add custom fonts, could you consider adding FontAwesome to have some icons available and maybe deleting some of the img assets that are included on the APK currently?

FontAwesome.otf has 86KB of size and includes 479 icons:



Also it would be great to have let's say, 4 or 5 typefaces to choose

Thanks!

Dave Smart

unread,
Sep 6, 2014, 4:44:34 AM9/6/14
to androi...@googlegroups.com
Hi Jorge,

Thanks for the info... I'll take a look at it.

Dave Smart

unread,
Sep 6, 2014, 1:01:05 PM9/6/14
to androi...@googlegroups.com
Hi Jorge, I'm adding FontAwesome.ttf right now.

I will also try to add a way to load your own ttf fonts :)

(I also weeded out some of the unused assets and shrunk some by converting from png to jpeg)

Jorge Ramirez

unread,
Sep 6, 2014, 6:31:29 PM9/6/14
to androi...@googlegroups.com
You rock Dave!

Thanks!

(is there a way to use the font now or will it be programmed?)

Aerik Sylvan

unread,
Sep 6, 2014, 8:08:19 PM9/6/14
to androi...@googlegroups.com
+1 for background service, contacts access, and database access, in that order... displaying notificatins and flashing the led would be nice too.

Jorge Ramirez

unread,
Sep 7, 2014, 10:39:01 AM9/7/14
to androi...@googlegroups.com
Another thing, I would like to be able to use custom fonts on the image "canvas" for games too.

Thanks Dave!

Aerik Sylvan

unread,
Sep 7, 2014, 11:53:21 AM9/7/14
to androi...@googlegroups.com
Being able to directly launch the speech recognition function would be great - I did a little "car mode" app like Salvatore's, that speaks texts, and it would be really cool if it could then listen for a response without the user having to touch the screen...

Jorge Ramirez

unread,
Sep 7, 2014, 1:15:22 PM9/7/14
to androi...@googlegroups.com
I would like for the text edits a way to execute a callback on focus (for example when the user click on the textedit, clear the current text), something like:

.SetOnFocus( callback )

.SetOnLostFocus( callback )

.SetFocus() //to make the cursor go to that specific text edit

Jose Viña

unread,
Sep 7, 2014, 2:12:35 PM9/7/14
to androi...@googlegroups.com
Text-to-speech seems to be in English by default. I need to change the phone settings to another language and override the app settings from there if I want my program to talk in another language. Controlling the language of the TTS from the app would make it more flexible.

jose.

Steve Garman

unread,
Sep 7, 2014, 2:41:33 PM9/7/14
to androi...@googlegroups.com
.SetOnFocus( callback )
.SetOnLostFocus( callback )
.SetFocus() //to make the cursor go to that specific text edit

Can I just point out that this is a real can of worms waiting to be opened.

If a user clicks from one TextEdit to another, would we be able to guarantee in which order the OnFocus and OnLostFocus handlers fire?

If a user does some validation in the LostFocus handler, and it fails validity so the TextEdit sets focus back to itself, can we prevent the OnFocus callback for the other TextEdit firing?

Don't get me wrong, I'd like to see this available but we would need to know all the ramifications and they need to be documented

Jorge Ramirez

unread,
Sep 7, 2014, 2:45:25 PM9/7/14
to androi...@googlegroups.com
If a user does some validation in the LostFocus handler, and it fails validity so the TextEdit sets focus back to itself, can we prevent the OnFocus callback for the other TextEdit firing?

Why would you like to prevent the OnFocus callback on the second TextEdit not to fire? You as a programmer should be on charge to make the verifications for that kind of situation (for example checking on the LostFocus function that if nothing was done to go back to the previous state).


Jorge Ramirez

unread,
Sep 7, 2014, 2:46:24 PM9/7/14
to androi...@googlegroups.com
Also, doesn't work in this way on current javascript on html forms?

Steve Garman

unread,
Sep 7, 2014, 3:02:12 PM9/7/14
to androi...@googlegroups.com
Why would you like to prevent the OnFocus callback on the second TextEdit not to fire? You as a programmer should be on charge to make the verifications for that kind of situation (for example checking on the LostFocus function that if nothing was done to go back to the previous state).

I'm not sure I do want to prevent it firing. I just want to be sure I know what's happening.

I click from Text1 to Text2, t1_LostFocus Fires and t2_Focus (in which order? May not matter
t2_Focus blanks T2, t1_LostFocus sets focus back to T1
so t2_LostFocus fires, and t1_Focus?

blank is an invalid value for T2 so t2_LostFocus sets focus back to T2
T1 loses focus but it already has an invalid value.

This looks like a deadly embrace to me.

I'm not saying the programmer can't handle it, I'm saying he needs to know he's got to.

Apologies to Jorge, I may have sent this reply by Email to you  by accident

Jorge Ramirez

unread,
Sep 7, 2014, 4:41:51 PM9/7/14
to androi...@googlegroups.com
so t2_LostFocus fires, and t1_Focus?

t1_focus fires again...

 blank is an invalid value for T2 

blank should return T2 to it's original status, say T2.SetText("Insert your email...");

I don't see a problem unless you make that circular checking that I think you shouldn't be doing since the beginning. 

I would argue that setting focus when there is an error it's a bad practice, that would lead to all kind of problems if used that way.

Jorge Ramirez

unread,
Sep 7, 2014, 6:43:01 PM9/7/14
to androi...@googlegroups.com
The Text object could have an option to auto brake if larger than the screen, is it possible?

Dave Smart

unread,
Sep 8, 2014, 4:54:36 AM9/8/14
to androi...@googlegroups.com
Hi Jorge, 

The Text control has a "Multiline" option already, which causes text to wrap...is that what you mean?

Chris Hopkin

unread,
Sep 8, 2014, 5:15:25 AM9/8/14
to androi...@googlegroups.com
Hi Jorge

If it is breaking with ellipsis (...) on Text objects that you need, that will be in the next beta. 
This will be supported on Text and List controls - txt.SetEllipsize("end"); will cause the text to be broken with ... at the end if it cannot fit.

Chris

Jorge Ramirez

unread,
Sep 8, 2014, 9:34:39 AM9/8/14
to androi...@googlegroups.com
I would like to auto-wrap, this code doesn't work on my side:

//Called when application is started.
function OnStart()
{
//Create a layout with objects vertically centered.
lay = app.CreateLayout( "linear", "VCenter,FillXY" );

//Create a text label and add it to layout.
txt = app.CreateText( "Hello, this is a very long text to test this multiline text.", "Multiline" );
txt.SetTextSize( 32 );
lay.AddChild( txt );
//Add layout to app.
app.AddLayout( lay );
}


It gives this result:

It only manually wraps with "\n".

Jorge Ramirez

unread,
Sep 8, 2014, 9:37:38 AM9/8/14
to androi...@googlegroups.com
I just got that I wasn't setting a width for the text, if I set it it works as I wanted! thanks.

txt = app.CreateText( "Hello, this is a very long text to test this thing",1,-1, "Multiline" ); //this works!


Jorge Ramirez

unread,
Sep 16, 2014, 9:52:08 AM9/16/14
to androi...@googlegroups.com
I've seen some apps that when you open a numeric text field trigger my keyboard to be numeric only with bug numbers (like a numpad). Can we have an option for the textfield to do that?

Cheers!

Steve Garman

unread,
Sep 16, 2014, 4:30:49 PM9/16/14
to androi...@googlegroups.com
I'm with Jorge on the numeric keypad if possible (just starting with the numeric version of the standard keyboard would be better than nothing)

And while we're making unreasonable requests about the TextEdit, how about a password option? (echo the input as bullets, asterisks or what-have-you)
It would probably come in useful for some future plugin as well.

Steve Garman

unread,
Sep 16, 2014, 4:38:06 PM9/16/14
to androi...@googlegroups.com
Is there any chance of some sort of indication (maybe an app event or a TextEdit callback) when the keyboard is shown?

I would like to be able to hide it (which I can) and offer an alternative input method. 
Or I might have both the keyboard and my alternative in use at the same time.

It might also be useful to know when the keyboard is hidden.

salvatore fusto

unread,
Sep 22, 2014, 11:58:20 AM9/22/14
to androi...@googlegroups.com
In the last beta, i appreciated a lot, in the wifi IDE, the scrolling list of the projects, sorted too.
but on my tablet, even if a 10 inches model that sometimes i use to develop when out of office, projects go out of the screen on the right and on bottom side without scroll so i cannot see all them: can you add a scroll, Horizzontal and Vertical,  on the device too?
may be it's simpler to display app icons limiting Horizzontal disposition and scroll them only vertically
thanks and regards

Jorge Ramirez

unread,
Sep 23, 2014, 3:41:48 PM9/23/14
to androi...@googlegroups.com
I would LOVE a javascript "console" in the web IDE, it would speed prototyping 1000x

The way I picture it, under the debug window there would be a text input that would make it so that anything you input there it would be evaluated into the running program. 

For the little I know about how AndroidScript works I would dare to say that it's not that difficult to throw code to be evaluated from the WebIde to the phone.

That would rock to inspect variables, to change positions and colors of layouts, etc.

I think maybe this was discussed before, but I'm not sure so I repeat it here.

Thanks!

Dave Smart

unread,
Sep 23, 2014, 5:56:52 PM9/23/14
to androi...@googlegroups.com
That's a nice idea Jorge... I think we could do that fairly easily :)

sankarshan dudhate

unread,
Sep 25, 2014, 11:38:51 AM9/25/14
to androi...@googlegroups.com
Dave, I was working on question paper which was large size. It seems to cause problems and makes device slower and misbehaves. Please do something.

Jorge Ramirez

unread,
Sep 25, 2014, 12:13:16 PM9/25/14
to androi...@googlegroups.com
Hey Sankarshan, 

nice to see you again!

please open a New Thread on the group about your specific problem, include your code too, and we will be delighted to help you!

Cheers!

Marc Shapiro

unread,
Sep 30, 2014, 11:54:05 PM9/30/14
to androi...@googlegroups.com
When using the wifi editor it would be nice to be able to select any file in the selected directory to edit.  Say I have an app called App1.  It shows as App1 in the Apps tab, but it is names App1.js in the App1 directory.  I may also have a file in that same directory called App1Config.txt, or another Javascript file that is called using App.LoadScript().  I would like to be able to select any of these files for editing, not just App1.js.

Chris Hopkin

unread,
Oct 1, 2014, 5:22:54 AM10/1/14
to androi...@googlegroups.com
Hi Marc

In the next release of AndroidScript, the Wifi IDE will support editing of multiple scripts contained within your app directory.

Thanks

Chris
It is loading more messages.
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages