2014년 12월 22일 월요일

Fusion Table doesn't always work

Help! My fusion table isn't always recording which image is visible.  (it''s supposed to record this.  I call this "stim").  It does it MOST of the time, not all the time. How can I fix this?

Discrimination B Training - Google Fusion Tabke



use Do it to debug your blocks, especially take a look at your global variable StimName
see also Tip 4 here 

Top 5 Tips: How to learn  App Inventor



It's not the username that's concerning me. It's the "stim" (image name) which isn't always coming up... I'll try DoIt again but last time it looked normal. That's prob why it's working most of the time.  But I'll try it again.



Here's the part of the blocks that names the images for the fusion table. 




And here's the "DoIt" response for my fusion table block.  I don't know why it says "stim35".  It shouldn't say that!
you will have to further debug your blocks
the screenshots you provided do not help us to be able to help you more


[App Inventor Open Source Development] Support for Java 8

I had tracked down the incompatibilities with Java 8 to guava, and
from there to Objectify, so I had a quick look and test with Jeff's
latest magical updates for GCS and voilà!

All libraries that needed updating have been updated, and I am running
my local server compiled with Oracle's Java 8 on mac. Will test on
Linux when I get a chance, but I'd appreciate some Windows backup. If
you guys have a chance, please report back.



Excellent!
Maybe someone with Windows and Linux can verify, and then we can update the developer docs (and our systems).



Tested on my machine. 
OpenSUSE Linux 13.2 64bit with JDK 8u25.
Successfully build and run on local server.



I'm only using the new guava on the server side. The old version is still used on the phone, in particular with the Fusion Tables and Texting components. So they may fail when compiled with Java 8. Obviously some testing is in order.

I do intend to update the libraries used on the phone (aka in the components) but that will require significant testing, and I didn't have time for that in our current "crises"mode.


Universal text size on any phone type.


Hi. How do I set the size of text so that it appears the same size across all phones? In other words I want my text to be the same size on any phone regardless of its pixel density.

-- 

At the moment, to have 'scalable' fonts on various sizes of device screens you have to do something like shown in this example discussing screen size  but will need toadapt it to the font also;

Universal screen size by Sajal Universal Screen Size Using App Inventor

Include a routine to set the font size of Buttons, Labels etc. to whatever you feel is appropriate for each screen size.  You can use the Advanced controls to change the fonts for all the Buttons, Labels and probably do this by proportioning the font to the screen dimensions.   There is no automatic way to do this with App Inventor 2 at present.  It would help to have available a third party emulator that can show you what the results would be on various devices.

--
Ok. Do you know how to scale font sizes? Increasing the size of a button or label does not also increase the font size.

--
Sure. :)      For a label, the default font size is 14.0    Change that to a larger value to get a larger font by using set Label.FontSize to 20  perhaps and see what it renders to.  You also can change the font size in the Designer Properties bin, but to work with different size screens, you will have to use Block code.

Correct, Increasing the size of a button or label only changes the dimensions of the control's footprint.

It is easy for a developer to experiment with these properties in the Designer.

--
In my opinion, there is currently no way to adjust font size according to screen size. Using the example above, we can resize buttons/labels proportionally. In theory proportional re sizing can also be done for fonts (either as button or text on canvas) but it hits a snag because font size is in pixels and different phones have different pixel densities. Default is 320x480 and if you imagine a tablet as being 1200x800, then it will scale the font but will hit a snag for HD phones which have 1080x1200 resolution i.e. display will be even bigger on HD phone than tablet. 

I think this generally ties in with posts related to scaling for tablets.I'd personally love to see this resolved and there seems to be an encouraging blog post

--
App Inventor doesn't currently have support for what Android developers call "responsive design", i.e., making apps look good across different screen sizes and different pixel densities.   We're moving toward that to a limited extent.  We're hoping to update the App Inventor system to API Level 4, and implement "density independent pixels".  Look for that in the first quarter of 2015.

Once that's done, we'll have  look at switching to "scalable fonts"l which will address some of the issues ecivon mentions. But only some of them.

--

Unable to correctly open a project in AI2

I'm maybe not in the right forum. If this is the case forgive me.
I am trying to develop a multi-screen project.
Until yesterday afternoon, no problems: the first 8 screens worked perfectly.
Since last night, after integration of a ninth screen, impossible to openthe project without getting the error message "An internal error has occured."
If I "force" the opening, the project appears. But only the first 2 screenswork.
If I try to open another screen I get back the error message "Internalerror".
It is likely that the error comes from the screen 9 itself.
The project is saved in the cloud of MIT but I do not have a copy of the file .aia
Is it possible to recover at least the first 8 screens?
If so, where or who to ask?




I'll pass this to the person that does it.  But first I have to know at whattime was the project OK (don't guess at this... be sure...), and what's the name of the project as it appears in your My Projects screen?



the project has worked well up to about 18 hours (French time)yesterday.
I have a working version of APK installed on my smartphone (samsung galaxy s4 mini).
Project Name: aide_photo
Component of the 9th screen:
Design: some labels, 8 buttons, 2 checkbox(can be the source of the error)
Blocks: some math formulas (tested with Exel) triggered "onclick"

But ..... right now, the project seems to have disappeared from the list :( :(

To be quite frank, there were two projects in the list respectively named:
aide_photo
and
Aide_photo.

I deleted (this morning) Aide_photo (which was just a test).
I do not know if the projects titles are interpreted as "case sensitive". If so, maybe the system has deleted the two simultaneously.
In which case I suppose I just have to cry .... and redo the project :) :)




I was unable to recover the project.



AS you can see by the message above, Jeff was unable to get your project back.  Projects are case sensitive... that's why you can have two on the project list with the same name, but different capitalization.  

However, if more than one project is selected in the My Projects list, they all get deleted.  Also, once a project is deleted, it's apparently deleted completely.

Do you have ANY AIA files you can go back upon?  If not, PLEASE read my tips below... you always want to have several AIA backup files...




I have already rebuilt the first eight screens of the project.
it works well (project name: PhotoTips)
For the 9th screen and the next, I'll do it prudently
I understand the need to back up .aia files on my computer.
From now it will be done regularly.



the path of the upload file

Who know the path of the upload file? My upload html file can't be seen with web viewer, what kinds of problems could be? Thanks



This example by Taifun might help http://puravidaapps.com/snippets.php#2htmlread     .    We are not sure what you are trying to do with an html file.

Is this example what you want to do?



It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.



I attach the upload html file. This file is used to get current location and translate the latitude and longitude to Baidu map's latitude and longitude(Baidu map is a Chinese map, we can't use Google map in Chnia) I try this html file in my phone with UC browser(Chinese browser), and it works well, but I can't use AI's web viewer to open it.




your html file dos not help very much here

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.



OK, you are getting your map from map.baidu.com/  ?     and you need to post your latitude and longitude to that Web page?    Is that the issue?      or did you try to download the html of that page into your assets?


The Baidu Maps API is here:  

You said you can not use Ai's WebViewer to view the map.   Did you know that you can probably use ActivityStarter instead to open the page?
Does this help?  



Both the Webviewer and ActivityStarter can view a map at Baidu if you are using your device.  The web pages do not load if you use the emulator.
Either of the two buttons will elicit the Baidu maps, an image from my tablet is shown below.

I expect that you can enter the latitude / longitude information either directly, using the ActivityStarter with that information in the url or using the Web component.  Do some experimenting and visit the Baidu developers page which should have some information in the section regarding browsers showing a script of how to enter latitude/longitude.     There is also an Android SDK that might give you some hints.



I use html5 to catch the current location data in my html file, and load the html file into my assets. My user may not install the map APP in their cell phone, so I don't use activitystarter.



Thank you Steve. My html file can work in the cell phone browser, but can't work with web viewer(I upload it into my assets). Does web viewer support html5? Because I use html5 to get the current location data.



unfortunately you did not provide a screenshot of your relevant blocks, so we can't see what you are doing


Dictionaries and Modules?

Having programmed for years in scripting languages (Python, Perl, Bash, et. al.), I really miss some features in ai2, most notablyDictionaries (Associative Arrays) and Modules (Libraries).
Are there plans to add these features in future App Inventor's versions?



Maybe, possibly sometime way down the line, but I doubt you'll see it any time soon.




Maybe, possibly sometime way down the line, but I doubt you'll see it any time soon.

Thanks Enis.
BTW, are there any URLs I can pursue that will help me implement my own extensions to ai2? 



see the MIT App Inventor sources and the forum of the App Inventor Open Source Development here https://groups.google.com/forum/#!forum/app-inventor-open-source-dev


How to set Listpicker in landscape

I am new in app inventor. Please kindly let me know how to set listPicker in landscape mode. I already try to set my main screen into landscape but when i start the listpicker. A list of element is still shown in portrait mode. Please help and guide me how to do. Thanks in advance.






if the screen orientation of the screen is defined as landscape, the listpicker should also display only in landscape

I just tried it and can confirm that issue, the listpicker displays in landscape and if you turn the device, it displays in portrait which looks like a bug...



Thank you for your quick reply and kind help. I have attached my block diagram here too. I want my user who clock the listpicker button. A bluetooth device list will be displayed in landscape instead of portrait. Is it really a bug or i do something wrongly? Thank you.




You're missing something... use the orientation blocks under the screen drawer to set the orientation for the list before.picking



Can you show me how to create the orientation block? Or any tutorial link on this part?thank you



To test how to setup a landscape orientation in listpicker, I try to design a very simple test apps. Please see the attached screenshot. Emulator shows that the list contain "a" and "b" in landscape mode-just follow the same orientation as the main screen1.However, when i run the complied apps in my handheld, android kit kat. The list is displayed in protrait instead of landscape. Is it really a bug or i miss something here?





as already said, I can confirm your issue.
please add your aia file of your test app into this thread, this will help MIT to fix this bug



Please confirm this as the correct description of the bug:

The listpicker's orientation is determined by the physical orientation of the phone, rather than by the screen Orientation property. In other words, if you hold the phone
oriented as a portrait, the listpicker will display in portrait mode, regardless of how the screen orientation property is set.   If you hold the phone oriented as landscape, 
the listpicker will display are landscape, regardless of how the screen Orientation property is set.   If you rotate the phone, the listpicker will rotate (sensor mode, just as the screen 
rotates in sensor mode).

Is this the accurate description of the issue?



Thank you for your help. Maybe i post the aia file and the corresponding screeshot later for MIT team to further investigate. I did a test for my galaxy nexus and samsung galaxy S5. It also has the same case as described before. .

My case is:

1. I set the main screen in landscape and try to add a listpicker button on the main screen
2. When i click the listpicker button. What i expect is to have a bluetooth device list which displayed in landscape instead of portrait.

With no luck, ai emulator just shows what i expected to do in my test apps- Bluetooth device listed displayed in landscape just the same as the orientation in screen1.

But for the real physical device, samsung galaxy and samsung S5, bluetooth device list is not tight with the orientation properties in screen1,which means bluetooth device list is displayed in portrait instead of landscape.And of course, screen1 is still displayed in landscape.



I have attached full set of file here. As per said, the orientation of the generated list is not tight with the orientation in screen1. The result show in emulator is not the same as what i can see in real physical device. Maybe someone can guide me on how to set landscape in listpicker? Thank you.









Yes, i confirm your description is correct. 

Case 1:
If i disallow orientation rotation in my handheld, screen1 is displayed in landscape where listpicker's orientation is in portrait mode.

Case 2:
If i allow orientation rotation in my handheld, screen1 keeps in displayed in landscape while listpicker's orientation just follow the handheld's physical sensor.It means "The listpicker's orientation is determined by the physical orientation of the phone, rather than by the screen Orientation property."

Please let me know if i need to provide any further info.Thank you



Thanks.  I'll file this as a bug for us to fix.




This has been fixed and will appear in a system update soon.

Thanks for reporting it.





Good to hear that. Thank you for you and MIT team's effort.