Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Hangout link for right now

2,711 views
Skip to first unread message

Jos Flores

unread,
Apr 27, 2013, 12:02:08 PM4/27/13
to app-inventor-o...@googlegroups.com

Jos Flores

unread,
Apr 27, 2013, 1:42:19 PM4/27/13
to app-inventor-o...@googlegroups.com
The recording is available at: https://www.youtube.com/watch?v=PgVX2NigkjU

Thanks to Hossein and Gareth for the demos and the fantastic projects
they are working on!

cheers,
José


On 27 April 2013 12:02, Jos Flores <josmas...@gmail.com> wrote:
> https://plus.google.com/hangouts/_/bb533932dc31f91f7f42b985a9a0766331ef5861?authuser=0&eid=116831753302186936352&hl=en-GB
>
> cheers,
> José

Taifun

unread,
Apr 27, 2013, 5:01:08 PM4/27/13
to app-inventor-o...@googlegroups.com
I just watched the video and I'm very impressed!
Looking forward to the SQLite solution! Also Gareth's tool will be very helpful!
Keep up the good work!

Concerning SQLite:
I like to suggest to use one block only similar to the fusion table component which is FusionTable1.SendQuery, in this case it would be SQLite1.SendQuery.
Avoid the redundancy and keep it simple! Don't worry about the developers. To be able to use the new component, they will have to be familiar with the SQL syntax anyway, else they will not be able to use it successfully (same by the way with the fusiontable component...) Also I would put the new component into "other components" instead of "basic components"...
Each statement should provide a result:
the create table and drop table statements could provide "true" if everything was ok
the delete, insert and update statements could provide the number of rows affected

@Jos: Are there any news concerning the NFC component, which has already been announced more than 1 year ago?
http://nfctimes.com/news/university-launch-nfc-app-inventor-ease-development-apps
http://www.technology-digital.com/smart_phones/near-field-communication-is-here-to-stay

Taifun

M. Hossein Amerkashi

unread,
Apr 27, 2013, 5:57:09 PM4/27/13
to app-inventor-o...@googlegroups.com
Great, glad that you all find that it could be a useful component.

Based on comments, I think it would be better to just have one block; as suggested: SendQuery. What I was attempting was to avoid sort-of once catch-all block, but I think, it would make sense for the one block. I'll check into feasibility.

I have to make a correction on what I stated in demo. I stated (or confirmed) that result is basically a list of list. The way I have it set up is actually a list of CSV rows. For example if you get item 10, it should return row 10, in csv format, from the result set. Also, I was thinking about adding a property that would indicate if column headers should be returned or not. Currently, the column headers are dynamically determined and unconditionally sent back. Might be better to allow user to indicate if s/he wants the column-headers or not.


This component will go into 'Other Components'

-Hossein.





--
You received this message because you are subscribed to the Google Groups "App Inventor Open Source Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to app-inventor-open-so...@googlegroups.com.
To post to this group, send email to app-inventor-o...@googlegroups.com.
Visit this group at http://groups.google.com/group/app-inventor-open-source-dev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jos Flores

unread,
Apr 27, 2013, 6:30:25 PM4/27/13
to app-inventor-o...@googlegroups.com
Hossein, sounds good. If one block is not feasible (technically), you
could also think of maybe two blocks, one that returns results (for
queries), and one that just indicates if the operation was successful
or not (for create/drop and so on); would that work or make things any
easier?

cheers,
José

James Hancock

unread,
Apr 28, 2013, 1:29:10 AM4/28/13
to app-inventor-o...@googlegroups.com
Just watched, 
Gareth, great creativity and certainly you have identified plenty of relevant use cases from a users perspective, looking forward to this.
Hossein perhaps the documentation can provide most of the clues on construction or SQL statements for users, how fast is this ? Seems like a natural progression for the future would be to have this sync with an online mysql db as they would use the same query language and potentially same block format as suggested above ?  

 

M. Hossein Amerkashi

unread,
Apr 28, 2013, 6:59:19 PM4/28/13
to app-inventor-o...@googlegroups.com
No problem. One block is possible. I already do have a version working.
Also, I implemented logic for accessing individual rows using 'select list item'
I'll try to publish a version into my AI instance by EOD EST today so that those interested can experiment with.

-Hossein.
>> email to app-inventor-open-source-dev+unsub...@googlegroups.com.
>> To post to this group, send email to
>> app-inventor-o...@googlegroups.com.
>> Visit this group at
>> http://groups.google.com/group/app-inventor-open-source-dev?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "App Inventor Open Source Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to app-inventor-open-source-dev+unsub...@googlegroups.com.

M. Hossein Amerkashi

unread,
Apr 28, 2013, 10:29:45 PM4/28/13
to app-inventor-o...@googlegroups.com
See latest version on my AI instance here: http://hosseinamerkashi.appspot.com

You can use my sample app from HERE to experiment with.

-Hossein.


Jos Flores

unread,
Apr 28, 2013, 10:36:08 PM4/28/13
to app-inventor-o...@googlegroups.com
Hey Hossein, are you going to share the links in the instructors forum?

cheers,
José
> --
> You received this message because you are subscribed to the Google Groups
> "App Inventor Open Source Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to app-inventor-open-so...@googlegroups.com.

M. Hossein Amerkashi

unread,
Apr 29, 2013, 9:09:27 AM4/29/13
to app-inventor-o...@googlegroups.com
James,

Re SQLite component performance, performed a quick test. On employee table (columns: id, fk_id, name, ssn - see attached, replaced 10 with 1000):
  • insert: 1,000 rows took about 9 seconds
  • select (retrieve 1000 rows):  < 1 second ~ 1/2 second

-Hossein.
SQLiteApp.jpg

Taifun

unread,
Apr 29, 2013, 9:53:46 AM4/29/13
to app-inventor-o...@googlegroups.com
this looks very nice Hossein!
concerning the SQL keywords to use: could be used anything of the language listed here http://www.sqlite.org/lang.html or are there any restrictions?
Taifun

Derrell Lipman

unread,
Apr 29, 2013, 10:01:00 AM4/29/13
to app-inventor-o...@googlegroups.com
On Mon, Apr 29, 2013 at 9:09 AM, M. Hossein Amerkashi <kkas...@gmail.com> wrote:
James,

Re SQLite component performance, performed a quick test. On employee table (columns: id, fk_id, name, ssn - see attached, replaced 10 with 1000):
  • insert: 1,000 rows took about 9 seconds
sqlite ensures that data is written to disk before returning to the user, for each "transaction." If you do not explicitly create a transaction, each INSERT query will be its own transaction. Rotation speed of the disk then becomes your bottleneck. With 9 seconds to write 1000 rows, it sounds very much like this test is not beginning a transaction in which to do the 1000 inserts. If you do BEGIN TRANSACTION, followed by the 1000 inserts, followed by COMMIT TRANSACTION, I suspect you'll get that speed down to well under one second.

Cheers,

Derrell

M. Hossein Amerkashi

unread,
Apr 29, 2013, 10:13:48 AM4/29/13
to app-inventor-o...@googlegroups.com
That's the site I used. I haven't really tried the entire list, but any valid sqlite command should do.
Re the site, I think that the pages might be too complicated for some users. I tried to find a cheatsheet that has commonly used sqlite statements, but didn't really find one that was that useful. If you can, please do a search and see what you come-up with.  I also may go ahead and as part of documentation, put something together with examples.


-Hossein


M. Hossein Amerkashi

unread,
Apr 29, 2013, 10:19:21 AM4/29/13
to app-inventor-o...@googlegroups.com, derrell...@unwireduniverse.com
Derrell,

The test was a simple test that and not include transaction for the batch; each row insert was transacted independently of the other.

-Hossein.

Taifun

unread,
Apr 29, 2013, 1:45:15 PM4/29/13
to app-inventor-o...@googlegroups.com

I tested a little bit, great job! Your examples work fine!

I additionally tested using that example http://zetcode.com/db/sqlite/introduction/ and I found out that somehow transactions don't work?
In the screenshot you can see I first tried to RunQuery each statement separately and got a "false" back with the "end transaction" statement (I also tried "commit" instead of "end transaction")
Then I tried to execute the transaction in one block with the RunQuery block, this results in true but there are no records in the table?

Some "nice to have" features:
if there is a syntax error in the sql statement it would be nice to get some kind of error message back instead of only "false"...
for insert, update and delete statements it would be nice to get a message "n rows affected" back instead of only a "true"
for the select statement it would be nice to define, if you like to get the header of the table back or not

again: great job!
Taifun

SQLite2.zip

M. Hossein Amerkashi

unread,
Apr 29, 2013, 1:58:15 PM4/29/13
to app-inventor-o...@googlegroups.com
On Mon, Apr 29, 2013 at 1:45 PM, Taifun <taifu...@gmail.com> wrote:

I tested a little bit, great job! Your examples work fine!
Thanks

I additionally tested using that example http://zetcode.com/db/sqlite/introduction/ and I found out that somehow transactions don't work?
In the screenshot you can see I first tried to RunQuery each statement separately and got a "false" back with the "end transaction" statement (I also tried "commit" instead of "end transaction")
Then I tried to execute the transaction in one block with the RunQuery block, this results in true but there are no records in the table?
In order to have transactions, basically, the series of insert statements has to be passed in together in one-shot to the query. Then once the query is run it should basically do something like below. The way you currently have will not wrap into a transaction. This type of processing is like a batch and currently batch processing is not supported in my code. Not really sure if this capability would be necessity. Maybe for v2 of this component?? I
Begin transaction
insert
insert
insert
....
end transaction
commit

 

Some "nice to have" features:
if there is a syntax error in the sql statement it would be nice to get some kind of error message back instead of only "false"...
Yes, I have been looking into that. Will see how this can be accomplished
 
for insert, update and delete statements it would be nice to get a message "n rows affected" back instead of only a "true" for the select statement it would be nice to define, if you like to get the header of the table back or not
Yes, that would be nice, but haven't really found a way to accomplish this in sqlite. Will keep checking into this.  

again: great job!

Jos Flores

unread,
Apr 29, 2013, 3:22:59 PM4/29/13
to app-inventor-o...@googlegroups.com
I wouldn't worry too much about rotation speed of the disk in a mobile device. You are probably going to be inserting one or two rows at a time in most cases (if you are gathering data through your app), so shouldn't be much of a worry.


cheers,
José

M. Hossein Amerkashi

unread,
Apr 29, 2013, 3:30:31 PM4/29/13
to app-inventor-o...@googlegroups.com
Good reading; love the YAGNI :) http://c2.com/cgi/wiki?YouArentGonnaNeedIt

-Hossein.

James Hancock

unread,
Apr 29, 2013, 7:06:12 PM4/29/13
to app-inventor-o...@googlegroups.com
Did a few lat, long selects based on a bounding box, nice ! This will open lots of doors.
 


M. Hossein Amerkashi

unread,
Apr 29, 2013, 7:27:00 PM4/29/13
to app-inventor-o...@googlegroups.com
Great James; can you show screenshot so that we can see what you've done?

-Hossein


On Mon, Apr 29, 2013 at 7:06 PM, James Hancock <abb...@gmail.com> wrote:
Did a few lat, long selects based on a bounding box, nice ! This will open lots of doors.

Abraham Getzler

unread,
Apr 30, 2013, 12:37:22 PM4/30/13
to app-inventor-o...@googlegroups.com
Great Job!

For error return, would the reserved error code names from http://www.sqlite.org/c3ref/c_abort.html
and http://www.sqlite.org/c3ref/c_abort_rollback.html appear
as True/False named subfields in the SQLiten tray in the block editor?
(App Inventor does not allow bitstring operations yet.)

Or would they appear as green error event handler blocks?

James Hancock

unread,
Apr 30, 2013, 10:31:20 PM4/30/13
to app-inventor-o...@googlegroups.com

I deleted it but, here is a very simple bounding box, note item 3 excluded.
Occurs to me also this now allows a much simpler method of doing web mashups - on the device
-Populating fields based on calculations or web lookups from data in other fields. 



张跃

unread,
Sep 22, 2013, 10:16:50 PM9/22/13
to app-inventor-o...@googlegroups.com
Is this a compoent for current released AI?can I add this component to my local AI develop tools? Where can I download it?and how to install it.
thanks a lot

在 2013年4月28日星期日UTC+8上午12时02分08秒,Jos写道:
https://plus.google.com/hangouts/_/bb533932dc31f91f7f42b985a9a0766331ef5861?authuser=0&eid=116831753302186936352&hl=en-GB

cheers,
José

M. Hossein Amerkashi

unread,
Sep 22, 2013, 10:53:43 PM9/22/13
to app-inventor-o...@googlegroups.com
It is actually available in an offline / standalone distro version of AI called AiLiveComplete! which can be downloaded HERE. Attached is a sample SQL lite source that you can import and experiment with.

For setup and run of AiLiveComplete!, see YouTube HERE.

-Hossein.



--
You received this message because you are subscribed to the Google Groups "App Inventor Open Source Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to app-inventor-open-so...@googlegroups.com.
To post to this group, send email to app-inventor-o...@googlegroups.com.
SQLite3.zip

Robert Balejík

unread,
Nov 21, 2014, 5:24:47 AM11/21/14
to app-inventor-o...@googlegroups.com
so it means  if I wanna can 'run' SQLite in appinventor I've to download your AILiveComplete ? and does it run it on Linux?

Dne sobota, 27. dubna 2013 18:02:08 UTC+2 Jos napsal(a):
https://plus.google.com/hangouts/_/bb533932dc31f91f7f42b985a9a0766331ef5861?authuser=0&eid=116831753302186936352&hl=en-GB

cheers,
José
Message has been deleted

Robert Balejík

unread,
Nov 21, 2014, 5:30:37 AM11/21/14
to app-inventor-o...@googlegroups.com
and another question is it possible to do this with AI2 -cause  I'm runnin this version

Jos Flores

unread,
Nov 21, 2014, 5:34:35 AM11/21/14
to app-inventor-open-source-dev

Please use the AILiveComplete forum for questions about that distribution. Thanks!

--------------------------------------------
mobile. brevity.typos.cheers

--
You received this message because you are subscribed to the Google Groups "App Inventor Open Source Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to app-inventor-open-so...@googlegroups.com.
To post to this group, send email to app-inventor-o...@googlegroups.com.
Visit this group at http://groups.google.com/group/app-inventor-open-source-dev.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages