2016년 12월 31일 토요일

camcoder and file path


Camcorder.afterrecording has clip parameter to give the file path, but I don't know why in my app give another path:

content://media/external/video/media/<number_with_4_digit>

someone know why?

--
the result from the camcorder unfortunately is a video content uri, but not a path to the recorded clip 
see also this old thread from Dec. 2014 getClip returns a file path not working MIT should change that and provide a file path instead

also unfortunately there is no conversion block available, which converts a video content uri into a path to the file
however you could write your own extension and create a block yourself...

more information about how to create an extension see here Announcing App Inventor Extension Components
however that will be more advanced and will require some Java skills...

I also can offer to write that conversion block, see also Q2 here https://puravidaapps.com/file.php#q .

--
in order to select manually the video recorded is there something like imagepicker?

-- 
there is no video picker component

you could use my file extension and the FileList block to get a list of files of a given directory, see also https://puravidaapps.com/file.php
 filelist.JPG
The App Inventor Extensions are currently in testing. See the announcement for more information about how to use an App Inventor Extension. 
  
-- 

Camcorder.afterrecording has clip parameter to give the file path, but I don't know why in my app give another path:
content://media/external/video/media/<number_with_4_digit>



it seems to be, MIT fixed that issue meanwhile
the camcorder now provides the path to the file instead of the content uri as previously
thank you MIT!

-- 

Error "Segment: Start (3) + length (1) - 1 exceeds text length (1)"


The arduino sending a string "010101" using by using bluetooth. i can see the program still running well at the back of the pop up message "Segment: Start (2) + length (1) - 1 exceeds text length (1)"

How to get rid of this error ?? "Segment: Start (2) + length (1) - 1 exceeds text length (1)"



--
Use the length block to test if rxstringstatus >= 3 before using the segment block.


--
thank you for the reply... you solve my problem.. thank you

-- 



I can't quite figure out how to get this right


I'm trying to control mt arduino from my android phone and get feedback like temperature and humidity from arduino using one string because it makes it alot easier but at the moment it is not working that well.
Here a pic of the code i came up with.
Any help is appreciated :)



--
1. see here how to receive something correctly

A simple Bluetooth Chat with App Inventor 2

btchat.aia

2. it does not make sense to check this regularly, because once connected, ISCOnnected will stay true even if the connection is gone

3. before doing this, you should check, if the length of the list is >= 2 to avoid errors in case it is not

-- 
I'll try that tomorrow and give an update on my progress.

-- 
Ok so I decided to just get out of bed and try it right now so I tried what you suggested and it works almost perfectly now.




-- 
Many thanks for the help, I am going to try it now with more values and i'll just see where that goes.

-- 
this looks better
see here how to connect correctly

and remove the first if block inside the clock component

-- 
Alright so I removed the connect block from the clock and I added some notifiers



-- 


Trying to connect to App Inventor with Arduino Bluetooth


Hi, I'm trying to connect an arduino sensor (PIR) with MIT App Inventor using a bluetooth module. Basically, the goal is so that if the pir sensor reads above a certain value, I will be able to send SendText to the phone, as well as give a high to a pin on the arduino. While I know how the computer logic will work (the if, then logic), I don't know how to start it. Has anyone else done something mildly similar to what I've been trying to do who can help me figure out how to access the arduino data so that it can be manipulated in my code? (What chunks of code should I add so that I can get to the point of data manipulation?) Thanks! 

Screenshot (19).png 표시 중

--
It does not look like you have used the forums yet, as a search using the search box above would have returned several threads about this topic.

-- 
I know, I haven't posted on forums yet, but I've spent the past few hours looking at others post, without any clear answers (except for a couple examples that kind of contradicted), so I figured I'd try asking myself.

-- 
what about following this example I can't quite figure out how to get this right which has been discussed 2 days ago?
and there are many more..

-- 

Making a Game using GIMP, Inkscape and App Inventor part 01! (Video Tutorial)


Today I have the first part of a new tutorial. How to make an App using GIMP, INkscape and App Inventor. I start since the very begining. I show in the first part of the video the app we are planning to make. I hope you find it useful I am sure you will learn some useful tips to improve your apps! to make them look better ... well I hope so.. Part 2 will be ready by thursday.. so please check it !
Thank you friends!



--
Very useful for showing how to create sprite images from parts of another image.
Looking forward to the next video...

-- 

The operation add items to list cannot accept the arguments: [0] [1000]


Hi, I am trying to construct a list with time values, but I received the error msg at runtime. 
I would appreciate a little help on this.

PartOfMyCode.png 표시 중

--
try to initalize the list using the create empty list block
-- 
I already did it, also using make a list block, with the same result :-(

-- 
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 already figured it out. Let me tell you that dealing with data files I/O in app inventor 2 is not straightforward at all. In my case, it did not work to convert immediately to csv (inside the timer block), instead of that I had to make my lists and post-process them in another block in order to save the data in a .txt file.  

-- 
a screenshot could have helped us to give you some suggestions


 dealing with data files I/O in app inventor 2 is not straightforward at all. In my case, it did not work to convert immediately to csv (inside the timer block)

my guess is, you are reading a file using the file component. You should convert the text in the File.GotText event and not in a Clock.Timer event

-- 
I know you are very helpful, thanks anyway, I am sure I will need your help at some point in the future.

-- 

Camera Project


Hi everyone, I'm Thomas and I'm kinda new to appinventor

Is there a way to avoid having to click on "OK" after taking a picture with the camera TakePicture function?

--
unfortunately this is not possible usng the built-in camera component

you could write your own extension and create some blocks yourself...

more information about how to create an extension see here https://groups.google.com/d/msg/mitappinventortest/Ip2AX036d0U/5NJlAEbFCgAJ
however that will be more advanced and will require some Java skills...


-- 
I have Java skills but I have never programmed phone stuff without using AppInventor

What I really need to do is when recieving a byte (like the value "3") that has been sent from another phone (I have already achieved this part),
the phone recieving the byte takes a photo and stores it.

I have linked the app I've made.
I use another app to send the byte.

So far, when i recieve the byte, it opens the camera on the phone, but it doesnt take a picture. And if it would do, I would have to press the OK button to take the picture, and the whole purpose of our project is taking picture remotely.

I feel like I'm so close to do it, but AppInventor doesnt seem to make possible what I want to do.
Is there any way you could help me ?

Thanks

So far when I 


-- 
I deleted your post because it has an .apk attached, which is not allowed. You can attach an .aia if desired.

--
Hi everyone, I'm Thomas and I'm kinda new to appinventor

Is there a way to avoid having to click on "OK" after taking a picture with the camera TakePicture function?

--
unfortunately this is not possible usng the built-in camera component

you could write your own extension and create some blocks yourself...

more information about how to create an extension see here https://groups.google.com/d/msg/mitappinventortest/Ip2AX036d0U/5NJlAEbFCgAJ
however that will be more advanced and will require some Java skills...

alternatively I can offer this workaround 

Take Pictures programmatically using the Activity Starter calling a Java app

-- 
I have Java skills but I have never programmed phone stuff without using AppInventor

What I really need to do is when recieving a byte (like the value "3") that has been sent from another phone (I have already achieved this part),
the phone recieving the byte takes a photo and stores it.

I have linked the app I've made.
I use another app to send the byte.

So far, when i recieve the byte, it opens the camera on the phone, but it doesnt take a picture. And if it would do, I would have to press the OK button to take the picture, and the whole purpose of our project is taking picture remotely.

I feel like I'm so close to do it, but AppInventor doesnt seem to make possible what I want to do.
Is there any way you could help me ?

So far when I 


-- 
I deleted your post because it has an .apk attached, which is not allowed. You can attach an .aia if desired.

--


How do I create an email feature?


I need to create a basic Email function, that allows me to write and send an Email to a particular address. Thank you in advance. :)

--
See Taifun's post HERE on different email solutions.

-- 

How can I change version code during building an app


How can I change version code during building an app?

--
well, actually you change it before building in Screen1

-- 

Passing variables with TinyDB seems to fail when App is built


Working with a group of disabled students on a variety of apps. An interesting problem has occurred in several of these apps where we are using TinyDB to pass values between screens. This ranges from values used to control which colour schemes to use on screens, or a simple login system using one variable signifying Logged in (True) or Not logged in (False).

The problem is that when we are testing through the MITAI2 Companion everything works fine - Pictures appear, colour changes work, the Login is fine (hiding/revealing content depending on value), however when we build the final App these things no longer work.

As a test in one app I got a message to appear on the screen stating if security was on or off after using the login screen. In the Companion the message changes to 'Security is Off' after the login. Build the app and install then run and this doesn't happen - the message states 'Security is On'. Note. On the login screen itself a RED square appears if you are not logged in and once your username and Password are checked the square turns to green - this display bit works fine in the built App, but you are still not logged in when you return to the previous screen.

Whats happening differently beween the test stage and the final App? Any ideas?

--
What might have happened is that while you are developing and testing the TinyDB becomes populated with data. However, after you built the app, the TinyDB will be empty. Therefore, if your app depends on data being there, then you must do some initialization the first time the app starts. And save that you have done that in th TinyDB.

--
An initial screen setups the values to be stored in TinyDB by the App, then any changes are updated on the various screens, so the TinyDB isn't empty at any point.

-- 
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.

-- 
Something else must go wrong then. Could you provide an .aia to look at?

--
Attached is one of the students project Apps. This is one where the login works in development but not when the final app is built.


-- 
Probably your problems is this: screen handling is not the same when you use the companion or a built file.
When you return from the login, you expect to do the Mainscreen.initialize again, but since you did not close the Mainscreen, that does not happen.
Start using when ... otherScreenClosed, or always close the screens directly after you called another screen.

Read Taifun's tips on this:

-- 

Possible to add two different tinyDB to sms text?


Hi, is it possible to add two different tinyDB to sms text? 
I know that this doesn't work, but it will show you the idea

 Capture.PNG
--
There is only one TinyDB, but it can have many tags. I see a problem with your code because it is very unlikely that a specific Lat,Lon combination would be there, therefore you would always get blank values, unless you do not move.
So could you please explain a bit more what you want to do?


--
The proper test for proximity would be:
If abs(target lon - current lon) + abs(target lat - current lat) < epsilon then
  you are close
else
  you are far.

Epsilon is whatever number you choose (> 0) for how close you need to be, bigger is looser.

-- 

Problem with MIT app Inventor


I am create on MIT app inventor in my project application but some problem in MIT app inventor.

My Problem is Not progress bar pun on image how to put it ??

--
Do you want to put a progress bar on top of an image? I do not think you can do that. You could have a background image of the screen, if that is sufficient for you.
--
You can pre-build images of a progress bar, and show a sprite with a current image picked off a list, that cycles thru your progress.

--