2017년 7월 9일 일요일

gps time


I'm looking for a extension that give me additional gps info as time information sent by satellites.
someone can help me?

--
I need keep the internal clock of an Android device accurate by synchronizing it with the GPS time signal.

-- 
what about using an API, which provides the current time?

--
thanks Taifun, but I need a time "without" latency:
If two device taking time by web, them can have a relative time offset also di 200 ms. Instead gps time is more accurate, but unfortunately app inventor give gps access but without this feature. So I'm looking for a extension that do this.

-- 
I think, this should be possible, see this snippet here GPS-time in Android
In case you like to be the sponsor of a location sensor extension, please contact me by email. thank you

-- 
To get GPS time it is necessary for your Android to strip the ephemeris data from a satellite NMEA data string.  Currently GPS time is ahead of UTC by about 6 seconds.

You don' explain why you need such accuracy (Time posted from a satellite can be accurate to about 40 ns).  To get this precision you need 
to  get a satellite fix, receive the data on your Android, and probably either compare the data with something internal or display the data on the device's screen.  Your problem begins here.  

AI2 graphics display on AI2 apps is inherently slower than display using apps compiled with Java compilers, the lag in satellite acquisition (this depends on the device location - in a parking garage or out on the highway makes a difference) and the time to parse the NEMA string all contribute to a delay in using the ephemeris information to displaying it.

If someone were to write an extension to receive the NEMA data, you would have access to GPS time information.  How accurate would that data be?  You are expecting an answer with less that +/- 200ms.   I am not sure that is possible coding with AI2.  Just pushing a button on your device will not provide the exact time of the touch.  The cumulative affect of the 'delays' acquiring the NMEA string, processing it and displaying it will mess that up.   If you do perchance write an extension, be sure to test it against an atomic standard

Check out http://www.time.gov/  .  It provides an accurate time standard corrected for network delay that might be appropriate for your use requirments.

--
In My app isn't necessary show time on screen, I need only that two android device are synchronized with accuracy better than NTP approach (200 ms). Considering that I can't send time between device by sms, Bluetooth or other way I've thought to GPS.
Ai2 GPS blocks doesn't give all satellite parameters but there are app on play store to do this. So I'm sure that is possible, so I've two possibility:
1) looking for an app on play store to synchronized preliminary two devices and after run my app;
2) include in my app an extension to synchronized devices too.

Suggestion are appreciated.

--
Perhaps the app described here:  https://android.gadgethacks.com/how-to/set-your-android-atomic-time-for-perfectly-synced-clock-0170500/    ?  Each user sets his own Android...you assume you are syncronized.

Here is a link to a Java program to capture NMEA sentences    http://www.programcreek.com/java-api-examples/index.php?api=android.location.GpsStatus.NmeaListener  .  Unlike relying on a location change event to acquire the 'GPS' time, something like this should constantly monitor the data streams from all the visible satellites.  A timestamp can be found on most of the available  data streams.  This technique does not depend on a location change event, it would simply capture every beacon stream the satellites send   The various data streams are tagged $GPRMC , or $GPGGA etc.  Google "NEMA sentences" for more examples.     The satellites constantly send this beacon data and can be received as long as the device's GPS is turned on.

For example   $GPRMC,040302.663,A,3939.7,N,10506.6,W,0.27,358.86,200804,,*1A    The time is in the form "HHMMSS.XXX," where HH represents hours, MM represents minutes, SS represents seconds, and XXX represents milliseconds. The above value represents 04:03:02.663 AM UTC.  Keep in mind the 6 seconds difference between what the satellite reports and UTC if that is an issue.

I read somewhere where Android devices/clocks don't keep time to ms precision, only seconds.  That is going to be a problem.

-- 
do you think that this java code is sufficient to do an ai2 extension?

--
The Java example code will allow one to display $GPRMC and $GPGGA data strings. Once you have the string, the developer would have to parse it to extract the time and other satellite information (depending on the actual string you can get the satellite altitude and position in the sky etc. I assume the code will work (I haven't tested it - haven't use Android Studio in several months), one has to try. Is the code sufficient to do an ai2 extension? Well, it appears it can be used to get the data streams. In your case, either additional code would have to be added to capture the time or the time can be parsed using AI2 blocks. The parsing could be done in the extension I suppose.

The Java should allow creation of a block providing one or more NMEA data strings. With more work the extension could have a block providing the time, another for the elevation angle etc. It depends what data string information one needs to work with.

--
the problem is do extension now...
are there video tutorial about how do an extension?

-- 
Step by step explanation of how to make an extension    The process of the creating extensions for you


there may be more.

-- 

Tutorial creation extension App Inventor (Video)


Read pinstate arduino script


I'm trying to create an app that can read the status of the Arduino outputs.
I made a button to turn the light on and a button to turn off the light.
If I do the light of the app has to see whether the light really is on (status output)
But how do I get to see this.

Screenshot of the APP and the Arduino script


--
What happens if you try your app?
I think you should add some diagnostics to your app, for example put some (temporary) labels in your design and fill them with responseCode, responseType and responseContent, whenever the Web1.GotText event is triggered. In this way you can find out that something happened and if it is not what you expected, what the problem may be.
Here is a nice tutorial that may help: ESP8266 Controlled with Android App (MIT App Inventor)

The nice thing about App Inventor is that you can try it out of your mind, just as long as it works!

-- 
Have looked at the link and this built in my APP but unfortunately it does not work.
The APP i exported to .aia.
Hope you can see what I'm doing wrong.


-- 
I Will take a look later, but I do not have an ESPxxx so we Will see.
The problem is not that it does not work, no programming job ever works first time, but what the symptoms are and what the app you have really does.

--
I can through the APP or the light on and off, but do not get feedback from the Arduino.Normally goes through "Serial.write" I thought as below
The text of "Serial.write" for example "licht aan" must be labeled "Werkblad_status"


   if(request.indexOf("gpio/1") >0){
      digitalWrite
(2,1);
      
Serial.write("licht aan");
    
}
    
if(request.indexOf("gpio/0") >0){
      digitalWrite
(2,0);
      
Serial.write("licht uit");
    
}

-- 
In the app as you have it now, you just set the URL, so i am amazed that anything happens at all!
In your orginal setup you did Web1.Get and a had a Web1.GotText, now you do not have these, so I am not surprised nothing happens. I am surprised that you can switch your LED's!
So, put in the Web1.Get again and the event block, and do as I said with the debug labels, or you could put in a notifier to see what you received.
In addition I am wondering about your Serial.write(). For a piece of text I would think that you would use Serial.println(). You need the ln part, otherwise the server will think that you will be writing more.

Alternatively, you could try to use the Randomnerd app. It uses a WebViewer component instead of the Web component. Maybe you could also use his sketch at first to see if everything works. And when it does, change it so that you get your nice design back. First make it work and then make it nice is a very good principle in computing.

-- 

Reading a cell value in CSV File


I would like to develop an app from a CSV File which gives premium through Age Vs Sum Insured Table.  There would be Two List Pickers pertaining to Age and Sum Insured. I wish to fetch the Premium Ultimately. What is the best way to develop without using Web components. I would like to develop this in such a way that the user doesn't need internet access to work with the app. Attached is the screenshot of the Table in CSV File.


--
First of all, try to get familiar with lists:
lean how to work with lists and use the select list item block to select an item from a list
⦁ How to work with Lists and Lists of lists (pdf) by appinventor.org
Then, make a csv table out of your table and load it as an asset in your app. Use the list from csv table block to load your table and search through it as you know now how to do as per the previous step. Then, if there is something not clear, post here again with a screenshot of the blocks you tried.
I have a question about not wanting to use an internet connection, though. Is your table ever going to be updated? If yes, you must think of being able to update the data in your app, without having to send a new app to all your users. The answer depends also on how many users you have and how frequently the table is going to be updated. 
--
Hey! Thanks for your swift reply.

My table is never going to be updated. It is static. I think, If I get this using CSVs I think it won't require internet connection as the file will be in the "Assets". Moreover the end user has to just view the premium. There won't be any modifications / uploading from his end also. So, I don't think Number Of users is relevant in this case. 

I've tried some basic thing on this - attaching the same. You throw some light on how to go further. I am not getting how to use "List from CSV". 



--
You can do this with a three column (age, suminsured,premium) table and the Select
 and WHERE_EQ procedures from this doc and app: Build Your Own DB - Part 1

--
perhaps this is an off-topic (sorry), in this table with two dimensions I choose a column and a row and I get the data.

This is a Spanish tutorial about this app.




--

Reading a Cell Value


I would like to develop an app from a CSV File which gives premium through Age Vs Sum Insured Table.  There would be Two List Pickers pertaining to Age and Sum Insured. I wish to fetch the Premium Ultimately. What is the best way to develop without using Web components. I would like to develop this in such a way that the user doesn't need internet access to work with the app. Attached is the screenshot of the Table in CSV File.


--

I would like to develop an app from a CSV File which gives premium through Age Vs Sum Insured Table.  There would be Two List Pickers pertaining to Age and Sum Insured. I wish to fetch the Premium Ultimately. What is the best way to develop without using Web components. I would like to develop this in such a way that the user doesn't need internet access to work with the app. Attached is the screenshot of the Table in CSV File.



--
Please ask for help in the Programming forum:
https://groups.google.com/forum/#!forum/mitappinventortest 


This one is for developers working on the App Inventor sources. 

--

Camera with rotated image! Why?


On my YouTube tutorial, using a camera, displays an image with the picture shown correctly. But my test app it is displayed rotated 90 degrees. I have put the app on three different phone and the result is the same. Please tell what I did wrong? 

--
This is a common problem. I am not sure whether that is APP Inventor or some Android feature.
You could use Taifuns image extension to rotate the image: http://puravidaapps.com/image.php

-- 
Thanks! Using ParaVidaApps I downloaded 'Rotate' and then tried to import the aia. After unzipping I was shown 3 files associated to Rotate, not the aia. Where did I go wrong? 

--
See the App Inventor Extensions document about how to use an App InventorExtension and download the aix file, then import the extension into your project.


The aia files you downloaded are test apps you can use to test the new methods
To unzip an aia file does not make much sense, does it?

--
I checked your Extensions document and expected a selection of extensions to choose from. I found 3. What I was looking for was rotate.aia, shown above, in your green banner. The click sent me to Source Forge which downloaded it. As I said before, this resulted with 3 files, not an aia or even an aix. I donated in anticipation of the aia. Again, where is the rotate source? Sorry for being a bother. 

--
You should download taifunimage.aix, include that as an extension in your app and use the taifunrotate block. You might want to read again what Taifun wrote above.


--
Thank you,
Using Tiafun's large green box I clicked taifunimage.aix. It was downloaded and I saved it to both the Desktop and Downloads. As you see in the attachment I receive a Zip file rather than an .aix. I also see that this source is available on a URL. Where can I find this URL? 


--
your browser(?) somehow renamed the aix file into zip...
therefore rename the file back to aix and import the extension in App Inventor

-- 
I moved my browser from MSM to Google and it worked perfectly. Now have beautifully rotated pictures. 

--
Don't use MS browsers with anything App Inventor! They just do not work properly.

--

Starting Dropbox app with Activity Starter


I cannot seem to find an easy way to get the activity class and package for Dropbox.
I just want my app to start the Dropbox app on my phone.  
Are these available?

--
The Activity Starter app got me almost there.
See pic.

-- 
I just need to start the app, nothing else.

-- 
Thanks.

The Activity Starter App got me closer, but not quite close enough.
I only want to open the app, nothing else.
There are lots of examples of how to put things and get things from your DropBox acct., but how to just open it?


-- 
Got it.  Dropbox support actually helped me.


-- 
They did say it is unpublished and may change so use at your own risk.

-- 

Storing files to subfolder


i did search the forum but couldnt finde the solution although the topic did get discussed quite some times. 
So i ask for specific code for my app to get it working. Ty for that. 

The problem: 

As u can see on the attachment iam saving some values ( Questions/ text ) into a csv file. I was wondering if i can save the file
onto the sdcard into a folder which will be created by the app. From my research /foldername/filename ( wich is set by a textbox entry) 
should do it. ( but it doesnt :/ ). Is this function supported by AI2 ? 

Also the user should be able to send away the file via email.

The file shall be read and displayed on another screen in label -box in csv format again .

The Errors i get are:
1. file could not be saved into the set directory
2. file could not be found in the set directory

So i assume that i only got the path wrong. Right?

Also does any1 know if it is necessary to add a .csv to the file to make it usable with e.g. excel ? I didnt work for me without it.


--
see the documentation http://ai2.appinventor.mit.edu/reference/components/storage.html#File and use a relative path!



SaveFile(text text, text fileName)
Saves text to a file. If the filename begins with a slash (/) the file is written to the sdcard (for example, writing to /myFile.txt will write the file to /sdcard/myFile.txt). If the filename does not start with a slash, it will be written in the program's private data directory where it will not be accessible to other programs on the phone. There is a special exception for the AI Companion where these files are written to /sdcard/AppInventor/data to facilitate debugging. Note that this block will overwrite a file if it already exists. If you want to add content to a file use the append block.

Also the user should be able to send away the file via email.

Different eMail solutions for App Inventor

--
Hi ty for the replay.

I read this manytimes, but what about folders? They dont mention this at all. I only saw some post at the forums where they were talking about folders like this /sdcard/folder1/file1

and i dont rly get the diffrence between /sdcard/filename and file:///mnt/sdcard/.
Vreden

-- 
  /foldername/filename.csv 
this is a relative path

  file:///mnt/sdcard/foldername/filename.csv
this is a full path

the file component only is able to understand relative paths...
hope that helps

-- 
Yep, thanks that was clear :)

think i can work with this.

-- 
you should find that information in the documentation... usually the relative path should work

-- 

RatingBar Extension for Happy Builder


Here is new RatingBar extension - v1.0
A RatingBar is component that shows a rating in stars. The user can touch/drag or use arrow keys to set the rating when using the default size RatingBar.


Give it a try: com.appybuilder.RatingBar.aix16 (9.5 KB)


Rating Bar Extension


Here is a RatingBar extension - v1.0

A RatingBar is component that shows a rating in stars. The user can touch/drag or use arrow keys to set the rating when using the default size RatingBar.

This is only version 1.0 and we are improving it.


--
Great idea, great possibilities, thanks for sharing Hossein

-- 
Looks very nice!
Is this is sneaky way to make a visual extension? Seems to work well!
I tried 7 stars, but it seems five is the maximum?

-- 
Glad you like it. Yes :) making visual extension :)

There is a block for adding stars.
See image or link that was sent.

--



search results for Filtering Lists from TinyDB


If you are using a global MyList variable, the List must be initialized every time the app is run. If you have a list, run the app and change the list and ...
These might help: ===== Lists. Sajal's example http://www.imagnity.com/tutorials/ app-inventor/list-blocks-on-app-inventor/. Hossein's example ...
You are downloading all 50000 from the FT? That is 750000 pieces of data. You are doing a simple sort so your app looks at your data 50000 times.
Here is some reading that might help you achieve your goal of creating a type of ' book library' app. ===== Lists. Sajal's example ...
You want the same data on multiple screens? You wanted an explanation? You have lots to read . If what you pass to the other screens is lots of data, ...
Dear all,. Thank you for all your help so far with understanding AI2. I am trying to search a tinyDB database stores names/dob/email/phone numbers of ...
You said " I know that I have to loop it but I don't know how to." You may not need to loop. You can set up a loop using the for each number .... control ...
1) A TinyDB is entirely on the device. 2) You can store information on your device three ways: a) In a TinyDb ...this data can be modified and ...
What is multiple output Cha? If you have data in a TinyDB, the data can be recalled using the GetValue block ...
call TinyDB1.ClearAll completely deletes the records. "viewing a TinyBD and that it needs the phone to be rooted" ...you did not provide a link but that ...
Your screen looks nice Jennifer and it is a start. Have you done the MIT tutorials? Have you read the free ebook? These resources teach you how to ...
If you want the database on your Android, Marcus, there is one option: TinyDB. You can also manage csv files with the File component and it may be ...
To the best of my knowledge, no one has built a leader board quite like what you want; so you are going to have figure out how to do it; try some block ...
Here is documentation for the App Inventor Texting component; the component you need for sms ...
Yes, you are clear. You are new. Some of what you want to do is regarded as requiring advanced programming skills. The clicking on a pin on a map ...
You can not filter directly. Since the tags of the TinyDB are a list, you might use a ListPicker and use its filtering capabilities. Add a ListPicker. On the ...
Is your question, is there a way to search for particular coding Blocks in the Blocks editor or how to search a List of data in the app? You can not search ...
You are missing a separate list, needing the name "class rosters". You started with a list called "classnameslist", which is a flat 1-Dimensional.
Lists. Sajal http://www.imagnity.com/tutorials/app-inventor/list-blocks-on-app- inventor/. List of Lists. Taifun example ...
Alfo, you have two suggestions. Either would give you the ability to do some of what you want to do. Try some blocks and ask a specific question.
Here's a doc on filtering lists of lists for queries .
Huge database dictionary? On the Android? You already got some good advice. Huge on the Android means SLOW. Better to do this on the ...
Josh replied by eMail..threads are automatically terminated for lack of activity after two weeks... why did it take so long to reply Josh? Your note:.
Bob sent the following by email. I am trying to save the data on where is my car. I just want to modify it so that the data is saved if the phone or app is ...
If you can change an individual item in your Address database depends on how you structured the database. If you stored Name, Street, City under a ...
Toby, you should only have ONE TinyDB on a screen. Put the second TinyDB on your second Screen. What you put on the TinyDB on Screen1 can be ...
Here are some resources omkar . You do not have a second database, you have only a single database, that is why the tinydb1.gettags block provides ...
All you need is a TinyDB to 'remember' which sound file was selected last (and of course the List). For the app to 'remember' any setting that is made ...
Why is each question on a different screen? You can re-use controls and input blocks to collect all the data you need. Are you using Lists? Again, why ...
A ListView does not have a double-click event handler so you cannot 'double click' without writing some code...possible depending on what you ...
Here is some training on using Lists and the TinyDB: ===== Lists. Sajal's example ...
What you want is possible. It will take several steps. The first is to read the AI2 free online eBook http://appinventor.mit.edu/explore/ai2/tutorials.html ...
Here are some resources: Tutorials: MITs tutorials http://appinventor.mit.edu/ explore/ai2/tutorials.html. The AI2 free online eBook ...
Yes, you can do this. You will need a list of items you can shop for, perhaps call it Items. You could use the check box to associate a Boolean value ...
1) It is easier on the forum to read (and you) if you use your PC to capture a screen image rather than providing a photo. Win7 and above, learn to use ...
===== Lists. Sajal http://www.imagnity.com/tutorials/app-inventor/list-blocks-on- app-inventor/. List of Lists. Taifun example ...
I am not sure how you will do this without using variables, Why concerned about the number of variables? Yes, the List gets assigned to a variable.
Taifun is probably correct about filtering using code on the table. however, posting about 12 points is possible using the Google Maps static api ...