Tell us what you want!

6084 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

Cosmin Butnaru

unread,
Aug 15, 2014, 10:09:53 AM8/15/14
to androi...@googlegroups.com
I want:
-Gestures Support (swype, pinch to zoom, etc)
-Full Screen Mode
-Better IDE
-Bug Fixes
-Maybe support for some native code

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