2017년 5월 29일 월요일

I could convert my application from silver to gold with easy but...


Finally I could convert my application from silver to gold, and now I am very excited about returning to use appbuilder with the Gold version, without losing time to make the app from starting again. But I have a little problem dan give me headache.
I've created a table with javascript, you can see the sample script  in http://puravidaapps.com/table.php, I have modified these examples and in the table I also add an event to the following script:
tr.addEventListener ("click", function () {window.AppInventor.setWebViewString (this.innerHTML);}); and the result is as you see in the screenshots.
The question is, why in the Gold version, the EventListener can not be read? while in the Silver version everything goes well. For example, when I chose the second line (007 CELL) in the table below, in the Silver version, the block can read the line and produce a list of what I wanted, but in not the Gold version. Hopefully Mr. amerkashi or someone can help me.

Screenshot1 : Silver version

Screenshot2 : Gold Version


--
I haven't used Taifun's example. Maybe you want to post the question to him
--
Are you able to provide a solution to display a table like that, how about the GridView, whether it can display data as the table above?

--
This is a pretty nicely formatted table with colored header and row-highlighting (I think).
Gridview CAN display data in tableformat style, but not with the formatting that you are shwoing

--
It is sad if I have to stick with version Silver

--
I don't think it's an issue of the code example, since he says it works in silver.
I have a similar problem with the webviewstring not working properly, but it's a new project, I will test if it works on silver too. 

--
Yes, Jörg Hüneburg, I wait for the results of your project, and I hope you want to post the results here.

--
On click event works on silver, but not on gold.
Hossein, could this be an api problem with the webviewer or is it a bug?
I'll try to test on MIT too and report back

--
Please do let us know of your finding after you test on MIT.

--
I just finished the test, on click event works on MIT

--
I wonder if API has something to do with.
Will check into it.

--
I made this OCR project using tesseract javascript.
it works in silver and MIT, but not in gold

OCR.aia

--
Thanks Jorg for the sample .aia 
We are checking into it.

--
Trying the attached on MIT, it complains that ocr.html file is not found. However, I checked the .aia and indeed it includes ocr.html.

You don't see the same issue?

--
Never mind. I saw your flag for development vs production :o)

--

In gold it doesn't even show the text in the webviewer, as if javaScript doesn't work.
On silver and MIT you can see the progress of image detection in the webviewer

--
works for me



--
That's weird...
What device and which android version?

--
Hi on Honor 8 with Android 6 the Gold Version doesn't work with Silver and Mit version is ok.

--
@Jörg I used a modified companion when I tried this last night, now with the original it doesn't work for me either.

I would have to track back which modified version I used.

--
Does it work with compiled apk?

--
Hi, I've tried source of Jörg, and this result with LG G4 :

And this is what happened with my case :
 Thungkable          Appy Silver          Appy Gold

In thunkable, I can still make a list, but it should be displayed in a textbox first, the textbox will be displayed text like message in silver version ( show all the content & attribute of html table ). As you can see in the Gold, did not happen anything. 
But I believe mr husein are currently trying to fix it with satisfactory results. 
But anyway .... mr boban, whether the slide menu that you created could run in the Gold version? :), Sorry I ask you, because I like your slide menu, unfortunately what I made can only run in the silver version. I dont know how to make it functioning again in the Gold version.

--
ahh i think i had the targetsdk removed from my modified version

--
Thanks, I'll try that

--
Have you made any other updates to your companion .apk?

--
No i haven't, have been busy rebuilding my site and some testing of other things..

--
But anyway .... mr boban, whether the slide menu that you created could run in the Gold version? :), Sorry I ask you, because I like your slide menu, unfortunately what I made can only run in the silver version. I dont know how to make it functioning again in the Gold version.

what i have i'm not completely satisfied with it 

--
You are so kind, thank for Mr. Boban. I'll try tomorrow and let you know as soon as possible, because it's been midnight in my country :) 

--
wonder if this is the reason that javascript won't work if we have targetsdk above 19

--
could you show some screenshot

--
So, guys, is the problem with the webviewer fixed or maybe any solution? I want to know if i should use silver or gold for my app. Wouldn't want to start over if the problem persist.

--
Sorry Mr Booban,  I was late to report the results of your slide menu. I'm still having problems in Gold if compiled with ApptoMarket, the application will not running, I'm sure not because of your script, other than that I still have a problem with tables javascript, so I went back to silver, but by slightly modifying and combining scripts from you (baasmenu.xml for some screen that does not contain javascript and mycustomtheme.xml to some screen that contains javascript), so the result is I get the effect of Gold in the silver version for some screen, that's what I did, while I am quite satisfied with it.

--
I don't know yet, I'm having problems changing the targetsdk, but I'm sure there will be a fix in the future.
If your app relies heavily on the webviewer you should use silver. If not, definitely use gold, much more features

--
If you are using AppToMarket this no longer works
You have to manually remove it from apktool.yml file.

@Jörg
Have already tested with targetsdk 17,18,19 and doesn't work, just remove the targetsdk line


--
I'll try it out and report back

--
setting targetSdk to 18 didn't work.
We'll check into this issue and figure the issue. 

--
i use apk modder to remove sdk target

--
@Mr. massimo.antonini  Can you give me the link so I can download the apk modder 2 ? I ve googling but not find it, will you?

--
Yes..thankyou massimo

--
I've created a table with javascript, you can see the sample script  in http://puravidaapps.com/table.php, I have modified these examples and in the table I also add an event to the following script:
tr.addEventListener ("click", function () {window.AppInventor.setWebViewString (this.innerHTML);}); and the result is as you see in the screenshots.

@Handi zufaro: could you please provide the modified html file?
to have a clickable table would be a great enhancement of my table example...

--
@Taifun thanks for your response, and sorry because I did not ask directly to you as suggestions Mr.Husein, here is the script :

<!doctype html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<title>Table</title>
<style type="text/css">
table{ 
font-family: verdana;
font-size: 9px;
border: 1px solid #E3F3F9;
border-right: 1px solid lightgrey;
border-bottom: 1px solid lightgrey;
width: 100%;
background: #E3F3F9;
}

table th{
background: white;
border-top: 1px solid white;
border-bottom: 1px solid lightgrey;
border-right: 1px solid white;
border-left: 1px solid white;
color: red;
font-size: 9px;
height: 18px;
text-align: center;
}

table td{
border-top: 1px solid white;
border-bottom: 1px solid white;
border-right: 1px solid white;
border-left: 1px solid white;
font-family: Arial,Helvetica,sans-serif;
font-size: 9px;
height: 15px;
}    

table tr:hover{
background: white;
}
</style>
</head>

<body>
<div id="myTable" style="font-size:8px"></div>
<script>
function Calc(num)
{
num = num.toString().replace(/\$|\,/g, '');
if (isNaN(num))
{
num = "0";
}
sign = (num == (num = Math.abs(num)));
num = Math.floor(num * 100 + 0.50000000001);
cents = num % 100;
num = Math.floor(num / 100).toString();
if (cents < 10)
{
cents = "0" + cents;
}
for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3); i++)
{
num = num.substring(0, num.length - (4 * i + 3)) + ',' + num.substring(num.length - (4 * i + 3));
}
return (((sign) ? '' : '-') + num);
}
var urlArray = window.AppInventor.getWebViewString().split("\n");

var doc = document;
var fragment = doc.createDocumentFragment();
var S005 = 0;
var S010 = 0;
var S020 = 0;
var S025 = 0;
var S050 = 0;
var S100 = 0;
var TOTAL = 0;
for(i=0;i<urlArray.length;i++){
var tr = doc.createElement("tr");
var rowArray = urlArray[i].split(",");
tr.addEventListener ("click", function() { window.AppInventor.setWebViewString(this.innerHTML);});

 
for(j=0;j<rowArray.length;j++){
var td = doc.createElement("td");
if (i == 0) { var td = doc.createElement("th"); td.innerHTML = rowArray[j];}
else if (j == 0) { td.innerHTML = rowArray[j];}
else if (j == 1) { td.innerHTML = rowArray[j];}
else if (j == 2) { S005 = S005 + parseInt(rowArray[j]); td.innerHTML = Calc(rowArray[j]); td.setAttribute("align", "right");}
else if (j == 3) { S010 = S010 + parseInt(rowArray[j]); td.innerHTML = Calc(rowArray[j]); td.setAttribute("align", "right");}
else if (j == 4) { S020 = S020 + parseInt(rowArray[j]); td.innerHTML = Calc(rowArray[j]); td.setAttribute("align", "right");}
else if (j == 5) { S025 = S025 + parseInt(rowArray[j]); td.innerHTML = Calc(rowArray[j]); td.setAttribute("align", "right");}
else if (j == 6) { S050 = S050 + parseInt(rowArray[j]); td.innerHTML = Calc(rowArray[j]); td.setAttribute("align", "right");}
else if (j == 7) { S100 = S100 + parseInt(rowArray[j]); td.innerHTML = Calc(rowArray[j]); td.setAttribute("align", "right");}
else if (j == 8) { TOTAL = TOTAL + parseInt(rowArray[j]); td.innerHTML = Calc(rowArray[j]); td.setAttribute("align", "right");}
tr.appendChild(td);
fragment.appendChild(tr);
  }
}

var table = doc.createElement("table");
table.appendChild(fragment);
doc.getElementById("myTable").appendChild(table);

var row = table.insertRow(urlArray.length);
var cell1 = row.insertCell(0);
var cell2 = row.insertCell(1);
var cell3 = row.insertCell(2);
var cell4 = row.insertCell(3);
var cell5 = row.insertCell(4);
var cell6 = row.insertCell(5);
var cell7 = row.insertCell(6);
var cell8 = row.insertCell(7);
var cell9 = row.insertCell(8);

cell1.innerHTML = "GRAND"; cell1.style.fontWeight = 'bold';
cell2.innerHTML = "TOTAL"; cell2.style.fontWeight = 'bold';
cell3.innerHTML = Calc(S005); cell3.setAttribute("align", "right"); cell3.style.fontWeight = 'bold';
cell4.innerHTML = Calc(S010); cell4.setAttribute("align", "right"); cell4.style.fontWeight = 'bold';
cell5.innerHTML = Calc(S020); cell5.setAttribute("align", "right"); cell5.style.fontWeight = 'bold';
cell6.innerHTML = Calc(S025); cell6.setAttribute("align", "right"); cell6.style.fontWeight = 'bold';
cell7.innerHTML = Calc(S050); cell7.setAttribute("align", "right"); cell7.style.fontWeight = 'bold';
cell8.innerHTML = Calc(S100); cell8.setAttribute("align", "right"); cell8.style.fontWeight = 'bold';
cell9.innerHTML = Calc(TOTAL); cell9.setAttribute("align", "right"); cell9.style.fontWeight = 'bold';
var row = table.insertRow(urlArray.length).style.height= '1px'; 
var cell1 = row.insertCell(0);
var cell2 = row.insertCell(1);
var cell3 = row.insertCell(2);
var cell4 = row.insertCell(3);
var cell5 = row.insertCell(4);
var cell6 = row.insertCell(5);
var cell7 = row.insertCell(6);
var cell8 = row.insertCell(7);
var cell9 = row.insertCell(8);
</script>  
</body>
</html>

//=============================
Hope you can help, thanks

--
setting targetSdk to 18 didn't work.
We'll check into this issue and figure the issue. 
any progress on this 

--
Hope it can be resolved soon..

--

댓글 없음:

댓글 쓰기